android-toolbar

How to set space on left&right of the logo in the actionBar ?

丶灬走出姿态 提交于 2019-12-12 09:14:20
问题 Background I want to show a bitmap on the left side of the title of the activity, in the actionbar (toolbar, to be exact), so I used this: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setLogo(R.mipmap.ic_launcher); ... The problem Thing is, the logo seems to have too much margin on its left,

Implementing Ripple Effect in Toolbar

送分小仙女□ 提交于 2019-12-12 08:18:19
问题 I am trying to add this Ripple effect on my toolbar https://github.com/traex/RippleEffect but currently I'm lost on how to do this. base on how to add toolbar <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="56dp" android:background="@color/app_secondary_color" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" app:theme="@style/ThemeOverlay.AppCompat.ActionBar" > </android.support.v7.widget.Toolbar> then setting in

v7 widget toolbar not showing, why?

依然范特西╮ 提交于 2019-12-12 07:04:13
问题 I am so close. I have the android studio project set up correctly with libs, the project compiles, and the emulators and device run the app. I am trying to get rid of the bottom button popup menu of older devices and replace with v7 appcompat toolbar. The old action bar is gone but the menu inflate still inflates to the old popup menu. I start off using a splashscreen then the app main shows the database view activity. This means I have to dynamically load the toolbar. My thinking now is the

RecyclerView and Toolbar, can't scroll bottom item into view

六眼飞鱼酱① 提交于 2019-12-12 03:32:57
问题 EDIT: See Using the Master/Detail template in ViewPager Fragments (download link) for full code I have a toolbar and a recyclerView . When the layout is first inflated the last item of the recyclerView is out of the scroll-able region of the screen and is therefore not visible. After rotating the item appears. It is apparent that the toolbar is pushing the recyclerView outside the boundaries of the screen. If I add padding to the bottom of the recyclerView with the height of the toolbar the

Activity transition ignoring Toolbar

ε祈祈猫儿з 提交于 2019-12-12 03:04:43
问题 let's see if someone can help me with this. In my app I have successfully implemented slide transitions between most of my activities. All my activities layouts consist in a regular toolbar and some content below. So what I would like is the animations to ignore the toolbar and only affect the main content. Ideally, the toolbar would remain in its place and the main content of the layout would be the one sliding. For completion of the question, here is one of my transition xmls: <?xml version

Transparent action bar not being fully transparent. (Leaves weirdbox)

橙三吉。 提交于 2019-12-12 02:35:58
问题 I've tried setting the action bar I custom-made for my application to be transparent. However instead of being completely transparent, it leaves a weird elevation shadow: http://puu.sh/rdYyb/04ce0147f6.jpg The XML for the bar: <android.support.design.widget.AppBarLayout android:id="@+id/appbarlayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout

Android ActionBar missing after extending Appcompatactivity

筅森魡賤 提交于 2019-12-11 19:04:49
问题 I've recently updated my app extending Appcompatactivity in my Activities . Since then, the Actionbar is gone when I launch an external library Intent. For example, I'm using the HockeyApp SDK to launch their FeedbackActivity Here is my code: FeedbackManager.showFeedbackActivity(this, Uri.fromFile(file)); And here a screenshot (you can see the ActionBar is gone). It used to work before until I started extending Appcompatactivity. For the rest of Activities it works. The ActionBar is gone only

Align ImageView to fully left

寵の児 提交于 2019-12-11 18:51:41
问题 I have been fighting with this issue but I have no idea what I am doing wrong in here. I have a custom toolbar [code] <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar 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:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="0dp" android:background="

Handling activity toolbar visibility according to visible fragment

社会主义新天地 提交于 2019-12-11 17:50:38
问题 In my android application I have one activity and many fragments. However, I only want to show the toolbar for some fragments, for the others I want the fragment to be fullscreen. What's the best and recommended way to do this (show and hide the activity toolbar according to the visible fragment)? 回答1: I preferred using interface for this. public interface ActionbarHost { void showToolbar(boolean showToolbar); } make your activity implement ActionbarHost and override showToolbar as. @Override

Can I have toolbar for each fragment separately. How to handle navigation drawer

自古美人都是妖i 提交于 2019-12-11 17:37:31
问题 In my app some pages have custom view in toolbar. Some fragment have transparent toolbar and some have coordinate layout scroll. So I have decided to have toolbar separate for each fragment I want to know is it a good practice or not. If someone has already done this please share code or example. 回答1: You can use custom toolbars in your fragments. and you have to implement them separately for each fragment. First of all declare your toolbar in your fragment layout : <RelativeLayout xmlns