Last active
June 8, 2016 08:46
-
-
Save kamikat/1a92a4b2adea201d810905aec697ffbe to your computer and use it in GitHub Desktop.
Draw a circle under the Android status bar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item> | |
<shape> | |
<solid android:color="?attr/colorPrimary"/> | |
</shape> | |
</item> | |
<item android:gravity="right|center_vertical" android:width="200dp" android:height="200dp" android:right="30dp" android:top="-100dp" android:bottom="-100dp"> | |
<shape android:shape="oval"> | |
<solid android:color="?attr/colorAccent"/> | |
</shape> | |
</item> | |
</layer-list> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<android.support.design.widget.CoordinatorLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:fitsSystemWindows="true"> | |
<android.support.design.widget.AppBarLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:fitsSystemWindows="true" | |
android:background="@drawable/bg_toolbar" | |
android:theme="@style/AppTheme.AppBarOverlay"> | |
<!-- AppBarLayout will dispatch applyWindowInsets event to child view, use a FrameLayout to consumes that --> | |
<!-- https://github.com/hehonghui/android-tech-frontier/blob/master/issue-35/%E4%B8%BA%E4%BB%80%E4%B9%88%E6%88%91%E4%BB%AC%E8%A6%81%E7%94%A8fitsSystemWindows.md --> | |
<FrameLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:fitsSystemWindows="true"> | |
<android.support.v7.widget.Toolbar | |
android:id="@+id/toolbar" | |
android:layout_width="match_parent" | |
android:layout_height="?attr/actionBarSize" | |
app:popupTheme="@style/AppTheme.PopupOverlay"/> | |
</FrameLayout> | |
</android.support.design.widget.AppBarLayout> | |
</android.support.design.widget.CoordinatorLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources> | |
<string name="app_name">PlayFitSystemWindow</string> | |
</resources> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources> | |
<!-- Base application theme. --> | |
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> | |
<!-- Customize your theme here. --> | |
<item name="colorPrimary">#3949AB</item> | |
<item name="colorPrimaryDark">#43A047</item> | |
<item name="colorAccent">#FF5722</item> | |
</style> | |
<style name="AppTheme.NoActionBar"> | |
<item name="windowActionBar">false</item> | |
<item name="windowNoTitle">true</item> | |
</style> | |
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/> | |
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/> | |
</resources> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources> | |
<style name="AppTheme.NoActionBar"> | |
<item name="windowActionBar">false</item> | |
<item name="windowNoTitle">true</item> | |
<item name="android:windowDrawsSystemBarBackgrounds">true</item> | |
<item name="android:statusBarColor">@android:color/transparent</item> | |
</style> | |
</resources> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Preview
On Android N with split window feature & Android M