Parcourir la source

Merge branch 'feature_setting'

# Conflicts:
#	reader/src/main/java/com/kdanmobile/reader/ReaderActivity.kt
#	reader/src/main/res/values-de/strings.xml
#	reader/src/main/res/values-es/strings.xml
#	reader/src/main/res/values-fr/strings.xml
#	reader/src/main/res/values-it/strings.xml
#	reader/src/main/res/values-ja/strings.xml
#	reader/src/main/res/values-ko/strings.xml
#	reader/src/main/res/values-pt/strings.xml
#	reader/src/main/res/values-ru/strings.xml
#	reader/src/main/res/values-zh-rTW/strings.xml
#	reader/src/main/res/values-zh/strings.xml
#	reader/src/main/res/values/strings.xml
liweihao il y a 5 ans
Parent
commit
f1bea27d6e
46 fichiers modifiés avec 1201 ajouts et 2 suppressions
  1. 4 2
      reader/src/main/AndroidManifest.xml
  2. 9 0
      reader/src/main/java/com/kdanmobile/reader/ReaderActivity.kt
  3. 144 0
      reader/src/main/java/com/kdanmobile/reader/screen/ViewerSettingActivity.kt
  4. 65 0
      reader/src/main/java/com/kdanmobile/reader/screen/ViewerSettingViewModel.kt
  5. 11 0
      reader/src/main/java/com/kdanmobile/reader/screen/ViewerSettingViewModelFactory.kt
  6. 83 0
      reader/src/main/java/com/kdanmobile/reader/screen/data/ViewerSettingSharePrefs.kt
  7. 103 0
      reader/src/main/java/com/kdanmobile/reader/screen/model/SharePrefsModel.kt
  8. 97 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/ReadingModeSelectView.kt
  9. 51 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/RowSwitchView.kt
  10. 39 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/ScreenSettingView.kt
  11. 51 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/ToolbarSettingView.kt
  12. 66 0
      reader/src/main/java/com/kdanmobile/reader/screen/view/TurnPageModeSelectView.kt
  13. BIN
      reader/src/main/res/drawable-hdpi/ic_stat_lock.png
  14. BIN
      reader/src/main/res/drawable-xhdpi/ic_stat_lock.png
  15. BIN
      reader/src/main/res/drawable-xxhdpi/ic_stat_lock.png
  16. BIN
      reader/src/main/res/drawable/ic_stat_lock.png
  17. 8 0
      reader/src/main/res/drawable/selector_day_mode.xml
  18. 8 0
      reader/src/main/res/drawable/selector_lilac_mode.xml
  19. 8 0
      reader/src/main/res/drawable/selector_night_mode.xml
  20. 8 0
      reader/src/main/res/drawable/selector_sefia_mode.xml
  21. 9 0
      reader/src/main/res/drawable/shape_day_mode.xml
  22. 9 0
      reader/src/main/res/drawable/shape_day_mode_checked.xml
  23. 9 0
      reader/src/main/res/drawable/shape_night_mode.xml
  24. 9 0
      reader/src/main/res/drawable/shape_night_mode_checked.xml
  25. 9 0
      reader/src/main/res/drawable/shape_sepia_mode.xml
  26. 9 0
      reader/src/main/res/drawable/shape_sepia_mode_checked.xml
  27. 9 0
      reader/src/main/res/drawable/shape_white_lilac_mode.xml
  28. 9 0
      reader/src/main/res/drawable/shape_white_lilac_mode_checked.xml
  29. 79 0
      reader/src/main/res/layout/activity_viewer_setting.xml
  30. 88 0
      reader/src/main/res/layout/view_reading_mode_select.xml
  31. 29 0
      reader/src/main/res/layout/view_row_switch.xml
  32. 27 0
      reader/src/main/res/layout/view_screen_setting.xml
  33. 36 0
      reader/src/main/res/layout/view_toolbar_setting.xml
  34. 52 0
      reader/src/main/res/layout/view_turn_page_mode_select.xml
  35. 4 0
      reader/src/main/res/values-de/strings.xml
  36. 4 0
      reader/src/main/res/values-es/strings.xml
  37. 4 0
      reader/src/main/res/values-fr/strings.xml
  38. 4 0
      reader/src/main/res/values-it/strings.xml
  39. 4 0
      reader/src/main/res/values-ja/strings.xml
  40. 4 0
      reader/src/main/res/values-ko/strings.xml
  41. 4 0
      reader/src/main/res/values-pt/strings.xml
  42. 4 0
      reader/src/main/res/values-ru/strings.xml
  43. 4 0
      reader/src/main/res/values-zh-rTW/strings.xml
  44. 4 0
      reader/src/main/res/values-zh/strings.xml
  45. 9 0
      reader/src/main/res/values/attrs.xml
  46. 14 0
      reader/src/main/res/values/strings.xml

+ 4 - 2
reader/src/main/AndroidManifest.xml

@@ -5,8 +5,10 @@
     <application>
         <activity
             android:name=".ReaderActivity"
-            android:theme="@style/ReaderActivityNoActionBarNoTitle"
-            />
+            android:theme="@style/ReaderActivityNoActionBarNoTitle" />
+        <activity
+            android:name=".screen.ViewerSettingActivity"
+            android:theme="@style/ReaderActivityNoActionBarNoTitle" />
     </application>
 
 </manifest>

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

@@ -3,6 +3,7 @@ package com.kdanmobile.reader
 import android.annotation.SuppressLint
 import android.arch.lifecycle.Observer
 import android.arch.lifecycle.ViewModelProviders
+import android.content.Intent
 import android.net.Uri
 import android.os.Build
 import android.support.v7.app.AppCompatActivity
@@ -27,6 +28,7 @@ import com.kdanmobile.reader.screen.view.SearchView
 import com.kdanmobile.reader.screen.view.ThumbnailView
 import com.kdanmobile.reader.utils.AnimationUtil
 import com.kdanmobile.reader.utils.DensityUtil
+import com.kdanmobile.reader.screen.ViewerSettingActivity
 import kotlinx.android.synthetic.main.activity_reader.*
 import kotlin.Exception
 
