ListPopupMenu on pre android 11 - android

I want to know if someone knows a library that contains a back ported implementation for ListPopupMenu that works on pre android 11

I don't but you could use PopupWindow whcich is available since API 1. You can create a list as your contentView. You can use showAsDropDown which could give you the same type of effect
This might be worth checking out. I like to use it for backwards compatibility sometimes for the effect it gives
PopupWindow
showAsDropDown

Related

android:fontFamily is only working with AppCompatTextView

I was moving my project drop Calligraphy and use the native android android support for fonts. However, I can only make it work if I use AppCompat elements instead of the default ones (TextView, Button, etc..). I wanted to know if this is expected and if not, how could I solve it?
So I figured it out:
The problem was that in on of the legacy BaseActivity#onCreate we were calling setContentView before the call to super.onCreate(). By doing this it will somehow disable the font from being correctly rendered.

Same style on all API using AppCompat

I'm using com.android.support:appcompat-v7:22.2.0 to make Lolipop material design on pre-Lolipop devices. The problem is that widgets (example EditText) are displaying different views with different parameters on different API.
Question is how to make it all looks the same on all API 15 and above?
Example here (different bottom line, margin between text and line etc.):
I think that I found solution.
AppCompat generates proper look during inflating layout.
If API < 20 it generates look like newest API (ex. 22).
If API >= 21 it generates look depending on API.
Don't look at preview in XML (my image is from previews). Open emulator and check by yourself how it will looks on device.
Hope it helps someone in future.

Android Action bar direction RTL

I try what simon tell to do for change direction but it's doesn't working.
It's seems that for hundredth of a second it's work but when Action bar add the action buttons it's put the buttons at left instead at right.
What can be the problem? it's seems that somewhere in nmy code had line that tell freamwork to do otherwise?
The RTL value (true or false) is included in the flags in getApplicationInfo.flags.
As a long shot - is it possible that you are somehow changing the value?
The ability to set RTL was added in Android 4.2 if you are supporting this OS level or higher, this will be easier for you to accomplish.
Proof it is 4.2+: https://groups.google.com/forum/#!topic/actionbarsherlock/-npidM2Eo0w
Google post outlining how to change to RTL: https://plus.google.com/+AndroidDevelopers/posts/HuHNSb8V7s8
Otherwise, I would reference the SO question already pointed to in another comment if you are supporting an OS level older than 4.2: How to handle RTL languages on pre 4.2 versions of Android?

how to make ICS like tabs (white background with sky blue line at the bottom) in android 2.2

How Do I make deafult ICS style tabs in android 2.2. I don't want to use ActionBarSherlock, instead I need to apply custom drawables. Can someone help ?
I tried using 9.png but didn't help much, as it didn't fill the complete tab, instead it shows only some blurred extended background. If you are suggesting some drawables - Please provide the drawable as well.
You can download ready made demo from this link: ICSStyleTab. I tried it for one of the project and it is working fine. If you wanted to add pager functionality, you can easily add using FragmentPager from Support V4 Library.
Update: ICSStyle Tab With Pager Demo
Thanks.
HoloEverywhere is a library to provide ICS/Holo theme to pre-3.0 devices:
https://github.com/Prototik/HoloEverywhere
Even if you really want to write your own code, you can gain a great deal of insight simply by looking into its source.

View Animations alternatives for API<11

This google API tutorial shows how to animate Views. However it uses methods that are available from API level 11, such as View.setAlpha
Now, using a phone with android 2.1 (API 7) I can find many , many applications using the same kind of animations (the card flip animation is very popular)
Are there any Google libraries to do the animations shown in this tutorial that would work with ANY API prior to 11?
If not, any other alternatives?
P.S I am aware of this question But appearantly that was specifically about objectanimator and got an unuseful anser accepted
NineOldAndroids will be able to provide you with animation APIs that you see in 11+. For example...
ViewHelper.setAlpha(view, 0);
Easy animation such as transform, rotate, move (which it seems to be what you want) may be made with such classes as:
http://developer.android.com/reference/android/view/animation/AnimationUtils.html
http://developer.android.com/reference/android/animation/AnimatorSet.html
http://developer.android.com/reference/android/view/animation/Animation.html
In brief you will have create animation resources (or classes) and run it on views. After ending animation possibly you will have hide this view by visibility method.
Check this for details - http://jmsliu.com/779/android-view-animation-example.html.

Categories

Resources