Merge pull request #680 from Aga-C/fix-opening-shortcut

Fixed showing note picker on opening from shortcut (#679)
This commit is contained in:
Tibor Kaputa 2023-08-30 17:33:38 +02:00 committed by GitHub
commit aa41b534b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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()
} }