@@ -78,6 +80,7 @@ abstract class ReaderActivity : AppCompatActivity() {
         cloneOriginConstraintSet()
         setupToolbar()
         setupLeftToolbar()
+        setupRightSideToolbar()
         setupBottomToolbar()
 
         val factory = ReaderViewModelFactory()
@@ -340,6 +343,12 @@ abstract class ReaderActivity : AppCompatActivity() {
         cloneOriginConstraintSet()
     }
 
+    private fun setupRightSideToolbar() {
+        iv_readerActivity_setting.setOnClickListener {
+            startActivity(Intent(this, ViewerSettingActivity::class.java))
+        }
+    }
+
     private fun setupBottomToolbar() {
         val context = this
         /** Set buttons color **/

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

@@ -0,0 +1,144 @@
+package com.kdanmobile.reader.screen
+
+import android.arch.lifecycle.Observer
+import android.arch.lifecycle.ViewModelProviders
+import android.support.v7.app.AppCompatActivity
+import android.os.Bundle
+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.*
+
+class ViewerSettingActivity : AppCompatActivity() {
+
+    private lateinit var viewModel: ViewerSettingViewModel
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        setContentView(R.layout.activity_viewer_setting)
+
+        viewModel = ViewModelProviders.of(this, ViewerSettingViewModelFactory(SharePrefsModel(applicationContext)))
+                .get(ViewerSettingViewModel::class.java)
+
+        viewModel.readMode.observe(this, Observer(this::onReadModeChanged))
+        viewModel.isCropModeEnable.observe(this, Observer(this::onCropModeEnableChanged))
+        viewModel.isShowStateBarEnable.observe(this, Observer(this::onShowStateBarEnableChanged))
+        viewModel.turnPageDirection.observe(this, Observer(this::onTurnPageDirectionChanged))
+        viewModel.isShowTurnPageBtnEnable.observe(this, Observer(this::onShowTurnPageBtnEnableChange))
+        viewModel.isLockScreenSleepEnable.observe(this, Observer(this::onLockScreenSleepEnableChange))
+        viewModel.isShowCommentToolEnable.observe(this, Observer(this::onShowCommentToolEnableChange))
+        viewModel.isShowBOTAToolEnable.observe(this, Observer(this::onShowBOTAToolEnableChange))
+
+        setupToolbar()
+        setupReadingModeView()
+        setupTurnPageView()
+        setupScreenSettingView()
+        setupToolbarSettingView()
+
+        rowSwitchView_smartCrop.onCheckedChangeListener = CompoundButton.OnCheckedChangeListener { _, isChecked ->
+            viewModel.setCropModeEnable(isChecked)
+        }
+        rowSwitchView_showStateBar.onCheckedChangeListener = CompoundButton.OnCheckedChangeListener { _, isChecked ->
+            viewModel.setShowStateBarEnable(isChecked)
+        }
+    }
+
+    private fun setupToolbar() {
+        setSupportActionBar(toolbar_viewerSetting)
+        supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_arrow_back_black_24dp)
+        supportActionBar?.setDisplayHomeAsUpEnabled(true)
+    }
+
+    override fun onOptionsItemSelected(item: MenuItem?): Boolean {
+        when (item?.itemId) {
+            android.R.id.home -> finish()
+        }
+        return super.onOptionsItemSelected(item)
+    }
+
+    private fun setupReadingModeView() {
+        readingModeSelectView.isLock = true
+        readingModeSelectView.onReadModeSelectListener = object : ReadingModeSelectView.OnReadModeSelectListener {
+            override fun onReadModeSelect(readMode: Int) {
+                viewModel.setReadMode(readMode)
+            }
+        }
+    }
+
+    private fun setupTurnPageView() {
+        turnPageModeSelectView.onTurnPageModeChangedListener = object : TurnPageModeSelectView.OnTurnPageModeChangedListener {
+            override fun onTurnPageModeChanged(direction: Int) {
+                viewModel.setTurnPageDirection(direction)
+            }
+        }
+        turnPageModeSelectView.onShowTurnPageBtnEnableChangedListener = CompoundButton.OnCheckedChangeListener { _, isChecked ->
+            viewModel.setTurnPageButtonEnable(isChecked)
+        }
+    }
+
+    private fun setupScreenSettingView() {
+        screenSettingView.onCheckedChangeListener = CompoundButton.OnCheckedChangeListener { _, isChecked ->
+            viewModel.setLockScreenSleepEnable(isChecked)
+        }
+    }
+
+    private fun setupToolbarSettingView() {
+        toolbarSettingView.onCheckedChangeListenerComment = CompoundButton.OnCheckedChangeListener { _, isChecked ->
+            viewModel.setShowCommentToolEnable(isChecked)
+        }
+        toolbarSettingView.onCheckedChangeListenerBOTA = CompoundButton.OnCheckedChangeListener { _, isChecked ->
+            viewModel.setShowBOTAToolEnable(isChecked)
+        }
+    }
+
+    private fun onReadModeChanged(readMode: Int?) {
+        readMode?.let {
+            readingModeSelectView.currentReadMode = it
+        }
+    }
+
+    private fun onCropModeEnableChanged(enable: Boolean?) {
+        enable?.let {
+            rowSwitchView_smartCrop.isChecked = it
+        }
+    }
+
+    private fun onShowStateBarEnableChanged(enable: Boolean?) {
+        enable?.let {
+            rowSwitchView_showStateBar.isChecked = it
+        }
+    }
+
+    private fun onTurnPageDirectionChanged(direction: Int?) {
+        direction?.let {
+            turnPageModeSelectView.direction = it
+        }
+    }
+
+    private fun onShowTurnPageBtnEnableChange(enable: Boolean?) {
+        enable?.let {
+            turnPageModeSelectView.isTurnPageBtnEnable = it
+        }
+    }
+
+    private fun onLockScreenSleepEnableChange(enable: Boolean?) {
+        enable?.let {
+            screenSettingView.isLockScreenSleepEnable = it
+        }
+    }
+
+    private fun onShowCommentToolEnableChange(enable: Boolean?) {
+        enable?.let {
+            toolbarSettingView.isShowCommentToolEnable = it
+        }
+    }
+
+    private fun onShowBOTAToolEnableChange(enable: Boolean?) {
+        enable?.let {
+            toolbarSettingView.isShowBOTAToolEnable = it
+        }
+    }
+}

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

