Skip to content

Commit f3832e8

Browse files
alperozturk96backportbot[bot]
authored andcommitted
fix category
Signed-off-by: alperozturk <[email protected]>
1 parent a7b9521 commit f3832e8

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetFactory.kt

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,14 @@ class NoteListWidgetFactory internal constructor(private val context: Context, i
133133
createNoteIntent = getCreateNoteIntent(localAccount)
134134
}
135135

136-
val category = getCategoryTitle(context)
137-
138136
return RemoteViews(context.packageName, R.layout.widget_entry).apply {
139137
setOnClickFillInIntent(R.id.widget_note_list_entry, openNoteIntent)
140138

141139
createNoteIntent?.let {
142140
setOnClickFillInIntent(R.id.widget_entry_fav_icon, createNoteIntent)
143141
}
144142

145-
if (category != null) {
146-
setTextViewText(R.id.widget_entry_content_tv, category)
147-
} else {
148-
setTextViewText(R.id.widget_entry_content_tv, note.title)
149-
}
143+
setTextViewText(R.id.widget_entry_content_tv, (note.title + data?.category))
150144

151145
val starIconId = if (note.favorite) {
152146
R.drawable.ic_star_yellow_24dp
@@ -157,20 +151,6 @@ class NoteListWidgetFactory internal constructor(private val context: Context, i
157151
}
158152
}
159153

160-
private fun getCategoryTitle(context: Context): String? {
161-
val widgetData = data ?: return null
162-
163-
return when (widgetData.mode) {
164-
NotesListWidgetData.MODE_DISPLAY_STARRED -> context.getString(R.string.label_favorites)
165-
NotesListWidgetData.MODE_DISPLAY_CATEGORY -> if ("" == widgetData.category)
166-
context.getString(R.string.action_uncategorized)
167-
else
168-
widgetData.category
169-
170-
else -> context.getString(R.string.app_name)
171-
}
172-
}
173-
174154
override fun getLoadingView(): RemoteViews? {
175155
return null
176156
}

0 commit comments

Comments
 (0)