Android EditText tinting issues on API 22 - android

I'm having a weird issue on Android 5.1 (API level 22) where if i use a controlColorNormal and controlColorActivated that reference a colour resource that is overridden in the land folder, when the device is rotated, the EditText background (the underline) is not tinted with the correct land colour, but with the base variant (or the other way around, if the app is started in land orientation).
This works fine on Android 5.0.x and lower, it's just misbehaving on 5.1.
Here is a PoC project with a more in-depth description and some screenshots: https://github.com/rock3r/EditTextTinting
Has anyone seen this happening, and possibly found a workaround for it?

Related

Xamarin.Android designer is VS bugs with the arabic language

I struggled a lot with this, and i'v searched a lot also but found nothing.
I am using VS 2017 to develop a Xamarin.Android app, with the minimum SDK version of Android 5.0 (API Level 21) and a target SDK version of Android 8.1 (API Level 27).
In the app, i am using the Arabic language, and i faced 2 problems :
The first one is that in the designer view, i can't get the direction of the layout to be RTL(Right to left), when i added the property : android:layoutDirection="rtl", it worked only when i run the app on my physical device, but in the designer i can't get it to be RTL, i tried even changing setting in the toolbar in the designer view here :
The second one is that the arabic text value is being show as squares as also shown in the picture above.
I have tried rebuilding but also no chance, anyone have an idea or a solution for what's happening?

App created for Android 1.6 lost it's style in Android 8

I have an app which I'm developing since Android 1.6, starting with Eclipse and moving to Android Studio later. I did my best to keep the compatibility but recently decided to give up on these 6 people having it installed on Android below 4.0 version. I changed the compileSdkVersion and targetSdkVersion to 26 and... I lost my styling.
My text is black instead of white:
So apparently my default app style was switched from dark to light (I guess it was Holo Dark back then?). What can I do to fix this?
I've seen some answers about using styles, colors etc. but I don't have xml's like these because when I started this project, they didn't exist yet.
I'd like to avoid recreating every color and applying it to every element to bring back the old look. What should I do?

I wanna create selector for Switch on both Android 5.0 and less android 5.0 application

I wanna create theme for both Android 5.0 and less android 5.0 application.
In first case for example I have Switch that if I don't set any background it appearance will change on Android 5.0 to like a slide button as you know,
but in less android 5.0 it show as on/off button.
when I put
android:thumb="#drawable/switch_selector"
to change thumb image and color it's fine on android 4.4 but my Switch show nothing on Android 5.0. my question is how to create a selector or theme for Switch that can show on all devices?
UPDATED
in simple way, we hava many drawable folders for each screen dpi's. I wanna know if I can set drawable for each Api's as like as for each dpi's ?!
after my hard times with Android notifications, where I need to do one method for android devices with Android 5.x and higher and another method for pre-Lollipop devices, I would advice you to search for additional libraries like this
SwitchButton
This project provides you a convenient way to use and customise a SwitchButton widget in Android. With just resources changed and attrs set, you can create a lifelike SwitchButton of Android 5.0+, iOS, MIUI, or Flyme and so on.
Now we get the biggest movement since SwitchButton published. v1.3.0 comes with totally reconsitution and more convenient API. A wholly new demo can give you a tour in it.
Github page: https://github.com/kyleduo/SwitchButton
More like this you would find here: http://android-arsenal.com/
Additional libraries may help you to avoid problems with backward compatibilities of Android components.
Like you said, you add this line of code:
android:thumb="#drawable/switch_selector"
and it works on Kitkat, but not on Lollipop.
I've found already that on Lollipop you may have much more to work.
Just take a look here: How to have a Lollipop switch button
So try to find your desired additional library like this above and let me know how it works ;-)
EDIT: To get API version use this:
Build.VERSION.RELEASE;
That will give you the actual numbers of your version; aka 2.3.3 or
2.2. The problem with using Build.VERSION.SDK_INT is if you have a rooted phone or custom rom, you could have a none standard OS (aka my
android is running 2.3.5) and that will return a null when using
Build.VERSION.SDK_INT so Build.VERSION.RELEASE will work no matter
what!
To use it, you could just do this;
String androidOS = Build.VERSION.RELEASE;
From: Retrieving Android API version programmatically

colorButtonNormal works correctly on my 4.3 android device

I am new in android. According to a note:
colorButtonNormal will only work on phones running API 22 and above.
So if you have an older phone, the buttons will not be colored orange.
My Android version is 4.3 (API 18) , but they change to orange without problem!
so why this happened?
does it mean that my android version has a high API?
Thank you.
If your project includes support-v7-appcompat, it supports the colorButtonNormal attribute. That should be the reason why.
https://developer.android.com/reference/android/support/v7/appcompat/R.attr.html#colorButtonNormal

Android ICS browser fixed header style disappearing

I'm finding an odd bug in the Android ICS browser, both on my Skyrocket device and in the emulator. Basically the fixed header I have is losing almost all of it's styling (reverting to text though still fixed it appears). This appears to occur when there is a PJAX transition or on certain pages (even though the header HTML and CSS is the same in all cases).
You can see this on a staging environment I've set up:
https://tt-chnicola.herokuapp.com/
User: testuser
Password: password
Just navigate around a bit and you can see what I mean.
Update: To be specific I'm using 4.0.3 (API level 15) and my phone is 4.0.4 from Samsung
Also occurs on 4.0 (API 14)
It works fine on GB (API 10) and JB (API 16) so this seems to be an ICS exclusive problem.
So this does appear to be a browser bug, but it was fixable by removing a floated "image replacement" element that was using a technique similar to this:
https://stackoverflow.com/a/471538/235243
Looks like the text that was being hidden was coming up and pushing the entire header out of view for some reason.

Categories

Resources