Fix shortcuts
This commit is contained in:
parent
619d94bf36
commit
5e3d71c6c5
2 changed files with 9 additions and 7 deletions
|
@ -37,8 +37,8 @@ class MainActivity : BaseActivity() {
|
||||||
setAppTheme()
|
setAppTheme()
|
||||||
super.onCreate(savedState)
|
super.onCreate(savedState)
|
||||||
|
|
||||||
// Do not let the launcher create a new activity
|
// Do not let the launcher create a new activity http://stackoverflow.com/questions/16283079
|
||||||
if (intent.flags and Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT != 0) {
|
if (!isTaskRoot) {
|
||||||
finish()
|
finish()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ class MainActivity : BaseActivity() {
|
||||||
// Shortcut actions
|
// Shortcut actions
|
||||||
private const val SHORTCUT_LIBRARY = "eu.kanade.tachiyomi.SHOW_LIBRARY"
|
private const val SHORTCUT_LIBRARY = "eu.kanade.tachiyomi.SHOW_LIBRARY"
|
||||||
private const val SHORTCUT_RECENTLY_UPDATED = "eu.kanade.tachiyomi.SHOW_RECENTLY_UPDATED"
|
private const val SHORTCUT_RECENTLY_UPDATED = "eu.kanade.tachiyomi.SHOW_RECENTLY_UPDATED"
|
||||||
private const val SHORTCUT_RECENTLY_READ = "eu.kanade.tachiyomi.RECENTLY_READ"
|
private const val SHORTCUT_RECENTLY_READ = "eu.kanade.tachiyomi.SHOW_RECENTLY_READ"
|
||||||
private const val SHORTCUT_CATALOGUES = "eu.kanade.tachiyomi.SHOW_CATALOGUES"
|
private const val SHORTCUT_CATALOGUES = "eu.kanade.tachiyomi.SHOW_CATALOGUES"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ import rx.Subscription
|
||||||
import rx.android.schedulers.AndroidSchedulers
|
import rx.android.schedulers.AndroidSchedulers
|
||||||
import rx.schedulers.Schedulers
|
import rx.schedulers.Schedulers
|
||||||
import uy.kohesive.injekt.injectLazy
|
import uy.kohesive.injekt.injectLazy
|
||||||
import java.util.ArrayList
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Presenter of MangaInfoFragment.
|
* Presenter of MangaInfoFragment.
|
||||||
|
@ -79,9 +78,12 @@ class MangaInfoPresenter : BasePresenter<MangaInfoFragment>() {
|
||||||
?.subscribeLatestCache(MangaInfoFragment::setChapterCount)
|
?.subscribeLatestCache(MangaInfoFragment::setChapterCount)
|
||||||
|
|
||||||
// Update favorite status
|
// Update favorite status
|
||||||
SharedData.get(MangaFavoriteEvent::class.java)?.observable
|
SharedData.get(MangaFavoriteEvent::class.java)?.let {
|
||||||
?.observeOn(AndroidSchedulers.mainThread())
|
it.observable
|
||||||
?.subscribe { setFavorite(it) }
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe { setFavorite(it) }
|
||||||
|
.apply { add(this) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Reference in a new issue