Browse Source

Merge branch 'modify-setting-toolbar'

Wayne 5 years ago
parent
commit
f9f6fb1c1e

+ 1 - 2
reader/src/main/java/com/kdanmobile/reader/setting/ReaderSettingActivity.kt

@@ -48,8 +48,7 @@ class ReaderSettingActivity : AppCompatActivity() {
 
 
     private fun setupToolbar() {
     private fun setupToolbar() {
         setSupportActionBar(toolbar_viewerSetting)
         setSupportActionBar(toolbar_viewerSetting)
-        supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_arrow_back_black_24dp)
-        supportActionBar?.setDisplayHomeAsUpEnabled(true)
+        supportActionBar?.setDisplayShowTitleEnabled(false)
     }
     }
 
 
     override fun onOptionsItemSelected(item: MenuItem?): Boolean {
     override fun onOptionsItemSelected(item: MenuItem?): Boolean {

+ 77 - 64
reader/src/main/res/layout/activity_reader_setting.xml

@@ -1,79 +1,92 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+
+<android.support.constraint.ConstraintLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_height="match_parent"
     tools:context=".setting.ReaderSettingActivity">
     tools:context=".setting.ReaderSettingActivity">
 
 
-    <android.support.constraint.ConstraintLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+    <android.support.v7.widget.Toolbar
+        android:id="@+id/toolbar_viewerSetting"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:elevation="4dp"
+        android:background="@android:color/white"
+        android:minHeight="?attr/actionBarSize"
+        app:navigationIcon="@drawable/ic_close_dark"
+        android:theme="@style/ReaderToolBarStyle"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <ScrollView
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/toolbar_viewerSetting"
+        app:layout_constraintBottom_toBottomOf="parent"
+        android:layout_width="0dp"
+        android:layout_height="0dp">
 
 
-        <android.support.v7.widget.Toolbar
-            android:id="@+id/toolbar_viewerSetting"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:elevation="4dp"
-            android:minHeight="?attr/actionBarSize"
-            android:theme="@style/ReaderToolBarStyle"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toTopOf="parent" />
+        <android.support.constraint.ConstraintLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
 
 
-        <com.kdanmobile.reader.screen.view.ReadingModeSelectView
-            android:id="@+id/readingModeSelectView"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/toolbar_viewerSetting" />
+            <com.kdanmobile.reader.screen.view.ReadingModeSelectView
+                android:id="@+id/readingModeSelectView"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintRight_toRightOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
 
 
-        <com.kdanmobile.reader.screen.view.RowSwitchView
-            android:id="@+id/rowSwitchView_smartCrop"
-            android:layout_width="0dp"
-            android:layout_height="48dp"
-            android:layout_marginTop="24dp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/readingModeSelectView"
-            app:text="@string/viewer_setting_switch_smart_crop" />
+            <com.kdanmobile.reader.screen.view.RowSwitchView
+                android:id="@+id/rowSwitchView_smartCrop"
+                android:layout_width="0dp"
+                android:layout_height="48dp"
+                android:layout_marginTop="24dp"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintRight_toRightOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/readingModeSelectView"
+                app:text="@string/viewer_setting_switch_smart_crop" />
 
 
-        <com.kdanmobile.reader.screen.view.RowSwitchView
-            android:id="@+id/rowSwitchView_showStateBar"
-            android:layout_width="0dp"
-            android:layout_height="48dp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/rowSwitchView_smartCrop"
-            app:text="@string/viewer_setting_switch_show_state_bar" />
+            <com.kdanmobile.reader.screen.view.RowSwitchView
+                android:id="@+id/rowSwitchView_showStateBar"
+                android:layout_width="0dp"
+                android:layout_height="48dp"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintRight_toRightOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/rowSwitchView_smartCrop"
+                app:text="@string/viewer_setting_switch_show_state_bar" />
 
 
-        <com.kdanmobile.reader.screen.view.TurnPageModeSelectView
-            android:id="@+id/turnPageModeSelectView"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="24dp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/rowSwitchView_showStateBar" />
+            <com.kdanmobile.reader.screen.view.TurnPageModeSelectView
+                android:id="@+id/turnPageModeSelectView"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="24dp"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintRight_toRightOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/rowSwitchView_showStateBar" />
 
 
-        <com.kdanmobile.reader.screen.view.ScreenSettingView
-            android:id="@+id/screenSettingView"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="24dp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/turnPageModeSelectView" />
+            <com.kdanmobile.reader.screen.view.ScreenSettingView
+                android:id="@+id/screenSettingView"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="24dp"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintRight_toRightOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/turnPageModeSelectView" />
 
 
-        <com.kdanmobile.reader.screen.view.ToolbarSettingView
-            android:id="@+id/toolbarSettingView"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="24dp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/screenSettingView" />
+            <com.kdanmobile.reader.screen.view.ToolbarSettingView
+                android:id="@+id/toolbarSettingView"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="24dp"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintRight_toRightOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/screenSettingView" />
 
 
-    </android.support.constraint.ConstraintLayout>
-</ScrollView>
+        </android.support.constraint.ConstraintLayout>
+    </ScrollView>
+</android.support.constraint.ConstraintLayout>