From a5a12f8b3acd4b79500c8f4b8344ca382db9ef03 Mon Sep 17 00:00:00 2001 From: len Date: Sat, 20 May 2017 14:56:31 +0200 Subject: [PATCH] Add landscape layout for manga info. Fix portrait layout image paddings when the tab layout was expanded --- app/build.gradle | 2 +- .../ui/manga/info/MangaInfoController.kt | 12 +- .../res/layout-land/fragment_manga_info.xml | 229 ++++++++++++++++++ .../main/res/layout/fragment_manga_info.xml | 18 +- 4 files changed, 246 insertions(+), 15 deletions(-) create mode 100644 app/src/main/res/layout-land/fragment_manga_info.xml diff --git a/app/build.gradle b/app/build.gradle index c2e063e9c..8f98e5a8c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -222,7 +222,7 @@ dependencies { } buildscript { - ext.kotlin_version = '1.1.2' + ext.kotlin_version = '1.1.2-3' repositories { mavenCentral() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt index 9dcef5aea..547fc1c32 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt @@ -158,11 +158,13 @@ class MangaInfoController : NucleusController(), .centerCrop() .into(manga_cover) - Glide.with(context) - .load(manga) - .diskCacheStrategy(DiskCacheStrategy.RESULT) - .centerCrop() - .into(backdrop) + if (backdrop != null) { + Glide.with(context) + .load(manga) + .diskCacheStrategy(DiskCacheStrategy.RESULT) + .centerCrop() + .into(backdrop) + } } } } diff --git a/app/src/main/res/layout-land/fragment_manga_info.xml b/app/src/main/res/layout-land/fragment_manga_info.xml new file mode 100644 index 000000000..fa49622b5 --- /dev/null +++ b/app/src/main/res/layout-land/fragment_manga_info.xml @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_manga_info.xml b/app/src/main/res/layout/fragment_manga_info.xml index 3183d9925..614d255f1 100644 --- a/app/src/main/res/layout/fragment_manga_info.xml +++ b/app/src/main/res/layout/fragment_manga_info.xml @@ -15,12 +15,12 @@ android:layout_height="match_parent" xmlns:android="http://schemas.android.com/apk/res/android"> - + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginTop="16dp" + app:layout_constraintTop_toBottomOf="@+id/manga_cover"/> + app:layout_constraintRight_toLeftOf="@+id/guideline2" + app:layout_constraintDimensionRatio="h,2:3" + tools:background="@color/material_grey_700"/>