Compare commits

..

3 Commits

Author SHA1 Message Date
Pupil
3159c343c1 Merge pull request #34 from tom5079/development
Version 4.2-beta1
2019-12-13 20:10:55 +09:00
tom5079
678a8f0914 Merge pull request #21 from tom5079/development
Fixed bug with missing hash
2019-11-02 21:46:11 +09:00
tom5079
f2a2656837 Merge pull request #20 from tom5079/development
Development
2019-11-02 20:30:04 +09:00
8 changed files with 25 additions and 24 deletions

View File

@@ -14,7 +14,7 @@ android {
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 29 targetSdkVersion 29
versionCode 31 versionCode 31
versionName "4.2-beta2-hotfix1" versionName "4.2-beta1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true multiDexEnabled true
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
@@ -25,7 +25,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
} }
buildTypes.each { buildTypes.each {
it.buildConfigField('boolean', 'PRERELEASE', 'true') it.buildConfigField('boolean', 'PRERELEASE', 'false')
it.buildConfigField('boolean', 'CENSOR', 'false') it.buildConfigField('boolean', 'CENSOR', 'false')
} }
} }

View File

@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":31,"versionName":"4.2-beta2-hotfix1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] [{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":31,"versionName":"4.2-beta1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

View File

@@ -95,6 +95,7 @@ class GalleryBlockAdapter(private val glide: RequestManager, private val galleri
if (BuildConfig.CENSOR) if (BuildConfig.CENSOR)
override(5, 8) override(5, 8)
} }
.fitCenter()
.into(galleryblock_thumbnail) .into(galleryblock_thumbnail)
} }

View File

@@ -49,21 +49,17 @@ class ReaderAdapter(private val glide: RequestManager,
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.view as ImageView holder.view as ImageView
if (isFullScreen)
holder.view.layoutParams.height = RecyclerView.LayoutParams.MATCH_PARENT
else
holder.view.layoutParams.height = RecyclerView.LayoutParams.WRAP_CONTENT
glide glide
.load(File(getCachedGallery(holder.view.context, galleryID), images[position])) .load(File(getCachedGallery(holder.view.context, galleryID), images[position]))
.dontTransform()
.diskCacheStrategy(DiskCacheStrategy.NONE) .diskCacheStrategy(DiskCacheStrategy.NONE)
.skipMemoryCache(true) .skipMemoryCache(true)
.error(R.drawable.image_broken_variant) .error(R.drawable.image_broken_variant)
.dontTransform()
.apply { .apply {
if (BuildConfig.CENSOR) if (BuildConfig.CENSOR)
override(5, 8) override(5, 8)
} }
.fitCenter()
.into(holder.view) .into(holder.view)
} }

View File

@@ -39,6 +39,7 @@ class ThumbnailAdapter(private val glide: RequestManager, private val thumbnails
if (BuildConfig.CENSOR) if (BuildConfig.CENSOR)
override(5, 8) override(5, 8)
} }
.fitCenter()
.into(holder.view) .into(holder.view)
} }

View File

@@ -81,14 +81,9 @@ fun getOldReaderGalleries(context: Context) : List<File> {
if (!readerFile.exists()) if (!readerFile.exists())
return@let return@let
try { Json(JsonConfiguration.Stable).parseJson(readerFile.readText()).jsonObject.let { reader ->
Json(JsonConfiguration.Stable).parseJson(readerFile.readText()) if (!reader.contains("code"))
.jsonObject.let { reader -> oldGallery.add(gallery)
if (!reader.contains("code"))
oldGallery.add(gallery)
}
} catch (e: Exception) {
// do nothing
} }
} }
} }
@@ -114,8 +109,7 @@ fun updateOldReaderGalleries(context: Context) {
reader["code"] = when { reader["code"] = when {
(File(gallery, "images").list()?. (File(gallery, "images").list()?.
all { !it.endsWith("webp") } ?: return@forEach) && all { !it.endsWith("webp") } ?: return@forEach) &&
availableInHiyobi(gallery.name.toIntOrNull() ?: return@forEach) availableInHiyobi(gallery.name.toInt()) -> json.toJson(codeSerializer, Reader.Code.HIYOBI)
-> json.toJson(codeSerializer, Reader.Code.HIYOBI)
else -> json.toJson(codeSerializer, Reader.Code.HITOMI) else -> json.toJson(codeSerializer, Reader.Code.HITOMI)
} }

View File

@@ -26,11 +26,18 @@
android:background="@color/dark_gray" android:background="@color/dark_gray"
tools:context=".ui.ReaderActivity"> tools:context=".ui.ReaderActivity">
<androidx.recyclerview.widget.RecyclerView <LinearLayout
android:id="@+id/reader_recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/> android:layout_gravity="center_vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/reader_recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -22,4 +22,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="100dp" android:minHeight="100dp"
android:paddingBottom="8dp"/> android:paddingBottom="8dp"
android:scaleType="fitCenter"
android:adjustViewBounds="true"/>