Fix folder toolbar and folder icon background
This commit is contained in:
parent
33ed4fe4c3
commit
310cfe8491
3 changed files with 22 additions and 25 deletions
|
@ -8,13 +8,14 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.adapter.base.AbsMultiSelectAdapter
|
||||
import code.name.monkey.retromusic.adapter.base.MediaEntryViewHolder
|
||||
import code.name.monkey.retromusic.glide.GlideApp
|
||||
import code.name.monkey.retromusic.glide.audiocover.AudioFileCover
|
||||
import code.name.monkey.retromusic.interfaces.CabHolder
|
||||
import code.name.monkey.retromusic.adapter.base.AbsMultiSelectAdapter
|
||||
import code.name.monkey.retromusic.adapter.base.MediaEntryViewHolder
|
||||
import code.name.monkey.retromusic.util.RetroUtil
|
||||
import com.bumptech.glide.GenericTransitionOptions
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
|
@ -81,8 +82,12 @@ class SongFileAdapter(private val activity: AppCompatActivity, private var dataS
|
|||
private fun loadFileImage(file: File, holder: ViewHolder) {
|
||||
val iconColor = ATHUtil.resolveColor(activity, R.attr.iconColor)
|
||||
if (file.isDirectory) {
|
||||
holder.image!!.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN)
|
||||
holder.image!!.setImageResource(R.drawable.ic_folder_white_24dp)
|
||||
holder.image?.let {
|
||||
it.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN)
|
||||
it.setImageResource(R.drawable.ic_folder_white_24dp)
|
||||
}
|
||||
holder.imageTextContainer?.setCardBackgroundColor(ThemeStore.primaryColor(activity))
|
||||
|
||||
} else {
|
||||
val error = RetroUtil.getTintedVectorDrawable(activity, R.drawable.ic_file_music_white_24dp, iconColor)
|
||||
GlideApp.with(activity)
|
||||
|
|
|
@ -18,7 +18,6 @@ import android.annotation.SuppressLint;
|
|||
import android.app.Activity;
|
||||
import android.media.MediaScannerConnection;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
@ -58,17 +57,7 @@ public class UpdateToastMediaScannerCompletionListener implements MediaScannerCo
|
|||
}
|
||||
String text = " " + String.format(scannedFiles, scanned, toBeScanned.length) + (failed > 0 ? " " + String.format(couldNotScanFiles, failed) : "");
|
||||
toast.setText(text);
|
||||
try {
|
||||
if (toast.getView().isShown()) {
|
||||
toast.cancel();
|
||||
}
|
||||
if (Build.VERSION.SDK_INT < 28 && toast.getView().isShown()) {
|
||||
toast.cancel();
|
||||
}
|
||||
toast.show();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
toast.show();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,30 +31,33 @@
|
|||
app:elevation="0dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/toolbarContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="6dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
app:cardElevation="0dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:strokeColor="?dividerColor"
|
||||
app:strokeWidth="1dp">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_scrollFlags="scroll|enterAlways">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
android:layout_gravity="center_vertical"
|
||||
app:layout_collapseMode="pin"
|
||||
app:titleMarginStart="0dp"
|
||||
app:title="@string/folders"
|
||||
app:titleMarginStart="0dp"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/cab_stub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="48dp" />
|
||||
</FrameLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
|
Loading…
Reference in a new issue