Fix #153 & #154 - Icon not visible in menu / No indicator for audio messages

This commit is contained in:
Thomas 2022-06-09 17:20:45 +02:00
parent 640a725495
commit f51c24dfb2
7 changed files with 61 additions and 9 deletions

View file

@ -9,8 +9,8 @@ android {
defaultConfig {
minSdk 21
targetSdk 31
versionCode 19
versionName "beta-19"
versionCode 20
versionName "beta-20"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View file

@ -934,6 +934,11 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
} else {
layoutMediaBinding.playVideo.setVisibility(View.GONE);
}
if (statusToDeal.media_attachments.get(0).type != null && statusToDeal.media_attachments.get(0).type.equalsIgnoreCase("audio")) {
layoutMediaBinding.playMusic.setVisibility(View.VISIBLE);
} else {
layoutMediaBinding.playMusic.setVisibility(View.GONE);
}
if (!mediaObfuscated(statusToDeal) || expand_media) {
layoutMediaBinding.viewHide.setImageResource(R.drawable.ic_baseline_visibility_24);
Glide.with(layoutMediaBinding.media.getContext())
@ -972,6 +977,11 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
} else {
layoutMediaBinding.playVideo.setVisibility(View.GONE);
}
if (attachment.type != null && attachment.type.equalsIgnoreCase("audio")) {
layoutMediaBinding.playMusic.setVisibility(View.VISIBLE);
} else {
layoutMediaBinding.playMusic.setVisibility(View.GONE);
}
lp.setMargins(0, 0, (int) Helper.convertDpToPixel(5, context), 0);
if (!mediaObfuscated(statusToDeal) || expand_media) {
layoutMediaBinding.viewHide.setImageResource(R.drawable.ic_baseline_visibility_24);

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="128dp"
android:height="128dp"
android:tint="#FFFFFF"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M12,3v9.28c-0.47,-0.17 -0.97,-0.28 -1.5,-0.28C8.01,12 6,14.01 6,16.5S8.01,21 10.5,21c2.31,0 4.2,-1.75 4.45,-4H15V6h4V3h-7z" />
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#FFFFFF"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M12,3v9.28c-0.47,-0.17 -0.97,-0.28 -1.5,-0.28C8.01,12 6,14.01 6,16.5S8.01,21 10.5,21c2.31,0 4.2,-1.75 4.45,-4H15V6h4V3h-7z" />
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:tint="#FFFFFF"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M12,3v9.28c-0.47,-0.17 -0.97,-0.28 -1.5,-0.28C8.01,12 6,14.01 6,16.5S8.01,21 10.5,21c2.31,0 4.2,-1.75 4.45,-4H15V6h4V3h-7z" />
</vector>

View file

@ -20,6 +20,14 @@
android:src="@drawable/ic_baseline_play_circle_filled_24"
android:visibility="gone" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/play_music"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/ic_baseline_audiotrack_24"
android:visibility="gone" />
<ImageView
android:id="@+id/view_hide"
android:layout_width="24dp"

View file

@ -3,8 +3,18 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
xmlns:tools="http://schemas.android.com/tools"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/background_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="@dimen/nav_header_height"
android:scaleType="centerCrop"
tools:src="@tools:sample/backgrounds/scenic" />
<ImageView
android:id="@+id/header_option_info"
android:layout_width="wrap_content"
@ -17,13 +27,6 @@
android:src="@drawable/ic_baseline_more_vert_24"
app:tint="?iconColor" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/background_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="@dimen/nav_header_height"
android:scaleType="centerCrop" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="180dp"
@ -42,6 +45,7 @@
android:layout_gravity="center_vertical"
android:contentDescription="@string/profile_picture"
android:paddingTop="@dimen/nav_header_vertical_spacing"
tools:src="@tools:sample/avatars"
android:scaleType="fitCenter" />
<androidx.appcompat.widget.LinearLayoutCompat