Fixed showing note picker on opening from shortcut (#679)

This commit is contained in:
Agnieszka C 2023-08-28 19:49:37 +02:00
parent 7bfd0de6c1
commit 48eb068150
1 changed files with 6 additions and 2 deletions

View File

@ -98,18 +98,22 @@ class MainActivity : SimpleActivity() {
searchNextBtn = findViewById(com.simplemobiletools.commons.R.id.search_next) searchNextBtn = findViewById(com.simplemobiletools.commons.R.id.search_next)
searchClearBtn = findViewById(com.simplemobiletools.commons.R.id.search_clear) searchClearBtn = findViewById(com.simplemobiletools.commons.R.id.search_clear)
initViewPager(intent.getLongExtra(OPEN_NOTE_ID, -1L)) val noteToOpen = intent.getLongExtra(OPEN_NOTE_ID, -1L)
initViewPager(noteToOpen)
binding.pagerTabStrip.drawFullUnderline = false binding.pagerTabStrip.drawFullUnderline = false
val textSize = getPercentageFontSize() val textSize = getPercentageFontSize()
binding.pagerTabStrip.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize) binding.pagerTabStrip.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize)
binding.pagerTabStrip.layoutParams.height = binding.pagerTabStrip.layoutParams.height =
(textSize + resources.getDimension(com.simplemobiletools.commons.R.dimen.medium_margin) * 2).toInt() (textSize + resources.getDimension(com.simplemobiletools.commons.R.dimen.medium_margin) * 2).toInt()
(binding.pagerTabStrip.layoutParams as ViewPager.LayoutParams).isDecor = true (binding.pagerTabStrip.layoutParams as ViewPager.LayoutParams).isDecor = true
val hasNoIntent = intent.action.isNullOrEmpty() && noteToOpen == -1L
checkWhatsNewDialog() checkWhatsNewDialog()
checkIntents(intent) checkIntents(intent)
storeStateVariables() storeStateVariables()
if (config.showNotePicker && savedInstanceState == null) { if (config.showNotePicker && savedInstanceState == null && hasNoIntent) {
displayOpenNoteDialog() displayOpenNoteDialog()
} }