incognito
This commit is contained in:
parent
c1a0eeb361
commit
e77ab2800a
9 changed files with 119 additions and 33 deletions
|
@ -998,7 +998,9 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
preloading = false
|
||||
val context = this
|
||||
|
||||
if (isOnline(context) && Discord.token != null) {
|
||||
val incognito = this.getSharedPreferences("Dantotsu", MODE_PRIVATE)
|
||||
.getBoolean("incognito", false)
|
||||
if (isOnline(context) && Discord.token != null && !incognito) {
|
||||
lifecycleScope.launch {
|
||||
val presence = RPC.createPresence(RPC.Companion.RPCData(
|
||||
applicationId = Discord.application_Id,
|
||||
|
@ -1158,6 +1160,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
if (showProgressDialog && Anilist.userid != null && if (media.isAdult) settings.updateForH else true)
|
||||
AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.auto_update, media.userPreferredName))
|
||||
.setMessage(getString(R.string.incognito_will_not_update))
|
||||
.apply {
|
||||
setOnCancelListener { hideSystemBars() }
|
||||
setCancelable(false)
|
||||
|
|
|
@ -12,6 +12,7 @@ import android.view.*
|
|||
import android.view.KeyEvent.*
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import android.widget.AdapterView
|
||||
import android.widget.CheckBox
|
||||
import androidx.activity.addCallback
|
||||
import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
@ -253,20 +254,22 @@ class MangaReaderActivity : AppCompatActivity() {
|
|||
showProgressDialog =
|
||||
if (settings.askIndividual) loadData<Boolean>("${media.id}_progressDialog") != true else false
|
||||
progressDialog =
|
||||
if (showProgressDialog && Anilist.userid != null && if (media.isAdult) settings.updateForH else true)
|
||||
if (showProgressDialog && Anilist.userid != null && if (media.isAdult) settings.updateForH else true) {
|
||||
val dialogView = layoutInflater.inflate(R.layout.item_custom_dialog, null)
|
||||
val checkbox = dialogView.findViewById<CheckBox>(R.id.dialog_checkbox)
|
||||
checkbox.text = getString(R.string.dont_ask_again, media.userPreferredName)
|
||||
checkbox.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) progressDialog = null
|
||||
saveData("${media.id}_progressDialog", isChecked)
|
||||
showProgressDialog = isChecked
|
||||
}
|
||||
AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.title_update_progress)).apply {
|
||||
setMultiChoiceItems(
|
||||
arrayOf(getString(R.string.dont_ask_again, media.userPreferredName)),
|
||||
booleanArrayOf(false)
|
||||
) { _, _, isChecked ->
|
||||
if (isChecked) progressDialog = null
|
||||
saveData("${media.id}_progressDialog", isChecked)
|
||||
showProgressDialog = isChecked
|
||||
}
|
||||
.setTitle(getString(R.string.title_update_progress))
|
||||
.setView(dialogView)
|
||||
.apply {
|
||||
setOnCancelListener { hideBars() }
|
||||
}
|
||||
else null
|
||||
} else null
|
||||
|
||||
//Chapter Change
|
||||
fun change(index: Int) {
|
||||
|
@ -329,7 +332,9 @@ class MangaReaderActivity : AppCompatActivity() {
|
|||
chaptersTitleArr.getOrNull(currentChapterIndex - 1) ?: ""
|
||||
applySettings()
|
||||
val context = this
|
||||
if (isOnline(context) && Discord.token != null) {
|
||||
val incognito = context.getSharedPreferences("Dantotsu", 0)
|
||||
?.getBoolean("incognito", false) ?: false
|
||||
if (isOnline(context) && Discord.token != null && !incognito) {
|
||||
lifecycleScope.launch {
|
||||
val presence = RPC.createPresence(
|
||||
RPC.Companion.RPCData(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue