浏览代码

Refactor: rename view_km_thumb_layout.xml to view_thumbnail.xml

cooperku_kdanmobile 5 年之前
父节点
当前提交
122255da12

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

@@ -198,7 +198,7 @@ open class ReaderActivity : AppCompatActivity() {
         viewGroup_readerActivity_leftToolbar.setScroll(false)
         setLeftToolbarWidth(w_240)
         viewGroup_readerActivity_leftToolbar.smoothScrollTo(w_240, 0, 0)
-        val child = layoutInflater.inflate(R.layout.view_km_thumb_layout, null)
+        val child = layoutInflater.inflate(R.layout.view_thumbnail, null)
         linearLayout_readerActivity_leftToolbarContainer.addView(child)
         cloneOriginConstraintSet()
     }
@@ -270,7 +270,7 @@ open class ReaderActivity : AppCompatActivity() {
         if (isLeftToolbarOpen) {
             if (leftToolbarType != type) {
                 linearLayout_readerActivity_leftToolbarContainer.removeAllViews()
-                val child = layoutInflater.inflate(R.layout.view_km_thumb_layout, null)
+                val child = layoutInflater.inflate(R.layout.view_thumbnail, null)
                 linearLayout_readerActivity_leftToolbarContainer.addView(child)
             }
             iv_readerActivity_bookmark.setImageResource(R.drawable.ic_pagelist_bookmk_h)
@@ -286,7 +286,7 @@ open class ReaderActivity : AppCompatActivity() {
         if (isLeftToolbarOpen) {
             if (leftToolbarType != type) {
                 linearLayout_readerActivity_leftToolbarContainer.removeAllViews()
-                val child = layoutInflater.inflate(R.layout.view_km_thumb_layout, null)
+                val child = layoutInflater.inflate(R.layout.view_thumbnail, null)
                 linearLayout_readerActivity_leftToolbarContainer.addView(child)
             }
             iv_readerActivity_outline.setImageResource(R.drawable.ic_pagelist_outline_h)
@@ -302,7 +302,7 @@ open class ReaderActivity : AppCompatActivity() {
         if (isLeftToolbarOpen) {
             if (leftToolbarType != type) {
                 linearLayout_readerActivity_leftToolbarContainer.removeAllViews()
-                val child = layoutInflater.inflate(R.layout.view_km_thumb_layout, null)
+                val child = layoutInflater.inflate(R.layout.view_thumbnail, null)
                 linearLayout_readerActivity_leftToolbarContainer.addView(child)
             }
             iv_readerActivity_search.setImageResource(R.drawable.ic_pagelist_search_h)

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

@@ -9,7 +9,7 @@ import android.widget.RelativeLayout
 import com.kdanmobile.reader.R
 import com.kdanmobile.reader.ReaderViewModel
 import com.kdanmobile.reader.widget.drag.OnRecyclerItemClickListener
-import kotlinx.android.synthetic.main.view_km_thumb_layout.view.*
+import kotlinx.android.synthetic.main.view_thumbnail.view.*
 
 class ThumbnailView: RelativeLayout {
     companion object {
@@ -32,7 +32,7 @@ class ThumbnailView: RelativeLayout {
 
     private fun initView(handler: ThumbnailHandler) {
         this.handler = handler
-        LayoutInflater.from(context).inflate(R.layout.view_km_thumb_layout, this)
+        LayoutInflater.from(context).inflate(R.layout.view_thumbnail, this)
         val layoutManager = LinearLayoutManager(context)
         layoutManager.orientation = LinearLayoutManager.VERTICAL
 

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

@@ -11,7 +11,7 @@
         android:layout_centerHorizontal="true"
         android:drawableLeft="@drawable/ic_pagelist_title_thumbnail"
         android:gravity="center_vertical"
-        android:text="thumbnail_title"
+        android:text="@string/thumbnail_title"
         android:textColor="#afafaf"
         android:textSize="12sp"/>