Fix id names
This commit is contained in:
parent
486f1aebc6
commit
5c495108c4
25 changed files with 92 additions and 90 deletions
|
@ -47,8 +47,7 @@ class AppWidgetCard : BaseAppWidget() {
|
|||
* actions if service not running.
|
||||
*/
|
||||
override fun defaultAppWidget(context: Context, appWidgetIds: IntArray) {
|
||||
val appWidgetView = RemoteViews(context.packageName,
|
||||
R.layout.app_widget_card)
|
||||
val appWidgetView = RemoteViews(context.packageName, R.layout.app_widget_card)
|
||||
|
||||
appWidgetView.setViewVisibility(R.id.media_titles, View.INVISIBLE)
|
||||
appWidgetView.setImageViewResource(R.id.image, R.drawable.default_album_art)
|
||||
|
@ -64,8 +63,7 @@ class AppWidgetCard : BaseAppWidget() {
|
|||
* Update all active widget instances by pushing changes
|
||||
*/
|
||||
override fun performUpdate(service: MusicService, appWidgetIds: IntArray?) {
|
||||
val appWidgetView = RemoteViews(service.packageName,
|
||||
R.layout.app_widget_card)
|
||||
val appWidgetView = RemoteViews(service.packageName, R.layout.app_widget_card)
|
||||
|
||||
val isPlaying = service.isPlaying
|
||||
val song = service.currentSong
|
||||
|
|
|
@ -49,6 +49,7 @@ class AppWidgetClassic : BaseAppWidget() {
|
|||
override fun defaultAppWidget(context: Context, appWidgetIds: IntArray) {
|
||||
val appWidgetView = RemoteViews(context.packageName, R.layout.app_widget_classic)
|
||||
|
||||
|
||||
appWidgetView.setViewVisibility(R.id.media_titles, View.INVISIBLE)
|
||||
appWidgetView.setImageViewResource(R.id.image, R.drawable.default_album_art)
|
||||
appWidgetView.setImageViewBitmap(R.id.button_next, createBitmap(RetroUtil.getTintedVectorDrawable(context, R.drawable.ic_skip_next_white_24dp, MaterialValueHelper.getSecondaryTextColor(context, true))!!, 1f))
|
||||
|
@ -63,8 +64,7 @@ class AppWidgetClassic : BaseAppWidget() {
|
|||
* Update all active widget instances by pushing changes
|
||||
*/
|
||||
override fun performUpdate(service: MusicService, appWidgetIds: IntArray?) {
|
||||
val appWidgetView = RemoteViews(service.packageName,
|
||||
R.layout.app_widget_classic)
|
||||
val appWidgetView = RemoteViews(service.packageName, R.layout.app_widget_classic)
|
||||
|
||||
val isPlaying = service.isPlaying
|
||||
val song = service.currentSong
|
||||
|
|
|
@ -73,11 +73,11 @@ abstract class BaseAppWidget : AppWidgetProvider() {
|
|||
/**
|
||||
* Check against [AppWidgetManager] if there are any instances of this widget.
|
||||
*/
|
||||
protected fun hasInstances(context: Context): Boolean {
|
||||
private fun hasInstances(context: Context): Boolean {
|
||||
val appWidgetManager = AppWidgetManager.getInstance(context)
|
||||
val mAppWidgetIds = appWidgetManager.getAppWidgetIds(ComponentName(context,
|
||||
javaClass))
|
||||
return mAppWidgetIds.size > 0
|
||||
return mAppWidgetIds.isNotEmpty()
|
||||
}
|
||||
|
||||
protected fun buildPendingIntent(context: Context, action: String,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue