For an activity with NoActionBar in its theme, an action bar is still shown temporarily when calling startActionMode().
Is it possible to make the temporary action bar shown use an overlay? Setting windowActionBarOverlay in the theme does not affect the action bar shown by startActionMode().
Related
i have an activity where i am switching between fragments.
some fragments i want to have the action bar show in full, others i want it to be transparent.
i used the trick found in the answer to this question, where i essentially have a theme that has:
<item name="windowActionBarOverlay">true</item>
and in my layouts where i want a static/ full action bar i'll add:
`layout_marginTop:"?android:attr/actionBarSize"`
in the fragments where i want a transparent action bar, i'll do:
getActivity().getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.argb(0, 0, 0, 0)));
the problem: in the latter case, the action bar shadow still shows. i can disable it if i add:
<item name="android:windowContentOverlay">#null</item>
but now what about when i want the action bar to show in full/ non-transparent? i want the shadow to show with it as well. so is there a way to trigger that shadow on and off?
alternatively, i could just ditch the whole styling deal and just do:
getActivity().getSupportActionBar().show(); // or hide
and then in my layout i could manually add the back button that i want from the action bar. the issue in that case is that the action bar slides in and out and looks sloppy. i can't call:
getActivity().getSupportActionBar().setShowHideAnimationEnabled(false);
because it tells me:
ActionBar.setShowHideAnimationEnabled can only be called from within the same library group (groupId=com.android.support)
so how can i add/remove the action bar shadow depending on which fragment is showing? or else, how can i hide the action bar without animation?
thanks!
I tried to add an icon to the Action Bar, in ShowAsAction I set it to ifRoom. But no matter how, the icon only shows up in the 3 dot menu and never show up in the Action Bar, what are the possible cause of this issue?
I'm looking to show the action bar "action mode" persistently throughout the life on an activity. This activity edits an image and once the user clicks the check mark the image is saved and the activity exits. However, if they press back the edit process is canceled.
My action bar is translucent with overlay content set to true. Here is how it looks.
Here is what I have tried
1. Action bar is translucent as well as my action mode. Action mode is overlayed causing a darkening of the action bar.
2. Make action bar transparent. Everything looks good but once you click the check mark you see an odd looking action bar without a background which is shown for a second.
3. Hide the action bar. This causes animation issues where you can see the action bar animate in while the activity is exiting.
All these attempts are hacks and they don't work well. Maybe I can somehow add the check mark on the left? I'm not sure how to reproduce that action mode as my action bar. Hopefully someone has a good idea on how I can achieve the action mode style.
I'm using the compat library to add an action bar to an app. I have set a custom theme which extends Theme.AppCompat and set a background for the action bar and a background for the application. However the action bar icon and title backgrounds seems to be transparent which means the app background is visible through the action bar as you can see below. Any ideas?
Thanks
How can I hide the top Action Bar but show the Split Action Bar using ActionBarSherlock. I would like to have Tabs at the top instead like this:
The Android developer site states the following to hide the action bar but keep the split action bar:
If you'd like to hide the main action bar at the top, because you're
using the built-in navigation tabs along with the split action bar,
call setDisplayShowHomeEnabled(false) to disable the application icon
in the action bar. In this case, there's now nothing left in the main
action bar, so it disappears and all that’s left are the navigation
tabs at the top and the action items at the bottom, as shown by the
second device in figure 3.
https://developer.android.com/guide/practices/tablets-and-handsets.html#SplitActionBar
In my SherlockFragmentActivity I call the following, however only the app icon and title disappear and the action bar stays like this:
//Hide action bar
getSupportActionBar().setDisplayShowTitleEnabled(false);
getSupportActionBar().setDisplayShowHomeEnabled(false);
Calling getSupportActionBar().hide() hides the action bar but also hides the split action bar.
The tabs only roll up into the top action bar if you are using the Tabs provided by ABS. You're not using ViewPager/ViewPagerIndicator for the tabs by any chance are you? (I have this issue currently)