Added missing files
This commit is contained in:
@@ -13,8 +13,13 @@ android {
|
||||
applicationId "xyz.quaver.pupil"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 29
|
||||
<<<<<<< HEAD
|
||||
versionCode 27
|
||||
versionName "3.2-beta2"
|
||||
=======
|
||||
versionCode 26
|
||||
versionName "3.2-beta"
|
||||
>>>>>>> origin/development
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
@@ -26,7 +31,10 @@ android {
|
||||
}
|
||||
buildTypes.each {
|
||||
it.buildConfigField('boolean', 'PRERELEASE', 'true')
|
||||
<<<<<<< HEAD
|
||||
it.buildConfigField('boolean', 'CENSOR', 'false')
|
||||
=======
|
||||
>>>>>>> origin/development
|
||||
}
|
||||
}
|
||||
kotlinOptions {
|
||||
@@ -56,9 +64,15 @@ dependencies {
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.0.0'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.android.support:multidex:1.0.3'
|
||||
<<<<<<< HEAD
|
||||
implementation 'com.google.android.material:material:1.1.0-alpha09'
|
||||
implementation 'com.google.firebase:firebase-core:17.1.0'
|
||||
implementation 'com.google.firebase:firebase-perf:19.0.0'
|
||||
=======
|
||||
implementation 'com.google.android.material:material:1.1.0-alpha08'
|
||||
implementation 'com.google.firebase:firebase-core:17.0.1'
|
||||
implementation 'com.google.firebase:firebase-perf:18.0.1'
|
||||
>>>>>>> origin/development
|
||||
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
|
||||
implementation 'com.github.arimorty:floatingsearchview:2.1.1'
|
||||
implementation 'com.github.clans:fab:1.6.4'
|
||||
@@ -67,7 +81,10 @@ dependencies {
|
||||
transitive = false
|
||||
}
|
||||
implementation 'com.andrognito.patternlockview:patternlockview:1.0.0'
|
||||
<<<<<<< HEAD
|
||||
implementation 'com.jsibbold:zoomage:1.3.0'
|
||||
=======
|
||||
>>>>>>> origin/development
|
||||
implementation "ru.noties.markwon:core:${markwonVersion}"
|
||||
kapt 'com.github.bumptech.glide:compiler:4.9.0'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
|
||||
@@ -41,7 +41,10 @@ import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.JsonConfiguration
|
||||
import xyz.quaver.hitomi.GalleryBlock
|
||||
import xyz.quaver.hitomi.Reader
|
||||
<<<<<<< HEAD
|
||||
import xyz.quaver.pupil.BuildConfig
|
||||
=======
|
||||
>>>>>>> origin/development
|
||||
import xyz.quaver.pupil.Pupil
|
||||
import xyz.quaver.pupil.R
|
||||
import xyz.quaver.pupil.types.Tag
|
||||
@@ -87,10 +90,13 @@ class GalleryBlockAdapter(private val glide: RequestManager, private val galleri
|
||||
.skipMemoryCache(true)
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||
.error(R.drawable.image_broken_variant)
|
||||
<<<<<<< HEAD
|
||||
.apply {
|
||||
if (BuildConfig.CENSOR)
|
||||
override(5, 8)
|
||||
}
|
||||
=======
|
||||
>>>>>>> origin/development
|
||||
.into(galleryblock_thumbnail)
|
||||
}
|
||||
|
||||
|
||||
@@ -18,19 +18,30 @@
|
||||
|
||||
package xyz.quaver.pupil.adapters
|
||||
|
||||
<<<<<<< HEAD
|
||||
import android.graphics.drawable.Drawable
|
||||
=======
|
||||
>>>>>>> origin/development
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.bumptech.glide.RequestManager
|
||||
<<<<<<< HEAD
|
||||
import com.bumptech.glide.load.DataSource
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.bumptech.glide.load.engine.GlideException
|
||||
import com.bumptech.glide.request.RequestListener
|
||||
import com.bumptech.glide.request.target.Target
|
||||
import xyz.quaver.pupil.BuildConfig
|
||||
=======
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
>>>>>>> origin/development
|
||||
import xyz.quaver.pupil.R
|
||||
import xyz.quaver.pupil.util.getCachedGallery
|
||||
import java.io.File
|
||||
@@ -39,8 +50,14 @@ class ReaderAdapter(private val glide: RequestManager,
|
||||
private val galleryID: Int,
|
||||
private val images: List<String>) : RecyclerView.Adapter<ReaderAdapter.ViewHolder>() {
|
||||
|
||||
<<<<<<< HEAD
|
||||
var isFullScreen = false
|
||||
private var prev : Drawable? = null
|
||||
=======
|
||||
class ReaderAdapter(private val glide: RequestManager, private val images: List<String>) : RecyclerView.Adapter<ReaderAdapter.ViewHolder>() {
|
||||
|
||||
var isFullScreen = false
|
||||
>>>>>>> origin/development
|
||||
|
||||
class ViewHolder(val view: View) : RecyclerView.ViewHolder(view)
|
||||
|
||||
@@ -53,6 +70,7 @@ class ReaderAdapter(private val glide: RequestManager,
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
<<<<<<< HEAD
|
||||
holder.view as ImageView
|
||||
|
||||
glide
|
||||
@@ -88,6 +106,21 @@ class ReaderAdapter(private val glide: RequestManager,
|
||||
}
|
||||
})
|
||||
.into(holder.view)
|
||||
=======
|
||||
runBlocking {
|
||||
CoroutineScope(Dispatchers.Default).launch {
|
||||
val image = glide
|
||||
.load(images[position])
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||
.skipMemoryCache(true)
|
||||
.error(R.drawable.image_broken_variant)
|
||||
.submit()
|
||||
.get()
|
||||
|
||||
(holder.view as ImageView).setImageDrawable(image)
|
||||
}.join()
|
||||
}
|
||||
>>>>>>> origin/development
|
||||
}
|
||||
|
||||
override fun getItemCount() = images.size
|
||||
|
||||
@@ -22,7 +22,10 @@ import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.bumptech.glide.RequestManager
|
||||
<<<<<<< HEAD
|
||||
import xyz.quaver.pupil.BuildConfig
|
||||
=======
|
||||
>>>>>>> origin/development
|
||||
|
||||
class ThumbnailAdapter(private val glide: RequestManager, private val thumbnails: List<String>) : RecyclerView.Adapter<ThumbnailAdapter.ViewHolder>() {
|
||||
|
||||
@@ -35,10 +38,13 @@ class ThumbnailAdapter(private val glide: RequestManager, private val thumbnails
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
glide
|
||||
.load(thumbnails[position])
|
||||
<<<<<<< HEAD
|
||||
.apply {
|
||||
if (BuildConfig.CENSOR)
|
||||
override(5, 8)
|
||||
}
|
||||
=======
|
||||
>>>>>>> origin/development
|
||||
.into(holder.view)
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,14 @@ import kotlinx.serialization.ImplicitReflectionSerializer
|
||||
import xyz.quaver.pupil.Pupil
|
||||
import xyz.quaver.pupil.R
|
||||
import xyz.quaver.pupil.adapters.ReaderAdapter
|
||||
<<<<<<< HEAD:app/src/main/java/xyz/quaver/pupil/ui/ReaderActivity.kt
|
||||
import xyz.quaver.pupil.util.*
|
||||
=======
|
||||
import xyz.quaver.pupil.util.GalleryDownloader
|
||||
import xyz.quaver.pupil.util.Histories
|
||||
import xyz.quaver.pupil.util.ItemClickSupport
|
||||
import xyz.quaver.pupil.util.hasPermission
|
||||
>>>>>>> origin/development:app/src/main/java/xyz/quaver/pupil/ReaderActivity.kt
|
||||
|
||||
class ReaderActivity : AppCompatActivity() {
|
||||
|
||||
@@ -218,6 +225,7 @@ class ReaderActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
<<<<<<< HEAD:app/src/main/java/xyz/quaver/pupil/ui/ReaderActivity.kt
|
||||
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
|
||||
//currentPage is 1-based
|
||||
return when(keyCode) {
|
||||
@@ -235,6 +243,8 @@ class ReaderActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
=======
|
||||
>>>>>>> origin/development:app/src/main/java/xyz/quaver/pupil/ReaderActivity.kt
|
||||
private fun initDownloader() {
|
||||
var d: GalleryDownloader? = GalleryDownloader.get(galleryID)
|
||||
|
||||
@@ -277,12 +287,16 @@ class ReaderActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
onErrorHandler = {
|
||||
<<<<<<< HEAD:app/src/main/java/xyz/quaver/pupil/ui/ReaderActivity.kt
|
||||
Snackbar
|
||||
.make(reader_layout, it.message ?: it.javaClass.name, Snackbar.LENGTH_INDEFINITE)
|
||||
.setAction(R.string.reader_help) { view ->
|
||||
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.error_help))))
|
||||
}
|
||||
.show()
|
||||
=======
|
||||
Snackbar.make(reader_layout, it.message ?: it.javaClass.name, Snackbar.LENGTH_INDEFINITE).show()
|
||||
>>>>>>> origin/development:app/src/main/java/xyz/quaver/pupil/ReaderActivity.kt
|
||||
downloader.download = false
|
||||
}
|
||||
onCompleteHandler = {
|
||||
@@ -330,7 +344,11 @@ class ReaderActivity : AppCompatActivity() {
|
||||
|
||||
private fun initView() {
|
||||
with(reader_recyclerview) {
|
||||
<<<<<<< HEAD:app/src/main/java/xyz/quaver/pupil/ui/ReaderActivity.kt
|
||||
adapter = ReaderAdapter(Glide.with(this@ReaderActivity), galleryID, images)
|
||||
=======
|
||||
adapter = ReaderAdapter(Glide.with(this@ReaderActivity), images)
|
||||
>>>>>>> origin/development:app/src/main/java/xyz/quaver/pupil/ReaderActivity.kt
|
||||
|
||||
addOnScrollListener(object: RecyclerView.OnScrollListener() {
|
||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
@@ -360,7 +378,11 @@ class ReaderActivity : AppCompatActivity() {
|
||||
scrollMode(false)
|
||||
fullscreen(true)
|
||||
} else {
|
||||
<<<<<<< HEAD:app/src/main/java/xyz/quaver/pupil/ui/ReaderActivity.kt
|
||||
(reader_recyclerview.layoutManager as LinearLayoutManager?)?.scrollToPosition(currentPage) //Moves to next page because currentPage is 1-based indexing
|
||||
=======
|
||||
(reader_recyclerview.layoutManager as LinearLayoutManager?)?.scrollToPosition(currentPage)
|
||||
>>>>>>> origin/development:app/src/main/java/xyz/quaver/pupil/ReaderActivity.kt
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -368,6 +390,7 @@ class ReaderActivity : AppCompatActivity() {
|
||||
with(reader_fab_download) {
|
||||
setImageResource(R.drawable.ic_download)
|
||||
setOnClickListener {
|
||||
<<<<<<< HEAD:app/src/main/java/xyz/quaver/pupil/ui/ReaderActivity.kt
|
||||
|
||||
if (!this@ReaderActivity.hasPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
|
||||
AlertDialog.Builder(this@ReaderActivity).apply {
|
||||
@@ -381,6 +404,21 @@ class ReaderActivity : AppCompatActivity() {
|
||||
|
||||
downloader.download = !downloader.download
|
||||
|
||||
=======
|
||||
|
||||
if (!this@ReaderActivity.hasPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
|
||||
AlertDialog.Builder(this@ReaderActivity).apply {
|
||||
setTitle(R.string.warning)
|
||||
setMessage(R.string.update_no_permission)
|
||||
setPositiveButton(android.R.string.ok) { _, _ -> }
|
||||
}.show()
|
||||
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
downloader.download = !downloader.download
|
||||
|
||||
>>>>>>> origin/development:app/src/main/java/xyz/quaver/pupil/ReaderActivity.kt
|
||||
if (!downloader.download)
|
||||
downloader.clearNotification()
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ import xyz.quaver.pupil.util.Lock
|
||||
import xyz.quaver.pupil.util.LockManager
|
||||
import xyz.quaver.pupil.util.getDownloadDirectory
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
class SettingsActivity : AppCompatActivity() {
|
||||
|
||||
@@ -279,7 +278,7 @@ class SettingsActivity : AppCompatActivity() {
|
||||
s ?: return
|
||||
|
||||
if (s.any { it.isUpperCase() })
|
||||
s.replace(0, s.length, s.toString().toLowerCase(Locale.getDefault()))
|
||||
s.replace(0, s.length, s.toString().toLowerCase())
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -353,38 +352,6 @@ class SettingsActivity : AppCompatActivity() {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
with(findPreference<Preference>("nomedia")) {
|
||||
this!!
|
||||
|
||||
onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue ->
|
||||
val directories = listOf(
|
||||
context.cacheDir,
|
||||
getDownloadDirectory(context)
|
||||
)
|
||||
|
||||
when (newValue as Boolean) {
|
||||
true -> {
|
||||
directories.forEach {
|
||||
it ?: return@forEach
|
||||
|
||||
if (it.exists())
|
||||
File(it, ".nomedia").createNewFile()
|
||||
}
|
||||
}
|
||||
false -> {
|
||||
directories.forEach {
|
||||
it ?: return@forEach
|
||||
|
||||
if (it.exists())
|
||||
File(it, ".nomedia").delete()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,15 +63,24 @@ class GalleryDownloader(
|
||||
field = true
|
||||
notificationManager.notify(galleryID, notificationBuilder.build())
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (reader?.isActive == false && downloadJob?.isActive != true) {
|
||||
val data = File(getDownloadDirectory(this), galleryID.toString())
|
||||
val cache = File(cacheDir, "imageCache/$galleryID")
|
||||
=======
|
||||
val data = getCachedGallery(this, galleryID)
|
||||
val cache = File(cacheDir, "imageCache/$galleryID")
|
||||
>>>>>>> origin/development
|
||||
|
||||
if (File(cache, "images").exists() && !data.exists()) {
|
||||
cache.copyRecursively(data, true)
|
||||
cache.deleteRecursively()
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
if (reader?.isActive == false && downloadJob?.isActive != true)
|
||||
>>>>>>> origin/development
|
||||
field = false
|
||||
}
|
||||
|
||||
@@ -170,8 +179,11 @@ class GalleryDownloader(
|
||||
downloadJob = CoroutineScope(Dispatchers.Default).launch {
|
||||
val reader = reader!!.await()
|
||||
|
||||
<<<<<<< HEAD
|
||||
notificationBuilder.setContentTitle(reader.title)
|
||||
|
||||
=======
|
||||
>>>>>>> origin/development
|
||||
if (reader.readerItems.isEmpty()) {
|
||||
onErrorHandler?.invoke(IOException(getString(R.string.unable_to_connect)))
|
||||
return@launch
|
||||
@@ -320,6 +332,14 @@ class GalleryDownloader(
|
||||
setProgress(0, 0, true)
|
||||
priority = NotificationCompat.PRIORITY_LOW
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
CoroutineScope(Dispatchers.Default).launch {
|
||||
while (reader == null) ;
|
||||
notificationBuilder.setContentTitle(reader.await().title)
|
||||
}
|
||||
>>>>>>> origin/development
|
||||
}
|
||||
|
||||
}
|
||||
@@ -70,7 +70,11 @@
|
||||
<string name="settings_app_lock">アプリロック</string>
|
||||
<string name="settings_app_lock_type">アップロックの種類</string>
|
||||
<string name="settings_app_version_title">バージョン</string>
|
||||
<<<<<<< HEAD
|
||||
<string name="settings_lock_biometrics">生体認識</string>
|
||||
=======
|
||||
<string name="settings_lock_biomatrics">生体認識</string>
|
||||
>>>>>>> origin/development
|
||||
<string name="settings_lock_confirm">ロック確認のためもう一回入力してください。</string>
|
||||
<string name="settings_lock_enabled">有効</string>
|
||||
<string name="settings_lock_fingerprint">指紋</string>
|
||||
@@ -99,7 +103,10 @@
|
||||
<string name="gallery_tags">タグ</string>
|
||||
<string name="gallery_thumbnails">サムネイル</string>
|
||||
<string name="gallery_related">おすすめ</string>
|
||||
<<<<<<< HEAD
|
||||
<string name="settings_nomedia_summary">イメージを隠す</string>
|
||||
<string name="settings_nomedia_title">イメージをギャラリーから見えなくする</string>
|
||||
<string name="reader_help">ヘルプ</string>
|
||||
=======
|
||||
>>>>>>> origin/development
|
||||
</resources>
|
||||
@@ -70,7 +70,11 @@
|
||||
<string name="settings_app_lock">앱 잠금</string>
|
||||
<string name="settings_app_lock_type">앱 잠금 종류</string>
|
||||
<string name="settings_app_version_title">앱 버전</string>
|
||||
<<<<<<< HEAD
|
||||
<string name="settings_lock_biometrics">생체 인식</string>
|
||||
=======
|
||||
<string name="settings_lock_biomatrics">생체 인식</string>
|
||||
>>>>>>> origin/development
|
||||
<string name="settings_lock_confirm">잠금 확인을 위해 한번 더 입력해주세요</string>
|
||||
<string name="settings_lock_enabled">사용 중</string>
|
||||
<string name="settings_lock_fingerprint">지문</string>
|
||||
@@ -99,7 +103,10 @@
|
||||
<string name="gallery_tags">태그</string>
|
||||
<string name="gallery_related">관련 갤러리</string>
|
||||
<string name="gallery_thumbnails">미리보기</string>
|
||||
<<<<<<< HEAD
|
||||
<string name="settings_nomedia_summary">이미지 숨기기</string>
|
||||
<string name="settings_nomedia_title">갤러리에서 이미지 검색이 되지 않도록 합니다</string>
|
||||
<string name="reader_help">도움말</string>
|
||||
=======
|
||||
>>>>>>> origin/development
|
||||
</resources>
|
||||
@@ -127,14 +127,21 @@
|
||||
<string name="settings_security_mode_summary">Enable security mode to make the screen invisible on recent app window</string>
|
||||
<string name="settings_dark_mode_title">Dark mode</string>
|
||||
<string name="settings_dark_mode_summary">Protect yourself against light attacks!</string>
|
||||
<<<<<<< HEAD
|
||||
<string name="settings_nomedia_title">Hide image from gallery</string>
|
||||
<string name="settings_nomedia_summary">Hides image from gallery</string>
|
||||
=======
|
||||
>>>>>>> origin/development
|
||||
|
||||
<string name="settings_lock_none">None</string>
|
||||
<string name="settings_lock_pattern">Pattern</string>
|
||||
<string name="settings_lock_pin" translatable="false">PIN</string>
|
||||
<string name="settings_lock_password">Password</string>
|
||||
<<<<<<< HEAD
|
||||
<string name="settings_lock_biometrics">Biometrics</string>
|
||||
=======
|
||||
<string name="settings_lock_biomatrics">Biomatrics</string>
|
||||
>>>>>>> origin/development
|
||||
<string name="settings_lock_fingerprint">Fingerprint</string>
|
||||
<string name="settings_lock_enabled">Enabled</string>
|
||||
<string name="settings_lock_confirm">Input same lock once more to confirm Lock</string>
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
app:key="lock_password"/>
|
||||
|
||||
<PreferenceCategory
|
||||
<<<<<<< HEAD
|
||||
app:title="@string/settings_lock_biometrics">
|
||||
=======
|
||||
app:title="@string/settings_lock_biomatrics">
|
||||
>>>>>>> origin/development
|
||||
|
||||
<Preference
|
||||
app:title="@string/settings_lock_fingerprint"
|
||||
|
||||
@@ -69,11 +69,14 @@
|
||||
app:title="@string/settings_dark_mode_title"
|
||||
app:summary="@string/settings_dark_mode_summary"/>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<SwitchPreference
|
||||
app:key="nomedia"
|
||||
app:title="@string/settings_nomedia_title"
|
||||
app:summary="@string/settings_nomedia_title"/>
|
||||
|
||||
=======
|
||||
>>>>>>> origin/development
|
||||
</PreferenceCategory>
|
||||
|
||||
</androidx.preference.PreferenceScreen>
|
||||
|
||||
Reference in New Issue
Block a user