mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 16:18:55 +01:00 
			
		
		
		
	Reduce priority of jcenter repository
This commit is contained in:
		@@ -41,6 +41,8 @@ object PreferenceKeys {
 | 
			
		||||
 | 
			
		||||
    const val readWithTapping = "reader_tap"
 | 
			
		||||
 | 
			
		||||
    const val readWithLongTap = "reader_long_tap"
 | 
			
		||||
 | 
			
		||||
    const val readWithVolumeKeys = "reader_volume_keys"
 | 
			
		||||
 | 
			
		||||
    const val readWithVolumeKeysInverted = "reader_volume_keys_inverted"
 | 
			
		||||
 
 | 
			
		||||
@@ -69,6 +69,8 @@ class PreferencesHelper(val context: Context) {
 | 
			
		||||
 | 
			
		||||
    fun readWithTapping() = rxPrefs.getBoolean(Keys.readWithTapping, true)
 | 
			
		||||
 | 
			
		||||
    fun readWithLongTap() = rxPrefs.getBoolean(Keys.readWithLongTap, true)
 | 
			
		||||
 | 
			
		||||
    fun readWithVolumeKeys() = rxPrefs.getBoolean(Keys.readWithVolumeKeys, false)
 | 
			
		||||
 | 
			
		||||
    fun readWithVolumeKeysInverted() = rxPrefs.getBoolean(Keys.readWithVolumeKeysInverted, false)
 | 
			
		||||
 
 | 
			
		||||
@@ -62,6 +62,7 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BottomSheetDia
 | 
			
		||||
        show_page_number.bindToPreference(preferences.showPageNumber())
 | 
			
		||||
        fullscreen.bindToPreference(preferences.fullscreen())
 | 
			
		||||
        keepscreen.bindToPreference(preferences.keepScreenOn())
 | 
			
		||||
        long_tap.bindToPreference(preferences.readWithLongTap())
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,7 @@ open class Pager(
 | 
			
		||||
    /**
 | 
			
		||||
     * Long tap listener function to execute when a long tap is detected.
 | 
			
		||||
     */
 | 
			
		||||
    var longTapListener: ((MotionEvent) -> Unit)? = null
 | 
			
		||||
    var longTapListener: ((MotionEvent) -> Boolean)? = null
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Gesture listener that implements tap and long tap events.
 | 
			
		||||
@@ -38,8 +38,7 @@ open class Pager(
 | 
			
		||||
 | 
			
		||||
        override fun onLongTapConfirmed(ev: MotionEvent) {
 | 
			
		||||
            val listener = longTapListener
 | 
			
		||||
            if (listener != null) {
 | 
			
		||||
                listener.invoke(ev)
 | 
			
		||||
            if (listener != null && listener.invoke(ev)) {
 | 
			
		||||
                performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -19,6 +19,9 @@ class PagerConfig(private val viewer: PagerViewer, preferences: PreferencesHelpe
 | 
			
		||||
    var tappingEnabled = true
 | 
			
		||||
        private set
 | 
			
		||||
 | 
			
		||||
    var longTapEnabled = true
 | 
			
		||||
        private set
 | 
			
		||||
 | 
			
		||||
    var volumeKeysEnabled = false
 | 
			
		||||
        private set
 | 
			
		||||
 | 
			
		||||
@@ -44,6 +47,9 @@ class PagerConfig(private val viewer: PagerViewer, preferences: PreferencesHelpe
 | 
			
		||||
        preferences.readWithTapping()
 | 
			
		||||
            .register({ tappingEnabled = it })
 | 
			
		||||
 | 
			
		||||
        preferences.readWithLongTap()
 | 
			
		||||
            .register({ longTapEnabled = it })
 | 
			
		||||
 | 
			
		||||
        preferences.pageTransitions()
 | 
			
		||||
            .register({ usePageTransitions = it })
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -92,11 +92,15 @@ abstract class PagerViewer(val activity: ReaderActivity) : BaseViewer {
 | 
			
		||||
                else -> activity.toggleMenu()
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        pager.longTapListener = {
 | 
			
		||||
            val item = adapter.items.getOrNull(pager.currentItem)
 | 
			
		||||
            if (item is ReaderPage) {
 | 
			
		||||
                activity.onPageLongTap(item)
 | 
			
		||||
        pager.longTapListener = f@ {
 | 
			
		||||
            if (activity.menuVisible || config.longTapEnabled) {
 | 
			
		||||
                val item = adapter.items.getOrNull(pager.currentItem)
 | 
			
		||||
                if (item is ReaderPage) {
 | 
			
		||||
                    activity.onPageLongTap(item)
 | 
			
		||||
                    return@f true
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            false
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        config.imagePropertyChangedListener = {
 | 
			
		||||
 
 | 
			
		||||
@@ -19,6 +19,9 @@ class WebtoonConfig(preferences: PreferencesHelper = Injekt.get()) {
 | 
			
		||||
    var tappingEnabled = true
 | 
			
		||||
        private set
 | 
			
		||||
 | 
			
		||||
    var longTapEnabled = true
 | 
			
		||||
        private set
 | 
			
		||||
 | 
			
		||||
    var volumeKeysEnabled = false
 | 
			
		||||
        private set
 | 
			
		||||
 | 
			
		||||
@@ -35,6 +38,9 @@ class WebtoonConfig(preferences: PreferencesHelper = Injekt.get()) {
 | 
			
		||||
        preferences.readWithTapping()
 | 
			
		||||
            .register({ tappingEnabled = it })
 | 
			
		||||
 | 
			
		||||
        preferences.readWithLongTap()
 | 
			
		||||
            .register({ longTapEnabled = it })
 | 
			
		||||
 | 
			
		||||
        preferences.cropBordersWebtoon()
 | 
			
		||||
            .register({ imageCropBorders = it }, { imagePropertyChangedListener?.invoke() })
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -37,7 +37,7 @@ open class WebtoonRecyclerView @JvmOverloads constructor(
 | 
			
		||||
    private val detector = Detector()
 | 
			
		||||
 | 
			
		||||
    var tapListener: ((MotionEvent) -> Unit)? = null
 | 
			
		||||
    var longTapListener: ((MotionEvent) -> Unit)? = null
 | 
			
		||||
    var longTapListener: ((MotionEvent) -> Boolean)? = null
 | 
			
		||||
 | 
			
		||||
    override fun onMeasure(widthSpec: Int, heightSpec: Int) {
 | 
			
		||||
        halfWidth = MeasureSpec.getSize(widthSpec) / 2
 | 
			
		||||
@@ -220,8 +220,7 @@ open class WebtoonRecyclerView @JvmOverloads constructor(
 | 
			
		||||
 | 
			
		||||
        override fun onLongTapConfirmed(ev: MotionEvent) {
 | 
			
		||||
            val listener = longTapListener
 | 
			
		||||
            if (listener != null) {
 | 
			
		||||
                listener.invoke(ev)
 | 
			
		||||
            if (listener != null && listener.invoke(ev)) {
 | 
			
		||||
                performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -95,13 +95,17 @@ class WebtoonViewer(val activity: ReaderActivity) : BaseViewer {
 | 
			
		||||
                else -> activity.toggleMenu()
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        recycler.longTapListener = { event ->
 | 
			
		||||
            val child = recycler.findChildViewUnder(event.x, event.y)
 | 
			
		||||
            val position = recycler.getChildAdapterPosition(child)
 | 
			
		||||
            val item = adapter.items.getOrNull(position)
 | 
			
		||||
            if (item is ReaderPage) {
 | 
			
		||||
                activity.onPageLongTap(item)
 | 
			
		||||
        recycler.longTapListener = f@ { event ->
 | 
			
		||||
            if (activity.menuVisible || config.longTapEnabled) {
 | 
			
		||||
                val child = recycler.findChildViewUnder(event.x, event.y)
 | 
			
		||||
                val position = recycler.getChildAdapterPosition(child)
 | 
			
		||||
                val item = adapter.items.getOrNull(position)
 | 
			
		||||
                if (item is ReaderPage) {
 | 
			
		||||
                    activity.onPageLongTap(item)
 | 
			
		||||
                    return@f true
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            false
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        frame.layoutParams = ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)
 | 
			
		||||
 
 | 
			
		||||
@@ -108,6 +108,11 @@ class SettingsReaderController : SettingsController() {
 | 
			
		||||
                titleRes = R.string.pref_read_with_tapping
 | 
			
		||||
                defaultValue = true
 | 
			
		||||
            }
 | 
			
		||||
            switchPreference {
 | 
			
		||||
                key = Keys.readWithLongTap
 | 
			
		||||
                titleRes = R.string.pref_read_with_long_tap
 | 
			
		||||
                defaultValue = true
 | 
			
		||||
            }
 | 
			
		||||
            switchPreference {
 | 
			
		||||
                key = Keys.readWithVolumeKeys
 | 
			
		||||
                titleRes = R.string.pref_read_with_volume_keys
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user