toolbar

Don't collapse Toolbar when RecyclerView fits the screen

眉间皱痕 提交于 2019-11-26 22:33:43
问题 I've made an app using Android Design Library , with a Toolbar and TabLayout. Actually 2 tabs are present, both with 2 RecyclerView, that automatically collapse the Toolbar when scrolled. My question is: can I disable Toolbar collapsing when RecyclerView has few items and completely fits the screen (like in TAB 2)? I've seen a lot of examples like CheeseSquare, made by a Google employee where the issue is still present: even if the RecyclerView has just 1 item, the toolbar keeps hiding on

Creating a SearchView that looks like the material design guidelines

戏子无情 提交于 2019-11-26 22:14:13
问题 I'm currently in the process of learning how to convert my app to Material design and I'm a bit stuck right now. I've got the Toolbar added and I have made my navigation drawer overlay all the content. I'm now trying to create an expandable search that looks like the one in the material guidelines: This is what I've got right now and I can't figure out how to make it like the above: This is my menu xml: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk

when set app:elevation=“0dp” then hamburgermenu not showing to toolbar

僤鯓⒐⒋嵵緔 提交于 2019-11-26 21:50:35
问题 Hi I wanted to remove the below shadow of toolbar for that I have used elevation property, Currently my code is <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/transparent"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android

Title, etc. not showing in Android Toolbar

倾然丶 夕夏残阳落幕 提交于 2019-11-26 21:31:07
问题 I've just added an Android Toolbar to an app I'm working on. The toolbar placement works correctly with the toolbar layout appearing at the top of the display. However, the toolbar is showing up as a blank colored bar...the App Title and Overflow Icon do not show up in the Toolbar. Any ideas on how to fix? ToolbarActivity.java: public abstract class ToolbarActivity extends ActionBarActivity { private Toolbar toolbar; @Override protected void onCreate(Bundle savedInstanceState) { super

How can I align Android Toolbar menu/icons to the left like in Google Maps app?

て烟熏妆下的殇ゞ 提交于 2019-11-26 21:27:07
Here is a screenshot of Google Maps Toolbar. As you can see icons are aligned to the left instead of right (default behavior). I've tried adding android:layout_gravity="left" and android:gravity="left" to the toolbar but it didn't work. Also tried adding an internal LinearLayout (with same gravity values) to the Toolbar but didn't worked either. Any ideas? I want to be able to use a regular Android menu with the Toolbar widget instead of recreating everything from the scratch. rylexr After some struggling and digging in Android Toolbar code I managed to make it work. Basically, the idea is to

How do I make DrawerLayout to display below the Toolbar?

只愿长相守 提交于 2019-11-26 19:59:33
How to make the drawer layout be below the actionbar/toolbar? I'm using v7:21 app compat library with the new ToolBar view. Examples that I see looks like <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/my_drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- drawer view --> <LinearLayout android:layout_width="304dp" android:layout_height="match_parent" android:layout_gravity="left|start"> <!-- drawer content --> </LinearLayout> <!-- normal content view --> <LinearLayout android:layout

Translucent/Transparent status bar + CoordinatorLayout + Toolbar + Fragment

谁都会走 提交于 2019-11-26 19:59:13
问题 I have following setup: I'm using AppCompat MainActivity, that holds a fragment and has a toolbar, that's hiding when scrolling down Fragment with RecyclerView all views that should fit the screen have the according android:fitsSystemWindows="true" in the xml layout The problem is, I can't get the statusbar transparent in this case. What I do is following: Create the activity and call setContent Then I try to adjust the activity to programmatically get a translucent toolbar like following:

Make Disabled Menu and Toolbar Images look better?

自古美人都是妖i 提交于 2019-11-26 19:25:14
问题 Please see the attached screenshot which illustrates a TToolBar from one of my programs: Notice the last two images of the Toolbar, they are disabled. The way they have been drawn to appear disabled is not very appealing, in fact in the Delphi IDE some of the images look the same. The issue I have with it is I want my application to look a lot cleaner. The way the disabled items are drawn doesn't look very good. The TToolBar allows to set a disabled TImageList, I tried making my images black

How to set a custom font to the title in toolbar android

独自空忆成欢 提交于 2019-11-26 19:22:03
问题 I am doing this: toolbar = (Toolbar) findViewById(com.sports.unity.R.id.tool_bar); setSupportActionBar(toolbar); setTitle("hello"); I want to set a custom font for the text here in the title "hello". How to do that? 回答1: Update 2018 (kotlin version) fun Toolbar.changeToolbarFont(){ for (i in 0 until childCount) { val view = getChildAt(i) if (view is TextView && view.text == title) { view.typeface = Typeface.createFromAsset(view.context.assets, "fonts/customFont") break } } } and use it like

How to change CollapsingToolbarLayout typeface and size?

左心房为你撑大大i 提交于 2019-11-26 18:49:27
问题 I want to change CollapsingToolbarLayout font size and its typeface. How I can achieve that? 回答1: Update Before we dive into the code let's first decide the textSize for our CollapsingToolbarLayout . Google published a website called material.io , this website also explains the best way on how to deal with Typography. The article mentioned about "Heading" category which also explains the recommended font size to use in sp . Although the article never mentioned the recommended