mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
adding colored launcher icons
This commit is contained in:
@ -5,7 +5,25 @@ import com.simplemobiletools.notes.R
|
||||
|
||||
open class SimpleActivity : BaseSimpleActivity() {
|
||||
override fun getAppIconIDs() = arrayListOf(
|
||||
R.mipmap.ic_launcher
|
||||
R.mipmap.ic_launcher_red,
|
||||
R.mipmap.ic_launcher_pink,
|
||||
R.mipmap.ic_launcher_purple,
|
||||
R.mipmap.ic_launcher_deep_purple,
|
||||
R.mipmap.ic_launcher_indigo,
|
||||
R.mipmap.ic_launcher_blue,
|
||||
R.mipmap.ic_launcher_light_blue,
|
||||
R.mipmap.ic_launcher_cyan,
|
||||
R.mipmap.ic_launcher_teal,
|
||||
R.mipmap.ic_launcher_green,
|
||||
R.mipmap.ic_launcher_light_green,
|
||||
R.mipmap.ic_launcher_lime,
|
||||
R.mipmap.ic_launcher_yellow,
|
||||
R.mipmap.ic_launcher_amber,
|
||||
R.mipmap.ic_launcher,
|
||||
R.mipmap.ic_launcher_deep_orange,
|
||||
R.mipmap.ic_launcher_brown,
|
||||
R.mipmap.ic_launcher_blue_grey,
|
||||
R.mipmap.ic_launcher_grey_black
|
||||
)
|
||||
|
||||
override fun getAppLauncherName() = getString(R.string.app_launcher_name)
|
||||
|
@ -8,6 +8,7 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.widget.RemoteViews
|
||||
import com.simplemobiletools.commons.extensions.getLaunchIntent
|
||||
import com.simplemobiletools.commons.extensions.setBackgroundColor
|
||||
import com.simplemobiletools.notes.R
|
||||
import com.simplemobiletools.notes.activities.SplashActivity
|
||||
@ -32,7 +33,7 @@ class MyWidgetProvider : AppWidgetProvider() {
|
||||
}
|
||||
|
||||
val widgetId = context.config.widgetNoteId
|
||||
val startActivityIntent = Intent(context, SplashActivity::class.java)
|
||||
val startActivityIntent = context.getLaunchIntent() ?: Intent(context, SplashActivity::class.java)
|
||||
val startActivityPendingIntent = PendingIntent.getActivity(context, widgetId, startActivityIntent, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
views.setPendingIntentTemplate(R.id.notes_widget_listview, startActivityPendingIntent)
|
||||
|
||||
@ -45,7 +46,7 @@ class MyWidgetProvider : AppWidgetProvider() {
|
||||
|
||||
private fun setupAppOpenIntent(context: Context, views: RemoteViews, id: Int) {
|
||||
val widgetId = context.config.widgetNoteId
|
||||
val intent = Intent(context, SplashActivity::class.java)
|
||||
val intent = context.getLaunchIntent() ?: Intent(context, SplashActivity::class.java)
|
||||
intent.putExtra(OPEN_NOTE_ID, widgetId)
|
||||
val pendingIntent = PendingIntent.getActivity(context, widgetId, intent, 0)
|
||||
views.setOnClickPendingIntent(id, pendingIntent)
|
||||
|
Reference in New Issue
Block a user