Formatting NumberPicker - android

My default NumberPicker looks like this:
I want it to look more like this:
I'm not married to the +/- thing, but I want a smaller widget that can fit on a screen along with other stuff. My understanding is that setting the theme in the Manifest to one based on Theme will do the trick, but no joy. Here is my Manifest entry:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/android:Theme.Holo.Light" >
I am using Android 4.3 platform and API 18 on my ADV.
What am I doing wrong?
Thanks.

Related

How to force rtl support for a view?

I've disabled and forced my application to not support rtl . Because it made lots of problems of views and layouts , this is my manifest code:
<application
android:name="ir.dizbon.persiandesigners.ParseApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="false"
android:theme="#style/AppTheme"
tools:replace="android:supportsRtl">
in one layout I add this code :
android:layoutDirection="rtl"
When I remove the manifest code ,the layout change the direction and works fine but I can't remove manifest codes .
I tried to change the direction pragmatically:
pass_l.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
it doesn't work either .
How can I make my view to support rtl and get rtl ?
You can create different layout in android studio to support rtl.
Right click layout -> New -> Layout Resource File -> then choose Layout Direction Qualifier.

Can I make an exception for the manifest merger replace tag?

This is my app’s manifest which I want to override the android:supportsRtl tag for all of my libraries
<application
android:name=".ApplicationClass"
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:supportsRtl="false"
android:theme="#style/AppTheme"
tools:replace="android:icon,android:label,android:supportsRtl">
I have 5 libraries which I want to replace the android:supportsRtl=”false” using tools:replace.
But there is one library which I want to let it supportRtl.
The question is that, can I make an exception for the library which needs android:supportsRtl="true" to actually support the RTL and leave the other libraries to be overridden by my app and stay android:supportsRtl="false"?
Unfortunately, currently it is not possible. What you have to do is to come the other way around, i.e. specify what packages this markers should be applied to.
Make use of marker selector tools:selector specifying package names of other 4 libs you want the tools:replace to be applied to.
tools:selector="com.package.lib1, com.package.lib2"
EDIT
As mentioned by OP in comments, this will work only for <permission> tag.

Translate android app a and make it force RTL

I'm new to android and i want to translate an app. to arabic and force RTL direction.
If anyone can help please.
Thank you
If you want to support Arabic for your app, follow the below steps :
1) Create resource file (res/values-ar/strings.xml) and put your content.
2) Mostly supportsRTl set as true. Check once in Manifest file.
Example:Creating Arabic resource file
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
3) Test it in your device by doing below settings changes :
Select locale(Arabic) in language option
"Force RTL layout direction" in Developer option.
Note : Developer option will be enabled once you select build number 7 times. (inside Settings/ About Phone)
You can find simple example in below link:
https://www.tutorialspoint.com/android/android_localization.htm

Home up button changes its direction when language is changed

I have two languages in my app, English and Urdu. When the language is changed to Urdu home up button changes its direction like this:
Please help me how can I fix this issue. I want arrow direction to be on left side
To support right to left screen layout, you have to android:supportsRtl="true" line in your manifest.xml For example:
<application
android:name=".Application"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
>
After writing this tag, the arrow button will appear on the right and other icons on the left.
For more information, see this post.
There is not issue and supportsRtl.
Because if
android:supportsRtl="true"
then view display from right-hand-side.
If false then it'll display as it is.
Can i have your manifest application tag and style which used there?

Android RTL locales. How to mirror only when locale is supported?

I have an app that supports Hebrew and declares in the manifest its support for RTL locales. However, there are other RTL locales that I do not support and would like my Views not to be mirrored when these locales are set. For example, I don't want my app's Views to be swapped from right to left when in the Arabic locale, since I don't support Arabic and therefore text will show in English.
I guess the best way is to make android:supportsRtl value to be selected according to the language. To do that see below:
AndroidManifest.xml
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:supportsRtl="#string/is_hebrew" >...</application>
Then in values/strings.xml add:
<string name="is_hebrew">false</string>
And with values-he/strings.xml add:
<string name="is_hebrew">true</string>
You can choose to turn mirroring on or off at runtime. See https://stackoverflow.com/a/17683045/192373. This is limited to 4.2 or higher, and only in onCreate() of your activity.

Categories

Resources