android-actionbar

Action bar in Android like whatsapp

≯℡__Kan透↙ 提交于 2020-03-05 11:42:50
问题 How does whatsapp implement its action bar?The latest updated version contains action bar which works perfect on android 2.2 and android 4.1 without any differences. Any ideas how they've achieved backward compatibility? The back button works on android 2.2 which i could not get working by any means. 回答1: According to Androlyzer, Whatsapp uses ActionBarSherlock for their Action Bar, which allows them to have a consistent Action Bar on all Android 2.1+ devices 来源: https://stackoverflow.com

Android keyboard not appearing, even when explicitly requested

笑着哭i 提交于 2020-02-25 04:27:06
问题 I have an app with two activities, and sometimes, I need to switch activity and at the same time open up the search input in the actionbar of the activity that's just been resumed. Everything works fine, except that I can't get the keyboard to come up. The relevant bits of my code are below (NB: the boolean startsearch is set true as a result of switching activities if the search input is required): public class MyActivity extends Activity { private InputMethodManager imm; public boolean

Android Actionbar navigation spinner text color

二次信任 提交于 2020-02-10 08:17:07
问题 I am able to change the background of the navigation spinner: <style name="MyTheme" parent="android:style/Theme.Light"> <item name="android:actionBarStyle">@style/MyActionBar</item> <item name="android:actionDropDownStyle">@style/MyDropDownNav</item> </style> <style name="MyDropDownNav" parent="android:style/Widget.Spinner"> <item name="android:background">@drawable/spinner_white</item> <item name="android:textColor">@color/red</item> </style> Nevertheless the textColor is not changed. I also

how to make the actionbar transparent

隐身守侯 提交于 2020-02-07 05:28:05
问题 i am learning actionbar and created an actionbar with tabs .the following image shows the view ! requestWindowFeature(Window.FEATURE_ACTION_MODE_OVERLAY); ActionBar ab=getActionBar(); ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); ab.setBackgroundDrawable(new ColorDrawable(Color.MAGENTA)); ab.addTab(ab.newTab().setText("Popular").setTabListener(this)); ab.addTab(ab.newTab().setText("Latest").setTabListener(this)); ab.addTab(ab.newTab().setText("Nearby").setTabListener(this)); They

Tab item width in Action Bar (Android)

六月ゝ 毕业季﹏ 提交于 2020-02-03 11:07:57
问题 I'm using 12 tabs in an Activity, in the Action Bar (target is API 17, tested on Galaxy Nexus 4.2.2) . As expected, I get a horizontall scrolling list of tabs under my action bar. In the screenshot below, you can see that the last tab (B, on the right) is noticably smaller than the other tabs (don't take the "E" tab into account, it can be scrolled as there are 4 more tabs on the left) . You can see from the blue glow that there is nothing more to scroll. I'm using the default Theme.Holo

Setting ActionMode Background programmatically

蓝咒 提交于 2020-01-31 06:23:37
问题 I am aware of android:actionModeBackground that can be used in XML themes. Is there a way to set this background in code? Basically I need the ActionMode equavalent of getActionBar().setBackgroundDrawable(drawable); 回答1: I figured out with reflection help. Because I dont have an actionbar public static void setActionModeBackgroundColor(ActionMode actionMode, int color) { try { StandaloneActionMode standaloneActionMode = (StandaloneActionMode) actionMode; Field mContextView =

Setting ActionMode Background programmatically

天大地大妈咪最大 提交于 2020-01-31 06:23:08
问题 I am aware of android:actionModeBackground that can be used in XML themes. Is there a way to set this background in code? Basically I need the ActionMode equavalent of getActionBar().setBackgroundDrawable(drawable); 回答1: I figured out with reflection help. Because I dont have an actionbar public static void setActionModeBackgroundColor(ActionMode actionMode, int color) { try { StandaloneActionMode standaloneActionMode = (StandaloneActionMode) actionMode; Field mContextView =

ActionBar BUG: List mode navigation not visible after using SearchView

北城以北 提交于 2020-01-31 04:29:06
问题 Project demonstrating this bug: https://github.com/smarek/ActionBar-Navigation-Bug Bugreport on b.android.com : http://code.google.com/p/android/issues/detail?id=51449 I'm currently facing an issue with ActionBar. Let's have a ViewPager+PagerTitleStrip and 3 Fragments. User flow: Open application First Fragment has set navigation mode to NAVIGATION_MODE_LIST Other Fragments has NAVIGATION_MODE_STANDARD All Fragments has options menu item with SearchView Go to second or third and open search

How to put the icon to the left of action bar tabs

ε祈祈猫儿з 提交于 2020-01-30 06:26:51
问题 I am using the ActionBar.Tab, and they always appear at the left of screen. I want to put the activity icon to the left of tabs, but it always appear at the right of tabs. How can I move their position to where I want? 回答1: here is what works for me like a dream: in the Activity I have this: //hiding default app icon ActionBar actionBar = getActionBar(); actionBar.setDisplayShowHomeEnabled(false); //displaying custom ActionBar View mActionBarView = getLayoutInflater().inflate(R.layout.my

How to change Tab Indicator color programmatically

核能气质少年 提交于 2020-01-30 05:16:18
问题 I am new to Android , and before starting programming i found that now a days many of the apps are using Fragments, especially Tab with Swipeable Views How to change Tab Indicator/highlight color (I googled and changed ActionBar color to RED programmatically), but don't know how to change Tab Indicator color to RED. (priority programmatically) still my ActionBar looks like this I am using below lines to change background color of ActionBar , but i also need to change the color of Tab