mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-21 05:50:59 +01:00
properly handle the Show Recent Calls intent
This commit is contained in:
parent
41d0a7b189
commit
44b6d1fc5a
@ -57,6 +57,15 @@
|
|||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW"/>
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
<category android:name="android.intent.category.BROWSABLE"/>
|
||||||
|
|
||||||
|
<data android:mimeType="vnd.android.cursor.dir/calls"/>
|
||||||
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
|
@ -370,7 +370,11 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
// selecting the proper tab sometimes glitches, add an extra selector to make sure we have it right
|
// selecting the proper tab sometimes glitches, add an extra selector to make sure we have it right
|
||||||
main_tabs_holder.onGlobalLayout {
|
main_tabs_holder.onGlobalLayout {
|
||||||
Handler().postDelayed({
|
Handler().postDelayed({
|
||||||
|
if (intent?.action == Intent.ACTION_VIEW && intent.type == "vnd.android.cursor.dir/calls") {
|
||||||
|
main_tabs_holder.getTabAt(getRecentsTabIndex())?.select()
|
||||||
|
} else {
|
||||||
main_tabs_holder.getTabAt(config.lastUsedViewPagerPage)?.select()
|
main_tabs_holder.getTabAt(config.lastUsedViewPagerPage)?.select()
|
||||||
|
}
|
||||||
invalidateOptionsMenu()
|
invalidateOptionsMenu()
|
||||||
}, 100L)
|
}, 100L)
|
||||||
}
|
}
|
||||||
@ -545,6 +549,22 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
|
|
||||||
private fun getAllFragments() = arrayListOf(contacts_fragment, favorites_fragment, recents_fragment, groups_fragment)
|
private fun getAllFragments() = arrayListOf(contacts_fragment, favorites_fragment, recents_fragment, groups_fragment)
|
||||||
|
|
||||||
|
private fun getRecentsTabIndex(): Int {
|
||||||
|
var index = 0
|
||||||
|
if (config.showTabs and RECENTS_TAB_MASK == 0) {
|
||||||
|
return index
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.showTabs and CONTACTS_TAB_MASK != 0) {
|
||||||
|
index++
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.showTabs and FAVORITES_TAB_MASK != 0) {
|
||||||
|
index++
|
||||||
|
}
|
||||||
|
return index
|
||||||
|
}
|
||||||
|
|
||||||
private fun checkWhatsNewDialog() {
|
private fun checkWhatsNewDialog() {
|
||||||
arrayListOf<Release>().apply {
|
arrayListOf<Release>().apply {
|
||||||
add(Release(10, R.string.release_10))
|
add(Release(10, R.string.release_10))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user