textview

android - Using EditText values to a textview on another activity

被刻印的时光 ゝ 提交于 2020-06-13 11:12:30
问题 What I need is quite simple. 1- User types some info on EditTexts. 2- Uses intent and bundle to take the data to another activity 3- Shows the data stored from EditTexts to TextViews. But, here's the problem. EditTexts are at MainActivity, the activity that will receive the data isn't the next one, but the last one, named finalizar_relatorio.class. And also, I'm trying to send this bundle to the next activity when I call one method because if I use startActivity() inside onCreate, it will

How to calculate letterSpacing for TextView from sketch values?

☆樱花仙子☆ 提交于 2020-06-11 17:34:12
问题 In design I have a text field with 16 as text size and 0.6 as character spacing But, if I set this value for android:letterSpacing attribute of TextView spacing will be much more larger than in design. So, what is the way to convert sketch value to android value? 回答1: According to Romain Guy, Android uses the "1 em = font size" definition, so you'd just do setLetterSpacing(characterSpacing / textSize) ...just make sure those values are in the same unit (dp vs px) 回答2: If Sketch provides the

How to show two Textview with ellipsize end in horizontal Linearlayout in android?

橙三吉。 提交于 2020-06-11 06:47:51
问题 I am facing one problem which is, I have two Textview in one horizontal Linearlayout and one Textview with ellipsize end and When I have type text more content then it display "..." in Textview ending, But at that time I can not show the second TextView. Below Images. But I want to both Textview. If First Textview is with more content then it display ellipsize end and also display second Textview. Below Image. My Xml Layout is, <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns

Fragment editText data getting cleared when i am moving to another activity and coming back in Quiz app

…衆ロ難τιáo~ 提交于 2020-06-09 05:32:48
问题 I have an android quiz app source code. In which options are in checkbox type. But for some questions, I need to make as edittext answer. How to convert the input type from checkbox to edittext. I will attach the images explaining the requirement. I am giving the GitHub link below Source Code of the Quiz App: https://github.com/tendentious/Multiple-Choice-Questions-Android-App XML files: https://github.com/tendentious/Multiple-Choice-Questions-Android-App/tree/master/app/src/main/res/layout

TextView rotation keeps width and height

醉酒当歌 提交于 2020-05-27 01:53:09
问题 Im trying to rotate a textview but when i rotate it, it keeps the width and height information i want to the selected area gone i just want to text appears on the green indicator aligned centered. i'm changing the text 'Small Text' in java part but when the length of the text changes the alignment goes crazy (picture3) here is my code what am i doing wrong ? <ImageView android:id="@+id/statusIcon" android:layout_width="wrap_content" android:layout_height="match_parent" android:src="@drawable

Why is TextView showing the unicode right arrow (\u2192) at the bottom line?

一笑奈何 提交于 2020-05-26 12:47:12
问题 My application uses the unicode character \u2192 to display a right arrow within a TextView element. However, the arrow is shown at the very bottom line, but should be centered vertically: However, if I print the unicode character using the standard output, everything is fine: public class Main { public static void main(String[] args) { System.out.println("A" + Character.toString("\u2192".toCharArray()[0])); } } How I can enforce the right arrow to be centered in the TextView, too? My

Why is TextView showing the unicode right arrow (\u2192) at the bottom line?

冷暖自知 提交于 2020-05-26 12:46:26
问题 My application uses the unicode character \u2192 to display a right arrow within a TextView element. However, the arrow is shown at the very bottom line, but should be centered vertically: However, if I print the unicode character using the standard output, everything is fine: public class Main { public static void main(String[] args) { System.out.println("A" + Character.toString("\u2192".toCharArray()[0])); } } How I can enforce the right arrow to be centered in the TextView, too? My

How to put border around textview?

[亡魂溺海] 提交于 2020-04-19 08:57:39
问题 border.xml (in drawable folder) <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/ res/android"> <stroke android:width="2dp" android:color="#000"/> <corners android:radius="10dp" /> <padding android:left="10dp" android:top="5dp" android:right="10dp" android:bottom="5dp"/> </shape> </selector> activity_main.xml <TextView android:id="@+id/textView" android:layout_width="100dp" android

How to put border around textview?

被刻印的时光 ゝ 提交于 2020-04-19 08:57:19
问题 border.xml (in drawable folder) <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/ res/android"> <stroke android:width="2dp" android:color="#000"/> <corners android:radius="10dp" /> <padding android:left="10dp" android:top="5dp" android:right="10dp" android:bottom="5dp"/> </shape> </selector> activity_main.xml <TextView android:id="@+id/textView" android:layout_width="100dp" android

Custom font for clock textview

南楼画角 提交于 2020-04-18 12:41:46
问题 I am new in world of android developement and I want to make a clock such that each digit of time has it's own typeface. Hour digits has it's own typeface and minutes digit has its own typeface. How can i do this. Help me. 回答1: Let's say your font name is DemoFont . Make a Class which extends TextView . And initialize the font for the DemoFont . Next place the .ttf file of that font in the assets folder. public class DemoFont extends TextView { public DemoFont (Context context, AttributeSet