Fix id names
This commit is contained in:
parent
486f1aebc6
commit
5c495108c4
25 changed files with 92 additions and 90 deletions
|
@ -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<View>(R.id.image_container)
|
||||
if (container != null) {
|
||||
container.visibility = View.GONE
|
||||
}
|
||||
val container = itemView.findViewById<View>(R.id.imageContainer)
|
||||
container?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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?) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
<shape>
|
||||
<padding
|
||||
android:bottom="5dp"
|
||||
android:left="8dp"
|
||||
android:right="8dp"
|
||||
android:top="8dp" />
|
||||
<solid android:color="@android:color/transparent" />
|
||||
android:left="10dp"
|
||||
android:right="10dp"
|
||||
android:top="10dp" />
|
||||
<solid android:color="@color/transparent" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
|
@ -19,8 +19,8 @@
|
|||
android:left="0dp"
|
||||
android:right="0dp"
|
||||
android:top="0dp" />
|
||||
<solid android:color="#55d4d4d4" />
|
||||
<corners android:radius="6dp" />
|
||||
<solid android:color="@color/card_shadow_1" />
|
||||
<corners android:radius="2dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -30,15 +30,16 @@
|
|||
android:left="0dp"
|
||||
android:right="0dp"
|
||||
android:top="0dp" />
|
||||
<solid android:color="#55dddddd" />
|
||||
<corners android:radius="6dp" />
|
||||
<solid android:color="@color/card_shadow_2" />
|
||||
<corners android:radius="2dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- Background -->
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/card_background" />
|
||||
<corners android:radius="2dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@android:color/white" />
|
||||
<corners android:radius="6dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
|
@ -31,7 +31,7 @@
|
|||
app:titleEnabled="false">
|
||||
|
||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||
android:id="@+id/image_container"
|
||||
android:id="@+id/imageContainer"
|
||||
android:layout_width="320dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
app:titleEnabled="false">
|
||||
|
||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||
android:id="@+id/image_container"
|
||||
android:id="@+id/imageContainer"
|
||||
android:layout_width="320dp"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/image_container_card"
|
||||
android:id="@+id/imageContainerCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="8dp"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/app_widget_classic_height"
|
||||
android:background="#AA000000"
|
||||
android:background="@color/md_black_1000"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="ContentDescription">
|
||||
|
||||
|
@ -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" />
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/image_container"
|
||||
android:id="@+id/imageContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
@ -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" />
|
||||
|
||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
|
@ -16,12 +16,12 @@
|
|||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="112dp"
|
||||
tools:src="@tools:sample/avatars"
|
||||
android:layout_height="156dp"
|
||||
android:scaleType="centerCrop" />
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="@tools:sample/avatars" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/palette_color_container"
|
||||
android:id="@+id/paletteColorContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
tools:ignore="MissingPrefix">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/palette_color_container"
|
||||
android:id="@+id/paletteColorContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?rectSelector"
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
android:layout_height="40dp"
|
||||
app:civ_border="false"
|
||||
app:civ_shadow="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_person_flat"
|
||||
|
@ -54,7 +55,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/icon"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toEndOf="@id/icon"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/image_container_card"
|
||||
android:id="@+id/imageContainerCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="8dp"
|
||||
|
@ -32,7 +32,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:srcCompat="@tools:sample/backgrounds/scenic[18]" />
|
||||
tools:srcCompat="@tools:sample/backgrounds/scenic" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
tools:ignore="UnusedAttribute,UselessParent">
|
||||
|
||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||
android:id="@+id/image_container"
|
||||
android:id="@+id/imageContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp">
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/image_container_card"
|
||||
android:id="@+id/imageContainerCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="8dp"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
app:cardUseCompatPadding="true">
|
||||
|
||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||
android:id="@+id/image_container"
|
||||
android:id="@+id/imageContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
tools:visibility="visible" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/image_container"
|
||||
android:id="@+id/imageContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0"
|
||||
|
@ -32,7 +32,7 @@
|
|||
android:paddingEnd="0dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/image_text_container"
|
||||
android:id="@+id/imageTextContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
|
@ -48,7 +48,7 @@
|
|||
tools:srcCompat="@tools:sample/backgrounds/scenic[16]" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/image_text"
|
||||
android:id="@+id/imageText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:fontFeatureSettings="onum"
|
||||
|
|
|
@ -12,39 +12,38 @@
|
|||
~ See the GNU General Public License for more details.
|
||||
-->
|
||||
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="72dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:foreground="?attr/rectSelector"
|
||||
android:minHeight="72dp"
|
||||
android:padding="16dp"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingRight="16dp">
|
||||
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" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextViewSubtitle1"
|
||||
tools:text="Genre name" />
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFeatureSettings="onum"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title"
|
||||
tools:text="Genre details" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFeatureSettings="onum"
|
||||
android:singleLine="true"
|
||||
tools:text="Genre details" />
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -28,13 +28,13 @@
|
|||
tools:visibility="visible" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/image_container"
|
||||
android:id="@+id/imageContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/image_text"
|
||||
android:id="@+id/imageText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:fontFeatureSettings="onum"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
android:orientation="horizontal">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/image_container"
|
||||
android:id="@+id/imageContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0"
|
||||
|
@ -21,7 +21,7 @@
|
|||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/image_text"
|
||||
android:id="@+id/imageText"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
android:fontFeatureSettings="onum"
|
||||
|
@ -43,7 +43,7 @@
|
|||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/time"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/image_container"
|
||||
app:layout_constraintStart_toEndOf="@+id/imageContainer"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="Song title" />
|
||||
|
||||
|
|
|
@ -25,4 +25,11 @@
|
|||
<color name="blackColorSecondary">#000000</color>
|
||||
<color name="blackColorBackground">#000000</color>
|
||||
<color name="blackColorSurface">#121212</color>
|
||||
|
||||
<color name="transparent">#00000000</color>
|
||||
<!-- card colors -->
|
||||
<color name="card_background">#ffffff</color>
|
||||
<color name="card_shadow_1">#d4d4d4</color>
|
||||
<color name="card_shadow_2">#dddddd</color>
|
||||
<color name="card_detailing">#eee</color>
|
||||
</resources>
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
|
||||
android:layout="@layout/list_item_view"
|
||||
app:defaultValue="false"
|
||||
app:enableCopying="true"
|
||||
app:icon="@drawable/ic_volume_up_white_24dp"
|
||||
app:key="toggle_volume"
|
||||
app:summary="@string/pref_summary_toggle_volume"
|
||||
|
|
Loading…
Reference in a new issue