How show hint in Hebrew in android - android

How show hint message in Hebrew language?.If I remove "android:inputType="phone""
message show.
I have tried "android:ellipsize="start"", add some unicode but not work.
Is any way to show hint in Hebrew with "android:inputType="phone""?
Code:
<EditText
android:id="#+id/mobile"
android:layout_width="0dp"
android:layout_height="36dp"
android:layout_weight="1"
android:background="#drawable/drawrect_layout"
android:hint="#string/mobile"
android:inputType="phone"
android:padding="6dp"
android:textColor="#000000"
android:textSize="15sp" />

I think you are setting width to 0dp that is why you are getting this problem. Please use wrap_content or fill_parent. I have edited this and is working at my side.
<EditText
android:id="#+id/mobile"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="mobile"
android:inputType="phone"
android:padding="6dp"
android:textColor="#000000"
android:textSize="15sp"
android:layout_below="#id/text" />

Related

How to ellipsize a TextView in between an ImageView and a TextView?

Here is my layout:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="65dp"
android:layout_marginStart="20dp"
android:gravity="center_vertical|start"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18.9dp"
android:lineSpacingExtra="64sp"
android:textColor="#484848"
android:textSize="16sp"
tools:text="அனைத்து அனைத்துஅனைத்து" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="50dp"
android:lineSpacingExtra="64sp"
android:text="0"
android:textAlignment="center"
android:textColor="#color/red_500"
android:textSize="14sp" />
</LinearLayout>
All other languages are working fine, except tamil language is very big.
I need an icon at beginning and sometimes it show number of notifications at end. So I need to set ellipsize to text on middle.
How to achieve this?
you can use android:ellipsize atrribute to do that.
like this :
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18.9dp"
android:lineSpacingExtra="64sp"
android:textColor="#484848"
android:textSize="16sp"
android:ellipsize="end"
android:maxLines="1"
tools:text="அனைத்து அனைத்துஅனைத்து" />
note: don't forget to use android:maxLines attribute to set the line number of your text.

EditText and AutoCompleteTextView text starts not on same position

I've a EditText and a AutoCompleteTextView and the text starts not on the same position which looks a bit strange.
I'm using appcompat v7 and I don't know if it's possible to fix this.
The line in the bottom is also different (so so bad as the text begin)
I also tried to style it like appcompat's EditText, but that doesn't look like that.
Code
<EditText
android:id="#+id/input_ipAdresse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_alignEnd="#+id/button_berechnen"
android:layout_alignRight="#+id/button_berechnen"
android:ellipsize="end"
android:gravity="start"
android:hint="#string/input_ipAdresse"
android:imeOptions="flagNoExtractUi"
android:inputType="phone"
android:paddingStart="#dimen/padding_small"
android:paddingEnd="#dimen/padding_small"
android:textSize="#dimen/fontsize_medium" >
<requestFocus android:layout_width="match_parent" />
</EditText>
<AutoCompleteTextView
android:id="#+id/input_snm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_below="#+id/input_ipAdresse"
android:ellipsize="end"
android:gravity="start"
android:imeActionLabel="#string/Button_berechnen"
android:imeOptions="actionDone|flagNoExtractUi"
android:inputType="phone"
android:paddingStart="#dimen/padding_small"
android:paddingEnd="#dimen/padding_small"
android:textSize="#dimen/fontsize_medium" />

Android align drawable and text in EditText

i've an edittext :
<EditText android:id="#+id/chp"
android:layout_width="match_parent"
android:paddingLeft="10dp"
android:layout_height="340dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:gravity="top"
android:hint="#string/hintCommentaire"
android:textSize="25sp"
android:drawablePadding="10dp"
android:drawableLeft="#drawable/ic_comment"
android:layout_margin="5dp" />
The problem is, i've my hint at the top of the edittext, but the drawable stays in the center..
I tried with "drawableStart", but it's not working.
Someone to help me ?
EDIT : I want the text and drawable in the top(same line). (i want to keep the height of my edittext)
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/etMobile"
android:hint="Mobile"
android:fontFamily="sans-serif-normal"
android:singleLine="true"
android:textSize="15sp"
android:gravity="center|start"
android:textCursorDrawable="#null"
android:drawableStart="#drawable/ic_profile_bio"
android:drawablePadding="10dp"
app:met_floatingLabel="normal"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" />
Set this Property android:gravity="center|start" in above EditText

How to put a text into the center of its TextView?

I want to put a text exactly in the center of its containing box, and in preview that's OK, but in emulator it has a problem.
<TextView
android:id="#+id/textView1"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="#000"
android:gravity="center"
android:text="E"
android:textAllCaps="true"
android:textColor="#FFF"
android:textSize="75dp"
android:textStyle="bold" />
Any suggestions how to do that?
Add android:includeFontPadding=false to your TextView
<TextView
android:id="#+id/textView1"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="#000"
android:gravity="center"
android:includeFontPadding=false
android:text="E"
android:textAllCaps="true"
android:textColor="#FFF"
android:textSize="75dp"
android:textStyle="bold" />
http://developer.android.com/reference/android/widget/TextView.html#attr_android:includeFontPadding
Fonts have an inherent padding in them and this is what seems to be causing the problem.
Potentially it's just a bug in the preview why it's not showing up there but is in the emulator.
Change layout_height to wrap_content

TextEdit setText("some text here") changes my text color to white

When I call usernameField.setText(myEmail) it changes the text to white. The email address is still in there but it seems to be hidden for some reason. What could be causing this?
usernameField = (EditText) findViewById(R.id.usernameTextField);
usernameField.setText(myEmail);
usernameField.setTextColor(color.black);
XML for whole view:
<EditText
android:id="#+id/usernameTextField"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="24dp"
android:ems="10"
android:inputType="textPersonName"
android:text="#string/emailHint"
android:textColor="#color/black"
android:textColorHint="#color/black"
android:textColorLink="#color/white" />
<EditText
android:id="#+id/passwordtextField"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/usernameTextField"
android:layout_below="#+id/usernameTextField"
android:ems="10"
android:inputType="textPassword|textPersonName"
android:text="#string/emailHint"
android:textColor="#color/black"
android:textColorHint="#color/black"
android:textColorLink="#color/black" >
<requestFocus />
</EditText>
<ImageButton
android:id="#+id/loginButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#color/black"
android:src="#drawable/wallet_menu_profile"
android:contentDescription="#string/loginHint"
/>
<ProgressBar
android:id="#+id/progressBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
<TextView
android:id="#+id/statusTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/loginButton"
android:layout_centerHorizontal="true"
android:layout_marginTop="57dp"
android:text="#string/prowdstatus"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/grey" />
you use
android:textColorLink="#color/white"
change this color for black or other, or remove this line from xml beacuse if you set the email in editText android can change color for white and create link. (not sure if this happen by default, but if you add
android:autoLink="for example email", and if the text will be hosted email - text changed color automatically and created link.
I hope this will help you.
I believe this is the possible culprit: android:textColorLink="#color/white"
Change it to black or remove it and you're set.

Categories

Resources