@@ -0,0 +1,65 @@
+package com.kdanmobile.reader.screen
+
+import android.arch.lifecycle.LiveData
+import android.arch.lifecycle.ViewModel
+import com.kdanmobile.reader.screen.model.SharePrefsModel
+
+class ViewerSettingViewModel(private val sharePrefsModel: SharePrefsModel) : ViewModel() {
+
+    val readMode: LiveData<Int>
+        get() = sharePrefsModel.readMode
+
+    val isCropModeEnable: LiveData<Boolean>
+        get() = sharePrefsModel.isCropModeEnable
+
+    val isShowStateBarEnable: LiveData<Boolean>
+        get() = sharePrefsModel.isShowStateBarEnable
+
+    val turnPageDirection: LiveData<Int>
+        get() = sharePrefsModel.turnPageDirection
+
+    val isShowTurnPageBtnEnable: LiveData<Boolean>
+        get() = sharePrefsModel.isShowTurnPageBtnEnable
+
+    val isLockScreenSleepEnable: LiveData<Boolean>
+        get() = sharePrefsModel.isLockScreenSleepEnable
+
+    val isShowCommentToolEnable: LiveData<Boolean>
+        get() = sharePrefsModel.isShowCommentToolEnable
+
+    val isShowBOTAToolEnable: LiveData<Boolean>
+        get() = sharePrefsModel.isShowBOTAToolEnable
+
+    fun setReadMode(readMode: Int) {
+        sharePrefsModel.setReadMode(readMode)
+    }
+
+    fun setCropModeEnable(enable: Boolean) {
+        sharePrefsModel.setCropModeEnable(enable)
+    }
+
+    fun setShowStateBarEnable(enable: Boolean) {
+        sharePrefsModel.setShowStateBarEnable(enable)
+    }
+
+    fun setTurnPageDirection(direction: Int) {
+        sharePrefsModel.setTurnPageDirection(direction)
+    }
+
+    fun setTurnPageButtonEnable(enable: Boolean) {
+        sharePrefsModel.setTurnPageButtonEnable(enable)
+    }
+
+    fun setLockScreenSleepEnable(enable: Boolean) {
+        sharePrefsModel.setLockScreenSleepEnable(enable)
+    }
+
+    fun setShowCommentToolEnable(enable: Boolean) {
+        sharePrefsModel.setShowCommentToolEnable(enable)
+    }
+
+    fun setShowBOTAToolEnable(enable: Boolean) {
+        sharePrefsModel.setShowBOTAToolEnable(enable)
+    }
+}
+

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

@@ -0,0 +1,11 @@
+package com.kdanmobile.reader.screen
+
+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 {
+    override fun <T : ViewModel?> create(modelClass: Class<T>): T {
+        return ViewerSettingViewModel(sharePrefsModel) as T
+    }
+}

+ 83 - 0
reader/src/main/java/com/kdanmobile/reader/screen/data/ViewerSettingSharePrefs.kt

@@ -0,0 +1,83 @@
+package com.kdanmobile.reader.screen.data
+
+import android.content.Context
+import android.content.SharedPreferences
+
+class ViewerSettingSharePrefs(val context: Context, sharedPrefsFileName: String) {
+    companion object {
+        const val readMode = "READ_MODE"
+        const val cropMode = "CROP_MODE"
+        const val stateBar = "STATE_BAR"
+        const val turnPageDirection = "TURN_PAGE_DIRECTION"
+        const val turnPageBtn = "TURN_PAGE_BUTTON"
+        const val screenSleep = "SCREEN_SLEEP"
+        const val commentTool = "COMMENT_TOOL"
+        const val botaTool = "BOTA_TOOL"
+    }
+
+    private var sharedPreferences: SharedPreferences = context.getSharedPreferences(sharedPrefsFileName, Context.MODE_PRIVATE)
+
+    fun getReadMode(): Int {
+        return sharedPreferences.getInt(readMode, 0)
+    }
+
+    fun setReadMode(showMode: Int) {
+        sharedPreferences.edit().putInt(readMode, showMode).apply()
+    }
+
+    fun isCropModeEnable(): Boolean {
+        return sharedPreferences.getBoolean(cropMode, false)
+    }
+
+    fun setCropModeEnable(enable: Boolean) {
+        sharedPreferences.edit().putBoolean(cropMode, enable).apply()
+    }
+
+    fun isShowStateBarEnable(): Boolean {
+        return sharedPreferences.getBoolean(stateBar, false)
+    }
+
+    fun setShowStateBarEnable(enable: Boolean) {
+        sharedPreferences.edit().putBoolean(stateBar, enable).apply()
+    }
+
+    fun getTurnPageDirection(): Int {
+        return sharedPreferences.getInt(turnPageDirection, 0)
+    }
+
+    fun setTurnPageDirection(direction: Int) {
+        sharedPreferences.edit().putInt(turnPageDirection, direction).apply()
+    }
+
+    fun isShowTurnPageButtonEnable(): Boolean {
+        return sharedPreferences.getBoolean(turnPageBtn, false)
+    }
+
+    fun setShowTurnPageButtonEnable(enable: Boolean) {
+        sharedPreferences.edit().putBoolean(turnPageBtn, enable).apply()
+    }
+
+    fun isLockScreenSleepEnable(): Boolean {
+        return sharedPreferences.getBoolean(screenSleep, false)
+    }
+
+    fun setLockScreenSleepEnable(enable: Boolean) {
+        sharedPreferences.edit().putBoolean(screenSleep, enable).apply()
+    }
+
+    fun isShowCommentToolEnable(): Boolean {
+        return sharedPreferences.getBoolean(commentTool, false)
+    }
+
+    fun setShowCommentToolEnable(enable: Boolean) {
+        sharedPreferences.edit().putBoolean(commentTool, enable).apply()
+    }
+
+    fun isShowBOTAToolEnable(): Boolean {
+        return sharedPreferences.getBoolean(botaTool, false)
+    }
+
+    fun setShowBOTAToolEnable(enable: Boolean) {
+        sharedPreferences.edit().putBoolean(botaTool, enable).apply()
+    }
+}

+ 103 - 0
reader/src/main/java/com/kdanmobile/reader/screen/model/SharePrefsModel.kt

