Questions tagged [android-actionbar-compat]
ActionBar implementation from Android Support Library component that provides an ActionBar for applications built for Android 2.1 (API level 7) and higher.
663
questions
0
votes
1
answer
203
views
Searchview in centre and after focus it goes to app bar in android
Hey guys I am learning Searchview in android. I have searchview in centre and when I focus it will go to app bar just like chrome application.
And when focus it will go to app bar
I didn't find any ...
0
votes
1
answer
67
views
How can I detect a touch event in an Android ActionBar?
My app creates an ActionBar (androidx.appcompat.app.ActionBar) like so:
mActionBar = getSupportActionBar();
I need to detect touch events in the ActionBar and use dispatchTouchEvent() to do ...
0
votes
1
answer
304
views
SwitchCompat text not showing up on action bar
I have an action bar on my app and inside the action bar there is a SwitchCompat widget. I've gotten the widget to show up on the action bar but there is no text beside the switch when I test the app.
...
0
votes
2
answers
562
views
Android Studio layout design view doesn't show menu bar items?
i've defined a simple menu in res/menu/simple_menu.xml, with a single item called TITLE2. i then iflate this menu in my MainActivity, and all is good (See device screenshot on right, where my TITLE2 ...
0
votes
0
answers
47
views
Programatically apply various styles.xml to android supportActionBar
Me again,
I'm trying to programtically set the supportActionBar style/theme so I can achieve the below:
NB the title text has been made smaller and the subtitle text bigger.
It works perfectly when ...
0
votes
1
answer
44
views
Android ActionBar and Toolbar are not seen even when defined in xml
I have this layout and Fragment class:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/non_clickable_account_snackbar_constraint_layout"
android:...
0
votes
2
answers
84
views
Android: I set some icons in the actionbar, but they were not shown on my device
I want to put some actions in my actionbar. In my Design-Preview the icons were shown, but on my device there are no icons shown in actionbar. What do I have to change for showing the icons in the ...
0
votes
1
answer
304
views
Changing navigation back button icon dynamically doesn't work
I need to set navigation back button dynamically
when I do this `
viewBinding.toolbar.navigationIcon?.setColorFilter(Color.parseColor(theme.primaryTextColor), PorterDuff.Mode.MULTIPLY)
it doesn't ...
-1
votes
1
answer
672
views
Android - How to create action bar like WhatsApp chat?
I am trying to create Actionbar or Tollbar whatever it is in my app. I did my best to create the similar as below but the results are very bad so its better not to share here:
And remember that the ...
1
vote
1
answer
692
views
Set app:contentInsetStartWithNavigation on ActionBar programmatically
I have upgraded an older Android app to androidx.
Now there is a big space before the icon in the Actionbar.
I was looking into it and found a question where it explains that it is due to
app:...
0
votes
0
answers
18
views
Can action bar contain PagerSlidingTabStrip?
I am using Android studio 3.3 canary 8 and my API level is 28. I have an activity which has the action bar and another PagerSlidingTabStrip. The action bar has a title and a close button to go home. ...
2
votes
0
answers
42
views
How to add an ActionBar to a PreferenceScreen?
I have just migrated from ActionBarSherlock and I also had to increase the minSDK to 14. I am trying to make it look like the way it was. (I am not interested in the material design guidelines for now....
2
votes
1
answer
376
views
Which Google document should be followed for Android icon sizes?
Google's Android document on Iconography says that action bar icons should be 32x32 while its document on Action Bar Icons says that they should be 24x24 for the baseline that is presumably mdpi.
I ...
0
votes
1
answer
381
views
Action Bar increased space between Title and Icon
I'm setting Action Bar for my app's ChatActivity but space between Icon and Title is so much that title is not visible
Here is my code
ab.setDisplayHomeAsUpEnabled(true);
ab....
1
vote
1
answer
728
views
Action bar rendering issue
I am new to Android Studio. I had this action bar disappearing in design panel. Basically nothing was being rendered on the design view. no action bar no textView nothing. then i read that i should ...
1
vote
1
answer
95
views
Is there any way to catch the onkeydown event of the hardware menu button when using the SupportActionBar and the v7 support Toolbar?
My AppCompatActivity axml uses the Android.Support.v7.Widget.Toolbar and the Activity sets the toolbar with SetSupportActionBar(toolbar);. Everything works as expected, however I'd like to override ...
0
votes
1
answer
42
views
Is it ok to use LinearLayout.LayoutParams in case I don't need advanced functionality?
I've noticed that some Android views come with a custom version of LayoutParams, e.g. when adding an ActionBar to a LinearLayout I could set its dimensions like this:
android.support.v7.app.ActionBar....
3
votes
0
answers
1k
views
How to apply theme programmatically?
In XML, my action bar is created like this:
<android.support.v7.widget.Toolbar
android:id="@+id/myactivity_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/...
0
votes
2
answers
799
views
Action Bar with ImageView
enter image description here
Hi everybody
i want to put 3 ImageView in action bar two ImageView fixed and one does a zoom animation i try several times but i can not find the solution i want here is ...
2
votes
0
answers
323
views
SearchView pushes toolbar item off the edge of the screen
I would like to achieve the following - a SearchView with a button that gets sent to an overflow when the SearchView is expanded:
There is a known bug with SearchView that causes it to not respect ...
0
votes
1
answer
2k
views
(SearchView) MenuItemCompat.getActionView(item) always null
i am beginner in android studio and sorry my English is not good.
i have a searchView in secondActivity.
i have done things like below :
1.implemented the v7 AppCompat support library in gradle like ...
4
votes
1
answer
112
views
Grabbing a pointer to a TextView of a tab on the action bar?
Some other users and I are developing an Android application for the Stack Exchange chat network. We're adding a tutorial for each activity to explain the UI to the user. However, we've run into a bit ...
0
votes
1
answer
53
views
How to show overflow menu only if text can be displayed on the ActionBar
How can I know (programmatically) if the menu is displayed with text on the ActionBar?
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/...
1
vote
1
answer
2k
views
Android - Add a spinner on the ActionBar title
I'm willing to add a Spinner that will open when I click on the Activity's title in the ActionBar (I don't use a Toolbar, I use the support ActionBar).
I tried with the method ...
1
vote
2
answers
4k
views
Changing the color of a supportActionBar programmatically
I'm having an issue where changing the background drawable of the support ActionBar changes the color of most of the bar but leaves the old color around the text and icons. I've tried changing the ...
0
votes
1
answer
702
views
Setting ColorPrimary (Action Bar color) to transparent causes an exception
I'm trying to set my Action Bar color to transparent, so it will have the same color as the background and will also blend in with the gradient background.
I tried doing something like this:
<...
1
vote
1
answer
3k
views
SearchView with rounded corners in ActionBar
I am working on an app needing a SearchView in the search fragment.
I obviously know how to create a classic SearchView, but how is it possible to customize it to get a result like this :
0
votes
1
answer
38
views
How to modify Action Bar buttons based on a specific Condition in a certain Activity
I am developing an android application using the firebase quickstart code samples.
My app is an E- Auction app, there are three tabs shown to the user Fixed Price , Auction and My Listing. The first ...
2
votes
1
answer
416
views
How to handle ActionBar's icons visibility when using SearchView
Well, what I want is to:
Initialize ActionBar with all items, except "searchSettings";
When click on the Search icon, searchSettings appears and the rest of the icons disappear;
When close the search ...
0
votes
1
answer
1k
views
Gradient from actionbar in to tabs
I've googled for hours trying to find an answer to this seemingly obvious question but I can't even find another example of someone trying to do this. Is it possible to have a gradient extend from an ...
0
votes
0
answers
341
views
How to remove the divider between two action bar
How to remove the divider between two action bar
one the application action bar and the other tablayout action bar
here is my current view i want to remove that divider
current view of my ...
0
votes
1
answer
72
views
ActionBar is not being displayed anymore after migration from Eclipse to Android Studio
I recently tried to edit my 4 year old android application in the recently appeared Android Studio 2.3.1.
After importing the code I can launch it on my mobile phone. However the action bar seems to ...
1
vote
0
answers
37
views
Android on Locale changed to "ar" menu app:actionLayout is not VISIBLE
When I am using "en" locale menu is VISIBLE, Please find the code i am using to create menu.
<item
android:id="@+id/action_cart"
android:orderInCategory="100"
app:...
0
votes
1
answer
1k
views
Android AppBar not showing shadow
The AppBar and BottomNavigationView don't display any shadow on the listview between them even with
setSupportActionBar().setElevation(3.0f);
I have the following layout
CordinatorLayout
--...
0
votes
1
answer
102
views
Android AppCompat ActionBar 2xHeight
I have a view which has a TabLayout in it. But the action bar is twice the height that it normally is.
I don't know if this is related to the TabLayout. The other views in the app which do not have a ...
0
votes
2
answers
3k
views
How to add textview in actionbar instead of application name with image
I want to add Textview with image like below image instead of application name:
I dont want to remove menu image . i just want to remove applicatoin name from actionbar and put this kind of textview ...
1
vote
1
answer
1k
views
Android Toolbar doesn't hide a title
I can't hide a title in my Toolbar that I set as ActionBar.
Here my activity style:
<style name="Theme.Paper" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@...
1
vote
1
answer
147
views
Unalble to align left the custom layout in app bar
I've been dealing with this for quite a while. No success though!
What I want is to set the custom layout to the very left of the app bar. WITH NO MARGINS whatsoever. But no matter what I change, the ...
2
votes
1
answer
444
views
Can I get the position of the overflow menu and any other menu in the Action Bar
I have a ActionBar setup in my AppCompatActivity and I would very much like to be ablt to get the position of the menu items and the overflow menu, so that I can have a tool tip pointing to any item ...
-2
votes
1
answer
366
views
Android AppCompat SupportActionBar - how to make icon auto-fit to a certain size
In my app, Icon will be loading dynamically and auto-fit in icon slot. Currently, the icon is not resizing, so it expand the height of ActionBar. I am using SupportActionBar instead of ToolBar because ...
0
votes
4
answers
77
views
ActionBar didn't work?
My application crashes and I get
Error :
setNavigationMode(int)' on a null object reference
Code :
package com.example.muhammad_adel.tabs;
import android.app.ActionBar;
import android.support....
9
votes
4
answers
12k
views
Can't change ActionBar title text color
I've been trying to find solution but none worked for me.
Activity theme:
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/...
0
votes
3
answers
2k
views
ActionBar is not visible with Coordinator Layout
In my App, there is an activity which has a layout as the one posted below. the problem I have is, when that activity starts, action bar becomes invisible, CoordinatorLayout takes up all the screen.
...
1
vote
1
answer
208
views
Xamarin.Droid - DrawerLayout.SetDrawerLockMode(x) crashes V7.SupportActionBar
I'm trying to Disable the NavDrawer while I'm in an Android Fragment. The following code is currently working:
public class MainActivity : BaseActivity
{
protected override void OnCreate(Bundle ...
2
votes
2
answers
786
views
Remove space between home indicator to custom textview
I tried to remove the left margin of the icon OR the right margin of the text (i dont really sure).
I added layout bounded so you can see the problem easily.
Im not using a Toolbar. So i look for ...
1
vote
1
answer
104
views
Action Bar Menu Items Duplicating on Run
I am very new to Java Programming and Android Studio.
While creating an Options Menu, I created a list of options in the main menu with two items in a group sub menu.
This is my menu.xml
<?xml ...
2
votes
1
answer
299
views
Redraw ActionBar in Android manually
I have an Android app and layout is available in both landscape and portrait.
On some activities there are a lot of inputs and selections and I want to keep them even if I rotate the phone.
I added ...
2
votes
1
answer
841
views
How to load a circular appcompat actionbar logo using glide
Till now I have done the following, if I omit the circular image creation part it works fine, but I must show a circular image in actionbar
here is what I have tried so far, any help will be highly ...
0
votes
1
answer
84
views
Both Fragment in ActionBar return true for fragment.isVisible()
In my MainActivity with ActionBar I listen to a listener from a DialogFragment and based on which Fragment of ActionBar i am on, I need to do some things.
I am using below code to get the current ...
21
votes
3
answers
7k
views
Android - Activity Home/Up arrow has additional padding/margin with SDK 24
I've just updated my app from using SDK 23 to SDK 24.
A problem has arisen for my activities that have show the Up/Home arrow (i.e., getSupportActionBar().setDisplayHomeAsUpEnabled(true)) in that ...