how to remove shadow below actionbar with AppCompat.Light.NoActionBar?

I’m not an expert but I run into the same problem just a few hours ago. So the idea here is that with AppCompat we have to manage the library attributes rather than Android attributes. In other words, instead of android:elevation try app:elevation: <android.support.design.widget.AppBarLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:id=”@+id/appbar” android:layout_width=”match_parent” android:layout_height=”?attr/actionBarSize” android:theme=”@style/ThemeOverlay.AppCompat.Dark.ActionBar” android:fitsSystemWindows=”true” app:elevation=”0dp”> <android.support.v7.widget.Toolbar xmlns:app=”http://schemas.android.com/apk/res-auto” android:id=”@+id/toolbar” … Read more

Collapsing Toolbar layout with logo, title, subtitle in toolbar

I have preperead two amaizing avatar collapsing demo samples with approach that doesn’t use a custom CoordinatorLayoutBehavior! To view my samples native code: “Collapsing Avatar Toolbar Sample” To read my “Animation Collapsing Toolbar Android” post on Medium. demo 1 demo 2 Instead of use use a custom CoordinatorLayoutBehavior i use an OnOffsetChangedListener which comes from … Read more

AppCompat v7 Toolbar onOptionsItemSelected not called

I know this question has been answered but I found the real cause of the problem after 2 days of frustration. Take a look at the ActionBarDrawerToggle documentation: https://developer.android.com/reference/android/support/v7/app/ActionBarDrawerToggle.html Notice the two constructors there. My mistake was that I was using the second constructor that was taking a toolbar as a parameter. It took me … Read more

Don’t collapse Toolbar when RecyclerView fits the screen

Final Solution (thanks Michał Z.) Methods to turn off/on Toolbar scrolling: public void turnOffToolbarScrolling() { Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar); AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.appbar_layout); //turn off scrolling AppBarLayout.LayoutParams toolbarLayoutParams = (AppBarLayout.LayoutParams) mToolbar.getLayoutParams(); toolbarLayoutParams.setScrollFlags(0); mToolbar.setLayoutParams(toolbarLayoutParams); CoordinatorLayout.LayoutParams appBarLayoutParams = (CoordinatorLayout.LayoutParams) appBarLayout.getLayoutParams(); appBarLayoutParams.setBehavior(null); appBarLayout.setLayoutParams(appBarLayoutParams); } public void turnOnToolbarScrolling() { Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar); AppBarLayout appBarLayout = … Read more

Android : Change entire app layout directions programmatically

You can use this piece of code while your application’s minSdk >= 17. I used fa for Farsi, you can use other rtl language. Configuration configuration = getResources().getConfiguration(); configuration.setLayoutDirection(new Locale(“fa”)); getResources().updateConfiguration(configuration, getResources().getDisplayMetrics());

Appcompat v21 Toolbar elevation pre-lollipop

This worked for me very well: <android.support.v7.widget.CardView xmlns:card_view=”http://schemas.android.com/apk/res-auto” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”@color/primary” card_view:cardElevation=”4dp” card_view:cardCornerRadius=”0dp”> <android.support.v7.widget.Toolbar android:id=”@+id/toolbar” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”@color/primary” android:minHeight=”?attr/actionBarSize” /> </android.support.v7.widget.CardView>

Android RecyclerView below Toolbar

Try this: <?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” android:id=”@+id/coordinatorLayout” android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical”> <android.support.v7.widget.RecyclerView android:id=”@+id/recyclerView” android:layout_width=”match_parent” android:layout_height=”match_parent” app:layout_behavior=”@string/appbar_scrolling_view_behavior”/> <android.support.design.widget.AppBarLayout android:id=”@+id/appBarLayout” android:layout_width=”match_parent” android:layout_height=”wrap_content”> <android.support.v7.widget.Toolbar android:id=”@+id/toolbar” android:layout_width=”match_parent” android:layout_height=”?attr/actionBarSize” android:background=”?attr/colorPrimary” app:layout_scrollFlags=”scroll|enterAlways” /> </android.support.design.widget.AppBarLayout> </android.support.design.widget.CoordinatorLayout> I have removed the ViewPager and added scrolling behavior to RecyclerView

How do I make DrawerLayout to display below the Toolbar?

<LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”match_parent”> <!– The toolbar –> <android.support.v7.widget.Toolbar android:id=”@+id/my_awesome_toolbar” android:layout_height=”wrap_content” android:layout_width=”match_parent” android:minHeight=”?attr/actionBarSize” android:background=”?attr/colorPrimary” /> <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_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical”> <!– The rest of content view –> </LinearLayout> </android.support.v4.widget.DrawerLayout> </LinearLayout>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)