@@ -0,0 +1,103 @@
+package com.kdanmobile.reader.screen.model
+
+import android.arch.lifecycle.LiveData
+import android.arch.lifecycle.MutableLiveData
+import android.content.Context
+import com.kdanmobile.reader.screen.data.ViewerSettingSharePrefs
+
+class SharePrefsModel(context: Context) {
+    companion object {
+        const val viewerSettingFileName = "viewer_setting"
+    }
+
+    val readMode: LiveData<Int>
+        get() = mReadMode
+
+    val isCropModeEnable: LiveData<Boolean>
+        get() = mIsCropModeEnable
+
+    val isShowStateBarEnable: LiveData<Boolean>
+        get() = mIsShowStateBarEnable
+
+    val turnPageDirection: LiveData<Int>
+        get() = mTurnPageDirection
+
+    val isShowTurnPageBtnEnable: LiveData<Boolean>
+        get() = mIsShowTurnPageBtnEnable
+
+    val isLockScreenSleepEnable: LiveData<Boolean>
+        get() = mIsLockScreenSleepEnable
+
+    val isShowCommentToolEnable: LiveData<Boolean>
+        get() = mIsShowCommentToolEnable
+
+    val isShowBOTAToolEnable: LiveData<Boolean>
+        get() = mIsShowBOTAToolEnable
+
+    private var mReadMode = MutableLiveData<Int>()
+
+    private var mIsCropModeEnable = MutableLiveData<Boolean>()
+
+    private var mIsShowStateBarEnable = MutableLiveData<Boolean>()
+
+    private var mTurnPageDirection = MutableLiveData<Int>()
+
+    private var mIsShowTurnPageBtnEnable = MutableLiveData<Boolean>()
+
+    private var mIsLockScreenSleepEnable = MutableLiveData<Boolean>()
+
+    private var mIsShowCommentToolEnable = MutableLiveData<Boolean>()
+
+    private var mIsShowBOTAToolEnable = MutableLiveData<Boolean>()
+
+    private val viewSettingSharePrefs = ViewerSettingSharePrefs(context, viewerSettingFileName).apply {
+        mReadMode.value = this.getReadMode()
+        mIsCropModeEnable.value = this.isCropModeEnable()
+        mIsShowStateBarEnable.value = this.isShowStateBarEnable()
+        mTurnPageDirection.value = this.getTurnPageDirection()
+        mIsShowTurnPageBtnEnable.value = this.isShowTurnPageButtonEnable()
+        mIsLockScreenSleepEnable.value = this.isLockScreenSleepEnable()
+        mIsShowCommentToolEnable.value = this.isShowCommentToolEnable()
+        mIsShowBOTAToolEnable.value = this.isShowBOTAToolEnable()
+    }
+
+    fun setReadMode(readMode: Int) {
+        viewSettingSharePrefs.setReadMode(readMode)
+        mReadMode.value = readMode
+    }
+
+    fun setCropModeEnable(enable: Boolean) {
+        viewSettingSharePrefs.setCropModeEnable(enable)
+        mIsCropModeEnable.value = enable
+    }
+
+    fun setShowStateBarEnable(enable: Boolean) {
+        viewSettingSharePrefs.setShowStateBarEnable(enable)
+        mIsShowStateBarEnable.value = enable
+    }
+
+    fun setTurnPageDirection(direction: Int) {
+        viewSettingSharePrefs.setTurnPageDirection(direction)
+        mTurnPageDirection.value = direction
+    }
+
+    fun setTurnPageButtonEnable(enable: Boolean) {
+        viewSettingSharePrefs.setShowTurnPageButtonEnable(enable)
+        mIsShowTurnPageBtnEnable.value = enable
+    }
+
+    fun setLockScreenSleepEnable(enable: Boolean) {
+        viewSettingSharePrefs.setLockScreenSleepEnable(enable)
+        mIsLockScreenSleepEnable.value = enable
+    }
+
+    fun setShowCommentToolEnable(enable: Boolean) {
+        viewSettingSharePrefs.setShowCommentToolEnable(enable)
+        mIsShowCommentToolEnable.value = enable
+    }
+
+    fun setShowBOTAToolEnable(enable: Boolean) {
+        viewSettingSharePrefs.setShowBOTAToolEnable(enable)
+        mIsShowBOTAToolEnable.value = enable
+    }
+}

+ 97 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/ReadingModeSelectView.kt

@@ -0,0 +1,97 @@
+package com.kdanmobile.reader.screen.view
+
+import android.content.Context
+import android.support.constraint.ConstraintLayout
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.view.View
+import com.kdanmobile.reader.R
+import kotlinx.android.synthetic.main.view_reading_mode_select.view.*
+
+class ReadingModeSelectView : ConstraintLayout {
+    companion object {
+        const val modeDay = 0
+        const val modeNight = 1
+        const val modeSefia = 2
+        const val modeLilac = 5
+    }
+
+    interface OnReadModeSelectListener {
+        fun onReadModeSelect(readMode: Int)
+    }
+
+    var onReadModeSelectListener: OnReadModeSelectListener? = null
+
+    var currentReadMode: Int? = null
+        set(value) {
+            field = value
+            when (value) {
+                modeDay -> setReadModeBtnActivated(btn_readingMode_day)
+                modeNight -> setReadModeBtnActivated(btn_readingMode_night)
+                modeSefia -> setReadModeBtnActivated(btn_readingMode_sefia)
+                modeLilac -> setReadModeBtnActivated(btn_readingMode_lilac)
+            }
+        }
+
+    var isLock: Boolean = false
+        set(value) {
+            field = value
+            setReadModeBtnLockVisible(isLock)
+        }
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initView()
+    }
+
+    private fun initView() {
+        LayoutInflater.from(context).inflate(R.layout.view_reading_mode_select, this).apply {
+            btn_readingMode_day.setOnClickListener {
+                onReadModeSelectListener?.onReadModeSelect(modeDay)
+                setReadModeBtnActivated(it)
+            }
+            btn_readingMode_lilac.setOnClickListener {
+                onReadModeSelectListener?.onReadModeSelect(modeLilac)
+                setReadModeBtnActivated(it)
+            }
+            btn_readingMode_night.setOnClickListener {
+                if (!isLock) {
+                    onReadModeSelectListener?.onReadModeSelect(modeNight)
+                    setReadModeBtnActivated(it)
+                }
+            }
+            btn_readingMode_sefia.setOnClickListener {
+                if (!isLock) {
+                    onReadModeSelectListener?.onReadModeSelect(modeSefia)
+                    setReadModeBtnActivated(it)
+                }
+            }
+            setReadModeBtnLockVisible(isLock)
+        }
+    }
+
+    private fun setReadModeBtnActivated(view: View?) {
+        btn_readingMode_day?.isActivated = false
+        btn_readingMode_lilac?.isActivated = false
+        btn_readingMode_night?.isActivated = false
+        btn_readingMode_sefia?.isActivated = false
+        view?.isActivated = true
+    }
+
+    private fun setReadModeBtnLockVisible(isVisible: Boolean) {
+        if (isVisible) {
+            iv_readingMode_night_lock?.visibility = View.VISIBLE
+            iv_readingMode_sefia_lock?.visibility = View.VISIBLE
+        } else {
+            iv_readingMode_night_lock?.visibility = View.INVISIBLE
+            iv_readingMode_sefia_lock?.visibility = View.INVISIBLE
+        }
+    }
+}

+ 51 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/RowSwitchView.kt

