Compare commits
3 Commits
4.2-beta2-
...
4.2-beta1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3159c343c1 | ||
|
|
678a8f0914 | ||
|
|
f2a2656837 |
@@ -14,7 +14,7 @@ android {
|
|||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 31
|
versionCode 31
|
||||||
versionName "4.2-beta2-hotfix2"
|
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')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,12 +55,12 @@ dependencies {
|
|||||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0'
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation "androidx.biometric:biometric:1.0.1"
|
implementation "androidx.biometric:biometric:1.0.0"
|
||||||
implementation 'com.android.support:multidex:1.0.3'
|
implementation 'com.android.support:multidex:1.0.3'
|
||||||
implementation "com.daimajia.swipelayout:library:1.2.0@aar"
|
implementation "com.daimajia.swipelayout:library:1.2.0@aar"
|
||||||
implementation 'com.google.android.material:material:1.2.0-alpha03'
|
implementation 'com.google.android.material:material:1.2.0-alpha02'
|
||||||
implementation 'com.google.firebase:firebase-core:17.2.1'
|
implementation 'com.google.firebase:firebase-core:17.2.1'
|
||||||
implementation 'com.google.firebase:firebase-perf:19.0.4'
|
implementation 'com.google.firebase:firebase-perf:19.0.3'
|
||||||
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
|
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
|
||||||
implementation 'com.github.arimorty:floatingsearchview:2.1.1'
|
implementation 'com.github.arimorty:floatingsearchview:2.1.1'
|
||||||
implementation 'com.github.clans:fab:1.6.4'
|
implementation 'com.github.clans:fab:1.6.4'
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":31,"versionName":"4.2-beta2-hotfix2","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":{}}]
|
||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,21 +20,16 @@ package xyz.quaver.pupil.util
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.os.Build
|
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import java.util.*
|
|
||||||
import kotlin.collections.ArrayList
|
|
||||||
|
|
||||||
//Android Q+ uses scoped storage thus not requiring permission
|
|
||||||
fun Context.hasPermission(permission: String) =
|
fun Context.hasPermission(permission: String) =
|
||||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q || ContextCompat.checkSelfPermission(this, permission) == PackageManager.PERMISSION_GRANTED
|
ContextCompat.checkSelfPermission(this, permission) == PackageManager.PERMISSION_GRANTED
|
||||||
|
|
||||||
@UseExperimental(ExperimentalStdlibApi::class)
|
|
||||||
fun String.wordCapitalize() : String {
|
fun String.wordCapitalize() : String {
|
||||||
val result = ArrayList<String>()
|
val result = ArrayList<String>()
|
||||||
|
|
||||||
for (word in this.split(" "))
|
for (word in this.split(" "))
|
||||||
result.add(word.capitalize(Locale.getDefault()))
|
result.add(word.capitalize())
|
||||||
|
|
||||||
return result.joinToString(" ")
|
return result.joinToString(" ")
|
||||||
}
|
}
|
||||||
@@ -81,15 +81,10 @@ 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())
|
|
||||||
.jsonObject.let { reader ->
|
|
||||||
if (!reader.contains("code"))
|
if (!reader.contains("code"))
|
||||||
oldGallery.add(gallery)
|
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,12 +26,19 @@
|
|||||||
android:background="@color/dark_gray"
|
android:background="@color/dark_gray"
|
||||||
tools:context=".ui.ReaderActivity">
|
tools:context=".ui.ReaderActivity">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/reader_recyclerview"
|
android:id="@+id/reader_recyclerview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
@@ -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"/>
|
||||||
@@ -7,7 +7,7 @@ dependencies {
|
|||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.1'
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.1'
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.14.0"
|
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.14.0"
|
||||||
implementation 'org.jsoup:jsoup:1.12.1'
|
implementation 'org.jsoup:jsoup:1.11.3'
|
||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user