mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 05:25:08 +01:00
Part 2 of incognito (Enabling)
For this, i've finally changed the settings button in the 3 main tabs to more button, which opens a custom dialog with a toggle for incognito, settings, about, and help Also we're now at 4* animations this release
This commit is contained in:
parent
28f1be6cb7
commit
0042052458
@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.ui.main
|
||||
|
||||
import android.animation.AnimatorSet
|
||||
import android.animation.ValueAnimator
|
||||
import android.app.Dialog
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.graphics.Rect
|
||||
@ -29,8 +30,6 @@ import com.bluelinelabs.conductor.Conductor
|
||||
import com.bluelinelabs.conductor.Controller
|
||||
import com.bluelinelabs.conductor.ControllerChangeHandler
|
||||
import com.bluelinelabs.conductor.Router
|
||||
import com.bluelinelabs.conductor.RouterTransaction
|
||||
import com.bluelinelabs.conductor.changehandler.FadeChangeHandler
|
||||
import com.getkeepsafe.taptargetview.TapTarget
|
||||
import com.getkeepsafe.taptargetview.TapTargetView
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
@ -112,6 +111,7 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
|
||||
private val updateChecker by lazy { UpdateChecker.getUpdateChecker() }
|
||||
private val isUpdaterEnabled = BuildConfig.INCLUDE_UPDATER
|
||||
var tabAnimation: ValueAnimator? = null
|
||||
var overflowDialog: Dialog? = null
|
||||
|
||||
fun setUndoSnackBar(snackBar: Snackbar?, extraViewToCheck: View? = null) {
|
||||
this.snackBar = snackBar
|
||||
@ -548,6 +548,8 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
overflowDialog?.dismiss()
|
||||
overflowDialog = null
|
||||
DownloadService.removeListener(this)
|
||||
if (isBindingInitialized) {
|
||||
binding.toolbar.setNavigationOnClickListener(null)
|
||||
@ -609,18 +611,28 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
// Initialize option to open catalogue settings.
|
||||
R.id.action_settings -> {
|
||||
router.pushController(
|
||||
(RouterTransaction.with(SettingsMainController())).popChangeHandler(
|
||||
FadeChangeHandler()
|
||||
).pushChangeHandler(FadeChangeHandler())
|
||||
)
|
||||
R.id.action_more -> {
|
||||
if (overflowDialog != null) return false
|
||||
val overflowDialog = OverflowDialog(this)
|
||||
this.overflowDialog = overflowDialog
|
||||
overflowDialog.setOnDismissListener {
|
||||
this.overflowDialog = null
|
||||
}
|
||||
overflowDialog.show()
|
||||
}
|
||||
else -> return super.onOptionsItemSelected(item)
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
fun showSettings() {
|
||||
router.pushController(SettingsMainController().withFadeTransaction())
|
||||
}
|
||||
|
||||
fun showAbout() {
|
||||
router.pushController(AboutController().withFadeTransaction())
|
||||
}
|
||||
|
||||
override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
|
||||
gestureDetector?.onTouchEvent(ev)
|
||||
if (ev?.action == MotionEvent.ACTION_DOWN) {
|
||||
|
@ -0,0 +1,94 @@
|
||||
package eu.kanade.tachiyomi.ui.main
|
||||
|
||||
import android.app.Dialog
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.AnimatedVectorDrawable
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import eu.kanade.tachiyomi.BuildConfig
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.data.preference.toggle
|
||||
import eu.kanade.tachiyomi.databinding.TachiOverflowLayoutBinding
|
||||
import eu.kanade.tachiyomi.util.lang.withSubtitle
|
||||
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||
import eu.kanade.tachiyomi.util.system.openInBrowser
|
||||
import eu.kanade.tachiyomi.util.view.updateLayoutParams
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
class OverflowDialog(activity: MainActivity) : Dialog(activity, R.style.OverflowDialogTheme) {
|
||||
|
||||
val binding = TachiOverflowLayoutBinding.inflate(activity.layoutInflater, null, false)
|
||||
val preferences: PreferencesHelper by injectLazy()
|
||||
|
||||
init {
|
||||
setContentView(binding.root)
|
||||
|
||||
binding.touchOutside.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
val incogText = context.getString(R.string.incognito_mode)
|
||||
with(binding.incognitoModeItem) {
|
||||
val titleText = context.getString(
|
||||
if (preferences.incognitoMode().get()) R.string.turn_off_
|
||||
else R.string.turn_on_,
|
||||
incogText
|
||||
)
|
||||
val subtitleText = context.getString(R.string.pauses_reading_history)
|
||||
text = titleText.withSubtitle(context, subtitleText)
|
||||
setIcon(
|
||||
if (preferences.incognitoMode().get()) R.drawable.ic_incognito_24dp
|
||||
else R.drawable.ic_glasses_24dp
|
||||
)
|
||||
setOnClickListener {
|
||||
preferences.incognitoMode().toggle()
|
||||
val incog = preferences.incognitoMode().get()
|
||||
val newTitle = context.getString(
|
||||
if (incog) R.string.turn_off_
|
||||
else R.string.turn_on_,
|
||||
incogText
|
||||
)
|
||||
text = newTitle.withSubtitle(context, subtitleText)
|
||||
setIcon(
|
||||
if (incog) R.drawable.anim_read_to_incog
|
||||
else R.drawable.anim_incog_to_read
|
||||
)
|
||||
(getIcon() as? AnimatedVectorDrawable)?.start()
|
||||
}
|
||||
}
|
||||
binding.settingsItem.setOnClickListener {
|
||||
activity.showSettings()
|
||||
dismiss()
|
||||
}
|
||||
|
||||
binding.helpItem.setOnClickListener {
|
||||
activity.openInBrowser(URL_HELP)
|
||||
dismiss()
|
||||
}
|
||||
|
||||
binding.aboutItem.text = context.getString(R.string.about).withSubtitle(context, "v${BuildConfig.VERSION_NAME}")
|
||||
|
||||
binding.aboutItem.setOnClickListener {
|
||||
activity.showAbout()
|
||||
dismiss()
|
||||
}
|
||||
|
||||
binding.overflowCardView.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||
topMargin = activity.binding.toolbar.height - 2.dpToPx
|
||||
}
|
||||
window?.let { window ->
|
||||
window.navigationBarColor = Color.TRANSPARENT
|
||||
window.decorView.fitsSystemWindows = true
|
||||
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility
|
||||
.rem(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR)
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility
|
||||
.rem(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private companion object {
|
||||
private const val URL_HELP = "https://tachiyomi.org/help/"
|
||||
}
|
||||
}
|
@ -99,6 +99,17 @@ fun String.indexesOf(substr: String, ignoreCase: Boolean = true): List<Int> {
|
||||
}
|
||||
}
|
||||
|
||||
fun String.withSubtitle(context: Context, subtitle: String): Spanned {
|
||||
val spannable = SpannableStringBuilder(this + "\n" + subtitle)
|
||||
spannable.setSpan(
|
||||
ForegroundColorSpan(context.getResourceColor(android.R.attr.textColorSecondary)),
|
||||
this.length + 1,
|
||||
spannable.length,
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
return spannable
|
||||
}
|
||||
|
||||
fun String.addBetaTag(context: Context): Spanned {
|
||||
val betaText = context.getString(R.string.beta)
|
||||
val betaSpan = SpannableStringBuilder(this + betaText)
|
||||
|
11
app/src/main/res/anim/fade_in_grow_from_top.xml
Normal file
11
app/src/main/res/anim/fade_in_grow_from_top.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false">
|
||||
<scale android:interpolator="@android:anim/decelerate_interpolator"
|
||||
android:fromXScale="0.9" android:toXScale="1.0"
|
||||
android:fromYScale="0.9" android:toYScale="1.0"
|
||||
android:pivotX="100%" android:pivotY="0%"
|
||||
android:duration="220" />
|
||||
<alpha android:interpolator="@android:anim/decelerate_interpolator"
|
||||
android:fromAlpha="0.0" android:toAlpha="1.0"
|
||||
android:duration="150" />
|
||||
</set>
|
6
app/src/main/res/anim/fade_out_short.xml
Normal file
6
app/src/main/res/anim/fade_out_short.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false">
|
||||
<alpha android:interpolator="@android:anim/decelerate_interpolator"
|
||||
android:fromAlpha="1.0" android:toAlpha="0.0"
|
||||
android:duration="150" />
|
||||
</set>
|
46
app/src/main/res/drawable/anim_incog_to_read.xml
Normal file
46
app/src/main/res/drawable/anim_incog_to_read.xml
Normal file
@ -0,0 +1,46 @@
|
||||
<animated-vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt">
|
||||
<aapt:attr name="android:drawable">
|
||||
<vector
|
||||
android:name="vector"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:name="path"
|
||||
android:pathData="M 17.1 13 C 17.887 13 18.618 13.253 19.224 13.685 C 20.235 14.405 20.9 15.624 20.9 17 C 20.9 17.073 20.898 17.146 20.894 17.219 C 20.786 19.318 19.127 21 17 21 L 17 21 C 15.768 21 14.707 20.414 14.001 19.526 C 13.504 18.901 13.183 18.126 13.1 17.3 C 12 16.6 11.1 17.1 10.8 17.3 C 10.701 18.337 10.261 19.253 9.587 19.913 C 8.897 20.59 7.963 21 6.9 21 L 6.9 21 C 5.591 21 4.399 20.301 3.686 19.241 C 3.256 18.601 3 17.829 3 17 C 3 16.116 3.291 15.296 3.782 14.632 C 4.496 13.665 5.633 13.028 6.914 13.001 C 6.942 13 6.971 13 7 13 C 8.391 13 9.662 13.776 10.353 14.96 C 10.556 15.308 10.709 15.691 10.8 16.1 C 11.5 15.8 12.3 15.7 13.3 16.1 C 13.42 15.558 13.64 15.062 13.941 14.632 C 14.639 13.635 15.772 13 17.1 13 L 17.1 13 M 5.356 14.595 C 4.963 14.869 4.637 15.242 4.415 15.68 C 4.215 16.076 4.1 16.525 4.1 17 C 4.1 17.781 4.386 18.49 4.864 19.011 C 5.366 19.559 6.081 19.9 6.9 19.9 L 6.9 19.9 C 7.697 19.9 8.394 19.578 8.894 19.056 C 9.398 18.531 9.7 17.803 9.7 17 C 9.7 16.236 9.426 15.54 8.965 15.021 C 8.462 14.455 7.736 14.1 6.9 14.1 C 6.338 14.1 5.804 14.283 5.356 14.595 M 15.389 14.687 C 15.019 14.979 14.726 15.365 14.537 15.811 C 14.384 16.174 14.3 16.577 14.3 17 C 14.3 18.126 14.895 19.104 15.805 19.584 C 16.188 19.786 16.626 19.9 17.1 19.9 L 17.1 19.9 C 17.997 19.9 18.822 19.435 19.341 18.719 C 19.69 18.238 19.9 17.643 19.9 17 C 19.9 16.24 19.63 15.548 19.174 15.031 C 18.948 14.773 18.675 14.559 18.367 14.401 C 17.991 14.208 17.562 14.1 17.1 14.1 C 16.444 14.1 15.855 14.319 15.389 14.687"
|
||||
android:fillColor="#000"
|
||||
android:strokeWidth="1"/>
|
||||
<path
|
||||
android:name="path_1"
|
||||
android:pathData="M 22 10.5 L 2 10.5 L 2 12 L 22 12 L 22 10.5 M 15.5 2.6 C 15.3 2.1 14.7 1.8 14.2 2 L 12 2.8 L 9.8 2 L 9.7 2 C 9.2 1.9 8.6 2.2 8.4 2.7 L 6 9 L 18 9 L 15.5 2.6 Z"
|
||||
android:fillColor="#000"
|
||||
android:strokeWidth="1"/>
|
||||
</vector>
|
||||
</aapt:attr>
|
||||
<target android:name="path">
|
||||
<aapt:attr name="android:animation">
|
||||
<objectAnimator
|
||||
android:propertyName="pathData"
|
||||
android:startOffset="50"
|
||||
android:duration="400"
|
||||
android:valueFrom="M 17.1 13 C 17.887 13 18.618 13.253 19.224 13.685 C 20.235 14.405 20.9 15.624 20.9 17 C 20.9 17.073 20.898 17.146 20.894 17.219 C 20.786 19.318 19.127 21 17 21 L 17 21 C 15.768 21 14.707 20.414 14.001 19.526 C 13.504 18.901 13.183 18.126 13.1 17.3 C 12 16.6 11.1 17.1 10.8 17.3 C 10.701 18.337 10.261 19.253 9.587 19.913 C 8.897 20.59 7.963 21 6.9 21 L 6.9 21 C 5.591 21 4.399 20.301 3.686 19.241 C 3.256 18.601 3 17.829 3 17 C 3 16.116 3.291 15.296 3.782 14.632 C 4.496 13.665 5.633 13.028 6.914 13.001 C 6.942 13 6.971 13 7 13 C 8.391 13 9.662 13.776 10.353 14.96 C 10.556 15.308 10.709 15.691 10.8 16.1 C 11.5 15.8 12.3 15.7 13.3 16.1 C 13.42 15.558 13.64 15.062 13.941 14.632 C 14.639 13.635 15.772 13 17.1 13 L 17.1 13 M 5.356 14.595 C 4.963 14.869 4.637 15.242 4.415 15.68 C 4.215 16.076 4.1 16.525 4.1 17 C 4.1 17.781 4.386 18.49 4.864 19.011 C 5.366 19.559 6.081 19.9 6.9 19.9 L 6.9 19.9 C 7.697 19.9 8.394 19.578 8.894 19.056 C 9.398 18.531 9.7 17.803 9.7 17 C 9.7 16.236 9.426 15.54 8.965 15.021 C 8.462 14.455 7.736 14.1 6.9 14.1 C 6.338 14.1 5.804 14.283 5.356 14.595 M 15.389 14.687 C 15.019 14.979 14.726 15.365 14.537 15.811 C 14.384 16.174 14.3 16.577 14.3 17 C 14.3 18.126 14.895 19.104 15.805 19.584 C 16.188 19.786 16.626 19.9 17.1 19.9 L 17.1 19.9 C 17.997 19.9 18.822 19.435 19.341 18.719 C 19.69 18.238 19.9 17.643 19.9 17 C 19.9 16.24 19.63 15.548 19.174 15.031 C 18.948 14.773 18.675 14.559 18.367 14.401 C 17.991 14.208 17.562 14.1 17.1 14.1 C 16.444 14.1 15.855 14.319 15.389 14.687"
|
||||
android:valueTo="M 21 8 C 21.81 8 22.57 8.34 23.09 8.92 C 23.6 9.5 23.84 10.3 23.74 11.11 C 23.57 12.133 23.4 13.157 23.23 14.18 C 23.04 15.74 21.61 17 20 17 L 17 17 C 15.44 17 13.92 15.81 13.54 14.3 C 13.24 13.397 12.94 12.493 12.64 11.59 C 12.26 11.31 11.73 11.31 11.35 11.59 C 11.043 12.517 10.737 13.443 10.43 14.37 C 10.07 15.82 8.56 17 7 17 L 4 17 C 2.38 17 0.96 15.74 0.76 14.14 C 0.593 13.143 0.427 12.147 0.26 11.15 C 0.15 10.3 0.39 9.5 0.91 8.92 C 1.43 8.34 2.19 8 3 8 C 5 8 7 8 9 8 C 9.83 8 10.58 8.35 11.06 8.96 C 11.17 9.11 11.27 9.27 11.35 9.45 C 11.78 9.36 12.22 9.36 12.64 9.45 C 12.72 9.27 12.82 9.11 12.94 8.96 C 13.41 8.35 14.16 8 15 8 L 21 8 M 3 10 C 2.76 10 2.55 10.09 2.41 10.25 C 2.27 10.4 2.21 10.62 2.24 10.86 C 2.407 11.857 2.573 12.853 2.74 13.85 C 2.82 14.5 3.4 15 4 15 L 7 15 C 7.64 15 8.36 14.44 8.5 13.82 C 8.853 12.757 9.207 11.693 9.56 10.63 C 9.6 10.5 9.57 10.31 9.5 10.19 C 9.39 10.07 9.22 10 9 10 C 7 10 5 10 3 10 M 15 10 C 14.78 10 14.61 10.07 14.5 10.19 C 14.42 10.31 14.4 10.5 14.45 10.7 C 14.787 11.717 15.123 12.733 15.46 13.75 C 15.64 14.44 16.36 15 17 15 L 20 15 C 20.59 15 21.18 14.5 21.25 13.89 C 21.42 12.867 21.59 11.843 21.76 10.82 C 21.79 10.62 21.73 10.4 21.59 10.25 C 21.45 10.09 21.24 10 21 10 C 19 10 17 10 15 10 C 15 10 15 10 15 10"
|
||||
android:valueType="pathType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in"/>
|
||||
</aapt:attr>
|
||||
</target>
|
||||
<target android:name="path_1">
|
||||
<aapt:attr name="android:animation">
|
||||
<objectAnimator
|
||||
android:propertyName="fillAlpha"
|
||||
android:duration="300"
|
||||
android:valueFrom="1"
|
||||
android:valueTo="0"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in"/>
|
||||
</aapt:attr>
|
||||
</target>
|
||||
</animated-vector>
|
47
app/src/main/res/drawable/anim_read_to_incog.xml
Normal file
47
app/src/main/res/drawable/anim_read_to_incog.xml
Normal file
@ -0,0 +1,47 @@
|
||||
<animated-vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt">
|
||||
<aapt:attr name="android:drawable">
|
||||
<vector
|
||||
android:name="vector"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:name="path"
|
||||
android:pathData="M 3 10 C 2.76 10 2.55 10.09 2.41 10.25 C 2.27 10.4 2.21 10.62 2.24 10.86 L 2.74 13.85 C 2.82 14.5 3.4 15 4 15 L 7 15 C 7.64 15 8.36 14.44 8.5 13.82 L 9.56 10.63 C 9.6 10.5 9.57 10.31 9.5 10.19 C 9.39 10.07 9.22 10 9 10 L 3 10 M 7 17 L 4 17 C 2.38 17 0.96 15.74 0.76 14.14 L 0.26 11.15 C 0.15 10.3 0.39 9.5 0.91 8.92 C 1.43 8.34 2.19 8 3 8 L 9 8 C 9.83 8 10.58 8.35 11.06 8.96 C 11.17 9.11 11.27 9.27 11.35 9.45 C 11.78 9.36 12.22 9.36 12.64 9.45 C 12.72 9.27 12.82 9.11 12.94 8.96 C 13.41 8.35 14.16 8 15 8 L 21 8 C 21.81 8 22.57 8.34 23.09 8.92 C 23.6 9.5 23.84 10.3 23.74 11.11 L 23.23 14.18 C 23.04 15.74 21.61 17 20 17 L 17 17 C 15.44 17 13.92 15.81 13.54 14.3 L 12.64 11.59 C 12.26 11.31 11.73 11.31 11.35 11.59 L 10.43 14.37 C 10.07 15.82 8.56 17 7 17 M 15 10 C 14.78 10 14.61 10.07 14.5 10.19 C 14.42 10.31 14.4 10.5 14.45 10.7 L 15.46 13.75 C 15.64 14.44 16.36 15 17 15 L 20 15 C 20.59 15 21.18 14.5 21.25 13.89 L 21.76 10.82 C 21.79 10.62 21.73 10.4 21.59 10.25 C 21.45 10.09 21.24 10 21 10 L 15 10 Z"
|
||||
android:fillColor="#000"
|
||||
android:strokeWidth="1"/>
|
||||
<path
|
||||
android:name="path_1"
|
||||
android:pathData="M 22 10.5 L 2 10.5 L 2 12 L 22 12 L 22 10.5 M 15.5 2.6 C 15.3 2.1 14.7 1.8 14.2 2 L 12 2.8 L 9.8 2 L 9.7 2 C 9.2 1.9 8.6 2.2 8.4 2.7 L 6 9 L 18 9 L 15.5 2.6 Z"
|
||||
android:fillColor="#000"
|
||||
android:fillAlpha="0"
|
||||
android:strokeWidth="1"/>
|
||||
</vector>
|
||||
</aapt:attr>
|
||||
<target android:name="path">
|
||||
<aapt:attr name="android:animation">
|
||||
<objectAnimator
|
||||
android:propertyName="pathData"
|
||||
android:duration="400"
|
||||
android:valueFrom="M 21 8 C 21.81 8 22.57 8.34 23.09 8.92 C 23.6 9.5 23.84 10.3 23.74 11.11 C 23.57 12.133 23.4 13.157 23.23 14.18 C 23.04 15.74 21.61 17 20 17 L 17 17 C 15.44 17 13.92 15.81 13.54 14.3 C 13.24 13.397 12.94 12.493 12.64 11.59 C 12.26 11.31 11.73 11.31 11.35 11.59 C 11.043 12.517 10.737 13.443 10.43 14.37 C 10.07 15.82 8.56 17 7 17 L 4 17 C 2.38 17 0.96 15.74 0.76 14.14 C 0.593 13.143 0.427 12.147 0.26 11.15 C 0.15 10.3 0.39 9.5 0.91 8.92 C 1.43 8.34 2.19 8 3 8 C 5 8 7 8 9 8 C 9.83 8 10.58 8.35 11.06 8.96 C 11.17 9.11 11.27 9.27 11.35 9.45 C 11.78 9.36 12.22 9.36 12.64 9.45 C 12.72 9.27 12.82 9.11 12.94 8.96 C 13.41 8.35 14.16 8 15 8 L 21 8 M 3 10 C 2.76 10 2.55 10.09 2.41 10.25 C 2.27 10.4 2.21 10.62 2.24 10.86 C 2.407 11.857 2.573 12.853 2.74 13.85 C 2.82 14.5 3.4 15 4 15 L 7 15 C 7.64 15 8.36 14.44 8.5 13.82 C 8.853 12.757 9.207 11.693 9.56 10.63 C 9.6 10.5 9.57 10.31 9.5 10.19 C 9.39 10.07 9.22 10 9 10 C 7 10 5 10 3 10 M 15 10 C 14.78 10 14.61 10.07 14.5 10.19 C 14.42 10.31 14.4 10.5 14.45 10.7 C 14.787 11.717 15.123 12.733 15.46 13.75 C 15.64 14.44 16.36 15 17 15 L 20 15 C 20.59 15 21.18 14.5 21.25 13.89 C 21.42 12.867 21.59 11.843 21.76 10.82 C 21.79 10.62 21.73 10.4 21.59 10.25 C 21.45 10.09 21.24 10 21 10 C 19 10 17 10 15 10 C 15 10 15 10 15 10"
|
||||
android:valueTo="M 17.1 13 C 17.887 13 18.618 13.253 19.224 13.685 C 20.235 14.405 20.9 15.624 20.9 17 C 20.9 17.073 20.898 17.146 20.894 17.219 C 20.786 19.318 19.127 21 17 21 L 17 21 C 15.768 21 14.707 20.414 14.001 19.526 C 13.504 18.901 13.183 18.126 13.1 17.3 C 12 16.6 11.1 17.1 10.8 17.3 C 10.701 18.337 10.261 19.253 9.587 19.913 C 8.897 20.59 7.963 21 6.9 21 L 6.9 21 C 5.591 21 4.399 20.301 3.686 19.241 C 3.256 18.601 3 17.829 3 17 C 3 16.116 3.291 15.296 3.782 14.632 C 4.496 13.665 5.633 13.028 6.914 13.001 C 6.942 13 6.971 13 7 13 C 8.391 13 9.662 13.776 10.353 14.96 C 10.556 15.308 10.709 15.691 10.8 16.1 C 11.5 15.8 12.3 15.7 13.3 16.1 C 13.42 15.558 13.64 15.062 13.941 14.632 C 14.639 13.635 15.772 13 17.1 13 L 17.1 13 M 5.356 14.595 C 4.963 14.869 4.637 15.242 4.415 15.68 C 4.215 16.076 4.1 16.525 4.1 17 C 4.1 17.781 4.386 18.49 4.864 19.011 C 5.366 19.559 6.081 19.9 6.9 19.9 L 6.9 19.9 C 7.697 19.9 8.394 19.578 8.894 19.056 C 9.398 18.531 9.7 17.803 9.7 17 C 9.7 16.236 9.426 15.54 8.965 15.021 C 8.462 14.455 7.736 14.1 6.9 14.1 C 6.338 14.1 5.804 14.283 5.356 14.595 M 15.389 14.687 C 15.019 14.979 14.726 15.365 14.537 15.811 C 14.384 16.174 14.3 16.577 14.3 17 C 14.3 18.126 14.895 19.104 15.805 19.584 C 16.188 19.786 16.626 19.9 17.1 19.9 L 17.1 19.9 C 17.997 19.9 18.822 19.435 19.341 18.719 C 19.69 18.238 19.9 17.643 19.9 17 C 19.9 16.24 19.63 15.548 19.174 15.031 C 18.948 14.773 18.675 14.559 18.367 14.401 C 17.991 14.208 17.562 14.1 17.1 14.1 C 16.444 14.1 15.855 14.319 15.389 14.687"
|
||||
android:valueType="pathType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in"/>
|
||||
</aapt:attr>
|
||||
</target>
|
||||
<target android:name="path_1">
|
||||
<aapt:attr name="android:animation">
|
||||
<objectAnimator
|
||||
android:propertyName="fillAlpha"
|
||||
android:startOffset="150"
|
||||
android:duration="300"
|
||||
android:valueFrom="0"
|
||||
android:valueTo="1"
|
||||
android:valueType="floatType"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in"/>
|
||||
</aapt:attr>
|
||||
</target>
|
||||
</animated-vector>
|
10
app/src/main/res/drawable/ic_blank_28dp.xml
Normal file
10
app/src/main/res/drawable/ic_blank_28dp.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<size
|
||||
android:width="28dp"
|
||||
android:height="28dp" />
|
||||
|
||||
<solid android:color="@android:color/transparent" />
|
||||
|
||||
</shape>
|
8
app/src/main/res/drawable/ic_glasses_24dp.xml
Normal file
8
app/src/main/res/drawable/ic_glasses_24dp.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- drawable/glasses.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#000" android:pathData="M3,10C2.76,10 2.55,10.09 2.41,10.25C2.27,10.4 2.21,10.62 2.24,10.86L2.74,13.85C2.82,14.5 3.4,15 4,15H7C7.64,15 8.36,14.44 8.5,13.82L9.56,10.63C9.6,10.5 9.57,10.31 9.5,10.19C9.39,10.07 9.22,10 9,10H3M7,17H4C2.38,17 0.96,15.74 0.76,14.14L0.26,11.15C0.15,10.3 0.39,9.5 0.91,8.92C1.43,8.34 2.19,8 3,8H9C9.83,8 10.58,8.35 11.06,8.96C11.17,9.11 11.27,9.27 11.35,9.45C11.78,9.36 12.22,9.36 12.64,9.45C12.72,9.27 12.82,9.11 12.94,8.96C13.41,8.35 14.16,8 15,8H21C21.81,8 22.57,8.34 23.09,8.92C23.6,9.5 23.84,10.3 23.74,11.11L23.23,14.18C23.04,15.74 21.61,17 20,17H17C15.44,17 13.92,15.81 13.54,14.3L12.64,11.59C12.26,11.31 11.73,11.31 11.35,11.59L10.43,14.37C10.07,15.82 8.56,17 7,17M15,10C14.78,10 14.61,10.07 14.5,10.19C14.42,10.31 14.4,10.5 14.45,10.7L15.46,13.75C15.64,14.44 16.36,15 17,15H20C20.59,15 21.18,14.5 21.25,13.89L21.76,10.82C21.79,10.62 21.73,10.4 21.59,10.25C21.45,10.09 21.24,10 21,10H15Z" />
|
||||
</vector>
|
11
app/src/main/res/drawable/ic_help_outline_24dp.xml
Normal file
11
app/src/main/res/drawable/ic_help_outline_24dp.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/actionBarTintColor"
|
||||
android:autoMirrored="true">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M11,18h2v-2h-2v2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM12,6c-2.21,0 -4,1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5 0,-2.21 -1.79,-4 -4,-4z"/>
|
||||
</vector>
|
8
app/src/main/res/drawable/ic_incognito_24dp.xml
Normal file
8
app/src/main/res/drawable/ic_incognito_24dp.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- drawable/incognito.xml -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#000" android:pathData="M17.06 13C15.2 13 13.64 14.33 13.24 16.1C12.29 15.69 11.42 15.8 10.76 16.09C10.35 14.31 8.79 13 6.94 13C4.77 13 3 14.79 3 17C3 19.21 4.77 21 6.94 21C9 21 10.68 19.38 10.84 17.32C11.18 17.08 12.07 16.63 13.16 17.34C13.34 19.39 15 21 17.06 21C19.23 21 21 19.21 21 17C21 14.79 19.23 13 17.06 13M6.94 19.86C5.38 19.86 4.13 18.58 4.13 17S5.39 14.14 6.94 14.14C8.5 14.14 9.75 15.42 9.75 17S8.5 19.86 6.94 19.86M17.06 19.86C15.5 19.86 14.25 18.58 14.25 17S15.5 14.14 17.06 14.14C18.62 14.14 19.88 15.42 19.88 17S18.61 19.86 17.06 19.86M22 10.5H2V12H22V10.5M15.53 2.63C15.31 2.14 14.75 1.88 14.22 2.05L12 2.79L9.77 2.05L9.72 2.04C9.19 1.89 8.63 2.17 8.43 2.68L6 9H18L15.56 2.68L15.53 2.63Z" />
|
||||
</vector>
|
@ -2,7 +2,8 @@
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
android:viewportWidth="24.0"
|
||||
android:tint="?actionBarTintColor">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z"/>
|
||||
|
10
app/src/main/res/drawable/ic_outline_settings_24dp.xml
Normal file
10
app/src/main/res/drawable/ic_outline_settings_24dp.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/actionBarTintColor">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,9c-1.7,0 -3,1.3 -3,3s1.3,3 3,3s3,-1.3 3,-3S13.7,9 12,9M10,22c-0.2,0 -0.5,-0.2 -0.5,-0.4l-0.4,-2.6c-0.6,-0.2 -1.2,-0.6 -1.7,-1l-2.5,1c-0.2,0.1 -0.5,0 -0.6,-0.2l-2,-3.5c-0.1,-0.2 -0.1,-0.5 0.1,-0.6L4.6,13l-0.1,-1l0.1,-1L2.5,9.4C2.3,9.2 2.2,8.9 2.3,8.7l2,-3.5C4.5,5.1 4.7,5 4.9,5.1l2.5,1c0.5,-0.4 1.1,-0.7 1.7,-1l0.4,-2.7C9.5,2.2 9.8,2 10,2h4c0.2,0 0.5,0.2 0.5,0.4l0.4,2.7c0.6,0.2 1.2,0.6 1.7,1l2.5,-1c0.2,-0.1 0.5,0 0.6,0.2l2,3.5c0.1,0.2 0.1,0.5 -0.1,0.6L19.4,11l0.1,1l-0.1,1l2.1,1.6c0.2,0.1 0.2,0.4 0.1,0.6l-2,3.5C19.5,19 19.3,19 19,19l-2.5,-1c-0.5,0.4 -1.1,0.7 -1.7,1l-0.4,2.6c0,0.2 -0.2,0.4 -0.5,0.4H10M11.2,4l-0.4,2.6c-1.2,0.2 -2.3,0.9 -3,1.8l-2.4,-1L4.7,8.6l2.1,1.6c-0.4,1.2 -0.4,2.4 0,3.6l-2.1,1.6l0.8,1.3l2.4,-1c0.8,0.9 1.8,1.5 3,1.8l0.4,2.6h1.5l0.4,-2.6c1.2,-0.2 2.2,-0.9 3,-1.8l2.4,1l0.8,-1.3l-2.1,-1.5c0.4,-1.2 0.4,-2.4 0,-3.6l2.1,-1.6l-0.8,-1.3l-2.4,1c-0.8,-0.9 -1.8,-1.5 -3,-1.8L12.8,4H11.2z"/>
|
||||
</vector>
|
107
app/src/main/res/layout/tachi_overflow_layout.xml
Normal file
107
app/src/main/res/layout/tachi_overflow_layout.xml
Normal file
@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@android:color/transparent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<View
|
||||
android:id="@+id/touch_outside"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/overflow_card_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:background="?android:attr/colorBackground"
|
||||
app:cardBackgroundColor="?android:attr/colorBackground"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_min="250dp"
|
||||
app:layout_constraintWidth_default="wrap"
|
||||
app:layout_constrainedWidth="true">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/overflow_menu_layout"
|
||||
android:background="@android:color/transparent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp">
|
||||
|
||||
<eu.kanade.tachiyomi.widget.MenuSheetItemView
|
||||
android:id="@+id/incognito_mode_item"
|
||||
android:layout_width="0dp"
|
||||
app:layout_constraintWidth_min="wrap"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/divider"
|
||||
android:text="@string/incognito_mode"
|
||||
app:icon="@drawable/ic_glasses_24dp"
|
||||
tools:text="Turn on Incognito mode" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/incognito_mode_item"
|
||||
app:layout_constraintBottom_toTopOf="@id/settings_item"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/divider" />
|
||||
|
||||
<eu.kanade.tachiyomi.widget.MenuSheetItemView
|
||||
android:id="@+id/settings_item"
|
||||
android:layout_width="0dp"
|
||||
app:layout_constraintWidth_min="wrap"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/divider"
|
||||
app:layout_constraintBottom_toTopOf="@id/about_item"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:text="@string/settings"
|
||||
app:icon="@drawable/ic_outline_settings_24dp" />
|
||||
|
||||
<eu.kanade.tachiyomi.widget.MenuSheetItemView
|
||||
android:id="@+id/about_item"
|
||||
android:layout_width="0dp"
|
||||
app:layout_constraintWidth_min="wrap"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/settings_item"
|
||||
app:layout_constraintBottom_toTopOf="@+id/help_item"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:text="@string/about"
|
||||
app:icon="@drawable/ic_info_outline_24dp" />
|
||||
|
||||
<eu.kanade.tachiyomi.widget.MenuSheetItemView
|
||||
android:id="@+id/help_item"
|
||||
android:layout_width="0dp"
|
||||
app:layout_constraintWidth_min="wrap"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/about_item"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:text="@string/help"
|
||||
app:icon="@drawable/ic_help_outline_24dp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -16,9 +16,8 @@
|
||||
app:showAsAction="ifRoom"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:icon="@drawable/ic_settings_24dp"
|
||||
android:title="@string/settings"
|
||||
app:showAsAction="ifRoom"
|
||||
/>
|
||||
android:id="@+id/action_more"
|
||||
android:icon="@drawable/ic_more_vert_24dp"
|
||||
android:title="@string/more"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
||||
|
@ -20,9 +20,9 @@
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:icon="@drawable/ic_settings_24dp"
|
||||
android:title="@string/settings"
|
||||
android:id="@+id/action_more"
|
||||
android:icon="@drawable/ic_more_vert_24dp"
|
||||
android:title="@string/more"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
</menu>
|
||||
|
@ -17,8 +17,8 @@
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:icon="@drawable/ic_settings_24dp"
|
||||
android:title="@string/settings"
|
||||
android:id="@+id/action_more"
|
||||
android:icon="@drawable/ic_more_vert_24dp"
|
||||
android:title="@string/more"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
@ -187,6 +187,15 @@
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="OverflowDialogTheme" parent="BottomSheetDialogTheme">
|
||||
<item name="android:windowAnimationStyle">@style/Theme.Widget.Animation.DropFromAbove</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Widget.Animation.DropFromAbove" parent="android:Animation">
|
||||
<item name="android:windowEnterAnimation">@anim/fade_in_grow_from_top</item>
|
||||
<item name="android:windowExitAnimation">@anim/fade_out_short</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Widget.TextInputLayout.OutlinedBox.Dense" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense">
|
||||
<item name="boxStrokeColor">@color/text_input_stroke</item>
|
||||
<item name="hintTextColor">?colorAccent</item>
|
||||
|
Loading…
Reference in New Issue
Block a user