mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2024-12-27 00:33:53 +01:00
lets initialize the viewpager at third party intents too
This commit is contained in:
parent
ad4c1dbd99
commit
45f2b19775
@ -52,7 +52,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.simplemobiletools:commons:5.3.16'
|
||||
implementation 'com.simplemobiletools:commons:5.4.0'
|
||||
implementation 'joda-time:joda-time:2.10.1'
|
||||
implementation 'androidx.multidex:multidex:2.0.0'
|
||||
|
||||
|
@ -91,13 +91,13 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||
refreshCalDAVCalendars(false)
|
||||
}
|
||||
|
||||
checkAppOnSDCard()
|
||||
checkIsViewIntent()
|
||||
|
||||
checkIsViewIntent {
|
||||
if (!checkIsOpenIntent()) {
|
||||
updateViewPager()
|
||||
}
|
||||
if (!checkIsOpenIntent()) {
|
||||
updateViewPager()
|
||||
}
|
||||
|
||||
checkAppOnSDCard()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
@ -288,7 +288,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||
return false
|
||||
}
|
||||
|
||||
private fun checkIsViewIntent(callback: (() -> Unit)? = null) {
|
||||
private fun checkIsViewIntent() {
|
||||
if (intent?.action == Intent.ACTION_VIEW && intent.data != null) {
|
||||
val uri = intent.data
|
||||
if (uri.authority == "com.android.calendar") {
|
||||
@ -302,7 +302,6 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||
putExtra(EVENT_ID, id)
|
||||
startActivity(this)
|
||||
}
|
||||
return@Thread
|
||||
} else {
|
||||
toast(R.string.unknown_error_occurred)
|
||||
}
|
||||
@ -319,7 +318,6 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||
tryImportEventsFromFile(uri)
|
||||
}
|
||||
}
|
||||
callback?.invoke()
|
||||
}
|
||||
|
||||
private fun showViewDialog() {
|
||||
|
Loading…
Reference in New Issue
Block a user