Procházet zdrojové kódy

Merge branch 'refactor'

Wayne před 5 roky
rodič
revize
b7cf8537ec

+ 1 - 1
reader/src/main/AndroidManifest.xml

@@ -7,7 +7,7 @@
             android:name=".ReaderActivity"
             android:theme="@style/ReaderActivityNoActionBarNoTitle" />
         <activity
-            android:name=".screen.ViewerSettingActivity"
+            android:name=".setting.ReaderSettingActivity"
             android:theme="@style/ReaderActivityNoActionBarNoTitle" />
         <activity
             android:name=".screen.signature.SignatureActivity"

+ 2 - 2
reader/src/main/java/com/kdanmobile/reader/ReaderActivity.kt

@@ -27,7 +27,6 @@ import com.kdanmobile.reader.Utils.applyConstraintSet
 import com.kdanmobile.reader.annotationattribute.AnnotationAttribute
 import com.kdanmobile.reader.annotationattribute.AnnotationColor
 import com.kdanmobile.reader.annotationattribute.InkAttribute
-import com.kdanmobile.reader.screen.ViewerSettingActivity
 import com.kdanmobile.reader.screen.contextmenu.TextBoxContextMenuActionListener
 import com.kdanmobile.reader.screen.reader.mediabox.MediaBoxView
 import com.kdanmobile.reader.screen.reader.mediabox.shape.ShapeTabView
@@ -38,6 +37,7 @@ import com.kdanmobile.reader.screen.view.BookmarkView
 import com.kdanmobile.reader.screen.view.OutlineView
 import com.kdanmobile.reader.screen.view.SearchView
 import com.kdanmobile.reader.screen.view.ThumbnailView
+import com.kdanmobile.reader.setting.ReaderSettingActivity
 import com.kdanmobile.reader.utils.AnimationUtil
 import com.kdanmobile.reader.utils.DensityUtil
 import com.kdanmobile.reader.view.AnnotationAttributeView
@@ -496,7 +496,7 @@ abstract class ReaderActivity : AppCompatActivity() {
 
     private fun setupRightSideToolbar() {
         iv_readerActivity_setting.setOnClickListener {
-            startActivity(Intent(this, ViewerSettingActivity::class.java))
+            startActivity(Intent(this, ReaderSettingActivity::class.java))
         }
     }
 

+ 8 - 8
reader/src/main/java/com/kdanmobile/reader/screen/ViewerSettingActivity.kt

@@ -1,27 +1,27 @@
-package com.kdanmobile.reader.screen
+package com.kdanmobile.reader.setting
 
 import android.arch.lifecycle.Observer
 import android.arch.lifecycle.ViewModelProviders
-import android.support.v7.app.AppCompatActivity
 import android.os.Bundle
+import android.support.v7.app.AppCompatActivity
 import android.view.MenuItem
 import android.widget.CompoundButton
 import com.kdanmobile.reader.R
 import com.kdanmobile.reader.screen.model.SharePrefsModel
 import com.kdanmobile.reader.screen.view.ReadingModeSelectView
 import com.kdanmobile.reader.screen.view.TurnPageModeSelectView
-import kotlinx.android.synthetic.main.activity_viewer_setting.*
+import kotlinx.android.synthetic.main.activity_reader_setting.*
 
-class ViewerSettingActivity : AppCompatActivity() {
+class ReaderSettingActivity : AppCompatActivity() {
 
-    private lateinit var viewModel: ViewerSettingViewModel
+    private lateinit var viewModel: ReaderSettingViewModel
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
-        setContentView(R.layout.activity_viewer_setting)
+        setContentView(R.layout.activity_reader_setting)
 
-        viewModel = ViewModelProviders.of(this, ViewerSettingViewModelFactory(SharePrefsModel(applicationContext)))
-                .get(ViewerSettingViewModel::class.java)
+        viewModel = ViewModelProviders.of(this, ReaderSettingViewModelFactory(SharePrefsModel(applicationContext)))
+                .get(ReaderSettingViewModel::class.java)
 
         viewModel.readMode.observe(this, Observer(this::onReadModeChanged))
         viewModel.isCropModeEnable.observe(this, Observer(this::onCropModeEnableChanged))

+ 2 - 2
reader/src/main/java/com/kdanmobile/reader/screen/ViewerSettingViewModel.kt

@@ -1,10 +1,10 @@
-package com.kdanmobile.reader.screen
+package com.kdanmobile.reader.setting
 
 import android.arch.lifecycle.LiveData
 import android.arch.lifecycle.ViewModel
 import com.kdanmobile.reader.screen.model.SharePrefsModel
 
-class ViewerSettingViewModel(private val sharePrefsModel: SharePrefsModel) : ViewModel() {
+class ReaderSettingViewModel(private val sharePrefsModel: SharePrefsModel) : ViewModel() {
 
     val readMode: LiveData<Int>
         get() = sharePrefsModel.readMode

+ 3 - 3
reader/src/main/java/com/kdanmobile/reader/screen/ViewerSettingViewModelFactory.kt

@@ -1,11 +1,11 @@
-package com.kdanmobile.reader.screen
+package com.kdanmobile.reader.setting
 
 import android.arch.lifecycle.ViewModel
 import android.arch.lifecycle.ViewModelProvider
 import com.kdanmobile.reader.screen.model.SharePrefsModel
 
-class ViewerSettingViewModelFactory(private val sharePrefsModel: SharePrefsModel) : ViewModelProvider.Factory {
+class ReaderSettingViewModelFactory(private val sharePrefsModel: SharePrefsModel) : ViewModelProvider.Factory {
     override fun <T : ViewModel?> create(modelClass: Class<T>): T {
-        return ViewerSettingViewModel(sharePrefsModel) as T
+        return ReaderSettingViewModel(sharePrefsModel) as T
     }
 }

+ 1 - 1
reader/src/main/res/layout/activity_viewer_setting.xml

@@ -4,7 +4,7 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    tools:context=".screen.ViewerSettingActivity">
+    tools:context=".setting.ReaderSettingActivity">
 
     <android.support.constraint.ConstraintLayout
         android:layout_width="match_parent"