Downgrade kotlin

This commit is contained in:
Koitharu
2020-05-10 12:36:14 +03:00
parent 1927500f5a
commit e33dfd63e4
8 changed files with 16 additions and 25 deletions

View File

@@ -20,7 +20,7 @@ abstract class GroupleRepository : RemoteMangaRepository() {
offset: Int,
query: String?,
sortOrder: SortOrder?,
tag: MangaTag?,
tag: MangaTag?
): List<Manga> {
val domain = conf.getDomain(defaultDomain)
val doc = when {

View File

@@ -66,8 +66,9 @@ class ReaderActivity : BaseFullscreenActivity(), ReaderView, ChaptersDialog.OnCh
toolbar_bottom.inflateMenu(R.menu.opt_reader_bottom)
toolbar_bottom.setOnMenuItemClickListener(::onOptionsItemSelected)
state = savedInstanceState?.getParcelable(EXTRA_STATE)
?: intent.getParcelableExtra(EXTRA_STATE)
@Suppress("RemoveExplicitTypeArguments")
state = savedInstanceState?.getParcelable<ReaderState>(EXTRA_STATE)
?: intent.getParcelableExtra<ReaderState>(EXTRA_STATE)
?: let {
Toast.makeText(this, R.string.error_occurred, Toast.LENGTH_SHORT).show()
finish()
@@ -224,13 +225,11 @@ class ReaderActivity : BaseFullscreenActivity(), ReaderView, ChaptersDialog.OnCh
setUiIsVisible(!appbar_top.isVisible)
}
GridTouchHelper.AREA_TOP,
GridTouchHelper.AREA_LEFT,
-> if (isTapSwitchEnabled) {
GridTouchHelper.AREA_LEFT -> if (isTapSwitchEnabled) {
reader?.switchPageBy(-1)
}
GridTouchHelper.AREA_BOTTOM,
GridTouchHelper.AREA_RIGHT,
-> if (isTapSwitchEnabled) {
GridTouchHelper.AREA_RIGHT -> if (isTapSwitchEnabled) {
reader?.switchPageBy(1)
}
}
@@ -268,15 +267,13 @@ class ReaderActivity : BaseFullscreenActivity(), ReaderView, ChaptersDialog.OnCh
KeyEvent.KEYCODE_SPACE,
KeyEvent.KEYCODE_PAGE_DOWN,
KeyEvent.KEYCODE_DPAD_DOWN,
KeyEvent.KEYCODE_DPAD_RIGHT,
-> {
KeyEvent.KEYCODE_DPAD_RIGHT -> {
reader?.switchPageBy(1)
true
}
KeyEvent.KEYCODE_PAGE_UP,
KeyEvent.KEYCODE_DPAD_UP,
KeyEvent.KEYCODE_DPAD_LEFT,
-> {
KeyEvent.KEYCODE_DPAD_LEFT -> {
reader?.switchPageBy(-1)
true
}

View File

@@ -9,8 +9,8 @@ class WebtoonFrameLayout @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : FrameLayout(context, attrs, defStyleAttr) {
private val target: WebtoonImageView by lazy {
findViewById(R.id.ssiv)
private val target by lazy {
findViewById<WebtoonImageView>(R.id.ssiv)
}
fun dispatchVerticalScroll(dy: Int) = target.dispatchVerticalScroll(dy)

View File

@@ -61,7 +61,7 @@ class MangaShortcut(private val manga: Manga) {
private suspend fun buildShortcutInfo(
context: Context,
manga: Manga,
manga: Manga
): ShortcutInfoCompat.Builder {
val icon = safe {
val size = getIconSize(context)

View File

@@ -84,7 +84,7 @@ fun View.disableFor(timeInMillis: Long) {
fun View.showPopupMenu(
@MenuRes menuRes: Int, onPrepare: ((Menu) -> Unit)? = null,
onItemClick: (MenuItem) -> Boolean,
onItemClick: (MenuItem) -> Boolean
) {
val menu = PopupMenu(context, this)
menu.inflate(menuRes)