how to implement arabic rating bar in android - android

please help me to do this, I need to implement ARABIC rating(Reverse) bar into my application.When I change my application locale into Arabic the rating bar should be reversed. I stuck with this for long.

You mean RatingBar with RTL
In Android 4.2, RTL is supported, AFAIK. In your question. We can use this attributeandroid:mirrorForRtl to RatingBar
Here's an example
<RatingBar
android:mirrorForRtl="true"
android:numStars="5"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
You must also put android:supportsRtl="true" in <application > which is in Manifest file OR this will have no effect. By default, android:supportsRtl is set to false.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.rtl" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:supportsRtl="true" >

Related

Wrong icon and label app in Huawei Phone - how to fix that?

I got the following code to customize my app icon and label:
<application
tools:replace="android:icon"
android:allowBackup="true"
android:label="#string/app_name"
android:icon="#drawable/appicon"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
Everything is all right, the correct icon and label show up in some phones (including brands like Samsung and Xiaomi), but when I install on a Huawei Mate 20 the result is the following image icon and label:
Do you know what I'm doing wrong? Thank you.
Most of the mobiles use round edged icon for the app icon. But other use with round app icons.Depends on the theme of the device(having a separate icon or same icon for both instances work). you should change the round app icon also :
android:roundIcon="#mipmap/ic_launcher_round"
to
android:roundIcon="#drawable/appicon"
and remove
tools:replace="android:icon"
it should look like
<application
android:allowBackup="true"
android:label="#string/app_name"
android:icon="#drawable/appicon"
android:roundIcon="#drawable/appicon"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">

Xamarin.Android No style resource found

I'm using Xamarin for an android app on MacOS, my question is very simple but I haven't found anything online and I'm getting mad at this: I just want to set the app style to be Fullscreen and without a title bar so I changed my Manifest.xml as follows:
<uses-sdk android:minSdkVersion="23" />
<application android:allowBackup="true" android:icon="#mipmap/icon" android:label="#string/app_name" android:theme="#android:style/Theme.Material.NoTitleBar.FullScreen"></application>
And when it tries to compile it gives me the following error: No resource found that matches the given name (at 'theme' with value '#android:style/Theme.Material.NoTitleBar.FullScreen')(APT0000)
I tried every other fullscreen theme and no title bar that Xamarin suggests in the drop down menu in the designer but it gives me always that resource error
I just want to set the app style to be Fullscreen and without a title bar
You can add this in your AppTheme:
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
And your application doesn't need to change, just refer to it:
<application android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
</application>
I can't find style/Theme.Material.NoTitleBar.FullScreen in the source code.

Don't change the design when language of phone changed

hello i'm a new android developer and I create an android app.
when the language of phone is English everything is good but when i change it to a right to left language (for example Persian or Arabic) location of views are changed. what should i do? thanks .
in your AndroidManifest.xml, add the following line to the application node's attributes:
android:supportsRtl="false"
Your final code should look like this
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="false"
android:theme="#style/AppTheme">
...
</application>
</manifest>

How to change headlines of a theme with a click?

I have two different themes,original and demo. With a click it should switch from original to demo,but with different headlines.
In the Manifest file is the string for the headline declared, but how can I change it from there?
<application
android:allowBackup="true"
android:icon="#drawable/logo"
android:label="#string/app_name"
android:theme="#style/Theme.MyAppTheme" >
I just want to change the android:label.
**may be you can try setTheme(YOUR_THEME); before calling setContentView(YOUR_XML); in activities..'
and you can define theme in your style xml

How to keep the soft keyboard from showing up in android 1.6?

I've got an edit text on top of a list view and when I launch this default activity in android 1.6 the soft keyboard always show up by default. If i make focusable false it won't show but then I can't click it. Would a combination of focusable = false, focusableontouch = true resolve this or has anyone else run into this issue?
Note- on Android 2.x this is a non issue when I launch the app
In your AndroidManifest.xml, set this property inside activity tag: android:windowSoftInputMode="stateHidden".
For example:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="..."
android:versionCode="..."
android:versionName="..." >
<uses-sdk android:minSdkVersion="3" />
<uses-permission android:name="..."/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" android:allowClearUserData="true">
<activity
android:label="#string/app_name"
android:name="..."
android:windowSoftInputMode="stateHidden" >
...

Categories

Resources