Skip to content

Commit cc01f38

Browse files
committed
do not show the widget note picker if we are just customizing the colors
1 parent 10a4695 commit cc01f38

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

app/src/main/kotlin/com/simplemobiletools/notes/activities/WidgetConfigureActivity.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ class WidgetConfigureActivity : SimpleActivity() {
2929
private var mBgColor = 0
3030
private var mBgColorWithoutTransparency = 0
3131
private var mTextColor = 0
32-
private var mNotes = ArrayList<Note>()
3332
private var mCurrentNoteId = 0
33+
private var mIsCustomizingColors = false
34+
private var mNotes = ArrayList<Note>()
3435

3536
public override fun onCreate(savedInstanceState: Bundle?) {
3637
useDynamicTheme = false
@@ -39,10 +40,9 @@ class WidgetConfigureActivity : SimpleActivity() {
3940
setContentView(R.layout.widget_config)
4041
initVariables()
4142

42-
val isCustomizingColors = intent.extras?.getBoolean(IS_CUSTOMIZING_COLORS) ?: false
4343
mWidgetId = intent.extras?.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID) ?: AppWidgetManager.INVALID_APPWIDGET_ID
4444

45-
if (mWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID && !isCustomizingColors) {
45+
if (mWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID && !mIsCustomizingColors) {
4646
finish()
4747
}
4848

@@ -78,7 +78,8 @@ class WidgetConfigureActivity : SimpleActivity() {
7878
mTextColor = config.widgetTextColor
7979
updateTextColor()
8080
mNotes = dbHelper.getNotes()
81-
notes_picker_holder.beVisibleIf(mNotes.size > 1)
81+
mIsCustomizingColors = intent.extras?.getBoolean(IS_CUSTOMIZING_COLORS) ?: false
82+
notes_picker_holder.beVisibleIf(mNotes.size > 1 && !mIsCustomizingColors)
8283
updateCurrentNote(mNotes.first())
8384
}
8485

@@ -97,7 +98,7 @@ class WidgetConfigureActivity : SimpleActivity() {
9798
private fun updateCurrentNote(note: Note) {
9899
mCurrentNoteId = note.id
99100
notes_picker_value.text = note.title
100-
val sampleValue = if (note.value.isEmpty()) getString(R.string.widget_config) else note.value
101+
val sampleValue = if (note.value.isEmpty() || mIsCustomizingColors) getString(R.string.widget_config) else note.value
101102
notes_view.text = sampleValue
102103
}
103104

0 commit comments

Comments
 (0)