Coder Social home page Coder Social logo

Comments (14)

laobie avatar laobie commented on June 6, 2024

do you add “android:fitsSystemWindows="true" ” for drawerLayout?
can show me your code ?

from statusbarutil.

DJafari avatar DJafari commented on June 6, 2024

sure !

activity_main.xml :

<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:fitsSystemWindows="true"
    android:layoutDirection="rtl"
    android:background="@color/windowBackground2"
    android:id="@+id/drawer_layout"
    android:layout_height="match_parent"
    android:layout_width="match_parent">

    <include layout="@layout/content_main"/>

    <android.support.design.widget.NavigationView
        android:id="@+id/navigation"
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
        android:layout_gravity="right"
        android:fitsSystemWindows="true"/>

</android.support.v4.widget.DrawerLayout>

content_main.xml :

<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/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        app:elevation="0dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
        <android.support.v7.widget.Toolbar
            android:background="@android:color/transparent"
            style="@style/AppTheme.Toolbar"
            app:layout_scrollFlags="scroll|enterAlways|snap" />
        <android.support.design.widget.TabLayout
            android:id="@+id/tabs"
            android:layoutDirection="ltr"
            app:tabGravity="center"
            app:tabMode="scrollable"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </android.support.design.widget.AppBarLayout>

    <android.support.v4.view.ViewPager
        android:id="@+id/viewpager"
        android:layoutDirection="ltr"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

</android.support.design.widget.CoordinatorLayout>

from statusbarutil.

laobie avatar laobie commented on June 6, 2024

ok i try your code

from statusbarutil.

DJafari avatar DJafari commented on June 6, 2024

@laobie your sample is ok, because you are noting used from CoordinatorLayout .

from statusbarutil.

laobie avatar laobie commented on June 6, 2024

i notice that, i will check my code, if fix, i will tell u

from statusbarutil.

DJafari avatar DJafari commented on June 6, 2024

@laobie ok thanks

from statusbarutil.

laobie avatar laobie commented on June 6, 2024

I found another bug, but i don't meet the bug u met.
image

may u should give whole project u testing.

from statusbarutil.

DJafari avatar DJafari commented on June 6, 2024

what is your bug ?

clone this project : ( https://github.com/chrisbanes/cheesesquare ) and add your library into this project .

p.s :
update support library of this project to 23.2.1 and minSDK to 14
build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.support.android.designlibdemo"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    jcenter()
}

dependencies {
    compile 'com.android.support:design:23.2.1'
    compile 'com.android.support:cardview-v7:23.2.1'

    compile 'com.github.bumptech.glide:glide:3.6.0'
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile 'com.jaeger.statusbaruitl:library:1.0.0'

}

after activity launched, scroll list to down and see statusbar

from statusbarutil.

laobie avatar laobie commented on June 6, 2024

i can't change color if set for DrawerLayout, i try your project

from statusbarutil.

DJafari avatar DJafari commented on June 6, 2024

yes, exactly problem is this .

my bug and your bug is same, if statusbar view add in top of views. this problem solved

from statusbarutil.

laobie avatar laobie commented on June 6, 2024

I understand your problem = = my company project HomeActivity layout just like this, i add a LinearLayout wrap CoordinatorLayout, just like this

  <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <android.support.design.widget.CoordinatorLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@android:color/white">

                <android.support.design.widget.AppBarLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <include
                        android:id="@+id/toolbar_home"
                        layout="@layout/toolbar_base"
                        android:layout_width="match_parent"
                        android:layout_height="48dp"
                        app:layout_scrollFlags="scroll|enterAlways|snap"/>

                    <com.mingdao.app.views.SlidingTabLayout
                        android:id="@+id/sliding_tabs"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"/>

                </android.support.design.widget.AppBarLayout>

                <com.mingdao.app.views.HomeViewPage
                    android:id="@+id/viewpager"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:background="@android:color/white"
                    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>         

            </android.support.design.widget.CoordinatorLayout>

        </LinearLayout>

it will work right.

i will find another better way to solve this bug, but now, u may use like i do above.

from statusbarutil.

laobie avatar laobie commented on June 6, 2024

when i remove the LinearLayout, it just like you met.
image

from statusbarutil.

DJafari avatar DJafari commented on June 6, 2024

ok thanks

from statusbarutil.

laobie avatar laobie commented on June 6, 2024

You are welcome. if i fix the bug, i will tell u.

from statusbarutil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.