android-toolbar

Scroll behavior in nested RecyclerView with horizontal scroll

喜你入骨 提交于 2019-12-17 22:27:00
问题 I have to create vertical RecyclerView with nested horizontal RecyclerView in every item. Everything is within CoordinatorLayout . When I scroll by tapping outside nested RecyclerView toolbar hides, but when I scroll parent Recycler by tapping on nested one toolbar stays. Any help would be appreciated. Here is my xml layouts: main_activity.xml: <android.support.design.widget.CoordinatorLayout ...> <FrameLayout android:id="@+id/fragment_frame" ... android:fitsSystemWindows="true" app:layout

Toolbar inside CardView to create a popup menu (overflow icon)

六眼飞鱼酱① 提交于 2019-12-17 22:08:57
问题 I have a list that looks like google play in a recyclerview with cardview, and works perfect. I need to add a popup menu (with overflow icon), like this: which is the best way to do this ? I researched and found that there are 2 options: 1 - with a toolbar inside the cardview layout. is there a performanece problem with this solution ? 2 - with a imagebutton or imageview with a icon of the overflow, that when you click the menu is created. I need a solution to be compatible with >= API 10

How to change Toolbar navigation icon and options menu margin

旧城冷巷雨未停 提交于 2019-12-17 21:56:27
问题 Is there any way to change the left margin of the Navigation icon and the right margin of the Action items in Toolbar ? 回答1: I went through the Toolbar source code to find a solution and it turned out to be pretty simple. Toolbar uses two styles to style the toolbar and the navigation icon. Just had to override those styles with my own. <style name="myToolbarNavigationButtonStyle" parent="@style/Widget.AppCompat.Toolbar.Button.Navigation"> <item name="android:minWidth">0dp</item> <item name=

Content behind CoordinatorLayout AppBarLayout

a 夏天 提交于 2019-12-17 19:17:31
问题 I was creating a settings activity/layout for my app. I have a CoordinatorLayout with an AppBarLayout and Toolbar , then beneath that it includes content_settings.xml . When the content loads the .xml file is behind the app bar. I'm using this same setup to load the main content and it works fine, but for some reason isn't rendering correctly within the Settings section. activity_settings.xml <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height

How to center action menu on toolbar

情到浓时终转凉″ 提交于 2019-12-17 19:17:25
问题 I have an application with a split action bar loading an action menu. I changed the actionbar for the new toolbar and replaced the split actionbar by an other toolbar used in standalone mode : Toolbar toolbarBottom = (Toolbar) findViewById(R.id.toolbarBottom); toolbarBottom.inflateMenu(R.menu.ab_one_cam); As specified in the documentation the action menu is pin to the right of the toolbar : But i would like the icons to be centered on the toolbar , like it was on the split actionbar : How can

Android: how do I get SearchView close button to return the setQueryHint()?

霸气de小男生 提交于 2019-12-17 17:16:09
问题 I have a Search icon in my toolbar that searches a RecyclerView list. Pic 1: When the icon is clicked, the toolbar shows the SearchView's setQueryHint " Search here...". Pic 2: When a character is entered on the SearchView line, in this case the number "4", it is then searched in the RecyclerView list. If the character is not found, a close button "x" appears to the right of the character: Pic 3: My problem is that the default behavior when clicking on the close button "x" is to close the

Adding custom view to a toolbar

荒凉一梦 提交于 2019-12-17 16:04:58
问题 I am trying to add a custom view to the new toolbar (Lollipop) . But somehow the view gets added below the toolbar. It was working fine when I used actionBar.setCustomView but now after migrating to toolbar, it doesn't work. Below is the code. What changes should be done? Fragment : toolbar = (Toolbar) getView().findViewById(R.id.toolbar); ((ActionBarActivity) getActivity()).setSupportActionBar(toolbar); toolbar.setTitle(getString(R.string.app)); ActionBar actionBar = ((ActionBarActivity)

How to reduce the gap between navigation icon and toolbar title?

我的梦境 提交于 2019-12-17 10:54:13
问题 My problem is the extra space between the nav-drawer icon and toolbar title. The sample images are below: The xml view of the toolbar is <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:titleTextAppearance="@style/Toolbar.TitleText" app:popupTheme="@style/AppTheme.PopupOverlay" /> I have tried to solve this problem by using code below but no change occurred.

How to add dividers between specific menu items?

放肆的年华 提交于 2019-12-17 10:45:04
问题 Background I have a menu item in the action bar (toolbar actually) that when clicked, shows a list of items to choose from, similar to radio-buttons: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:icon="@drawable/..." android:title="@string/..." app:showAsAction="always"> <menu> <group android:id="@+id/..." android:checkableBehavior="single"> <item .../> <item .../> <item .../> </group> </menu> </item> </menu

Android Toolbar Adding Menu Items for different fragments

故事扮演 提交于 2019-12-17 07:11:34
问题 I have a toolbar as well as a navigation drawer. When I start my app, the toolbar and navigation drawer are created. When I click items in the navigation drawer, it starts new fragments and keeps the same toolbar. How do I basically add menu items to the toolbar such as search, add, edit when I start specific fragments? I don't want them at the start of the program, but created dynamically. Also, how would I be able to click these buttons and have them start other fragments. I want it so in