瀏覽代碼

Minor changes

len 7 年之前
父節點
當前提交
e8b432485d

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/data/database/DbOpenHelper.kt

@@ -51,7 +51,7 @@ class DbOpenHelper(context: Context)
         if (oldVersion < 4) {
             db.execSQL(ChapterTable.bookmarkUpdateQuery)
         }
-        if (oldVersion < 5){
+        if (oldVersion < 5) {
             db.execSQL(ChapterTable.addScanlator)
         }
     }

+ 2 - 1
app/src/main/java/eu/kanade/tachiyomi/data/database/models/ChapterImpl.kt

@@ -31,7 +31,8 @@ class ChapterImpl : Chapter {
         if (other == null || javaClass != other.javaClass) return false
 
         val chapter = other as Chapter
-        //forces updates on manga if scanlator changes.  This will allow existing manga in library with scanlator to update
+        // Forces updates on manga if scanlator changes. This will allow existing manga in library
+        // with scanlator to update.
         return url == chapter.url && scanlator == chapter.scanlator
 
     }

+ 3 - 3
app/src/main/java/eu/kanade/tachiyomi/data/database/tables/ChapterTable.kt

@@ -14,7 +14,7 @@ object ChapterTable {
 
     const val COL_READ = "read"
 
-    const val COL_SCANLATOR ="scanlator"
+    const val COL_SCANLATOR = "scanlator"
 
     const val COL_BOOKMARK = "bookmark"
 
@@ -55,7 +55,7 @@ object ChapterTable {
     val bookmarkUpdateQuery: String
         get() = "ALTER TABLE $TABLE ADD COLUMN $COL_BOOKMARK BOOLEAN DEFAULT FALSE"
 
-    val addScanlator:String
-        get ()= "ALTER TABLE $TABLE ADD COLUMN $COL_SCANLATOR  TEXT DEFAULT"
+    val addScanlator: String
+        get() = "ALTER TABLE $TABLE ADD COLUMN $COL_SCANLATOR TEXT DEFAULT NULL"
 
 }

+ 20 - 36
app/src/main/res/layout/chapters_item.xml

@@ -1,10 +1,11 @@
 <?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"
-                                             xmlns:tools="http://schemas.android.com/tools"
-                                             android:layout_width="fill_parent"
-                                             android:layout_height="?android:attr/listPreferredItemHeight"
-                                             android:background="?attr/selectable_list_drawable">
+<android.support.constraint.ConstraintLayout
+    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="fill_parent"
+    android:layout_height="?android:attr/listPreferredItemHeight"
+    android:background="?attr/selectable_list_drawable">
 
     <TextView
         android:id="@+id/chapter_title"
@@ -14,10 +15,11 @@
         android:ellipsize="end"
         android:maxLines="1"
         tools:text="Title"
-        app:layout_constraintLeft_toLeftOf="@+id/guideline3"
+        app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintRight_toLeftOf="@+id/chapter_menu"
         android:layout_marginTop="12dp"
-        app:layout_constraintRight_toLeftOf="@+id/chapter_menu"/>
+        android:layout_marginLeft="16dp"/>
 
     <TextView
         android:id="@+id/chapter_scanlator"
@@ -26,11 +28,11 @@
         android:layout_height="wrap_content"
         tools:text="Scanlator"
         android:maxLines="1"
-        app:layout_constraintLeft_toLeftOf="@+id/guideline3"
+        app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/chapter_title"
         app:layout_constraintBottom_toTopOf="@+id/chapter_date"
         app:layout_constraintRight_toLeftOf="@+id/chapter_menu"
-/>
+        android:layout_marginLeft="16dp"/>
 
     <TextView
         android:id="@+id/chapter_date"
@@ -40,9 +42,9 @@
         tools:text="22/02/2016"
         android:ellipsize="marquee"
         android:maxLines="1"
-        app:layout_constraintLeft_toLeftOf="@+id/guideline3"
+        app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintBottom_toBottomOf="parent"
-        />
+        android:layout_marginLeft="16dp"/>
 
     <TextView
         android:id="@+id/chapter_pages"
@@ -54,22 +56,20 @@
         android:maxLines="1"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintLeft_toLeftOf="parent"
-        />
+        app:layout_constraintLeft_toLeftOf="parent"/>
 
     <ImageView
         android:id="@+id/chapter_menu"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         app:srcCompat="@drawable/ic_more_horiz_black_24dp"
-        app:layout_constraintRight_toLeftOf="@+id/guideline4"
+        app:layout_constraintRight_toLeftOf="parent"
         app:layout_constraintTop_toTopOf="parent"
         android:paddingStart="12dp"
-        android:paddingEnd="0dp"
+        android:paddingEnd="12dp"
         android:paddingBottom="12dp"
         android:paddingTop="12dp"
-        android:contentDescription="@string/description_cover"
-        />
+        android:contentDescription="@string/description_cover"/>
 
     <TextView
         android:id="@+id/download_text"
@@ -78,24 +78,8 @@
         android:layout_height="wrap_content"
         tools:text="DOWNLOADED"
         android:textAllCaps="true"
-        app:layout_constraintRight_toLeftOf="@+id/guideline4"
+        app:layout_constraintRight_toLeftOf="parent"
         app:layout_constraintBottom_toBottomOf="parent"
-        />
-
-    <android.support.constraint.Guideline
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:id="@+id/guideline3"
-        android:orientation="vertical"
-        app:layout_constraintGuide_begin="16dp"
-      />
-
-    <android.support.constraint.Guideline
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:id="@+id/guideline4"
-        android:orientation="vertical"
-        app:layout_constraintGuide_end="16dp"
-     />
+        android:layout_marginRight="16dp"/>
 
 </android.support.constraint.ConstraintLayout>