Compare commits

..

7 Commits

Author SHA1 Message Date
Pupil
9922a9f82a Merge pull request #41 from tom5079/hotfix-40
Fixes #40
2019-12-19 09:37:23 +09:00
tom5079
445b9b4673 Fixes #40 2019-12-19 09:36:51 +09:00
tom5079
0ef7b358e0 Fixes #40 2019-12-19 09:33:10 +09:00
tom5079
2d3fb75576 Fixes wierd crash 2019-12-14 17:04:43 +09:00
tom5079
d55ff6d68e Fixes wierd crash 2019-12-14 17:04:04 +09:00
Pupil
079654a9c7 Merge pull request #36 from tom5079/Pupil-35
fixes #35
2019-12-14 16:56:58 +09:00
tom5079
30263c6260 fixes #35
warning: this can cause OOM
2019-12-14 16:54:59 +09:00
8 changed files with 24 additions and 25 deletions

View File

@@ -14,7 +14,7 @@ android {
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 29 targetSdkVersion 29
versionCode 31 versionCode 31
versionName "4.2-beta1" versionName "4.2-beta2-hotfix1"
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', 'false') it.buildConfigField('boolean', 'PRERELEASE', 'true')
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-beta1","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-beta2-hotfix1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

View File

@@ -95,7 +95,6 @@ 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,17 +49,21 @@ 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,7 +39,6 @@ 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,9 +81,14 @@ fun getOldReaderGalleries(context: Context) : List<File> {
if (!readerFile.exists()) if (!readerFile.exists())
return@let return@let
Json(JsonConfiguration.Stable).parseJson(readerFile.readText()).jsonObject.let { reader -> try {
if (!reader.contains("code")) Json(JsonConfiguration.Stable).parseJson(readerFile.readText())
oldGallery.add(gallery) .jsonObject.let { reader ->
if (!reader.contains("code"))
oldGallery.add(gallery)
}
} catch (e: Exception) {
// do nothing
} }
} }
} }
@@ -109,7 +114,8 @@ 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.toInt()) -> json.toJson(codeSerializer, Reader.Code.HIYOBI) availableInHiyobi(gallery.name.toIntOrNull() ?: return@forEach)
-> json.toJson(codeSerializer, Reader.Code.HIYOBI)
else -> json.toJson(codeSerializer, Reader.Code.HITOMI) else -> json.toJson(codeSerializer, Reader.Code.HITOMI)
} }

View File

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