-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion "24.0.1" | ||
|
||
defaultConfig { | ||
applicationId "com.itheima.systembar.systembartint" | ||
minSdkVersion 16 | ||
targetSdkVersion 23 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
testCompile 'junit:junit:4.12' | ||
compile 'com.android.support:appcompat-v7:23.4.0' | ||
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in C:\android\android_studio\SDK/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.itheima.systembar.systembartint; | ||
|
||
import android.app.Application; | ||
import android.test.ApplicationTestCase; | ||
|
||
/** | ||
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> | ||
*/ | ||
public class ApplicationTest extends ApplicationTestCase<Application> { | ||
public ApplicationTest() { | ||
super(Application.class); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.itheima.systembar.systembartint"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme"> | ||
|
||
<activity android:name=".MainActivity" | ||
android:theme="@style/ActionBarTheme"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
|
||
<category android:name="android.intent.category.LAUNCHER"/> | ||
<!-- <category android:name="com.readystatesoftware.systembartint.SAMPLE" />--> | ||
</intent-filter> | ||
</activity> | ||
|
||
|
||
</application> | ||
|
||
</manifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.itheima.systembar.systembartint; | ||
|
||
import android.annotation.TargetApi; | ||
import android.app.Activity; | ||
import android.os.Build; | ||
import android.os.Bundle; | ||
import android.view.Window; | ||
import android.view.WindowManager; | ||
|
||
import com.readystatesoftware.systembartint.SystemBarTintManager; | ||
|
||
public class MainActivity extends Activity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
|
||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | ||
setTranslucentStatus(true); | ||
} | ||
|
||
SystemBarTintManager tintManager = new SystemBarTintManager(this); | ||
tintManager.setStatusBarTintEnabled(true); | ||
//设置状态栏颜色 | ||
tintManager.setStatusBarTintResource(R.color.statusbar_bg); | ||
|
||
} | ||
|
||
@TargetApi(19) | ||
private void setTranslucentStatus(boolean on) { | ||
Window win = getWindow(); | ||
WindowManager.LayoutParams winParams = win.getAttributes(); | ||
final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; | ||
if (on) { | ||
winParams.flags |= bits; | ||
} else { | ||
winParams.flags &= ~bits; | ||
} | ||
win.setAttributes(winParams); | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:fitsSystemWindows="true" | ||
> | ||
|
||
|
||
<TextView | ||
android:padding="16dp" | ||
android:textSize="18sp" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/ipsum"/> | ||
</ScrollView> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<resources> | ||
|
||
<!-- | ||
Base application theme for API 14+. This theme completely replaces | ||
AppBaseTheme from BOTH res/values/styles.xml and | ||
res/values-v11/styles.xml on API 14+ devices. | ||
--> | ||
<style name="AppBaseTheme" parent="android:Theme.Holo"> | ||
<!-- API 14 theme customizations can go here. --> | ||
</style> | ||
|
||
<style name="FullBleedTheme" parent="android:Theme.Holo.Light.NoActionBar"> | ||
<!-- API 14 theme customizations can go here. --> | ||
</style> | ||
|
||
<!-- <style name="ActionBarTheme" parent="android:Theme.Holo.Light.DarkActionBar"> | ||
<!– API 14 theme customizations can go here. –> | ||
<item name="android:actionBarStyle">@style/ActionBarStyle</item> | ||
</style>--> | ||
|
||
<!-- <style name="ActionBarStyle" parent="android:Widget.Holo.Light.ActionBar.Solid.Inverse"> | ||
<item name="android:background">@color/actionbar_bg</item> | ||
</style>--> | ||
|
||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<resources> | ||
|
||
<!-- | ||
Base application theme for API 19+. This theme completely replaces | ||
AppBaseTheme from BOTH res/values/styles.xml and | ||
res/values-v11/styles.xml on API 19+ devices. | ||
--> | ||
<style name="FullBleedTheme" parent="android:Theme.Holo.Light.NoActionBar.TranslucentDecor"> | ||
<!-- API 19 theme customizations can go here. --> | ||
<!-- 沉浸式状态栏 --> | ||
<!-- <item name="android:fitsSystemWindows">true</item> | ||
<item name="android:clipToPadding">false</item>--> | ||
</style> | ||
|
||
</resources> |