Loading app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetFactory.kt +1 −21 Original line number Original line Diff line number Diff line Loading @@ -133,8 +133,6 @@ class NoteListWidgetFactory internal constructor(private val context: Context, i createNoteIntent = getCreateNoteIntent(localAccount) createNoteIntent = getCreateNoteIntent(localAccount) } } val category = getCategoryTitle(context) return RemoteViews(context.packageName, R.layout.widget_entry).apply { return RemoteViews(context.packageName, R.layout.widget_entry).apply { setOnClickFillInIntent(R.id.widget_note_list_entry, openNoteIntent) setOnClickFillInIntent(R.id.widget_note_list_entry, openNoteIntent) Loading @@ -142,11 +140,7 @@ class NoteListWidgetFactory internal constructor(private val context: Context, i setOnClickFillInIntent(R.id.widget_entry_fav_icon, createNoteIntent) setOnClickFillInIntent(R.id.widget_entry_fav_icon, createNoteIntent) } } if (category != null) { setTextViewText(R.id.widget_entry_content_tv, (note.title + data?.category)) setTextViewText(R.id.widget_entry_content_tv, category) } else { setTextViewText(R.id.widget_entry_content_tv, note.title) } val starIconId = if (note.favorite) { val starIconId = if (note.favorite) { R.drawable.ic_star_yellow_24dp R.drawable.ic_star_yellow_24dp Loading @@ -157,20 +151,6 @@ class NoteListWidgetFactory internal constructor(private val context: Context, i } } } } private fun getCategoryTitle(context: Context): String? { val widgetData = data ?: return null return when (widgetData.mode) { NotesListWidgetData.MODE_DISPLAY_STARRED -> context.getString(R.string.label_favorites) NotesListWidgetData.MODE_DISPLAY_CATEGORY -> if ("" == widgetData.category) context.getString(R.string.action_uncategorized) else widgetData.category else -> context.getString(R.string.app_name) } } override fun getLoadingView(): RemoteViews? { override fun getLoadingView(): RemoteViews? { return null return null } } Loading Loading
app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetFactory.kt +1 −21 Original line number Original line Diff line number Diff line Loading @@ -133,8 +133,6 @@ class NoteListWidgetFactory internal constructor(private val context: Context, i createNoteIntent = getCreateNoteIntent(localAccount) createNoteIntent = getCreateNoteIntent(localAccount) } } val category = getCategoryTitle(context) return RemoteViews(context.packageName, R.layout.widget_entry).apply { return RemoteViews(context.packageName, R.layout.widget_entry).apply { setOnClickFillInIntent(R.id.widget_note_list_entry, openNoteIntent) setOnClickFillInIntent(R.id.widget_note_list_entry, openNoteIntent) Loading @@ -142,11 +140,7 @@ class NoteListWidgetFactory internal constructor(private val context: Context, i setOnClickFillInIntent(R.id.widget_entry_fav_icon, createNoteIntent) setOnClickFillInIntent(R.id.widget_entry_fav_icon, createNoteIntent) } } if (category != null) { setTextViewText(R.id.widget_entry_content_tv, (note.title + data?.category)) setTextViewText(R.id.widget_entry_content_tv, category) } else { setTextViewText(R.id.widget_entry_content_tv, note.title) } val starIconId = if (note.favorite) { val starIconId = if (note.favorite) { R.drawable.ic_star_yellow_24dp R.drawable.ic_star_yellow_24dp Loading @@ -157,20 +151,6 @@ class NoteListWidgetFactory internal constructor(private val context: Context, i } } } } private fun getCategoryTitle(context: Context): String? { val widgetData = data ?: return null return when (widgetData.mode) { NotesListWidgetData.MODE_DISPLAY_STARRED -> context.getString(R.string.label_favorites) NotesListWidgetData.MODE_DISPLAY_CATEGORY -> if ("" == widgetData.category) context.getString(R.string.action_uncategorized) else widgetData.category else -> context.getString(R.string.app_name) } } override fun getLoadingView(): RemoteViews? { override fun getLoadingView(): RemoteViews? { return null return null } } Loading