First, the configuration method of float
Andriod default does not support float type settings, in the new Floats.xml file under values, add the following code internally:
<Resources> <Itemname= "Chart_view_line_width"format= "float"type= "Dimen">3.3</Item> <Itemname= "Chart_view_text_size"format= "float"type= "Dimen">17</Item> </Resources>
The way to use it in your code is:
R.setlinewidth (Float.parsefloat (Mcontext.getresources () getString (r.string.chart_view_line_width))); R.setchartvaluestextsize (Float.parsefloat (Mcontext.getresources () getString (r.string.chart_view_text_size)));
Second, the integer configuration method
Android supports the integer setting by default and creates a new Integers.xml file under values as follows:
<Resources> <integername= "Emotion_columm_num">14</integer> <integername= "Right_icon_visibility">0</integer> <integername= "Webview_fix_height">65</integer> <integername= "Right_icon_orientation">1</integer> <integername= "Dashboard_flip_interval">4000</integer> <integername= "Pairing_duration">100</integer></Resources>
Used in the code is:
<?XML version= "1.0" encoding= "Utf-8"?> <animation-listxmlns:android= "Http://schemas.android.com/apk/res/android"Android:id= "@+id/select"Android:oneshot= "false" > <Itemandroid:drawable= "@drawable/pairing_01"android:duration= "@integer/pairing_duration"/> <Itemandroid:drawable= "@drawable/pairing_02"android:duration= "@integer/pairing_duration"/> <Itemandroid:drawable= "@drawable/pairing_03"android:duration= "@integer/pairing_duration"/> </animation-list>
Mcontext.getresources (). Getinteger (R.integer.columns);