Fix grid dialog overlap and title overlap
This commit is contained in:
parent
59c5bbddcc
commit
8500241b83
13 changed files with 322 additions and 161 deletions
|
@ -1,7 +1,8 @@
|
||||||
package code.name.monkey.retromusic.fragments.mainactivity;
|
package code.name.monkey.retromusic.fragments.mainactivity;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
@ -11,45 +12,45 @@ import android.view.SubMenu;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.StringRes;
|
import androidx.annotation.StringRes;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
import com.afollestad.materialcab.MaterialCab;
|
import com.afollestad.materialcab.MaterialCab;
|
||||||
|
import com.bumptech.glide.request.Request;
|
||||||
|
import com.bumptech.glide.request.target.SizeReadyCallback;
|
||||||
|
import com.bumptech.glide.request.target.Target;
|
||||||
|
import com.bumptech.glide.request.transition.Transition;
|
||||||
import com.google.android.material.appbar.AppBarLayout;
|
import com.google.android.material.appbar.AppBarLayout;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import code.name.monkey.appthemehelper.ThemeStore;
|
import code.name.monkey.appthemehelper.ThemeStore;
|
||||||
import code.name.monkey.appthemehelper.common.ATHToolbarActivity;
|
import code.name.monkey.appthemehelper.common.ATHToolbarActivity;
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil;
|
import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||||
import code.name.monkey.appthemehelper.util.DrawableUtil;
|
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper;
|
import code.name.monkey.appthemehelper.util.TintHelper;
|
||||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.dialogs.CreatePlaylistDialog;
|
import code.name.monkey.retromusic.dialogs.CreatePlaylistDialog;
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment;
|
import code.name.monkey.retromusic.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment;
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsMainActivityFragment;
|
import code.name.monkey.retromusic.fragments.base.AbsMainActivityFragment;
|
||||||
|
import code.name.monkey.retromusic.glide.GlideApp;
|
||||||
import code.name.monkey.retromusic.helper.SortOrder;
|
import code.name.monkey.retromusic.helper.SortOrder;
|
||||||
import code.name.monkey.retromusic.interfaces.CabHolder;
|
import code.name.monkey.retromusic.interfaces.CabHolder;
|
||||||
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks;
|
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks;
|
||||||
import code.name.monkey.retromusic.util.Compressor;
|
import code.name.monkey.retromusic.util.NavigationUtil;
|
||||||
import code.name.monkey.retromusic.util.ImageUtil;
|
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||||
import code.name.monkey.retromusic.util.RetroColorUtil;
|
import code.name.monkey.retromusic.util.RetroColorUtil;
|
||||||
import code.name.monkey.retromusic.util.RetroUtil;
|
import code.name.monkey.retromusic.util.RetroUtil;
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
||||||
import io.reactivex.disposables.CompositeDisposable;
|
import io.reactivex.disposables.CompositeDisposable;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
|
||||||
|
|
||||||
import static code.name.monkey.retromusic.Constants.USER_PROFILE;
|
import static code.name.monkey.retromusic.Constants.USER_PROFILE;
|
||||||
|
|
||||||
|
@ -66,6 +67,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
||||||
private FragmentManager fragmentManager;
|
private FragmentManager fragmentManager;
|
||||||
private ImageView userImage;
|
private ImageView userImage;
|
||||||
private CompositeDisposable disposable;
|
private CompositeDisposable disposable;
|
||||||
|
private TextView bannerTitle;
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public static Fragment newInstance(int tab) {
|
public static Fragment newInstance(int tab) {
|
||||||
|
@ -94,6 +96,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
||||||
View view = inflater.inflate(R.layout.fragment_library, container, false);
|
View view = inflater.inflate(R.layout.fragment_library, container, false);
|
||||||
disposable = new CompositeDisposable();
|
disposable = new CompositeDisposable();
|
||||||
contentContainer = view.findViewById(R.id.fragmentContainer);
|
contentContainer = view.findViewById(R.id.fragmentContainer);
|
||||||
|
bannerTitle = view.findViewById(R.id.bannerTitle);
|
||||||
appBarLayout = view.findViewById(R.id.appBarLayout);
|
appBarLayout = view.findViewById(R.id.appBarLayout);
|
||||||
toolbar = view.findViewById(R.id.toolbar);
|
toolbar = view.findViewById(R.id.toolbar);
|
||||||
userImage = view.findViewById(R.id.userImage);
|
userImage = view.findViewById(R.id.userImage);
|
||||||
|
@ -103,21 +106,75 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void loadImageFromStorage() {
|
private void loadImageFromStorage() {
|
||||||
disposable.add(new Compressor(Objects.requireNonNull(getContext()))
|
GlideApp.with(getMainActivity())
|
||||||
.setMaxHeight(300)
|
.asDrawable()
|
||||||
.setMaxWidth(300)
|
.placeholder(R.drawable.ic_person_flat)
|
||||||
.setQuality(75)
|
.fallback(R.drawable.ic_person_flat)
|
||||||
.setCompressFormat(Bitmap.CompressFormat.WEBP)
|
.load(new File(PreferenceUtil.getInstance().getProfileImage(), USER_PROFILE))
|
||||||
.compressToBitmapAsFlowable(new File(PreferenceUtil.getInstance().getProfileImage(), USER_PROFILE))
|
.into(new Target<Drawable>() {
|
||||||
.subscribeOn(Schedulers.io())
|
@Override
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
public void onLoadStarted(@Nullable Drawable placeholder) {
|
||||||
.subscribe(bitmap -> userImage.setImageBitmap(bitmap),
|
userImage.setImageDrawable(placeholder);
|
||||||
throwable -> userImage.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_person_flat))));
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadFailed(@Nullable Drawable errorDrawable) {
|
||||||
|
userImage.setImageDrawable(errorDrawable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||||
|
userImage.setImageDrawable(resource);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadCleared(@Nullable Drawable placeholder) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getSize(@NonNull SizeReadyCallback cb) {
|
||||||
|
cb.onSizeReady(32, 32);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeCallback(@NonNull SizeReadyCallback cb) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setRequest(@Nullable Request request) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public Request getRequest() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStop() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTitle(@StringRes int name) {
|
public void setTitle(@StringRes int name) {
|
||||||
toolbar.setTitle(getString(name));
|
bannerTitle.setText(getString(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addOnAppBarOffsetChangedListener(@NonNull AppBarLayout.OnOffsetChangedListener onOffsetChangedListener) {
|
public void addOnAppBarOffsetChangedListener(@NonNull AppBarLayout.OnOffsetChangedListener onOffsetChangedListener) {
|
||||||
|
@ -167,9 +224,9 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
||||||
private void setupToolbar() {
|
private void setupToolbar() {
|
||||||
int primaryColor = ThemeStore.Companion.primaryColor(getContext());
|
int primaryColor = ThemeStore.Companion.primaryColor(getContext());
|
||||||
TintHelper.setTintAuto(contentContainer, primaryColor, true);
|
TintHelper.setTintAuto(contentContainer, primaryColor, true);
|
||||||
|
bannerTitle.setTextColor(ThemeStore.Companion.textColorPrimary(getContext()));
|
||||||
|
|
||||||
toolbar.setBackgroundColor(primaryColor);
|
toolbar.setBackgroundColor(primaryColor);
|
||||||
toolbar.setLogo( R.drawable.ic_person_flat);
|
|
||||||
toolbar.setNavigationIcon(null);
|
toolbar.setNavigationIcon(null);
|
||||||
appBarLayout.setBackgroundColor(primaryColor);
|
appBarLayout.setBackgroundColor(primaryColor);
|
||||||
appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
|
appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
|
||||||
|
@ -252,7 +309,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPrepareOptionsMenu(Menu menu) {
|
public void onPrepareOptionsMenu(@NonNull Menu menu) {
|
||||||
super.onPrepareOptionsMenu(menu);
|
super.onPrepareOptionsMenu(menu);
|
||||||
Activity activity = getActivity();
|
Activity activity = getActivity();
|
||||||
if (activity == null) {
|
if (activity == null) {
|
||||||
|
@ -367,7 +424,6 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("ConstantConditions")
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
//if (pager == null) return false;
|
//if (pager == null) return false;
|
||||||
|
@ -383,6 +439,9 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
||||||
}
|
}
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
switch (id) {
|
switch (id) {
|
||||||
|
case R.id.action_search:
|
||||||
|
NavigationUtil.goToSearch(getMainActivity());
|
||||||
|
break;
|
||||||
case R.id.action_new_playlist:
|
case R.id.action_new_playlist:
|
||||||
CreatePlaylistDialog.Companion.create().show(getChildFragmentManager(), "CREATE_PLAYLIST");
|
CreatePlaylistDialog.Companion.create().show(getChildFragmentManager(), "CREATE_PLAYLIST");
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -2,20 +2,21 @@ package code.name.monkey.retromusic.fragments.mainactivity.home
|
||||||
|
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.DisplayMetrics
|
import android.util.DisplayMetrics
|
||||||
import android.view.LayoutInflater
|
import android.view.*
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.appcompat.widget.Toolbar
|
import androidx.appcompat.widget.Toolbar
|
||||||
import androidx.core.content.ContextCompat
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper
|
import code.name.monkey.appthemehelper.common.ATHToolbarActivity
|
||||||
|
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
||||||
import code.name.monkey.retromusic.Constants.USER_BANNER
|
import code.name.monkey.retromusic.Constants.USER_BANNER
|
||||||
import code.name.monkey.retromusic.Constants.USER_PROFILE
|
import code.name.monkey.retromusic.Constants.USER_PROFILE
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
|
import code.name.monkey.retromusic.adapter.HomeAdapter
|
||||||
|
import code.name.monkey.retromusic.fragments.base.AbsMainActivityFragment
|
||||||
import code.name.monkey.retromusic.glide.GlideApp
|
import code.name.monkey.retromusic.glide.GlideApp
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks
|
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks
|
||||||
|
@ -26,13 +27,15 @@ import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist
|
||||||
import code.name.monkey.retromusic.model.smartplaylist.MyTopTracksPlaylist
|
import code.name.monkey.retromusic.model.smartplaylist.MyTopTracksPlaylist
|
||||||
import code.name.monkey.retromusic.mvp.contract.HomeContract
|
import code.name.monkey.retromusic.mvp.contract.HomeContract
|
||||||
import code.name.monkey.retromusic.mvp.presenter.HomePresenter
|
import code.name.monkey.retromusic.mvp.presenter.HomePresenter
|
||||||
import code.name.monkey.retromusic.adapter.HomeAdapter
|
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsMainActivityFragment
|
|
||||||
import code.name.monkey.retromusic.util.Compressor
|
import code.name.monkey.retromusic.util.Compressor
|
||||||
import code.name.monkey.retromusic.util.NavigationUtil
|
import code.name.monkey.retromusic.util.NavigationUtil
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import code.name.monkey.retromusic.util.RetroUtil
|
import code.name.monkey.retromusic.util.RetroUtil
|
||||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||||
|
import com.bumptech.glide.request.Request
|
||||||
|
import com.bumptech.glide.request.target.SizeReadyCallback
|
||||||
|
import com.bumptech.glide.request.target.Target
|
||||||
|
import com.bumptech.glide.request.transition.Transition
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.disposables.CompositeDisposable
|
import io.reactivex.disposables.CompositeDisposable
|
||||||
import io.reactivex.schedulers.Schedulers
|
import io.reactivex.schedulers.Schedulers
|
||||||
|
@ -107,23 +110,58 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun loadImageFromStorage(imageView: ImageView) {
|
private fun loadImageFromStorage(imageView: ImageView) {
|
||||||
disposable.add(Compressor(context!!)
|
GlideApp.with(mainActivity)
|
||||||
.setMaxHeight(300)
|
.asDrawable()
|
||||||
.setMaxWidth(300)
|
.placeholder(R.drawable.ic_person_flat)
|
||||||
.setQuality(75)
|
.fallback(R.drawable.ic_person_flat)
|
||||||
.setCompressFormat(Bitmap.CompressFormat.WEBP)
|
.load(File(PreferenceUtil.getInstance().profileImage, USER_PROFILE))
|
||||||
.compressToBitmapAsFlowable(File(PreferenceUtil.getInstance().profileImage, USER_PROFILE))
|
.into(object : Target<Drawable> {
|
||||||
.subscribeOn(Schedulers.io())
|
override fun onLoadStarted(placeholder: Drawable?) {
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
imageView.setImageDrawable(placeholder)
|
||||||
.subscribe({
|
}
|
||||||
if (it != null) {
|
|
||||||
imageView.setImageBitmap(it)
|
override fun onLoadFailed(errorDrawable: Drawable?) {
|
||||||
} else {
|
imageView.setImageDrawable(errorDrawable)
|
||||||
imageView.setImageDrawable(ContextCompat.getDrawable(context!!, R.drawable.ic_person_flat))
|
}
|
||||||
|
|
||||||
|
override fun onResourceReady(resource: Drawable, transition: Transition<in Drawable>?) {
|
||||||
|
imageView.setImageDrawable(resource)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onLoadCleared(placeholder: Drawable?) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getSize(cb: SizeReadyCallback) {
|
||||||
|
cb.onSizeReady(32, 32)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun removeCallback(cb: SizeReadyCallback) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun setRequest(request: Request?) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getRequest(): Request? {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStart() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStop() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}) {
|
|
||||||
imageView.setImageDrawable(ContextCompat.getDrawable(context!!, R.drawable.ic_person_flat))
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
@ -177,8 +215,8 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
||||||
|
|
||||||
private fun checkPadding() {
|
private fun checkPadding() {
|
||||||
val marginSpan = when {
|
val marginSpan = when {
|
||||||
MusicPlayerRemote.playingQueue.isEmpty() -> RetroUtil.convertDpToPixel(52f, context).toInt()
|
MusicPlayerRemote.playingQueue.isEmpty() -> RetroUtil.convertDpToPixel(52f, context!!).toInt()
|
||||||
else -> RetroUtil.convertDpToPixel(0f, context).toInt()
|
else -> RetroUtil.convertDpToPixel(0f, context!!).toInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
(recyclerView.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin = (marginSpan * 2.3f).toInt()
|
(recyclerView.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin = (marginSpan * 2.3f).toInt()
|
||||||
|
@ -187,12 +225,12 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
||||||
private fun setupToolbar() {
|
private fun setupToolbar() {
|
||||||
mainActivity.title = null
|
mainActivity.title = null
|
||||||
toolbar.apply {
|
toolbar.apply {
|
||||||
navigationIcon = TintHelper.createTintedDrawable(ContextCompat.getDrawable(context!!, R.drawable.ic_search_white_24dp), ThemeStore.textColorSecondary(context!!))
|
setBackgroundColor(if (PreferenceUtil.getInstance().isHomeBanner) Color.TRANSPARENT else ThemeStore.primaryColor(context))
|
||||||
setBackgroundColor(Color.TRANSPARENT)
|
|
||||||
setNavigationOnClickListener {
|
setNavigationOnClickListener {
|
||||||
NavigationUtil.goToSearch(activity)
|
NavigationUtil.goToSearch(activity)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mainActivity.setSupportActionBar(toolbar)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun handleBackPress(): Boolean {
|
override fun handleBackPress(): Boolean {
|
||||||
|
@ -245,6 +283,27 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
|
||||||
|
super.onCreateOptionsMenu(menu, inflater)
|
||||||
|
inflater.inflate(R.menu.menu_search, menu)
|
||||||
|
|
||||||
|
val activity = activity ?: return
|
||||||
|
ToolbarContentTintHelper.handleOnCreateOptionsMenu(activity, toolbar, menu, ATHToolbarActivity.getToolbarBackgroundColor(toolbar))
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPrepareOptionsMenu(menu: Menu) {
|
||||||
|
super.onPrepareOptionsMenu(menu)
|
||||||
|
val activity = activity ?: return
|
||||||
|
ToolbarContentTintHelper.handleOnPrepareOptionsMenu(activity, toolbar)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
if (item.itemId == R.id.action_search) {
|
||||||
|
NavigationUtil.goToSearch(mainActivity)
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item)
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
const val TAG: String = "BannerHomeFragment"
|
const val TAG: String = "BannerHomeFragment"
|
||||||
|
|
|
@ -26,6 +26,7 @@ import android.graphics.Bitmap;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
|
@ -46,18 +47,19 @@ import android.view.WindowManager;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.net.InetAddress;
|
|
||||||
import java.net.NetworkInterface;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import androidx.annotation.ColorInt;
|
import androidx.annotation.ColorInt;
|
||||||
import androidx.annotation.DrawableRes;
|
import androidx.annotation.DrawableRes;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
|
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.NetworkInterface;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import code.name.monkey.appthemehelper.ThemeStore;
|
import code.name.monkey.appthemehelper.ThemeStore;
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper;
|
import code.name.monkey.appthemehelper.util.TintHelper;
|
||||||
import code.name.monkey.retromusic.App;
|
import code.name.monkey.retromusic.App;
|
||||||
|
@ -113,19 +115,19 @@ public class RetroUtil {
|
||||||
return (float) Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
|
return (float) Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float convertDpToPixel(float dp, Context context) {
|
public static float convertDpToPixel(float dp, @NonNull Context context) {
|
||||||
Resources resources = context.getResources();
|
Resources resources = context.getResources();
|
||||||
DisplayMetrics metrics = resources.getDisplayMetrics();
|
DisplayMetrics metrics = resources.getDisplayMetrics();
|
||||||
return dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);
|
return dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float convertPixelsToDp(float px, Context context) {
|
public static float convertPixelsToDp(float px, @NonNull Context context) {
|
||||||
Resources resources = context.getResources();
|
Resources resources = context.getResources();
|
||||||
DisplayMetrics metrics = resources.getDisplayMetrics();
|
DisplayMetrics metrics = resources.getDisplayMetrics();
|
||||||
return px / ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);
|
return px / ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void openUrl(Activity context, String str) {
|
public static void openUrl(@NonNull Activity context, @NonNull String str) {
|
||||||
Intent intent = new Intent("android.intent.action.VIEW");
|
Intent intent = new Intent("android.intent.action.VIEW");
|
||||||
intent.setData(Uri.parse(str));
|
intent.setData(Uri.parse(str));
|
||||||
intent.setFlags(268435456);
|
intent.setFlags(268435456);
|
||||||
|
@ -197,7 +199,8 @@ public class RetroUtil {
|
||||||
ThemeStore.Companion.accentColor(App.Companion.getInstance()));
|
ThemeStore.Companion.accentColor(App.Companion.getInstance()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Bitmap createBitmap(Drawable drawable, float sizeMultiplier) {
|
@NonNull
|
||||||
|
public static Bitmap createBitmap(@NonNull Drawable drawable, float sizeMultiplier) {
|
||||||
Bitmap bitmap = Bitmap.createBitmap((int) (drawable.getIntrinsicWidth() * sizeMultiplier),
|
Bitmap bitmap = Bitmap.createBitmap((int) (drawable.getIntrinsicWidth() * sizeMultiplier),
|
||||||
(int) (drawable.getIntrinsicHeight() * sizeMultiplier), Bitmap.Config.ARGB_8888);
|
(int) (drawable.getIntrinsicHeight() * sizeMultiplier), Bitmap.Config.ARGB_8888);
|
||||||
Canvas c = new Canvas(bitmap);
|
Canvas c = new Canvas(bitmap);
|
||||||
|
@ -206,12 +209,13 @@ public class RetroUtil {
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
public static Drawable getTintedVectorDrawable(@NonNull Resources res, @DrawableRes int resId,
|
public static Drawable getTintedVectorDrawable(@NonNull Resources res, @DrawableRes int resId,
|
||||||
@Nullable Resources.Theme theme, @ColorInt int color) {
|
@Nullable Resources.Theme theme, @ColorInt int color) {
|
||||||
return TintHelper.createTintedDrawable(getVectorDrawable(res, resId, theme), color);
|
return TintHelper.createTintedDrawable(getVectorDrawable(res, resId, theme), color);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAllowedToDownloadMetadata(final Context context) {
|
public static boolean isAllowedToDownloadMetadata(final @NonNull Context context) {
|
||||||
switch (PreferenceUtil.getInstance().autoDownloadImagesPolicy()) {
|
switch (PreferenceUtil.getInstance().autoDownloadImagesPolicy()) {
|
||||||
case "always":
|
case "always":
|
||||||
return true;
|
return true;
|
||||||
|
@ -421,4 +425,11 @@ public class RetroUtil {
|
||||||
.getIdentifier(orientation == Configuration.ORIENTATION_PORTRAIT ? "navigation_bar_height" : "navigation_bar_height_landscape", "dimen", "android");
|
.getIdentifier(orientation == Configuration.ORIENTATION_PORTRAIT ? "navigation_bar_height" : "navigation_bar_height_landscape", "dimen", "android");
|
||||||
return id > 0;
|
return id > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public static Drawable resize(@NonNull Context context, @NonNull Drawable image) {
|
||||||
|
Bitmap b = ((BitmapDrawable) image).getBitmap();
|
||||||
|
Bitmap bitmapResized = Bitmap.createScaledBitmap(b, 50, 50, false);
|
||||||
|
return new BitmapDrawable(context.getResources(), bitmapResized);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,27 +59,28 @@
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
style="@style/Toolbar"
|
style="@style/Toolbar"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
app:layout_scrollFlags="scroll|enterAlways"
|
|
||||||
tools:ignore="UnusedAttribute">
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/bannerTitle"
|
|
||||||
style="@style/BigTitleTextAppearanceToolbar"
|
|
||||||
android:shadowColor="@color/md_black_1000"
|
|
||||||
android:shadowRadius="2"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
android:textColor="@color/md_white_1000"
|
|
||||||
tools:ignore="MissingPrefix" />
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.CircularImageView
|
<code.name.monkey.retromusic.views.CircularImageView
|
||||||
android:id="@+id/userImage"
|
android:id="@+id/userImage"
|
||||||
android:layout_width="32dp"
|
android:layout_width="32dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:layout_gravity="end|center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_weight="0"
|
||||||
app:civ_border="false" />
|
app:civ_border="false" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bannerTitle"
|
||||||
|
style="@style/BigTitleTextAppearanceToolbar"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:paddingStart="14dp"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textColor="@color/md_white_1000"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
</androidx.appcompat.widget.Toolbar>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||||
|
|
|
@ -29,24 +29,28 @@
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
style="@style/Toolbar"
|
style="@style/Toolbar"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
app:layout_scrollFlags="scroll|enterAlways"
|
|
||||||
tools:ignore="UnusedAttribute">
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
|
||||||
android:id="@+id/bannerTitle"
|
|
||||||
style="@style/BigTitleTextAppearanceToolbar"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
tools:ignore="MissingPrefix" />
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.CircularImageView
|
<code.name.monkey.retromusic.views.CircularImageView
|
||||||
android:id="@+id/userImage"
|
android:id="@+id/userImage"
|
||||||
android:layout_width="32dp"
|
android:layout_width="32dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:layout_gravity="end|center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_weight="0"
|
||||||
app:civ_border="false" />
|
app:civ_border="false" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bannerTitle"
|
||||||
|
style="@style/BigTitleTextAppearanceToolbar"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:paddingStart="14dp"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:text="@string/library"
|
||||||
|
android:textColor="@color/md_white_1000"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
|
@ -61,27 +61,28 @@
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
style="@style/Toolbar"
|
style="@style/Toolbar"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
app:layout_scrollFlags="scroll|enterAlways"
|
|
||||||
tools:ignore="UnusedAttribute">
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/bannerTitle"
|
|
||||||
style="@style/BigTitleTextAppearanceToolbar"
|
|
||||||
android:shadowColor="@color/md_black_1000"
|
|
||||||
android:shadowRadius="2"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
android:textColor="@color/md_white_1000"
|
|
||||||
tools:ignore="MissingPrefix" />
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.CircularImageView
|
<code.name.monkey.retromusic.views.CircularImageView
|
||||||
android:id="@+id/userImage"
|
android:id="@+id/userImage"
|
||||||
android:layout_width="32dp"
|
android:layout_width="32dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:layout_gravity="end|center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_weight="0"
|
||||||
app:civ_border="false" />
|
app:civ_border="false" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bannerTitle"
|
||||||
|
style="@style/BigTitleTextAppearanceToolbar"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:paddingStart="14dp"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:text="@string/library"
|
||||||
|
android:textColor="@color/md_white_1000"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
</androidx.appcompat.widget.Toolbar>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||||
|
|
|
@ -30,24 +30,28 @@
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
style="@style/Toolbar"
|
style="@style/Toolbar"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
app:layout_scrollFlags="scroll|enterAlways"
|
|
||||||
tools:ignore="UnusedAttribute">
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
|
||||||
android:id="@+id/bannerTitle"
|
|
||||||
style="@style/BigTitleTextAppearanceToolbar"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
tools:ignore="MissingPrefix" />
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.CircularImageView
|
<code.name.monkey.retromusic.views.CircularImageView
|
||||||
android:id="@+id/userImage"
|
android:id="@+id/userImage"
|
||||||
android:layout_width="32dp"
|
android:layout_width="32dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:layout_gravity="end|center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_weight="0"
|
||||||
app:civ_border="false" />
|
app:civ_border="false" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bannerTitle"
|
||||||
|
style="@style/BigTitleTextAppearanceToolbar"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:paddingStart="14dp"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:text="@string/library"
|
||||||
|
android:textColor="@color/md_white_1000"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
|
@ -7,15 +7,6 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:ignore="UnusedAttribute">
|
|
||||||
|
|
||||||
<include layout="@layout/status_bar" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
@ -69,27 +60,28 @@
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
style="@style/Toolbar"
|
style="@style/Toolbar"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
app:layout_scrollFlags="scroll|enterAlways"
|
|
||||||
tools:ignore="UnusedAttribute">
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/bannerTitle"
|
|
||||||
style="@style/BigTitleTextAppearanceToolbar"
|
|
||||||
android:shadowColor="@color/md_black_1000"
|
|
||||||
android:shadowRadius="2"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
android:textColor="@color/md_white_1000"
|
|
||||||
tools:ignore="MissingPrefix" />
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.CircularImageView
|
<code.name.monkey.retromusic.views.CircularImageView
|
||||||
android:id="@+id/userImage"
|
android:id="@+id/userImage"
|
||||||
android:layout_width="32dp"
|
android:layout_width="32dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:layout_gravity="end|center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_weight="0"
|
||||||
app:civ_border="false" />
|
app:civ_border="false" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bannerTitle"
|
||||||
|
style="@style/BigTitleTextAppearanceToolbar"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:paddingStart="14dp"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:text="@string/library"
|
||||||
|
android:textColor="@color/md_white_1000"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
</androidx.appcompat.widget.Toolbar>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||||
|
|
|
@ -31,24 +31,28 @@
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
style="@style/Toolbar"
|
style="@style/Toolbar"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
app:layout_scrollFlags="scroll|enterAlways"
|
|
||||||
tools:ignore="UnusedAttribute">
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
|
||||||
android:id="@+id/bannerTitle"
|
|
||||||
style="@style/BigTitleTextAppearanceToolbar"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
tools:ignore="MissingPrefix" />
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.CircularImageView
|
<code.name.monkey.retromusic.views.CircularImageView
|
||||||
android:id="@+id/userImage"
|
android:id="@+id/userImage"
|
||||||
android:layout_width="32dp"
|
android:layout_width="32dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:layout_gravity="end|center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_weight="0"
|
||||||
app:civ_border="false" />
|
app:civ_border="false" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bannerTitle"
|
||||||
|
style="@style/BigTitleTextAppearanceToolbar"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:paddingStart="14dp"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:text="@string/library"
|
||||||
|
android:textColor="@color/md_white_1000"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
</androidx.appcompat.widget.Toolbar>
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
|
|
@ -55,27 +55,28 @@
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
style="@style/Toolbar"
|
style="@style/Toolbar"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
app:layout_scrollFlags="scroll|enterAlways"
|
|
||||||
tools:ignore="UnusedAttribute">
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/bannerTitle"
|
|
||||||
style="@style/BigTitleTextAppearanceToolbar"
|
|
||||||
android:shadowColor="@color/md_black_1000"
|
|
||||||
android:shadowRadius="2"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
android:textColor="@color/md_white_1000"
|
|
||||||
tools:ignore="MissingPrefix" />
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.CircularImageView
|
<code.name.monkey.retromusic.views.CircularImageView
|
||||||
android:id="@+id/userImage"
|
android:id="@+id/userImage"
|
||||||
android:layout_width="32dp"
|
android:layout_width="32dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:layout_gravity="end|center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_weight="0"
|
||||||
app:civ_border="false" />
|
app:civ_border="false" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bannerTitle"
|
||||||
|
style="@style/BigTitleTextAppearanceToolbar"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:paddingStart="14dp"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textColor="@color/md_white_1000"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
</androidx.appcompat.widget.Toolbar>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||||
|
|
|
@ -27,24 +27,27 @@
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
style="@style/Toolbar"
|
style="@style/Toolbar"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
app:layout_scrollFlags="scroll|enterAlways"
|
|
||||||
tools:ignore="UnusedAttribute">
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
|
||||||
android:id="@+id/bannerTitle"
|
|
||||||
style="@style/BigTitleTextAppearanceToolbar"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
tools:ignore="MissingPrefix" />
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.CircularImageView
|
<code.name.monkey.retromusic.views.CircularImageView
|
||||||
android:id="@+id/userImage"
|
android:id="@+id/userImage"
|
||||||
android:layout_width="32dp"
|
android:layout_width="32dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:layout_gravity="end|center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_weight="0"
|
||||||
app:civ_border="false" />
|
app:civ_border="false" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bannerTitle"
|
||||||
|
style="@style/BigTitleTextAppearanceToolbar"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:paddingStart="14dp"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
|
@ -49,8 +49,16 @@
|
||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
app:civ_border="false" />
|
app:civ_border="false" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
<TextView
|
||||||
|
android:id="@+id/bannerTitle"
|
||||||
|
style="@style/BigTitleTextAppearanceToolbar"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:paddingStart="14dp"
|
||||||
|
android:text="@string/library"
|
||||||
|
android:textColor="@color/md_white_1000"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
|
||||||
<ViewStub
|
<ViewStub
|
||||||
android:id="@+id/cab_stub"
|
android:id="@+id/cab_stub"
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
<!--
|
||||||
|
~ Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
~
|
||||||
|
~ Licensed under the GNU General Public License v3
|
||||||
|
~
|
||||||
|
~ This is free software: you can redistribute it and/or modify it under
|
||||||
|
~ the terms of the GNU General Public License as published by
|
||||||
|
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
~
|
||||||
|
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
~ See the GNU General Public License for more details.
|
||||||
|
-->
|
||||||
|
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
|
Loading…
Reference in a new issue