toolbar

how to remove left margin of Android Toolbar?

好久不见. 提交于 2019-11-28 21:09:37
I'm trying to use toolbar for my project. Here is the code I am using: <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:layout_alignParentTop="true" android:background="?attr/colorPrimary" android:contentInsetLeft="0dp" android:elevation="@dimen/margin_padding_8dp" android:contentInsetStart="0dp"> <RelativeLayout android:id="@+id/rlToolbar" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/tvTitle" android:layout_width="wrap_content" android

Floating Toolbar with Appcompat

无人久伴 提交于 2019-11-28 19:53:13
How to create a floating toolbar like the following image as proposed in the material design guidelines and in the Google Map application. I've worked with the Toolbar before and all the comments from CommonsWare are absolutely correct. The Toolbar widget ( https://developer.android.com/reference/android/support/v7/widget/Toolbar.html ) have absolutely nothing special or different than any other Viewgroup and does not behave differently than any other ViewGroup. Put it inside a FrameLayout , put a layout_margin parameter on it, make the layout_width NOT match_parent and that's it. Put it

AppCompat v7 Toolbar onOptionsItemSelected not called

安稳与你 提交于 2019-11-28 19:06:58
I changed from the original ActionBar to the AppCompat Toolbar and setSupportActionBar(toolbar). When I am using getSupportActionBar() and setDisplayHomeAsUpEnabled(true) for the back arrow, the click never calls onOptionsItemSelected or any other listener method. Do I have to implement some special listener for it? Befor everything was working just fine. EDIT: Initialise the ActionBar: mToolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(mToolbar); mActionBar = getSupportActionBar(); mActionBar.setHomeButtonEnabled(true); and after replacing the content with a Fragment I do

Change the color of Navigation Drawer indicator icon

↘锁芯ラ 提交于 2019-11-28 18:26:21
问题 I am using a toolbar in place of actionbar and i am also using a navigation drawer.My toolbar colour is black and i want my navigation drawer indicator colour to be white.So how to change the colour of the navigation drawer indicator or put a custom navigation indicator in v7.Can any one please help me? 回答1: Try creating this style in your styles.xml . <style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle"> <item name="color">@android:color/white</item> </style> And, then

Toolbar will not collapse with Scrollview as child of CoordinatorLayout

怎甘沉沦 提交于 2019-11-28 18:14:52
问题 I am trying to follow the Google Docs on using the CoordinatorLayout but i am having an issue with the ScrollView inside the CoordinatorLayout. Basically, the Toolbar normally would collapse with a RecyclerView or a Listview when scrolling down. Now with a ScrollView it will not collapse. <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"

Hiding/Showing the toolbar when fragment in the tabs is scrolled

吃可爱长大的小学妹 提交于 2019-11-28 17:34:28
I added the new Toolbar , Tablayout and Viewpager in my android app. I provided Fragments for my 3 Tabs and its working fine. But the problem is that when i scroll up my Toolbar does not hide. I want that when i scroll my fragment it should hide. And one more thing, i am using Webview in the fragment. My codes are given below. MainActivity.Java public class MainActivity extends AppCompatActivity { TabLayout tabLayout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); setupToolbar(); setupTablayout(); } private void

Appcompat v21 Toolbar elevation pre-lollipop

血红的双手。 提交于 2019-11-28 17:01:10
问题 First off, I know that this question has been asked before, but it hasn't been answered before. I hope someone can give me an answer. In my application, I use the Toolbar from Appcompat_v7 (API 21). This is my code: <android.support.v7.widget.Toolbar style="@style/DarkActionbarStyle" android:id="@+id/toolBar" android:layout_width="match_parent" android:layout_height="@dimen/actionbar_height" /> And this is the ToolBar style I use: <style name="DarkActionbarStyle" parent="@style/Widget

CollapsingToolbarLayout with a custom view

二次信任 提交于 2019-11-28 16:02:50
问题 I'm trying to implement the CollapsingToolbarLayout with a custom view, but I'm unable to do it : What I want to do (sorry I can't post images so it's on imgur) : Expanded, the header is a profile screen with image and title Not expanded (on scroll), the image and title will be on the toolbar But everything I saw wasn't working as I expected I'm new to this and lollipop animations so if someone could help me I'll be very grateful ! (I don't post sample code because I don't have something

Custom Toolbar Views not centered

一个人想着一个人 提交于 2019-11-28 13:37:27
When using ActionBarDrawerToggle with my custom Toolbar , the TextView s in the Toolbar are no longer centered. main_layout.xml <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <include layout="@layout/toolbar" /> <FrameLayout android:id="@+id/flContent" android:layout

How to make jqgrid top toolbar custom buttons bigger like standard buttons

こ雲淡風輕ζ 提交于 2019-11-28 13:07:28
Style based on question jqGrid - How can I make the paging buttons bigger? is used to make jqgrid top level toolbar buttons bigger: .ui-jqgrid .ui-jqgrid-toppager { height:35px !important; } .ui-jqgrid .ui-pg-button { height:30px !important; width:30px !important;} .ui-jqgrid .ui-jqgrid-toppager .ui-icon { position:relative; margin: 0px 10px;} .ui-jqgrid .ui-jqgrid-toppager .ui-pg-div span.ui-icon { margin: 0 10px !important; } /* some settings to place Button in jqGrid */ .ui-jqgrid .ui-pg-table .my-nav-checkbox { margin: 0px; padding: 0px; float: left; height: 18px; } .ui-jqgrid .ui-pg-table