android-toolbar

How to change change text and arrow color on Toolbar?

拜拜、爱过 提交于 2019-12-19 05:23:37
问题 I am currently building an app using the new material design guidelines. I am using a Toolbar rather than an action bar. I want the text, overflow icon, and the arrow/hamburger icon (thing that flips over when you pull out the navigation draw) to be white rather than black, but the rest of my theme needs to be the AppCompat.light theme. If someone could please explain how i would go about changing these things, i would be very greatful. I also need to change the colors both in xml and via

Android toolbar setNavigationIcon not working

自作多情 提交于 2019-12-19 02:05:36
问题 So, I have a BaseActivity in which I have a toolbar and I call setSupportActionBar(toolbar). In some of my activities that extends BaseActivity, I would like to change the navigation icon (the default arrow) to another drawable. But when I call toolbar.setNavigationIcon(myDrawable) it doesn't work, it still shows the default left pointing arrow icon. Any idea? Thanks. 回答1: I think you can set like this menuDrawerToggle = new ActionBarDrawerToggle(this, menuDrawer, toolbar, R.string.drawer

Spinner Theme is dark in Android

孤者浪人 提交于 2019-12-19 00:43:14
问题 I am trying to change the toolbar spinner dropdown theme strangely this is not happening. It is coming up always dark when I click on the spinner. I would like to have the background grey and text black. I don't have any actionbar. I am setting everything through toolbar. Hence I tried the following: <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android

How to make the Toolbar title clickable exactly like on ActionBar, without setting it as ActionBar?

≯℡__Kan透↙ 提交于 2019-12-18 19:35:27
问题 Background I wish to show an ActionBar on PreferenceActivity, as it's not available for pre-Honeycomb devices (even in the support library). Because such a class isn't available on the support library, I can't just call "setSupportActionBar" . I also don't wish to use a library (like this one) since all of the libraries I've found still use Holo style, so they didn't get updated so far, with this in mind. To do this, I'm trying to mimic the look&feel of the title of the ActionBar into the new

Gmail tablet like Actionbar items

二次信任 提交于 2019-12-18 19:17:04
问题 I'm trying to build an app with a split actionbar/toolbar like in the Gmail app. Is there any view element for this behaviour or do I have to write such a toolbar myself? The search icon is moving with the master fragment when opening the slidingDrawer . 回答1: To accomplish this you can add one of the new Toolbar widgets to each of your fragments layouts. The new Toolbar class was designed to be much more flexible than a traditional Actionbar and will work well in this split design. This post

How to center toolbar back button?

旧街凉风 提交于 2019-12-18 18:48:20
问题 I'm having a problem trying to center the back button on the support toolbar. I'm using it inside an ActionBarActivity. <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:toolbar="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/colorPrimary" android:minHeight="?attr/actionBarSize" toolbar:popupTheme="@style/ThemeOverlay

Setting a subtitle on my Toolbar from a fragment

偶尔善良 提交于 2019-12-18 13:15:21
问题 I am having some trouble setting the sub-title in my Toolbar from my fragment. I keep getting a Null Pointer Exception at the setSubTitle. @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); getActivity().getActionBar().setSubtitle("About"); // NULL POINTER EXCEPTION here } Adding the toolbar to the host activity: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R

Collapsing Toolbar and DrawerLayout

我只是一个虾纸丫 提交于 2019-12-18 12:40:52
问题 I created a layout with parallax effect which I use in a fragment. <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support

How to show Toolbar's logo, icon, title, subtitle when wrapped in a CollapsingToolbarLayout?

ⅰ亾dé卋堺 提交于 2019-12-18 12:35:04
问题 After Android Support Design Library was released, I wanted to implement an effect like a page of Twitter Profile , in which Toolbar 's title and subtitle could be changed as screen scrolled vertically. So I tried to use CoordinatorLayout , AppBarLayout , CollapsingToolbarLayout and Toolbar from Android Support Design Library to achieve this effect. Everything worked as expected except that Toolbar 's content couldn't be showed or changed as I wanted. I should have been wanting to display

Adding Sliding Tabs using Support Library v7:21 with Toolbar in Android Developer Tools for existing project

天大地大妈咪最大 提交于 2019-12-18 12:26:33
问题 I have already read the information in this link: Use Tab with new ToolBar (AppCompat v7-21) and did a lot of research on the same. But the problem is the SlidingTabLayout project is using Gradle build files and structure. I want to add the tab layout using eclipse. How do I do this? I did run the SlidingTabLayout project in Android Studio though. But how do I add Tabs to Toolbar in v7:21? Note: All this needs to be done in a existing project, which has everything setup and warns me of the