There is such code:
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { Window w = getWindow(); w.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); w.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); } super.onCreate(savedInstanceState); setContentView(R.layout.sort_by_activity); The toolbar is too close to the status bar (when you hide an item, they generally overlap each other).
Changing the Gradle version and updating the libraries to the latest results did not bring. With the markup also tried to change the values, no changes.
Did anyone meet with a similar one and I will be glad to hear, at least, the direction in which to dig, for I can’t imagine what it can be connected with.
Nevertheless, I will indicate the Gradle - 2.14.1 version Gradle - 2.14.1 and the Plugin version - 2.1.3
Versions of libraries:
android { compileSdkVersion 24 buildToolsVersion "24.0.1" defaultConfig { applicationId "com.asgard.power" minSdkVersion 15 targetSdkVersion 24 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } android { defaultConfig { vectorDrawables.useSupportLibrary = true } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:24.2.1' compile 'com.android.support:design:24.2.1' compile 'com.android.support:recyclerview-v7:24.2.1' compile 'com.android.support:cardview-v7:24.2.1' compile 'com.roughike:bottom-bar:1.3.4' UPD:
wrapped in AppBarLayout:
<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/sortByCoordinator" android:parentActivityName=".ActivityMain" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/coordinatorBackground" android:clickable="true"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:fitsSystemWindows="true"> <android.support.v7.widget.Toolbar android:id="@+id/sort_toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@drawable/orange_gradient" android:clickable="true" android:fitsSystemWindows="true" app:layout_scrollFlags="scroll|enterAlwaysCollapsed" app:popupTheme="@style/Theme.AppCompat.Light.NoActionBar" app:theme="@style/Theme.AppCompat.NoActionBar" /> </android.support.design.widget.AppBarLayout> </android.support.design.widget.CoordinatorLayout> UPD: So it looks like with CollapsingToolbar on the advice @YuriSPB:
<android.support.design.widget.CollapsingToolbarLayout android:id="@+id/collapsing_toolbar_layout" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_scrollFlags="scroll|exitUntilCollapsed" app:contentScrim="?attr/colorPrimary" app:expandedTitleMarginStart="48dp" app:expandedTitleMarginEnd="64dp" android:fitsSystemWindows="true"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:layout_marginTop="6dp" android:paddingTop="6dp" android:background="@drawable/blue_gradient" android:clickable="true" android:fitsSystemWindows="true" app:layout_collapseMode="pin" app:layout_scrollFlags="scroll|enterAlwaysCollapsed" app:popupTheme="@style/Theme.AppCompat.Light.NoActionBar" app:theme="@style/Theme.AppCompat.NoActionBar" /> </android.support.design.widget.CollapsingToolbarLayout> Throws errorInflate .
UPD:
Styles:
<resources> <style name="AppDefault" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@android:color/transparent</item> <item name="colorPrimaryDark">@android:color/transparent</item> <item name="colorAccent">@color/colorAccent</item> <item name="android:statusBarColor">@android:color/transparent</item> <item name="android:windowTranslucentStatus">false</item> <item name="android:windowDrawsSystemBarBackgrounds">false</item> </style> <style name="MyCustomTabLayout" parent="Widget.Design.TabLayout"> <item name="tabTextAppearance">@style/MyCustomTabTextAppearance</item> <item name="tabIndicatorHeight">6dp</item> </style> <style name="MyCustomTabTextAppearance" parent="TextAppearance.Design.Tab"> <item name="android:textSize">14sp</item> <item name="textAllCaps">true</item> </style> </resources>
android:fitsSystemWindows="true"- Yuriy SPb ♦