@@ -0,0 +1,51 @@
+package com.kdanmobile.reader.screen.view
+
+import android.content.Context
+import android.support.constraint.ConstraintLayout
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.widget.CompoundButton
+import com.kdanmobile.reader.R
+import kotlinx.android.synthetic.main.view_row_switch.view.*
+
+class RowSwitchView : ConstraintLayout {
+    var text = ""
+
+    var isChecked = false
+        set(value) {
+            field = value
+            rowSwitchView_switch?.isChecked = isChecked
+        }
+
+    var onCheckedChangeListener: CompoundButton.OnCheckedChangeListener? = null
+        set(value) {
+            field = value
+            rowSwitchView_switch?.setOnCheckedChangeListener(onCheckedChangeListener)
+        }
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initAttr(attrs)
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initAttr(attrs)
+        initView()
+    }
+
+    private fun initAttr(attributeSet: AttributeSet) {
+        val typedArray = context.theme.obtainStyledAttributes(attributeSet, R.styleable.RowSwitchView, 0, 0)
+        text = typedArray.getString(R.styleable.RowSwitchView_text)
+        isChecked = typedArray.getBoolean(R.styleable.RowSwitchView_isChecked, false)
+    }
+
+    private fun initView() {
+        LayoutInflater.from(context).inflate(R.layout.view_row_switch, this)
+        rowSwitchView_text.text = text
+        rowSwitchView_switch.isChecked = isChecked
+    }
+}

+ 39 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/ScreenSettingView.kt

@@ -0,0 +1,39 @@
+package com.kdanmobile.reader.screen.view
+
+import android.content.Context
+import android.support.constraint.ConstraintLayout
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.widget.CompoundButton
+import com.kdanmobile.reader.R
+import kotlinx.android.synthetic.main.view_screen_setting.view.*
+
+class ScreenSettingView : ConstraintLayout {
+    var onCheckedChangeListener: CompoundButton.OnCheckedChangeListener? = null
+        set(value) {
+            field = value
+            rowSwitchView_lockScreenSleepEnable?.onCheckedChangeListener = value
+        }
+
+    var isLockScreenSleepEnable: Boolean = false
+        set(value) {
+            field = value
+            rowSwitchView_lockScreenSleepEnable?.isChecked = value
+        }
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initView()
+    }
+
+    private fun initView() {
+        LayoutInflater.from(context).inflate(R.layout.view_screen_setting, this)
+    }
+}

+ 51 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/ToolbarSettingView.kt

@@ -0,0 +1,51 @@
+package com.kdanmobile.reader.screen.view
+
+import android.content.Context
+import android.support.constraint.ConstraintLayout
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.widget.CompoundButton
+import com.kdanmobile.reader.R
+import kotlinx.android.synthetic.main.view_toolbar_setting.view.*
+
+class ToolbarSettingView : ConstraintLayout {
+    var onCheckedChangeListenerComment: CompoundButton.OnCheckedChangeListener? = null
+        set(value) {
+            field = value
+            rowSwitchView_show_commentTool?.onCheckedChangeListener = value
+        }
+
+    var onCheckedChangeListenerBOTA: CompoundButton.OnCheckedChangeListener? = null
+        set(value) {
+            field = value
+            rowSwitchView_show_BOTATool?.onCheckedChangeListener = value
+        }
+
+    var isShowCommentToolEnable: Boolean = false
+        set(value) {
+            field = value
+            rowSwitchView_show_commentTool?.isChecked = value
+        }
+
+    var isShowBOTAToolEnable: Boolean = false
+        set(value) {
+            field = value
+            rowSwitchView_show_BOTATool?.isChecked = value
+        }
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initView()
+    }
+
+    private fun initView() {
+        LayoutInflater.from(context).inflate(R.layout.view_toolbar_setting, this)
+    }
+}

+ 66 - 0
reader/src/main/java/com/kdanmobile/reader/screen/view/TurnPageModeSelectView.kt

@@ -0,0 +1,66 @@
+package com.kdanmobile.reader.screen.view
+
+import android.content.Context
+import android.support.constraint.ConstraintLayout
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.widget.CompoundButton
+import com.kdanmobile.reader.R
+import kotlinx.android.synthetic.main.view_turn_page_mode_select.view.*
+
+class TurnPageModeSelectView : ConstraintLayout {
+    companion object {
+        const val vertical = 0
+        const val horizontal = 1
+    }
+
+    interface OnTurnPageModeChangedListener {
+        fun onTurnPageModeChanged(direction: Int)
+    }
+
+    var onTurnPageModeChangedListener: OnTurnPageModeChangedListener? = null
+
+    var onShowTurnPageBtnEnableChangedListener: CompoundButton.OnCheckedChangeListener? = null
+        set(value) {
+            field = value
+            rowSwitchView_showTurnPageBtn?.onCheckedChangeListener = value
+        }
+
+    var direction: Int? = null
+        set(value) {
+            field = value
+            when (value) {
+                vertical -> radioBtn_turnPageMode_vertically.isChecked = true
+                horizontal -> radioBtn_turnPageMode_horizontally.isChecked = true
+            }
+        }
+
+    var isTurnPageBtnEnable: Boolean = false
+        set(value) {
+            field = value
+            rowSwitchView_showTurnPageBtn?.isChecked = value
+        }
+
+    constructor(context: Context) : super(context) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
+        initView()
+    }
+
+    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
+        initView()
+    }
+
+    private fun initView() {
+        LayoutInflater.from(context).inflate(R.layout.view_turn_page_mode_select, this)
+
+        radioGroup_turnPageMode.setOnCheckedChangeListener { _, checkedId ->
+            when (checkedId) {
+                R.id.radioBtn_turnPageMode_vertically -> onTurnPageModeChangedListener?.onTurnPageModeChanged(vertical)
+                R.id.radioBtn_turnPageMode_horizontally -> onTurnPageModeChangedListener?.onTurnPageModeChanged(horizontal)
+            }
+        }
+    }
+}

BIN
reader/src/main/res/drawable-hdpi/ic_stat_lock.png


BIN
reader/src/main/res/drawable-xhdpi/ic_stat_lock.png


BIN
reader/src/main/res/drawable-xxhdpi/ic_stat_lock.png


BIN
reader/src/main/res/drawable/ic_stat_lock.png


+ 8 - 0
reader/src/main/res/drawable/selector_day_mode.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:drawable="@drawable/shape_day_mode_checked" android:state_pressed="true" />
+    <item android:drawable="@drawable/shape_day_mode_checked" android:state_activated="true" />
+    <item android:drawable="@drawable/shape_day_mode" />
+
+</selector>

+ 8 - 0
reader/src/main/res/drawable/selector_lilac_mode.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:drawable="@drawable/shape_white_lilac_mode_checked" android:state_pressed="true" />
+    <item android:drawable="@drawable/shape_white_lilac_mode_checked" android:state_activated="true" />
+    <item android:drawable="@drawable/shape_white_lilac_mode" />
+
+</selector>

+ 8 - 0
reader/src/main/res/drawable/selector_night_mode.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:drawable="@drawable/shape_night_mode_checked" android:state_pressed="true" />
+    <item android:drawable="@drawable/shape_night_mode_checked" android:state_activated="true" />
+    <item android:drawable="@drawable/shape_night_mode" />
+
+</selector>

+ 8 - 0
reader/src/main/res/drawable/selector_sefia_mode.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:drawable="@drawable/shape_sepia_mode_checked" android:state_pressed="true" />
+    <item android:drawable="@drawable/shape_sepia_mode_checked" android:state_activated="true" />
+    <item android:drawable="@drawable/shape_sepia_mode" />
+
+</selector>

+ 9 - 0
reader/src/main/res/drawable/shape_day_mode.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="oval">
+    <solid android:color="#ffffff" />
+    <stroke
+        android:width="2dp"
+        android:color="#ffffff" />
+    <corners android:radius="4dp" />
+</shape>

+ 9 - 0
reader/src/main/res/drawable/shape_day_mode_checked.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="oval">
+    <solid android:color="#ffffff" />
+    <stroke
+        android:width="2dp"
+        android:color="#0077fd" />
+    <corners android:radius="4dp" />
+</shape>

+ 9 - 0
reader/src/main/res/drawable/shape_night_mode.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="oval">
+    <solid android:color="#000000" />
+    <stroke
+        android:width="2dp"
+        android:color="#ffffff" />
+    <corners android:radius="4dp" />
+</shape>

+ 9 - 0
reader/src/main/res/drawable/shape_night_mode_checked.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="oval">
+    <solid android:color="#000000" />
+    <stroke
+        android:width="2dp"
+        android:color="#0077fd" />
+    <corners android:radius="4dp" />
+</shape>

+ 9 - 0
reader/src/main/res/drawable/shape_sepia_mode.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="oval">
+    <solid android:color="#eedebc" />
+    <stroke
+        android:width="2dp"
+        android:color="#ffffff" />
+    <corners android:radius="4dp" />
+</shape>

+ 9 - 0
reader/src/main/res/drawable/shape_sepia_mode_checked.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="oval">
+    <solid android:color="#eedebc" />
+    <stroke
+        android:width="2dp"
+        android:color="#0077fd" />
+    <corners android:radius="4dp" />
+</shape>

+ 9 - 0
reader/src/main/res/drawable/shape_white_lilac_mode.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="oval">
+    <solid android:color="#e2e2e2" />
+    <stroke
+        android:width="2dp"
+        android:color="#ffffff" />
+    <corners android:radius="4dp" />
+</shape>

+ 9 - 0
reader/src/main/res/drawable/shape_white_lilac_mode_checked.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="oval">
+    <solid android:color="#e2e2e2" />
+    <stroke
+        android:width="2dp"
+        android:color="#0077fd" />
+    <corners android:radius="4dp" />
+</shape>

+ 79 - 0
reader/src/main/res/layout/activity_viewer_setting.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".screen.ViewerSettingActivity">
+
+    <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:minHeight="?attr/actionBarSize"
+            android:theme="@style/ReaderToolBarStyle"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <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.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.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.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>

+ 88 - 0
reader/src/main/res/layout/view_reading_mode_select.xml

@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout 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">
+
+    <TextView
+        android:id="@+id/tv_readingMode"
+        style="@style/Base.TextAppearance.AppCompat.Body1"
+        android:layout_width="0dp"
+        android:layout_height="48dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginStart="16dp"
+        android:layout_marginTop="8dp"
+        android:text="@string/viewer_setting_page_background_and_display"
+        android:textColor="#030303"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent" />
+
+    <ImageButton
+        android:id="@+id/btn_readingMode_day"
+        android:layout_width="48dp"
+        android:layout_height="48dp"
+        android:layout_marginLeft="16dp"
+        android:layout_marginStart="16dp"
+        android:background="#0000"
+        android:contentDescription="@string/viewer_setting_page_background_and_display"
+        android:src="@drawable/selector_day_mode"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_readingMode" />
+
+    <ImageButton
+        android:id="@+id/btn_readingMode_lilac"
+        android:layout_width="48dp"
+        android:layout_height="48dp"
+        android:layout_marginLeft="24dp"
+        android:layout_marginStart="24dp"
+        android:background="#0000"
+        android:contentDescription="@string/viewer_setting_page_background_and_display"
+        android:src="@drawable/selector_lilac_mode"
+        app:layout_constraintLeft_toRightOf="@+id/btn_readingMode_day"
+        app:layout_constraintTop_toBottomOf="@+id/tv_readingMode" />
+
+    <ImageButton
+        android:id="@+id/btn_readingMode_night"
+        android:layout_width="48dp"
+        android:layout_height="48dp"
+        android:layout_marginLeft="24dp"
+        android:layout_marginStart="24dp"
+        android:background="#0000"
+        android:contentDescription="@string/viewer_setting_page_background_and_display"
+        android:src="@drawable/selector_night_mode"
+        app:layout_constraintLeft_toRightOf="@+id/btn_readingMode_lilac"
+        app:layout_constraintTop_toBottomOf="@+id/tv_readingMode" />
+
+    <ImageView
+        android:id="@+id/iv_readingMode_night_lock"
+        android:layout_width="16dp"
+        android:layout_height="21dp"
+        android:src="@drawable/ic_stat_lock"
+        app:layout_constraintBottom_toBottomOf="@+id/btn_readingMode_night"
+        app:layout_constraintLeft_toLeftOf="@+id/btn_readingMode_night"
+        app:layout_constraintRight_toRightOf="@+id/btn_readingMode_night"
+        app:layout_constraintTop_toTopOf="@+id/btn_readingMode_night" />
+
+    <ImageButton
+        android:id="@+id/btn_readingMode_sefia"
+        android:layout_width="48dp"
+        android:layout_height="48dp"
+        android:layout_marginLeft="24dp"
+        android:layout_marginStart="24dp"
+        android:background="#0000"
+        android:contentDescription="@string/viewer_setting_page_background_and_display"
+        android:src="@drawable/selector_sefia_mode"
+        app:layout_constraintLeft_toRightOf="@+id/btn_readingMode_night"
+        app:layout_constraintTop_toBottomOf="@+id/tv_readingMode" />
+
+    <ImageView
+        android:id="@+id/iv_readingMode_sefia_lock"
+        android:layout_width="16dp"
+        android:layout_height="21dp"
+        android:src="@drawable/ic_stat_lock"
+        app:layout_constraintBottom_toBottomOf="@+id/btn_readingMode_sefia"
+        app:layout_constraintLeft_toLeftOf="@+id/btn_readingMode_sefia"
+        app:layout_constraintRight_toRightOf="@+id/btn_readingMode_sefia"
+        app:layout_constraintTop_toTopOf="@+id/btn_readingMode_sefia" />
+
+</android.support.constraint.ConstraintLayout>

+ 29 - 0
reader/src/main/res/layout/view_row_switch.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout 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">
+
+    <TextView
+        android:id="@+id/rowSwitchView_text"
+        style="@style/Base.TextAppearance.Widget.AppCompat.Toolbar.Subtitle"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="16dp"
+        android:layout_marginStart="16dp"
+        android:textColor="#de000000"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <Switch
+        android:id="@+id/rowSwitchView_switch"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="16dp"
+        android:layout_marginRight="16dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+</android.support.constraint.ConstraintLayout>

+ 27 - 0
reader/src/main/res/layout/view_screen_setting.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout 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">
+
+    <TextView
+        android:id="@+id/tv_turnPageMode"
+        style="@style/Base.TextAppearance.AppCompat.Body1"
+        android:layout_width="wrap_content"
+        android:layout_height="24dp"
+        android:layout_marginLeft="16dp"
+        android:layout_marginStart="16dp"
+        android:text="@string/viewer_setting_screen_setting"
+        android:textColor="#0077fd"
+        app:layout_constraintLeft_toLeftOf="parent" />
+
+    <com.kdanmobile.reader.screen.view.RowSwitchView
+        android:id="@+id/rowSwitchView_lockScreenSleepEnable"
+        android:layout_width="0dp"
+        android:layout_height="48dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_turnPageMode"
+        app:text="@string/viewer_setting_switch_screen_sleep" />
+
+</android.support.constraint.ConstraintLayout>

+ 36 - 0
reader/src/main/res/layout/view_toolbar_setting.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout 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">
+
+    <TextView
+        android:id="@+id/tv_toolbar_setting"
+        style="@style/Base.TextAppearance.AppCompat.Body1"
+        android:layout_width="wrap_content"
+        android:layout_height="24dp"
+        android:layout_marginLeft="16dp"
+        android:layout_marginStart="16dp"
+        android:text="@string/viewer_setting_toolbar_display_setting"
+        android:textColor="#0077fd"
+        app:layout_constraintLeft_toLeftOf="parent" />
+
+    <com.kdanmobile.reader.screen.view.RowSwitchView
+        android:id="@+id/rowSwitchView_show_commentTool"
+        android:layout_width="0dp"
+        android:layout_height="48dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_toolbar_setting"
+        app:text="@string/viewer_setting_toolbar_display_setting_comment" />
+
+    <com.kdanmobile.reader.screen.view.RowSwitchView
+        android:id="@+id/rowSwitchView_show_BOTATool"
+        android:layout_width="0dp"
+        android:layout_height="48dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/rowSwitchView_show_commentTool"
+        app:text="@string/viewer_setting_toolbar_display_setting_bota" />
+
+</android.support.constraint.ConstraintLayout>

+ 52 - 0
reader/src/main/res/layout/view_turn_page_mode_select.xml

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout 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">
+
+    <TextView
+        android:id="@+id/tv_turnPageMode"
+        style="@style/Base.TextAppearance.AppCompat.Body1"
+        android:layout_width="wrap_content"
+        android:layout_height="24dp"
+        android:layout_marginLeft="16dp"
+        android:layout_marginStart="16dp"
+        android:text="@string/viewer_setting_page_turn_mode"
+        android:textColor="#0077fd"
+        app:layout_constraintLeft_toLeftOf="parent" />
+
+    <RadioGroup
+        android:id="@+id/radioGroup_turnPageMode"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="12dp"
+        android:layout_marginStart="12dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_turnPageMode">
+
+        <RadioButton
+            android:id="@+id/radioBtn_turnPageMode_horizontally"
+            android:layout_width="wrap_content"
+            android:layout_height="48dp"
+            android:text="@string/viewer_setting_page_turn_mode_horizontally"
+            app:layout_constraintLeft_toLeftOf="parent" />
+
+        <RadioButton
+            android:id="@+id/radioBtn_turnPageMode_vertically"
+            android:layout_width="wrap_content"
+            android:layout_height="48dp"
+            android:text="@string/viewer_setting_page_turn_mode_vertically"
+            app:layout_constraintLeft_toLeftOf="parent" />
+
+    </RadioGroup>
+
+    <com.kdanmobile.reader.screen.view.RowSwitchView
+        android:id="@+id/rowSwitchView_showTurnPageBtn"
+        android:layout_width="0dp"
+        android:layout_height="48dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/radioGroup_turnPageMode"
+        app:text="@string/viewer_setting_page_turn_button_visible" />
+
+</android.support.constraint.ConstraintLayout>

+ 4 - 0
reader/src/main/res/values-de/strings.xml

@@ -26,4 +26,8 @@
     <string name="fileManager_thishi_search">Bitte geben Sie mindestens 3 Zeichen ein.</string>
 
     <string name="dialogAddBookmark_page">Seite</string>
+    <string name="viewer_setting_page_turn_mode">Durch Seiten scrollen</string>
+    <string name="viewer_setting_page_turn_mode_horizontal">Horizontal</string>
+    <string name="viewer_setting_page_turn_mode_vertically">Vertikal</string>
+    <string name="viewer_setting_page_turn_mode_horizontally">Horizontal</string>
 </resources>

+ 4 - 0
reader/src/main/res/values-es/strings.xml

@@ -26,4 +26,8 @@
     <string name="fileManager_thishi_search">Por favor, introduce al menos 3 caracteres.</string>
 
     <string name="dialogAddBookmark_page">página</string>
+    <string name="viewer_setting_page_turn_mode">Desplace páginas</string>
+    <string name="viewer_setting_page_turn_mode_horizontal">Horizontalmente</string>
+    <string name="viewer_setting_page_turn_mode_vertically">Verticalmente</string>
+    <string name="viewer_setting_page_turn_mode_horizontally">Horizontalmente</string>
 </resources>

