Minor changes

This commit is contained in:
len 2017-08-15 15:06:21 +02:00
parent a12a34e3bb
commit e8b432485d
4 changed files with 26 additions and 41 deletions

View File

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

View File

@ -31,7 +31,8 @@ class ChapterImpl : Chapter {
if (other == null || javaClass != other.javaClass) return false if (other == null || javaClass != other.javaClass) return false
val chapter = other as Chapter 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 return url == chapter.url && scanlator == chapter.scanlator
} }

View File

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

View File

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