mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-17 06:27:29 +01:00
Use elevated overlay on reader menu (#6347)
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
package eu.kanade.tachiyomi.util.view
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.Point
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.text.TextUtils
|
||||
import android.view.Gravity
|
||||
import android.view.Menu
|
||||
@@ -25,6 +27,7 @@ import androidx.viewpager.widget.ViewPager
|
||||
import com.google.android.material.chip.Chip
|
||||
import com.google.android.material.chip.ChipGroup
|
||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
import com.google.android.material.shape.MaterialShapeDrawable
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||
@@ -245,3 +248,14 @@ fun ViewPager.getActivePageView(): View? {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a deep copy of the provided [Drawable]
|
||||
*/
|
||||
inline fun <reified T : Drawable> T.copy(context: Context): T? {
|
||||
return (constantState?.newDrawable()?.mutate() as? T).apply {
|
||||
if (this is MaterialShapeDrawable) {
|
||||
initializeElevationOverlay(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user