diff --git a/.idea/misc.xml b/.idea/misc.xml index c452c65..7b6b661 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -24,7 +24,7 @@ - + diff --git a/jsonthemer/build.gradle b/jsonthemer/build.gradle index b3d0324..fe92ed0 100644 --- a/jsonthemer/build.gradle +++ b/jsonthemer/build.gradle @@ -28,8 +28,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:appcompat-v7:26.1.0' - implementation 'com.android.support:design:26.1.0' + implementation 'com.android.support:appcompat-v7:26.0.1' + implementation 'com.android.support:design:26.0.1' implementation 'com.google.code.gson:gson:2.8.2' testImplementation 'junit:junit:4.12' diff --git a/sample/build.gradle b/sample/build.gradle index 610ebdb..418b4e0 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -31,8 +31,8 @@ dependencies { implementation project(path: ':jsonthemer') - implementation 'com.android.support:appcompat-v7:26.1.0' - implementation 'com.android.support:design:26.1.0' + implementation 'com.android.support:appcompat-v7:26.0.1' + implementation 'com.android.support:design:26.0.1' implementation 'com.google.code.gson:gson:2.8.2' // Kotlin diff --git a/sample/src/main/assets/blue_theme.json b/sample/src/main/assets/blue_theme.json index 267c60c..5737e60 100644 --- a/sample/src/main/assets/blue_theme.json +++ b/sample/src/main/assets/blue_theme.json @@ -3,8 +3,8 @@ "toolbarThemeOverlay": 1, "popupThemeOverlay": 0, "statusBarColor": "#303F9F", - "toolbarColor": "#3F51B5", + "toolbarColor": "#C83F51B5", "accentColor": "#448AFF", - "navigationBarColor": "#303F9F", + "navigationBarColor": "#C8303F9F", "backgroundColor": "#FFFFFFFF" } \ No newline at end of file diff --git a/sample/src/main/assets/green_theme.json b/sample/src/main/assets/green_theme.json index 58e2b59..dff81c6 100644 --- a/sample/src/main/assets/green_theme.json +++ b/sample/src/main/assets/green_theme.json @@ -3,8 +3,8 @@ "toolbarThemeOverlay": 0, "popupThemeOverlay": 1, "statusBarColor": "#388E3C", - "toolbarColor": "#4CAF50", + "toolbarColor": "#C84CAF50", "accentColor": "#8BC34A", - "navigationBarColor": "#388E3C", + "navigationBarColor": "#C8388E3C", "backgroundColor": "#FF000000" } \ No newline at end of file diff --git a/sample/src/main/assets/lime_theme.json b/sample/src/main/assets/lime_theme.json index 72ea53a..f54d69b 100644 --- a/sample/src/main/assets/lime_theme.json +++ b/sample/src/main/assets/lime_theme.json @@ -3,8 +3,8 @@ "toolbarThemeOverlay": 0, "popupThemeOverlay": 1, "statusBarColor": "#00796B", - "toolbarColor": "#009688", + "toolbarColor": "#C8009688", "accentColor": "#CDDC39", - "navigationBarColor": "#00796B", + "navigationBarColor": "#C800796B", "backgroundColor": "#FF000000" } \ No newline at end of file diff --git a/sample/src/main/assets/red_theme.json b/sample/src/main/assets/red_theme.json index 55bef95..b9ae564 100644 --- a/sample/src/main/assets/red_theme.json +++ b/sample/src/main/assets/red_theme.json @@ -3,8 +3,8 @@ "toolbarThemeOverlay": 1, "popupThemeOverlay": 0, "statusBarColor": "#D32F2F", - "toolbarColor": "#F44336", + "toolbarColor": "#C8F44336", "accentColor": "#FF9800", - "navigationBarColor": "#D32F2F", + "navigationBarColor": "#C8D32F2F", "backgroundColor": "#FFFFFFFF" } \ No newline at end of file diff --git a/sample/src/main/java/com/sample/jsonthemer/MainActivity.kt b/sample/src/main/java/com/sample/jsonthemer/MainActivity.kt index a797dde..2c711ae 100644 --- a/sample/src/main/java/com/sample/jsonthemer/MainActivity.kt +++ b/sample/src/main/java/com/sample/jsonthemer/MainActivity.kt @@ -5,10 +5,12 @@ import android.os.Bundle import android.support.v7.app.AppCompatActivity import android.view.Menu import android.view.MenuItem +import android.view.View import com.sample.jsonthemer.databinding.ActivityMainBinding import jsonthemer.JsonThemer import jsonthemer.model.BaseThemeModel + class MainActivity : AppCompatActivity() { companion object { @@ -59,4 +61,18 @@ class MainActivity : AppCompatActivity() { currentTheme = style recreate() } + + override fun onWindowFocusChanged(hasFocus: Boolean) { + super.onWindowFocusChanged(hasFocus) + if (hasFocus) { + window.decorView.setSystemUiVisibility( + View.SYSTEM_UI_FLAG_LAYOUT_STABLE + or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + //or View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR + //or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar + //or View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar + or View.SYSTEM_UI_FLAG_IMMERSIVE); + } + } } \ No newline at end of file diff --git a/sample/src/main/res/layout/activity_main.xml b/sample/src/main/res/layout/activity_main.xml index 4c04e28..8c51f33 100644 --- a/sample/src/main/res/layout/activity_main.xml +++ b/sample/src/main/res/layout/activity_main.xml @@ -26,9 +26,10 @@ android:id="@+id/toolbar_layout" android:layout_width="match_parent" android:layout_height="match_parent" + android:background="@{themeModel.toolbarColor}" android:fitsSystemWindows="true" app:contentScrim="@{themeModel.statusBarColorDrawable}" - app:layout_scrollFlags="scroll|exitUntilCollapsed"> + app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"> + android:fitsSystemWindows="true" + android:fillViewport="true" + android:overScrollMode="never" + app:layout_behavior="@string/appbar_scrolling_view_behavior">