android-toolbar

Hiding Toolbar smoothly on RecyclerView Scroll?

会有一股神秘感。 提交于 2019-12-10 14:04:45
问题 Currently I've a RecyclerView that holds some list of items. I'm listening the Scroll listener of RecyclerView and if the RecyclerView at some point say 500, it should hide the toolbar and it should remain hide when it crosses to 500+. Similarly, it shows the toolbar when i reaches <= 450. This is the code I've tried so far. The problem is, It hides the toolbar but it flashes when it hides or shows at that mentioned point. How to achieve a smooth toolbar hide? recyclerView.addOnScrollListener

Search editText animation like Chrome app

蓝咒 提交于 2019-12-10 13:48:48
问题 I'm trying to make a search editText in the middle of screen, That whenever pressed, move with animation to the searchView in the toolbar. Exactly as you can find in new tab of chrome app (v46) for android. Didn't find any Github example, so any idea how to implement that? 回答1: I've created a gist to show one way that this can be done: https://github.com/orenothnay/SearchBar The main component is FocusableEditText (which I adapted from androids searchview widget). It uses a workaround to

Toolbar NavigationIcon loose theme

让人想犯罪 __ 提交于 2019-12-10 13:36:31
问题 I use two themes for my app depending of the actionBar color I want (dark or light color) : - Theme.AppCompat.Light.NoActionBar - Theme.AppCompat.NoActionBar Here's my toolbar layout : <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="fill_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize" app:theme="@style/ThemeOverlay.AppCompat.ActionBar" > <TextView android:id="@+id/toolbar_title" android:layout_width="wrap_content" android

Can getSupportActionBar be null right after setSupportActionBar?

China☆狼群 提交于 2019-12-10 13:25:59
问题 Should I null check the getSupportActionBar() method even if earlier in that method I have set the support action bar using getSupportActionBar() ? In onCreate() I have the three lines Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setTitle(getIntent().getStringExtra(TITLE_KEY)); Android Studio then gives me the warning "Method invocation may produce java.lang.NullPointerException" Assuming that the findViewById method does return a

Left space in Toolbar with SearchView android studio

陌路散爱 提交于 2019-12-10 12:36:29
问题 I'm trying to add a simple SearchView to the toolbar in my app. Everything it's working fine expect for the layout. There is this "space" between the NavigationDrawer icon and the SearchView . If I set a title the space is filled with that string, otherwise is empty. Empty string: With a string in title: How do I remove that annoying empty space? Edit: I'm using as base code the NavigationDrawer example from Android Studio main.xml <menu xmlns:android="http://schemas.android.com/apk/res

Android Multiline Toolbar Title

梦想与她 提交于 2019-12-10 04:24:41
问题 I have a Toolbar that when in landscape mode isn't as wide as usual, but it has more height than usual and for that reason I want to set the title to be multiline (2 lines to be precise) when it is in landscape. I have tried some things where I put a TextView inside of the Toolbar, but when I try to access the TextView to set it's title (since the the title is variable) I get a NullPointer after using findViewById. Here is some code of the current situation (without multiline): @Override

NestedWebView working properly with ScrollingViewBehavior

二次信任 提交于 2019-12-09 23:41:08
问题 I have an app with two activities extends same abstract - one with WebView , another with ViewPager with TabLayout and RecyclerView s - and on this level I've implemented "shared" showing/hiding toolbar with scroll/fling feature: app:layout_scrollFlags="scroll|snap|enterAlways" WebView is "pushing out" Toolbar just like RecyclerView under any tab in ViewPager (keeping TabLayout visible), in both cases any scroll to top brings back Toolbar . Just like on this example: Now I've to change this

AppBar hides view when scrolling until collapsed

早过忘川 提交于 2019-12-09 16:50:23
问题 My AppBar hides one of my views right when it reaches the end of the scrolling, but I want the pinned view to stay above the AppBar even when it reaches the end of its scrolling. Here is what my view looks like before I start scrolling: And this is what it looks like when it is fully scrolled: You can see that the circular image on the bottom left of the AppBar is now hidden under the bar. Here is my fragment's XML code: <android.support.design.widget.CoordinatorLayout xmlns:android="http:/

How to make the overflow popup menu avoid obstructing the action bar?

痞子三分冷 提交于 2019-12-09 09:33:54
问题 Background On my app, when I've updated to the new support library and also tried on Lollipop, I've noticed a weird issue: when clicking on the overflow button of the action bar (or even the new Toolbar class) will show the popup menu on top of the action bar, hiding other action items, as such: Here, the action items that got hidden are uninstallation and sharing. The problem I've tried to avoid this issue, by ovverriding the style of the overflow menu, but nothing has helped. Not only that,

This Activity already has an action bar supplied by the window decor (FEATURE_ACTION_BAR)

本小妞迷上赌 提交于 2019-12-09 07:55:33
问题 This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead This is the error I got, I searched for solutions but I didn't find how to solve it. This is my code: styles.xml <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/myPrimaryColor</item> <item name="colorPrimaryDark">@color