From 5c495108c48a9746cb5f7989bdd2613b41619578 Mon Sep 17 00:00:00 2001 From: h4h13 Date: Fri, 8 Nov 2019 22:37:30 +0530 Subject: [PATCH] Fix id names --- .../retromusic/adapter/SearchAdapter.kt | 6 +-- .../adapter/artist/ArtistAdapter.kt | 4 +- .../adapter/base/MediaEntryViewHolder.java | 13 +++-- .../retromusic/appwidgets/AppWidgetCard.kt | 6 +-- .../retromusic/appwidgets/AppWidgetClassic.kt | 4 +- .../appwidgets/base/BaseAppWidget.kt | 4 +- app/src/main/res/drawable/card.xml | 29 +++++----- .../res/layout-xlarge-land/activity_album.xml | 2 +- .../main/res/layout-xlarge/activity_album.xml | 2 +- app/src/main/res/layout-xlarge/item_image.xml | 2 +- .../main/res/layout/app_widget_classic.xml | 7 +-- app/src/main/res/layout/image.xml | 5 +- .../main/res/layout/item_artist_square.xml | 6 +-- app/src/main/res/layout/item_card_color.xml | 2 +- app/src/main/res/layout/item_contributor.xml | 3 +- app/src/main/res/layout/item_grid.xml | 4 +- app/src/main/res/layout/item_grid_circle.xml | 2 +- app/src/main/res/layout/item_image.xml | 2 +- .../main/res/layout/item_image_gradient.xml | 2 +- app/src/main/res/layout/item_list.xml | 6 +-- .../main/res/layout/item_list_no_image.xml | 53 +++++++++---------- app/src/main/res/layout/item_queue.xml | 4 +- app/src/main/res/layout/item_song.xml | 6 +-- app/src/main/res/values/colors.xml | 7 +++ .../main/res/xml/pref_now_playing_screen.xml | 1 - 25 files changed, 92 insertions(+), 90 deletions(-) diff --git a/app/src/main/java/code/name/monkey/retromusic/adapter/SearchAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/adapter/SearchAdapter.kt index b7756540..e9a976db 100644 --- a/app/src/main/java/code/name/monkey/retromusic/adapter/SearchAdapter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/adapter/SearchAdapter.kt @@ -92,10 +92,8 @@ class SearchAdapter( ALBUM -> setImageTransitionName(activity.getString(R.string.transition_album_art)) ARTIST -> setImageTransitionName(activity.getString(R.string.transition_artist_image)) else -> { - val container = itemView.findViewById(R.id.image_container) - if (container != null) { - container.visibility = View.GONE - } + val container = itemView.findViewById(R.id.imageContainer) + container?.visibility = View.GONE } } } diff --git a/app/src/main/java/code/name/monkey/retromusic/adapter/artist/ArtistAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/adapter/artist/ArtistAdapter.kt index 58e8dec5..51d89b2c 100644 --- a/app/src/main/java/code/name/monkey/retromusic/adapter/artist/ArtistAdapter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/adapter/artist/ArtistAdapter.kt @@ -126,9 +126,7 @@ class ArtistAdapter(val activity: AppCompatActivity, init { setImageTransitionName(activity.getString(code.name.monkey.retromusic.R.string.transition_artist_image)) - if (menu != null) { - menu!!.visibility = View.GONE - } + menu?.visibility = View.GONE } override fun onClick(v: View?) { diff --git a/app/src/main/java/code/name/monkey/retromusic/adapter/base/MediaEntryViewHolder.java b/app/src/main/java/code/name/monkey/retromusic/adapter/base/MediaEntryViewHolder.java index 17786888..ed59c1d5 100644 --- a/app/src/main/java/code/name/monkey/retromusic/adapter/base/MediaEntryViewHolder.java +++ b/app/src/main/java/code/name/monkey/retromusic/adapter/base/MediaEntryViewHolder.java @@ -14,7 +14,6 @@ package code.name.monkey.retromusic.adapter.base; -import android.os.Build; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; @@ -81,14 +80,14 @@ public class MediaEntryViewHolder extends RecyclerView.ViewHolder implements Vie image = itemView.findViewById(R.id.image); time = itemView.findViewById(R.id.time); - imageText = itemView.findViewById(R.id.image_text); - imageContainer = itemView.findViewById(R.id.image_container); - imageTextContainer = itemView.findViewById(R.id.image_text_container); - imageContainerCard = itemView.findViewById(R.id.image_container_card); + imageText = itemView.findViewById(R.id.imageText); + imageContainer = itemView.findViewById(R.id.imageContainer); + imageTextContainer = itemView.findViewById(R.id.imageTextContainer); + imageContainerCard = itemView.findViewById(R.id.imageContainerCard); menu = itemView.findViewById(R.id.menu); dragView = itemView.findViewById(R.id.drag_view); - paletteColorContainer = itemView.findViewById(R.id.palette_color_container); + paletteColorContainer = itemView.findViewById(R.id.paletteColorContainer); recyclerView = itemView.findViewById(R.id.recycler_view); mask = itemView.findViewById(R.id.mask); playSongs = itemView.findViewById(R.id.playSongs); @@ -111,7 +110,7 @@ public class MediaEntryViewHolder extends RecyclerView.ViewHolder implements Vie } public void setImageTransitionName(@NonNull String transitionName) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && image != null) { + if (image != null) { image.setTransitionName(transitionName); } } diff --git a/app/src/main/java/code/name/monkey/retromusic/appwidgets/AppWidgetCard.kt b/app/src/main/java/code/name/monkey/retromusic/appwidgets/AppWidgetCard.kt index 06a490ad..79f92cc5 100644 --- a/app/src/main/java/code/name/monkey/retromusic/appwidgets/AppWidgetCard.kt +++ b/app/src/main/java/code/name/monkey/retromusic/appwidgets/AppWidgetCard.kt @@ -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 diff --git a/app/src/main/java/code/name/monkey/retromusic/appwidgets/AppWidgetClassic.kt b/app/src/main/java/code/name/monkey/retromusic/appwidgets/AppWidgetClassic.kt index 516baec3..03a5141c 100644 --- a/app/src/main/java/code/name/monkey/retromusic/appwidgets/AppWidgetClassic.kt +++ b/app/src/main/java/code/name/monkey/retromusic/appwidgets/AppWidgetClassic.kt @@ -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 diff --git a/app/src/main/java/code/name/monkey/retromusic/appwidgets/base/BaseAppWidget.kt b/app/src/main/java/code/name/monkey/retromusic/appwidgets/base/BaseAppWidget.kt index a810e2cd..362f97c4 100644 --- a/app/src/main/java/code/name/monkey/retromusic/appwidgets/base/BaseAppWidget.kt +++ b/app/src/main/java/code/name/monkey/retromusic/appwidgets/base/BaseAppWidget.kt @@ -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, diff --git a/app/src/main/res/drawable/card.xml b/app/src/main/res/drawable/card.xml index 51265cae..7413c509 100644 --- a/app/src/main/res/drawable/card.xml +++ b/app/src/main/res/drawable/card.xml @@ -5,10 +5,10 @@ - + android:left="10dp" + android:right="10dp" + android:top="10dp" /> + @@ -19,8 +19,8 @@ android:left="0dp" android:right="0dp" android:top="0dp" /> - - + + @@ -30,15 +30,16 @@ android:left="0dp" android:right="0dp" android:top="0dp" /> - - + + + + + + + + + - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-xlarge-land/activity_album.xml b/app/src/main/res/layout-xlarge-land/activity_album.xml index 3f14506e..2fb0ef98 100644 --- a/app/src/main/res/layout-xlarge-land/activity_album.xml +++ b/app/src/main/res/layout-xlarge-land/activity_album.xml @@ -31,7 +31,7 @@ app:titleEnabled="false"> diff --git a/app/src/main/res/layout-xlarge/activity_album.xml b/app/src/main/res/layout-xlarge/activity_album.xml index c95bc60d..5377d90b 100644 --- a/app/src/main/res/layout-xlarge/activity_album.xml +++ b/app/src/main/res/layout-xlarge/activity_album.xml @@ -32,7 +32,7 @@ app:titleEnabled="false"> diff --git a/app/src/main/res/layout-xlarge/item_image.xml b/app/src/main/res/layout-xlarge/item_image.xml index 444036d2..16034b08 100644 --- a/app/src/main/res/layout-xlarge/item_image.xml +++ b/app/src/main/res/layout-xlarge/item_image.xml @@ -12,7 +12,7 @@ android:orientation="vertical"> @@ -76,7 +76,7 @@ android:layout_height="wrap_content" android:gravity="center_vertical" android:singleLine="true" - android:textAppearance="@style/TextViewNormal" + android:textAppearance="@style/TextViewSubtitle1" android:textColor="@color/ate_primary_text_dark" tools:text="Title" /> @@ -85,8 +85,9 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" + android:paddingTop="4dp" android:singleLine="true" - android:textAppearance="@style/TextViewCaption" + android:textAppearance="@style/TextViewNormal" android:textColor="@color/ate_secondary_text_dark" tools:text="Text" /> diff --git a/app/src/main/res/layout/image.xml b/app/src/main/res/layout/image.xml index 0ac65594..6dc2d8d1 100644 --- a/app/src/main/res/layout/image.xml +++ b/app/src/main/res/layout/image.xml @@ -1,7 +1,7 @@ @@ -30,6 +30,7 @@ android:maxLines="2" android:padding="12dp" android:textAppearance="@style/TextViewSubtitle1" - android:textColor="@color/md_white_1000" /> + android:textColor="@color/md_white_1000" + tools:text="@tools:sample/lorem/random" /> \ No newline at end of file diff --git a/app/src/main/res/layout/item_artist_square.xml b/app/src/main/res/layout/item_artist_square.xml index 48d8c79f..9afb5525 100644 --- a/app/src/main/res/layout/item_artist_square.xml +++ b/app/src/main/res/layout/item_artist_square.xml @@ -16,12 +16,12 @@ + android:scaleType="centerCrop" + tools:src="@tools:sample/avatars" /> diff --git a/app/src/main/res/layout/item_card_color.xml b/app/src/main/res/layout/item_card_color.xml index 96bb12e8..6a83f453 100644 --- a/app/src/main/res/layout/item_card_color.xml +++ b/app/src/main/res/layout/item_card_color.xml @@ -10,7 +10,7 @@ tools:ignore="MissingPrefix"> + tools:srcCompat="@tools:sample/backgrounds/scenic" /> diff --git a/app/src/main/res/layout/item_grid_circle.xml b/app/src/main/res/layout/item_grid_circle.xml index f46e5fab..9e264632 100644 --- a/app/src/main/res/layout/item_grid_circle.xml +++ b/app/src/main/res/layout/item_grid_circle.xml @@ -15,7 +15,7 @@ tools:ignore="UnusedAttribute,UselessParent"> diff --git a/app/src/main/res/layout/item_image.xml b/app/src/main/res/layout/item_image.xml index 2a7e47cd..16517c62 100644 --- a/app/src/main/res/layout/item_image.xml +++ b/app/src/main/res/layout/item_image.xml @@ -12,7 +12,7 @@ android:orientation="vertical"> diff --git a/app/src/main/res/layout/item_list.xml b/app/src/main/res/layout/item_list.xml index 8d36f852..1792fa40 100755 --- a/app/src/main/res/layout/item_list.xml +++ b/app/src/main/res/layout/item_list.xml @@ -24,7 +24,7 @@ tools:visibility="visible" /> - - + android:singleLine="true" + android:textAppearance="@style/TextViewSubtitle1" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:text="Genre name" /> - + - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/item_queue.xml b/app/src/main/res/layout/item_queue.xml index bc08e3cd..e4255f9a 100644 --- a/app/src/main/res/layout/item_queue.xml +++ b/app/src/main/res/layout/item_queue.xml @@ -28,13 +28,13 @@ tools:visibility="visible" /> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index d1335b93..dad10c0c 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -25,4 +25,11 @@ #000000 #000000 #121212 + + #00000000 + + #ffffff + #d4d4d4 + #dddddd + #eee diff --git a/app/src/main/res/xml/pref_now_playing_screen.xml b/app/src/main/res/xml/pref_now_playing_screen.xml index d37cf43c..a478dcb6 100644 --- a/app/src/main/res/xml/pref_now_playing_screen.xml +++ b/app/src/main/res/xml/pref_now_playing_screen.xml @@ -56,7 +56,6 @@