android-toolbar

Hide Toolbar back arrow with NavigationComponent and BottomNavigationView

北城余情 提交于 2020-01-06 06:46:45
问题 I'm in the process of implementing NavigationComponent coupled with a BottomNavigationView and I am noticing that the back arrow is shown in the toolbar for all fragment destinations except the one specified as the startDestination in my navigation graph. All examples of this implementation that I've been able to find show similar behavior. Hiding the back arrow for each associated fragment of a BottomNavigationView seems like a more natural design in my opinion, (hitting a back arrow in the

Multiple lines titles in toolbars header in Android

一曲冷凌霜 提交于 2020-01-06 01:17:22
问题 I am trying to set the toolbar title text in multiple lines but it shows only in single line and after 15 character text is going to be Eclipse in Android. Please help me guys. Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(mToolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); if(!getSupportActionBar().isTitleTruncated()){ getSupportActionBar().setTitle(job.getJob_title()); } Spannable text = new

Error inflating class android.support.v7.internal.view.menu.ActionMenuItemView, android?

不问归期 提交于 2020-01-05 14:28:42
问题 I am getting this error on inflating the menu Logcat: android.view.InflateException: Binary XML file line #17: Error inflating class android.support.v7.internal.view.menu.ActionMenuItemView at android.view.LayoutInflater.createView(LayoutInflater.java:620) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) at android.view.LayoutInflater.inflate(LayoutInflater.java:469) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at android.support.v7.internal.view

android.support.v7 Toolbar & DrawerLayout- how to change Hamburger icon

陌路散爱 提交于 2020-01-05 03:52:05
问题 My application uses ActionBarActivity and DrawerLayout and etc. i want to change the ActionBarDrawerToggle icon to be custom drawable. in my code i use android.support.v7.widget.Toolbar as SupportActionBar this is my code: toolbar.setNavigationIcon(R.drawable.lifeline_shield); setSupportActionBar(toolbar); ActionBar actionbar = getSupportActionBar(); actionbar.setDisplayHomeAsUpEnabled(true); actionbar.setDisplayShowTitleEnabled(false); mDrawerToggle = new ActionBarDrawerToggle(this,

Toolbar shifts up, when soft keyboard appears

孤街醉人 提交于 2020-01-04 06:21:56
问题 I want to make my activity layout resize when keyboard appears, but at the same time keep its toolbar position unchanged. So far all the screen shifts up, when I click on the edit text and the keyboard appears. Before keyboard appears: After keyboard appears, the toolbar isn't visible anymore: I would like to keep the keyboard in its place and shift below it the image. I can't just specify in the manifest: android:windowSoftInputMode="adjustNothing" , because the edit text will not be visible

Action Buttons do not cover the entire Toolbar

末鹿安然 提交于 2020-01-04 05:59:54
问题 I have used a Toolbar to display four action buttons. When I inflate the toolbar with menu, the action buttons are displayed towards one side as shown in the picture : How can I make these action buttons cover the entire toolbar? This is the code for the Activity : public class ResultActivity extends FragmentActivity { final int TAB_NUM = 2; private ViewPager mViewPager; private PagerAdapter mPagerAdapter; private Toolbar mResultToolbar; @Override protected void onCreate(Bundle

AppCompat Toolbar Font Size Inconsistent in Portrait vs. Landscape [duplicate]

三世轮回 提交于 2020-01-04 02:55:09
问题 This question already has answers here : Android Toolbar: small title text in landscape mode (5 answers) Closed 3 years ago . I'm using this: https://xisberto.wordpress.com/2014/11/08/how-to-combine-actionbar-and-preferenceactivity-headers-with-appcompat/ The "Settings" font size changes between portrait and landscape. How do I keep it consistent? 回答1: It is normal, the toolbar height in portrait mode have 56 dp, in landscape 48 dp, the OS resize its height. Take care if you change the title

Toolbar icons disappearing after expanding the SearchView in Android

时光毁灭记忆、已成空白 提交于 2020-01-04 02:09:28
问题 here's my problem: I have that nice toolbar with the icons in landscape mode: after expanding the search view and showing the popup menu the "add" item appears (I thought that it shouldn't): then returning with the back arrow key, as you see, the add button goes: and you won't find it in the popup menu anymore: I'm using support:appcompat-v7:25.1.0, and here's my menu code: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http:/

How to put toolbar on bottom side of the app?

吃可爱长大的小学妹 提交于 2020-01-04 01:51:13
问题 I tried many. but nothing worked I am using coodinatorlayout.I also used android:layout_alignParentBottom="true" But it is not working well my app bar_xml is <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android

Toolbar: IllegalStateException - configure your build for VectorDrawableCompat

北慕城南 提交于 2020-01-02 03:25:07
问题 I'm using Android Studio 2.1.2. I started a new project with minSdkVersion as 19. My activity extends AppCompatActivity. The project starts with an empty activity using a fragment. When previewing content_main.xml with API 24, all is good. when previewing API 19, I get the following rendering problem: The following classes could not be instantiated: - android.support.v7.widget.Toolbar java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure