增加翻页模式切换

old
zlj 5 years ago
parent 65f8eacf72
commit 1ced939f28
  1. 2
      .idea/misc.xml
  2. 1
      app/build.gradle
  3. 1
      app/src/main/java/com/novel/read/event/DeleteResponseEvent.kt
  4. 22
      app/src/main/java/com/novel/read/widget/dialog/ReadSettingDialog.kt
  5. 129
      app/src/main/res/layout/layout_setting.xml
  6. 6
      app/src/main/res/values-night/strings.xml
  7. 6
      app/src/main/res/values-zh-rTW-night/strings.xml
  8. 6
      app/src/main/res/values-zh-rTW/strings.xml
  9. 6
      app/src/main/res/values/strings.xml
  10. 2
      build.gradle
  11. 5
      common_lib/build.gradle

@ -10,7 +10,7 @@
<item index="0" class="java.lang.String" itemvalue="com.squareup.otto.Subscribe" /> <item index="0" class="java.lang.String" itemvalue="com.squareup.otto.Subscribe" />
</list> </list>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

@ -28,7 +28,6 @@ android {
dependencies { dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation rootProject.ext.dependencies["junit"] testImplementation rootProject.ext.dependencies["junit"]
androidTestImplementation rootProject.ext.dependencies["runner"] androidTestImplementation rootProject.ext.dependencies["runner"]
androidTestImplementation rootProject.ext.dependencies["espresso_core"] androidTestImplementation rootProject.ext.dependencies["espresso_core"]

@ -4,3 +4,4 @@ import com.mango.mangolib.event.BaseEvent
import com.novel.read.model.db.CollBookBean import com.novel.read.model.db.CollBookBean
class DeleteResponseEvent(var isDelete: Boolean, var collBook: CollBookBean) : BaseEvent<Any>() class DeleteResponseEvent(var isDelete: Boolean, var collBook: CollBookBean) : BaseEvent<Any>()

@ -39,6 +39,7 @@ class ReadSettingDialog(mActivity: Activity, private var mPageLoader: PageLoader
initData() initData()
initWidget() initWidget()
initClick() initClick()
initPageMode()
} }
//设置Dialog显示的位置 //设置Dialog显示的位置
@ -133,6 +134,27 @@ class ReadSettingDialog(mActivity: Activity, private var mPageLoader: PageLoader
mPageLoader.setTextSize(mSettingManager!!.textSize) mPageLoader.setTextSize(mSettingManager!!.textSize)
}) })
//Page Mode 切换
read_setting_rg_page_mode.setOnCheckedChangeListener { group, checkedId ->
val pageMode: PageMode = when (checkedId) {
R.id.read_setting_rb_simulation -> PageMode.SIMULATION
R.id.read_setting_rb_cover -> PageMode.COVER
R.id.read_setting_rb_scroll -> PageMode.SCROLL
R.id.read_setting_rb_none -> PageMode.NONE
else -> PageMode.SIMULATION
}
mPageLoader.setPageMode(pageMode)
}
}
private fun initPageMode() {
when (mPageMode) {
PageMode.SIMULATION -> read_setting_rb_simulation.isChecked = true
PageMode.COVER -> read_setting_rb_cover.isChecked = true
PageMode.NONE -> read_setting_rb_none.isChecked = true
PageMode. SCROLL -> read_setting_rb_scroll.isChecked = true
}
} }
companion object { companion object {

@ -1,111 +1,184 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:id="@+id/ll_setting"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/read_menu_color"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:background="@color/read_menu_color"
android:gravity="bottom" android:gravity="bottom"
android:orientation="vertical" android:orientation="vertical"
android:id="@+id/ll_setting"
android:padding="5dp"> android:padding="5dp">
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:orientation="horizontal"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"> android:layout_marginEnd="10dp"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:text="@string/font"
android:textColor="@color/smallColor" android:textColor="@color/smallColor"
android:textSize="16sp" android:textSize="16sp" />
android:text="@string/font"/>
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_simple" android:id="@+id/tv_simple"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:textColor="@drawable/text_color" android:text="@string/simple_font"
android:text="@string/simple_font"/> android:textColor="@drawable/text_color" />
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_trans" android:id="@+id/tv_trans"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:textColor="@drawable/text_color" android:text="@string/traditional_font"
android:text="@string/traditional_font"/> android:textColor="@drawable/text_color" />
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:orientation="horizontal"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"> android:layout_marginEnd="10dp"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:text="@string/font_size"
android:textColor="@color/smallColor" android:textColor="@color/smallColor"
android:textSize="16sp" android:textSize="16sp" />
android:text="@string/font_size"/>
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/read_setting_tv_font_minus" android:id="@+id/read_setting_tv_font_minus"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:src="@drawable/ic_font_min"/> android:layout_weight="1"
android:src="@drawable/ic_font_min" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/read_setting_tv_font_plus" android:id="@+id/read_setting_tv_font_plus"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:src="@drawable/ic_font_add"/> android:src="@drawable/ic_font_add" />
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/font_size"
android:textColor="@color/smallColor"
android:textSize="16sp" />
<RadioGroup
android:id="@+id/read_setting_rg_page_mode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatRadioButton
android:id="@+id/read_setting_rb_simulation"
android:layout_width="0dp"
android:layout_height="35dp"
android:layout_marginEnd="18dp"
android:layout_weight="1"
android:button="@null"
android:gravity="center"
android:text="@string/simulation"
android:textColor="@drawable/text_color"
android:textSize="14sp" />
<androidx.appcompat.widget.AppCompatRadioButton
android:id="@+id/read_setting_rb_cover"
android:layout_width="0dp"
android:layout_height="35dp"
android:layout_marginEnd="18dp"
android:layout_weight="1"
android:button="@null"
android:gravity="center"
android:text="@string/cover"
android:textColor="@drawable/text_color"
android:textSize="14sp" />
<androidx.appcompat.widget.AppCompatRadioButton
android:id="@+id/read_setting_rb_scroll"
android:layout_width="0dp"
android:layout_height="35dp"
android:layout_marginEnd="18dp"
android:layout_weight="1"
android:button="@null"
android:gravity="center"
android:text="@string/scroll"
android:textColor="@drawable/text_color"
android:textSize="14sp" />
<androidx.appcompat.widget.AppCompatRadioButton
android:id="@+id/read_setting_rb_none"
android:layout_width="0dp"
android:layout_height="35dp"
android:layout_weight="1"
android:button="@null"
android:gravity="center"
android:text="@string/none"
android:textColor="@drawable/text_color"
android:textSize="14sp" />
</RadioGroup>
</LinearLayout>
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:orientation="horizontal"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"> android:layout_marginEnd="10dp"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="@string/font_bg"
android:textColor="@color/smallColor" android:textColor="@color/smallColor"
android:textSize="16sp" android:textSize="16sp" />
android:text="@string/font_bg"/>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/read_setting_rv_bg" android:id="@+id/read_setting_rv_bg"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="4"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_weight="4"
android:scrollbars="none" /> android:scrollbars="none" />
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>

@ -142,6 +142,12 @@
<string name="good_text">如果您觉得我们做的还不错请给我们一个五星好评鼓励一下</string> <string name="good_text">如果您觉得我们做的还不错请给我们一个五星好评鼓励一下</string>
<!-- 翻页 -->
<string name="simulation">仿真</string>
<string name="cover">覆盖</string>
<string name="scroll">滚动</string>
<string name="none"></string>
<!--DownloadTask:书籍下载--> <!--DownloadTask:书籍下载-->
<string name="nb.download.add_succeed">成功添加到下载列表</string> <string name="nb.download.add_succeed">成功添加到下载列表</string>
<string name="nb.download.exist">该任务已存在</string> <string name="nb.download.exist">该任务已存在</string>

@ -139,6 +139,12 @@
<string name="good_text">如果您覺得我們做的還不錯請給我們壹個五星好評鼓勵壹下</string> <string name="good_text">如果您覺得我們做的還不錯請給我們壹個五星好評鼓勵壹下</string>
<!-- 翻页 -->
<string name="simulation">仿真</string>
<string name="cover">覆盖</string>
<string name="scroll">滚动</string>
<string name="none"></string>
<!--DownloadTask:书籍下载--> <!--DownloadTask:书籍下载-->
<string name="nb.download.add_succeed">成功添加到下載列表</string> <string name="nb.download.add_succeed">成功添加到下載列表</string>
<string name="nb.download.exist">該任務已存在</string> <string name="nb.download.exist">該任務已存在</string>

@ -141,6 +141,12 @@
<string name="good_text">如果您覺得我們做的還不錯請給我們壹個五星好評鼓勵壹下</string> <string name="good_text">如果您覺得我們做的還不錯請給我們壹個五星好評鼓勵壹下</string>
<!-- 翻页 -->
<string name="simulation">仿真</string>
<string name="cover">覆盖</string>
<string name="scroll">滚动</string>
<string name="none"></string>
<!--DownloadTask:书籍下载--> <!--DownloadTask:书籍下载-->
<string name="nb.download.add_succeed">成功添加到下載列表</string> <string name="nb.download.add_succeed">成功添加到下載列表</string>
<string name="nb.download.exist">該任務已存在</string> <string name="nb.download.exist">該任務已存在</string>

@ -144,6 +144,12 @@
<string name="good_text">如果您觉得我们做的还不错请给我们一个五星好评鼓励一下</string> <string name="good_text">如果您觉得我们做的还不错请给我们一个五星好评鼓励一下</string>
<!-- 翻页 -->
<string name="simulation">仿真</string>
<string name="cover">覆盖</string>
<string name="scroll">滚动</string>
<string name="none"></string>
<!--DownloadTask:书籍下载--> <!--DownloadTask:书籍下载-->
<string name="nb.download.add_succeed">成功添加到下载列表</string> <string name="nb.download.add_succeed">成功添加到下载列表</string>
<string name="nb.download.exist">该任务已存在</string> <string name="nb.download.exist">该任务已存在</string>

@ -6,6 +6,7 @@ buildscript {
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" } maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
google() google()
jcenter() jcenter()
maven { url "https://jitpack.io" }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.5.0' classpath 'com.android.tools.build:gradle:3.5.0'
@ -20,6 +21,7 @@ allprojects {
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" } maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
google() google()
jcenter() jcenter()
maven { url "https://jitpack.io" }
} }
} }

@ -40,8 +40,13 @@ dependencies {
api rootProject.ext.dependencies["glide"] api rootProject.ext.dependencies["glide"]
api rootProject.ext.dependencies["litepal"] api rootProject.ext.dependencies["litepal"]
//adapter
api 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.47'
//
api files('libs/ZHConverter.jar') api files('libs/ZHConverter.jar')
//
api 'com.google.android:flexbox:0.3.1' api 'com.google.android:flexbox:0.3.1'
// RxJava // RxJava

Loading…
Cancel
Save