android-toolbar

Using both AppCompat and Youtube API in one activity with firebase and RecyclerView in Android

痴心易碎 提交于 2019-12-11 17:10:11
问题 I am working on an application in which both AppCompatActivity and Youtube API should be used, but for some reasons I am unable to use both together in same activity when I use AppCompatActicity for my toolbar the Youtube API stops working and if I extends YoutubeBaseActivity the Toolbar does not work , I am also using RecyclerView and Firebase as a database in this applcation, can anybody help me with it and tell me how I can implement AppCompatActivity and youtubeAPI together so they both

Auto-hiding toolbar on scroll, when there are several other layers of views in-between

坚强是说给别人听的谎言 提交于 2019-12-11 14:33:53
问题 I would like my activity's Toolbar to smoothly scroll out as a given scrollview grows, and then smoothly scroll back in if the user scrolls down. I.e. the basic scroll|enterAlways behaviour from e.g. this answer. However, my layout has some layers between the CoordinatorLayout containing the Toolbar , and the ScrollView that should be driving everything. Unlike in this answer, I'd like to have the following layout: CoordinatorLayout AppBarLayout Toolbar LinearLayout [vertical] LinearLayout

Toolbar's popup menu - custom background (color and borders)

纵然是瞬间 提交于 2019-12-11 14:15:21
问题 How can I make such popup item menu for my toolbar (support v7)? screenshot of transparent toolbar's popup menu (MX Player) I found out how to make transparent background: from layout <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:theme="@style/MyToolbarTheme"/> from style <style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar"> <item name="android:colorBackground">@color/my

Getting 'The method setSupportActionBar(Toolbar) in the type AppCompatActivity is not applicable for the arguments (Toolbar)' in my AppCompatActivity

我只是一个虾纸丫 提交于 2019-12-11 12:16:40
问题 I'm upgrading the UI of a game that I built some time ago and am heading toward Google's Material Design. As part of the code upgrade, I installed the backwards compatibility support library, android-support-v7-appcompat, into my Eclipse project and extended the main activity to AppCompatActivity, like so: public class FivetoGo extends AppCompatActivity { @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); Toolbar mToolbar = (Toolbar)

Custom layout in toolbar not showing

依然范特西╮ 提交于 2019-12-11 11:16:35
问题 I have added supportActionbar to my app with toolBar using v7 support library. Now I need to show a custom layout on the actionbar which is simply a cart icon with a number badge. But when ever I try to put that, I get only a text button and no image is shown. My layout is: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="48dp" android:layout_height="fill_parent" android:layout_gravity="right" > <ImageView android:layout_width="wrap_content"

Add a TextView to the elements of a Toolbar

前提是你 提交于 2019-12-11 10:39:28
问题 I have made a material design toolbar. The menu item includes a cart. I want a number to be shown along with the cart icon indicating the number of items present in the cart. toolbar.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/colorPrimary" android:minHeight="?attr/actionBarSize" android:theme="@style

Home button not shown when using the design support library

会有一股神秘感。 提交于 2019-12-11 09:38:27
问题 In my app, I'm displaying a Toolbar with the home button visible. In some screens this works as an up button, in others not. That works fine. Problem is that when importing the design support library, the home button is not shown in the toolbar. This happens just by importing it, not a single line of code changed. I'm importing it in Gradle with: compile 'com.android.support:design:22.2.0' Do I need to change something in code for the design library not to make the home button disappear? Is

Using different layouts under a Toolbar

北慕城南 提交于 2019-12-11 09:25:39
问题 In my app, I am using a android.support.v7.widget.Toolbar and I have various fragments with different items it the toolbar. What is the correct way to implement that? Should I use a different android.support.v7.widget.Toolbar for each fragment with it's child views, or should I use one main toolbar and hide/make visible elements? The latter seems messy and ungly. 回答1: ToolBar is basically just a simple ViewGroup so you can treat it this way. You can create a fragment holder in the ToolBar and

toolbar back button error Android

僤鯓⒐⒋嵵緔 提交于 2019-12-11 08:05:24
问题 I want to add a Back button in a toolbar that I created because I deleted the default one to have the material design effect with some tabs, but every time I add the code to make that button appear, Android gives an exception saying this: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.juan.sdfnsdfnskdfnskdfmsfd, PID: 13348 java.lang.NullPointerException: Attempt to invoke virtual method 'int android.support.v4.widget.DrawerLayout.getDrawerLockMode(int)' on a null object

Setting HomeAsUpEnabled(true) but hide back button actionbar

自闭症网瘾萝莉.ら 提交于 2019-12-11 06:53:28
问题 I can't seem to find a solution for this anywhere. I just want to make the logo clickable in my activity, but it seems the only way to do this is setHomeAsUpEnabled(true), but this makes the back icon visible and clickable. I want to make the logo clickable, why isn't this possible? Do I have to create a custom view for this? 来源: https://stackoverflow.com/questions/28132061/setting-homeasupenabledtrue-but-hide-back-button-actionbar