+ 4 - 0
reader/src/main/res/values-fr/strings.xml

@@ -26,4 +26,8 @@
     <string name="fileManager_thishi_search">Veuillez entrer au moins 3 caractères.</string>
 
     <string name="dialogAddBookmark_page">Page</string>
+    <string name="viewer_setting_page_turn_mode">Défilement des Pages</string>
+    <string name="viewer_setting_page_turn_mode_horizontal">Horizontalement</string>
+    <string name="viewer_setting_page_turn_mode_vertically">Verticalement</string>
+    <string name="viewer_setting_page_turn_mode_horizontally">Horizontalement</string>
 </resources>

+ 4 - 0
reader/src/main/res/values-it/strings.xml

@@ -26,4 +26,8 @@
     <string name="fileManager_thishi_search">Si prega di inserire almeno 3 caratteri.</string>
 
     <string name="dialogAddBookmark_page">Pagina</string>
+    <string name="viewer_setting_page_turn_mode">Pagine di scorrimento</string>
+    <string name="viewer_setting_page_turn_mode_horizontal">Orizzontalmente</string>
+    <string name="viewer_setting_page_turn_mode_vertically">Verticalmente</string>
+    <string name="viewer_setting_page_turn_mode_horizontally">Orizzontalmente</string>
 </resources>

+ 4 - 0
reader/src/main/res/values-ja/strings.xml

@@ -24,4 +24,8 @@
 
     <string name="fileManager_no_results">見つかりませんでした。</string>
     <string name="fileManager_thishi_search">少なくとも3文字入力して下さい。</string>
+    <string name="viewer_setting_page_turn_mode">ページをスクロールします</string>
+    <string name="viewer_setting_page_turn_mode_horizontal">横方向</string>
+    <string name="viewer_setting_page_turn_mode_vertically">縦方向</string>
+    <string name="viewer_setting_page_turn_mode_horizontally">横方向</string>
 </resources>

+ 4 - 0
reader/src/main/res/values-ko/strings.xml

@@ -26,4 +26,8 @@
     <string name="fileManager_thishi_search">최소 3자 이상 입력해 주십시오.</string>
 
     <string name="dialogAddBookmark_page">페이지</string>
+    <string name="viewer_setting_page_turn_mode">페이지 스크롤</string>
+    <string name="viewer_setting_page_turn_mode_horizontal">가로</string>
+    <string name="viewer_setting_page_turn_mode_vertically">세로</string>
+    <string name="viewer_setting_page_turn_mode_horizontally">가로</string>
 </resources>

+ 4 - 0
reader/src/main/res/values-pt/strings.xml

@@ -26,4 +26,8 @@
     <string name="fileManager_thishi_search">Por favor digite no mínimo 3 caracteres.</string>
 
     <string name="dialogAddBookmark_page">página</string>
+    <string name="viewer_setting_page_turn_mode">Páginas de rolagem</string>
+    <string name="viewer_setting_page_turn_mode_horizontal">Horizontalmente</string>
+    <string name="viewer_setting_page_turn_mode_vertically">Verticalmente</string>
+    <string name="viewer_setting_page_turn_mode_horizontally">Horizontalmente</string>
 </resources>

+ 4 - 0
reader/src/main/res/values-ru/strings.xml

@@ -26,4 +26,8 @@
     <string name="fileManager_thishi_search">Пожалуйста введите минимум 3 символа</string>
 
     <string name="dialogAddBookmark_page">страница</string>
+    <string name="viewer_setting_page_turn_mode">Прокручивание страниц</string>
+    <string name="viewer_setting_page_turn_mode_horizontal">Горизонтально</string>
+    <string name="viewer_setting_page_turn_mode_vertically">Вертикально</string>
+    <string name="viewer_setting_page_turn_mode_horizontally">Горизонтально</string>
 </resources>

+ 4 - 0
reader/src/main/res/values-zh-rTW/strings.xml

@@ -26,4 +26,8 @@
     <string name="fileManager_thishi_search">請至少輸入3個字元</string>
 
     <string name="dialogAddBookmark_page">頁數</string>
+    <string name="viewer_setting_page_turn_mode">翻頁設定</string>
+    <string name="viewer_setting_page_turn_mode_horizontal">水平滾動</string>
+    <string name="viewer_setting_page_turn_mode_vertically">垂直滾動</string>
+    <string name="viewer_setting_page_turn_mode_horizontally">水平滾動</string>
 </resources>

+ 4 - 0
reader/src/main/res/values-zh/strings.xml

@@ -26,4 +26,8 @@
     <string name="fileManager_thishi_search">请至少输入3个字符</string>
 
     <string name="dialogAddBookmark_page">页码</string>
+    <string name="viewer_setting_page_turn_mode">翻页设置</string>
+    <string name="viewer_setting_page_turn_mode_horizontal">水平滚动</string>
+    <string name="viewer_setting_page_turn_mode_vertically">垂直滚动</string>
+    <string name="viewer_setting_page_turn_mode_horizontally">水平滚动</string>
 </resources>

+ 9 - 0
reader/src/main/res/values/attrs.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <declare-styleable name="RowSwitchView">
+        <attr name="text" format="string" />
+        <attr name="isChecked" format="boolean" />
+    </declare-styleable>
+
+</resources>

+ 14 - 0
reader/src/main/res/values/strings.xml

@@ -29,4 +29,18 @@
     <string name="fileManager_thishi_search">Please enter at least 3 characters.</string>
 
     <string name="dialogAddBookmark_page">page</string>
+
+    <!--viewer setting-->
+    <string name="viewer_setting_page_background_and_display">Page Background And Display</string>
+    <string name="viewer_setting_switch_smart_crop">Smart Crop Mode</string>
+    <string name="viewer_setting_switch_show_state_bar">Show State Bar</string>
+    <string name="viewer_setting_page_turn_mode">Scroll Pages</string>
+    <string name="viewer_setting_page_turn_mode_horizontally">Horizontally</string>
+    <string name="viewer_setting_page_turn_mode_vertically">Vertically</string>
+    <string name="viewer_setting_page_turn_button_visible">Show turn page button</string>
+    <string name="viewer_setting_screen_setting">Screen Setting</string>
+    <string name="viewer_setting_switch_screen_sleep">Screen Sleep Setting Enable</string>
+    <string name="viewer_setting_toolbar_display_setting">Toolbar Display Setting</string>
+    <string name="viewer_setting_toolbar_display_setting_comment">Display Comment Tool</string>
+    <string name="viewer_setting_toolbar_display_setting_bota">Display BOTA tool</string>
 </resources>