android-edittext

Hint and Text in editText at same time

你离开我真会死。 提交于 2021-02-19 01:53:25
问题 I just need an editText in which i can set Text and hint at the same time. e.g i want user to enter in editText string like user#1234 in this string user# should be text after that numbers will vary so that 1234 should be show as hint when user try to enter cursor will go after # and 1234 hint will gone when user type a character. Please guide me how to do this. Thanks 回答1: I managed to achieved this with bit of tricks and playing with margin and padding This is what I did <RelativeLayout

android EditText android:textDirection

女生的网名这么多〃 提交于 2021-02-19 01:09:39
问题 I'd like to set an EditText to be LTR at all times, how do I do that? android:textDirection does seem to be the answer, i cant get the project to compile with that directive 回答1: use gravity for the editText android:gravity="right" 回答2: Adding \u202D (LTR OVERRIDE) to the beginning of the string does the trick 回答3: use direction for the editText android:textDirection="ltr" 回答4: Add these to your EditText : android:gravity="left" android:textDirection="ltr" Note: android:textDirection requires

android EditText android:textDirection

。_饼干妹妹 提交于 2021-02-19 01:09:04
问题 I'd like to set an EditText to be LTR at all times, how do I do that? android:textDirection does seem to be the answer, i cant get the project to compile with that directive 回答1: use gravity for the editText android:gravity="right" 回答2: Adding \u202D (LTR OVERRIDE) to the beginning of the string does the trick 回答3: use direction for the editText android:textDirection="ltr" 回答4: Add these to your EditText : android:gravity="left" android:textDirection="ltr" Note: android:textDirection requires

Android TextInputLayout Password toggle not visible in new support library

拥有回忆 提交于 2021-02-17 21:35:31
问题 I have compiled with following design library and it is displaying password HIDE/SHOW button at the right of EditText compile 'com.android.support:design:24.2.1' <android.support.design.widget.TextInputLayout android:id="@+id/login_password_text_input_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/spacing_normal"> <android.support.v7.widget.AppCompatEditText android:id="@+id/login_password_edit_text" android:layout_width=

Android TextInputLayout Password toggle not visible in new support library

六月ゝ 毕业季﹏ 提交于 2021-02-17 21:34:05
问题 I have compiled with following design library and it is displaying password HIDE/SHOW button at the right of EditText compile 'com.android.support:design:24.2.1' <android.support.design.widget.TextInputLayout android:id="@+id/login_password_text_input_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/spacing_normal"> <android.support.v7.widget.AppCompatEditText android:id="@+id/login_password_edit_text" android:layout_width=

android EditText highlight multiple words in the text

大城市里の小女人 提交于 2021-02-16 19:18:06
问题 I have searched some words in the text of a EditText. After some logic, I get the index of these words. The indices are stored in an arrayList>. Then I used this function to highlight the color of these words. public void changeColor(EditText et, ArrayList<ArrayList<Integer>> arr) { Spannable wordtoSpan = new SpannableString(et.getText()); if (arr==null) return; for (int i=0; i<arr.size(); i++){ wordtoSpan.setSpan(new BackgroundColorSpan(Color.BLUE), arr.get(i).get(0), arr.get(i).get(1),

Remaking TikTok's comments UI: Sticky EditText at the bottom

青春壹個敷衍的年華 提交于 2021-02-11 15:42:58
问题 Problem: I am trying to remake TikTok's comments UI using a BottomSheetDialogFragment and a RecyclerView . This is how it looks like (ORIGINAL): This is what I have tried for now: Basically, I have a FrameLayour whose first child contains eveerything other than the EditText and the second child is, of course, the EditText. <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/relativeLayout" android:layout_width

Remaking TikTok's comments UI: Sticky EditText at the bottom

隐身守侯 提交于 2021-02-11 15:41:49
问题 Problem: I am trying to remake TikTok's comments UI using a BottomSheetDialogFragment and a RecyclerView . This is how it looks like (ORIGINAL): This is what I have tried for now: Basically, I have a FrameLayour whose first child contains eveerything other than the EditText and the second child is, of course, the EditText. <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/relativeLayout" android:layout_width

Keep Textinputlayout hint always top

ε祈祈猫儿з 提交于 2021-02-08 12:19:44
问题 Would be possible have my hint text always top, as if it were focusable? I tried this: <android.support.design.widget.TextInputLayout android:id="@+id/etSurnameInput" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/llNameImage" android:hint="My Hint Text" app:hintEnabled="true" app:hintAnimationEnabled="false" android:textColorHint="@color/gray_title"> 回答1: Here's a hack - programmatically add a space in the text if it's empty. However, you

How do I add text from an EditText field to different TextViews in android studio

北城余情 提交于 2021-02-08 11:19:56
问题 I'm relatively new to java and new to android studio, so any explanation would be greatly appreciated. I want to create an app that allows the user to enter someones name and assign them to one of two teams. I am at the point where the user can add one name to each team but I am unsure how to add multiple names to each team. In my XML I have a EditText field to enter the name, two buttons to put them in Team 1 or Team 2 and two TextViews to display all the people in each team. <EditText