From 153f1bd9d048689a476862f11e4de7520041dcbc Mon Sep 17 00:00:00 2001 From: h4h13 Date: Fri, 27 Sep 2019 21:06:10 +0530 Subject: [PATCH] Added android 10 dark theme support --- app/build.gradle | 8 +- app/src/main/assets/retro-changelog.html | 2 +- .../retromusic/activities/AboutActivity.kt | 14 +- .../activities/AlbumDetailsActivity.kt | 15 +- .../retromusic/adapter/song/SongAdapter.kt | 20 +-- .../fragments/MiniPlayerFragment.kt | 4 - .../mainactivity/LibraryFragment.java | 16 +- .../glide/artistimage/ArtistImageLoader.kt | 1 + .../retromusic/mvp/presenter/HomePresenter.kt | 22 +-- .../HomeLoader.kt => util/AttrsUtil.kt} | 23 +-- .../views/BaselineGridTextView.java | 18 +- .../views/WidthFitSquareCardView.kt | 6 +- .../main/res/layout-xlarge/abs_playlists.xml | 11 +- .../layout-xlarge/fragment_mini_player.xml | 39 ++-- app/src/main/res/layout/abs_playlists.xml | 9 +- app/src/main/res/layout/activity_about.xml | 9 +- app/src/main/res/layout/card_credit.xml | 3 +- app/src/main/res/layout/card_other.xml | 23 ++- app/src/main/res/layout/card_retro_info.xml | 82 ++++----- app/src/main/res/layout/card_social.xml | 46 +++-- app/src/main/res/layout/fragment_library.xml | 10 +- .../res/layout/fragment_main_settings.xml | 2 +- .../main/res/layout/fragment_mini_player.xml | 34 ++-- app/src/main/res/layout/item_contributor.xml | 7 +- .../res/layout/item_contributor_header.xml | 9 +- app/src/main/res/layout/item_list.xml | 166 +++++++++--------- app/src/main/res/values/attrs.xml | 45 +++-- app/src/main/res/values/styles.xml | 5 +- app/src/main/res/values/styles_parents.xml | 60 +++++-- .../common/views/ATESecondaryTextView.kt | 2 +- .../monkey/appthemehelper/util/ATHUtil.kt | 3 +- appthemehelper/src/main/res/values/attrs.xml | 8 - build.gradle | 2 +- 33 files changed, 372 insertions(+), 352 deletions(-) rename app/src/main/java/code/name/monkey/retromusic/{loaders/HomeLoader.kt => util/AttrsUtil.kt} (58%) rename {appthemehelper/src/main/java/code/name/monkey/appthemehelper/common => app/src/main/java/code/name/monkey/retromusic}/views/BaselineGridTextView.java (89%) diff --git a/app/build.gradle b/app/build.gradle index a9bf947e..2de3233e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,8 +13,8 @@ android { vectorDrawables.useSupportLibrary = true applicationId "code.name.monkey.retromusic" - versionCode 371 - versionName '3.4.000-beta-final' + versionCode 372 + versionName '3.4.000' multiDexEnabled true @@ -67,7 +67,7 @@ android { sourceCompatibility '1.8' targetCompatibility '1.8' } - buildToolsVersion = '29.0.1' + buildToolsVersion = '29.0.2' configurations.all { resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9' @@ -102,7 +102,7 @@ dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'androidx.multidex:multidex:2.0.1' - implementation 'androidx.fragment:fragment:1.2.0-alpha03' + implementation 'androidx.fragment:fragment:1.2.0-alpha04' implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.recyclerview:recyclerview:1.1.0-beta04' implementation "androidx.gridlayout:gridlayout:1.0.0" diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html index ce8cd164..a4346a45 100644 --- a/app/src/main/assets/retro-changelog.html +++ b/app/src/main/assets/retro-changelog.html @@ -1 +1 @@ -

v3.4.000

v3.3.200

v.3.3.100

v3.3.000

v3.2.240

v3.2.220

v3.2.203

v3.2.135

v3.2.125

v3.2.120

v3.2.105

v3.2.100

v3.2.000

v3.1.900

v3.1.850

v3.1.800

v3.1.700

v3.1.400

v3.1.300

v3.1.240

v3.1.200

v3.0.570

If you see entire app white or dark or black select same theme in settings to fix

FAQ's

*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again.

\ No newline at end of file +

v3.4.000

v3.3.200

v.3.3.100

v3.3.000

v3.2.240

v3.2.220

v3.2.203

v3.2.135

v3.2.125

v3.2.120

v3.2.105

v3.2.100

v3.2.000

v3.1.900

v3.1.850

v3.1.800

v3.1.700

v3.1.400

v3.1.300

v3.1.240

v3.1.200

v3.0.570

If you see entire app white or dark or black select same theme in settings to fix

FAQ's

*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again.

\ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/AboutActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/AboutActivity.kt index a699ab38..30c983ab 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/AboutActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/AboutActivity.kt @@ -9,8 +9,6 @@ import android.view.View import androidx.core.app.ShareCompat import androidx.recyclerview.widget.DefaultItemAnimator import androidx.recyclerview.widget.LinearLayoutManager -import code.name.monkey.appthemehelper.ThemeStore -import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper import code.name.monkey.retromusic.Constants.APP_INSTAGRAM_LINK import code.name.monkey.retromusic.Constants.APP_TELEGRAM_LINK import code.name.monkey.retromusic.Constants.APP_TWITTER_LINK @@ -60,16 +58,13 @@ class AboutActivity : AbsBaseActivity(), View.OnClickListener { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_about) - setStatusbarColorAuto() setNavigationbarColorAuto() setLightNavigationBar(true) loadContributors() - setUpToolbar() - + setSupportActionBar(toolbar) appVersion.text = getAppVersion() - setUpView() } @@ -83,10 +78,9 @@ class AboutActivity : AbsBaseActivity(), View.OnClickListener { } private fun setUpToolbar() { - appBarLayout.setBackgroundColor(ThemeStore.primaryColor(this)) - toolbar.setBackgroundColor(ThemeStore.primaryColor(this)) - setSupportActionBar(toolbar) - ToolbarContentTintHelper.colorBackButton(toolbar, ThemeStore.textColorSecondary(this)) + //appBarLayout.setBackgroundColor(ThemeStore.primaryColor(this)) + //toolbar.setBackgroundColor(ThemeStore.primaryColor(this)) + //ToolbarContentTintHelper.colorBackButton(toolbar, ThemeStore.textColorSecondary(this)) } private fun openUrl(url: String) { diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/AlbumDetailsActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/AlbumDetailsActivity.kt index d559704d..dd5c0b5b 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/AlbumDetailsActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/AlbumDetailsActivity.kt @@ -9,7 +9,6 @@ import android.transition.Slide import android.view.* import android.view.animation.AnimationUtils import android.widget.ImageView -import androidx.core.app.ActivityCompat import androidx.recyclerview.widget.DefaultItemAnimator import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager @@ -85,7 +84,7 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView { contentContainer?.setCardBackgroundColor(ColorStateList.valueOf(ThemeStore.primaryColor(this))) - ActivityCompat.postponeEnterTransition(this) + postponeEnterTransition() artistImage = findViewById(R.id.artistImage) @@ -169,7 +168,7 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView { } override fun complete() { - ActivityCompat.startPostponedEnterTransition(this) + scheduleStartPostponedTransition(image) } override fun album(album: Album) { @@ -224,6 +223,16 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView { }) } + private fun scheduleStartPostponedTransition(image: ImageView) { + image.viewTreeObserver.addOnPreDrawListener(object : ViewTreeObserver.OnPreDrawListener { + override fun onPreDraw(): Boolean { + image.viewTreeObserver.removeOnPreDrawListener(this) + startPostponedEnterTransition(); + return true; + } + }) + } + private fun setColors(color: Int) { val themeColor = if (PreferenceUtil.getInstance(this).adaptiveColor) color else ThemeStore.accentColor(this) diff --git a/app/src/main/java/code/name/monkey/retromusic/adapter/song/SongAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/adapter/song/SongAdapter.kt index f079a9ea..b58eeab4 100644 --- a/app/src/main/java/code/name/monkey/retromusic/adapter/song/SongAdapter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/adapter/song/SongAdapter.kt @@ -78,28 +78,18 @@ open class SongAdapter @JvmOverloads constructor( override fun onBindViewHolder(holder: ViewHolder, position: Int) { val song = dataSet[position] - val isChecked = isChecked(song) holder.itemView.isActivated = isChecked - - if (holder.title != null) { - holder.title!!.text = getSongTitle(song) - } - if (holder.text != null) { - holder.text!!.text = getSongText(song) - } + holder.title?.text = getSongTitle(song) + holder.text?.text = getSongText(song) loadAlbumCover(song, holder) } private fun setColors(color: Int, holder: ViewHolder) { if (holder.paletteColorContainer != null) { - holder.paletteColorContainer!!.setBackgroundColor(color) - if (holder.title != null) { - holder.title!!.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color))) - } - if (holder.text != null) { - holder.text!!.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color))) - } + holder.paletteColorContainer?.setBackgroundColor(color) + holder.title?.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color))) + holder.text?.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color))) } } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/MiniPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/MiniPlayerFragment.kt index 0bd4ef02..9c84f752 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/MiniPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/MiniPlayerFragment.kt @@ -10,11 +10,9 @@ import android.text.SpannableStringBuilder import android.text.style.ForegroundColorSpan import android.view.* import android.view.animation.DecelerateInterpolator -import android.widget.Toast import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.retromusic.R import code.name.monkey.retromusic.fragments.base.AbsMusicServiceFragment -import code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler @@ -46,8 +44,6 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - - view.setBackgroundColor(ThemeStore.primaryColor(requireContext())) view.setOnTouchListener(FlingPlayBackController(requireContext())) //view.setOnClickListener(v -> NavigationUtil.gotoNowPlayingActivity(getContext())); setUpMiniPlayer() diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/LibraryFragment.java b/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/LibraryFragment.java index 603a632e..fb2f27dc 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/LibraryFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/LibraryFragment.java @@ -30,8 +30,6 @@ import java.util.Objects; import code.name.monkey.appthemehelper.ThemeStore; import code.name.monkey.appthemehelper.common.ATHToolbarActivity; -import code.name.monkey.appthemehelper.util.ATHUtil; -import code.name.monkey.appthemehelper.util.TintHelper; import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper; import code.name.monkey.retromusic.R; import code.name.monkey.retromusic.dialogs.CreatePlaylistDialog; @@ -54,7 +52,6 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde private Toolbar toolbar; private AppBarLayout appBarLayout; - private View contentContainer; private MaterialCardView toolbarContainer; private MaterialCab cab; @@ -89,9 +86,8 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_library, container, false); disposable = new CompositeDisposable(); - contentContainer = view.findViewById(R.id.fragmentContainer); - toolbarContainer = view.findViewById(R.id.toolbarContainer); appBarLayout = view.findViewById(R.id.appBarLayout); + toolbarContainer = view.findViewById(R.id.toolbarContainer); toolbar = view.findViewById(R.id.toolbar); PreferenceUtil.getInstance(requireActivity()).registerOnSharedPreferenceChangedListener(this); return view; @@ -149,17 +145,15 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde @SuppressWarnings("ConstantConditions") private void setupToolbar() { - int primaryColor = ThemeStore.Companion.primaryColor(getContext()); - TintHelper.setTintAuto(contentContainer, primaryColor, true); - appBarLayout.setBackgroundColor(primaryColor); - toolbar.setBackgroundColor(RetroColorUtil.toolbarColor(getMainActivity())); + //int primaryColor = ThemeStore.Companion.primaryColor(getContext()); + //TintHelper.setTintAuto(contentContainer, primaryColor, true); + //appBarLayout.setBackgroundColor(primaryColor); + //toolbar.setBackgroundColor(RetroColorUtil.toolbarColor(getMainActivity())); toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp); toolbar.setOnClickListener(v -> { ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(getMainActivity(), toolbarContainer, getString(R.string.transition_toolbar)); NavigationUtil.goToSearch(getMainActivity(), options); }); - appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> - getMainActivity().setLightStatusbar(!ATHUtil.INSTANCE.isWindowBackgroundDark(getContext()))); getMainActivity().setSupportActionBar(toolbar); toolbar.setNavigationOnClickListener(v -> showMainMenu(OptionsSheetDialogFragment.LIBRARY)); } diff --git a/app/src/main/java/code/name/monkey/retromusic/glide/artistimage/ArtistImageLoader.kt b/app/src/main/java/code/name/monkey/retromusic/glide/artistimage/ArtistImageLoader.kt index cbd4c1c7..40e21d8d 100644 --- a/app/src/main/java/code/name/monkey/retromusic/glide/artistimage/ArtistImageLoader.kt +++ b/app/src/main/java/code/name/monkey/retromusic/glide/artistimage/ArtistImageLoader.kt @@ -64,6 +64,7 @@ class ArtistImageFetcher( } catch (ignore: IOException) { // can't do much about it } + } } diff --git a/app/src/main/java/code/name/monkey/retromusic/mvp/presenter/HomePresenter.kt b/app/src/main/java/code/name/monkey/retromusic/mvp/presenter/HomePresenter.kt index 763aeafb..9457b36a 100644 --- a/app/src/main/java/code/name/monkey/retromusic/mvp/presenter/HomePresenter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/mvp/presenter/HomePresenter.kt @@ -20,15 +20,11 @@ import code.name.monkey.retromusic.adapter.HomeAdapter.Companion.RECENT_ALBUMS import code.name.monkey.retromusic.adapter.HomeAdapter.Companion.RECENT_ARTISTS import code.name.monkey.retromusic.adapter.HomeAdapter.Companion.TOP_ALBUMS import code.name.monkey.retromusic.adapter.HomeAdapter.Companion.TOP_ARTISTS -import code.name.monkey.retromusic.model.Album -import code.name.monkey.retromusic.model.Artist import code.name.monkey.retromusic.model.Home -import code.name.monkey.retromusic.model.Playlist import code.name.monkey.retromusic.mvp.BaseView import code.name.monkey.retromusic.mvp.Presenter import code.name.monkey.retromusic.mvp.PresenterImpl import code.name.monkey.retromusic.providers.interfaces.Repository -import io.reactivex.Observable import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.Disposable import javax.inject.Inject @@ -44,16 +40,20 @@ interface HomeView : BaseView { interface HomePresenter : Presenter { fun loadSections() + class HomePresenterImpl @Inject constructor( private val repository: Repository ) : PresenterImpl(), HomePresenter { + + val hashSet: HashSet = HashSet() + override fun loadSections() { - /*loadRecentArtists() + loadRecentArtists() loadRecentAlbums() loadTopArtists() loadATopAlbums() - loadFavorite()*/ - loadHomeSection() + loadFavorite() + //loadHomeSection() } private var disposable: CompositeDisposable = CompositeDisposable() @@ -67,7 +67,7 @@ interface HomePresenter : Presenter { } } - /*private fun loadRecentArtists() { + private fun loadRecentArtists() { disposable += repository.recentArtistsFlowable .subscribe { if (it.isNotEmpty()) hashSet.add( @@ -140,9 +140,9 @@ interface HomePresenter : Presenter { )) showData(ArrayList(hashSet)) } - }*/ + } - private fun loadHomeSection() { + /*private fun loadHomeSection() { val ob = listOf(repository.recentArtistsFlowable, repository.recentAlbumsFlowable, repository.topArtistsFlowable, @@ -200,7 +200,7 @@ interface HomePresenter : Presenter { }.subscribe { view.sections(ArrayList(it)) } - } + }*/ } } diff --git a/app/src/main/java/code/name/monkey/retromusic/loaders/HomeLoader.kt b/app/src/main/java/code/name/monkey/retromusic/util/AttrsUtil.kt similarity index 58% rename from app/src/main/java/code/name/monkey/retromusic/loaders/HomeLoader.kt rename to app/src/main/java/code/name/monkey/retromusic/util/AttrsUtil.kt index 7b0fd672..93da81ea 100644 --- a/app/src/main/java/code/name/monkey/retromusic/loaders/HomeLoader.kt +++ b/app/src/main/java/code/name/monkey/retromusic/util/AttrsUtil.kt @@ -12,18 +12,19 @@ * See the GNU General Public License for more details. */ -package code.name.monkey.retromusic.loaders - +package code.name.monkey.retromusic.util import android.content.Context -import code.name.monkey.retromusic.model.Playlist -import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist -import code.name.monkey.retromusic.model.smartplaylist.HistoryPlaylist -import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist -import code.name.monkey.retromusic.model.smartplaylist.MyTopTracksPlaylist -import io.reactivex.Observable - -object HomeLoader { - +import androidx.annotation.AttrRes +object AttrsUtil { + @JvmOverloads + fun resolveColor(context: Context, @AttrRes attr: Int, fallback: Int = 0): Int { + val a = context.theme.obtainStyledAttributes(intArrayOf(attr)) + try { + return a.getColor(0, fallback) + } finally { + a.recycle() + } + } } diff --git a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/views/BaselineGridTextView.java b/app/src/main/java/code/name/monkey/retromusic/views/BaselineGridTextView.java similarity index 89% rename from appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/views/BaselineGridTextView.java rename to app/src/main/java/code/name/monkey/retromusic/views/BaselineGridTextView.java index fdd6b115..a82b38c6 100644 --- a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/views/BaselineGridTextView.java +++ b/app/src/main/java/code/name/monkey/retromusic/views/BaselineGridTextView.java @@ -12,7 +12,7 @@ * See the GNU General Public License for more details. */ -package code.name.monkey.appthemehelper.common.views; +package code.name.monkey.retromusic.views; import android.content.Context; import android.content.res.TypedArray; @@ -21,25 +21,11 @@ import android.util.AttributeSet; import android.util.TypedValue; import androidx.annotation.FontRes; -import androidx.appcompat.widget.AppCompatTextView; import com.google.android.material.textview.MaterialTextView; -import code.name.monkey.appthemehelper.R; +import code.name.monkey.retromusic.R; - -/** - * An extension to {@link AppCompatTextView} which aligns text to a 4dp baseline grid. - *

- * To achieve this we expose a {@code lineHeightHint} allowing you to specify the desired line - * height (alternatively a {@code lineHeightMultiplierHint} to use a multiplier of the text size). - * This line height will be adjusted to be a multiple of 4dp to ensure that baselines sit on - * the grid. - *

- * We also adjust spacing above and below the text to ensure that the first line's baseline sits on - * the grid (relative to the view's top) & that this view's height is a multiple of 4dp so that - * subsequent views start on the grid. - */ public class BaselineGridTextView extends MaterialTextView { private final float FOUR_DIP; diff --git a/app/src/main/java/code/name/monkey/retromusic/views/WidthFitSquareCardView.kt b/app/src/main/java/code/name/monkey/retromusic/views/WidthFitSquareCardView.kt index 6aaabe73..ba87f865 100644 --- a/app/src/main/java/code/name/monkey/retromusic/views/WidthFitSquareCardView.kt +++ b/app/src/main/java/code/name/monkey/retromusic/views/WidthFitSquareCardView.kt @@ -35,11 +35,11 @@ class WidthFitSquareCardView : MaterialCardView { } override fun onMeasure(i: Int, i2: Int) { - var i2 = i2 + var width = i2 if (this.forceSquare) { - i2 = i + width = i } - super.onMeasure(i, i2) + super.onMeasure(i, width) } private var forceSquare = true diff --git a/app/src/main/res/layout-xlarge/abs_playlists.xml b/app/src/main/res/layout-xlarge/abs_playlists.xml index e0e25cd8..b3a448f4 100644 --- a/app/src/main/res/layout-xlarge/abs_playlists.xml +++ b/app/src/main/res/layout-xlarge/abs_playlists.xml @@ -28,20 +28,21 @@ android:paddingStart="16dp" android:paddingEnd="0dp"> - + android:text="@string/welcome" + android:textColor="?colorOnBackground" /> - diff --git a/app/src/main/res/layout-xlarge/fragment_mini_player.xml b/app/src/main/res/layout-xlarge/fragment_mini_player.xml index 79a7bbb6..923c7c10 100644 --- a/app/src/main/res/layout-xlarge/fragment_mini_player.xml +++ b/app/src/main/res/layout-xlarge/fragment_mini_player.xml @@ -15,7 +15,7 @@ android:layout_height="match_parent" android:orientation="horizontal"> - + app:tint="?colorOnSurface" + tools:ignore="ContentDescription" + tools:tint="?colorOnSurface" /> - + android:textAppearance="@style/TextViewNormal" + android:textColor="?colorOnSurface" + tools:text="Song name and details" /> - + app:srcCompat="@drawable/ic_skip_previous_white_24dp" + app:tint="?colorOnSurface" + tools:tint="@color/black_color" /> - + app:tint="?colorOnSurface" + tools:ignore="ContentDescription" + tools:tint="?colorOnSurface" /> - + app:srcCompat="@drawable/ic_skip_next_white_24dp" + app:tint="?colorOnSurface" + tools:tint="?colorOnSurface" /> - + app:srcCompat="@drawable/ic_playlist_play_white_24dp" + app:tint="?colorOnSurface" + tools:tint="?colorOnSurface" /> diff --git a/app/src/main/res/layout/abs_playlists.xml b/app/src/main/res/layout/abs_playlists.xml index b727069b..6872e621 100644 --- a/app/src/main/res/layout/abs_playlists.xml +++ b/app/src/main/res/layout/abs_playlists.xml @@ -33,20 +33,21 @@ android:paddingStart="16dp" android:paddingEnd="0dp"> - + android:text="@string/welcome" + android:textColor="?colorOnBackground" /> - diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index f72d7d60..bd93cdcc 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -1,7 +1,6 @@ @@ -9,26 +8,22 @@ android:id="@+id/appBarLayout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:elevation="0dp" - app:elevation="0dp"> + app:liftOnScroll="true"> - - - \ No newline at end of file diff --git a/app/src/main/res/layout/card_credit.xml b/app/src/main/res/layout/card_credit.xml index 4239b229..34e0aa59 100644 --- a/app/src/main/res/layout/card_credit.xml +++ b/app/src/main/res/layout/card_credit.xml @@ -14,7 +14,8 @@ + android:textAppearance="@style/TextViewOverline" + android:textColor="?colorAccent" /> - - + app:lineHeightHint="24sp" /> - - + app:lineHeightHint="24sp" /> - - + app:lineHeightHint="24sp" /> - @@ -28,13 +29,13 @@ android:orientation="horizontal" tools:ignore="PrivateResource"> - + app:tint="?colorOnSurface" /> - - + app:lineHeightHint="24sp" /> @@ -72,13 +72,13 @@ android:orientation="horizontal" tools:ignore="PrivateResource"> - + app:tint="?colorOnSurface" /> - - + app:lineHeightHint="24sp" /> @@ -115,13 +114,13 @@ android:orientation="horizontal" tools:ignore="PrivateResource"> - + app:tint="?colorOnSurface" /> - - - + android:text="@string/rate_on_google_play_summary" + app:lineHeightHint="24sp" /> @@ -159,13 +156,13 @@ android:orientation="horizontal" tools:ignore="PrivateResource"> - + app:tint="?colorOnSurface" /> - - + android:text="@string/donate_summary" + app:lineHeightHint="24sp" /> @@ -203,13 +199,13 @@ android:orientation="horizontal" tools:ignore="PrivateResource"> - + app:tint="?colorOnSurface" /> - - + android:text="@string/bug_report_summary" + app:lineHeightHint="24sp" /> @@ -247,13 +242,13 @@ android:orientation="horizontal" tools:ignore="PrivateResource"> - + app:tint="?colorOnSurface" /> - - + android:textAppearance="@style/TextViewSubtitle1" /> @@ -288,13 +281,13 @@ android:orientation="horizontal" tools:ignore="PrivateResource"> - + app:tint="?colorOnSurface" /> - + android:textAppearance="@style/TextViewSubtitle1" /> diff --git a/app/src/main/res/layout/card_social.xml b/app/src/main/res/layout/card_social.xml index 1acce015..938839d0 100644 --- a/app/src/main/res/layout/card_social.xml +++ b/app/src/main/res/layout/card_social.xml @@ -28,12 +28,13 @@ android:orientation="horizontal" tools:ignore="PrivateResource"> - + app:tint="?colorOnSurface" /> - - - + app:lineHeightHint="24sp" /> @@ -71,12 +70,12 @@ android:orientation="horizontal" tools:ignore="PrivateResource"> - + app:tint="?colorOnSurface" /> - - + app:lineHeightHint="24sp" /> @@ -114,12 +112,12 @@ android:orientation="horizontal" tools:ignore="PrivateResource"> - + app:tint="?colorOnSurface" /> - - + app:lineHeightHint="24sp" /> @@ -156,12 +153,12 @@ android:orientation="horizontal" tools:ignore="PrivateResource"> - + app:tint="?colorOnSurface" /> - - + app:lineHeightHint="24sp" /> diff --git a/app/src/main/res/layout/fragment_library.xml b/app/src/main/res/layout/fragment_library.xml index d9447c85..3afdf124 100644 --- a/app/src/main/res/layout/fragment_library.xml +++ b/app/src/main/res/layout/fragment_library.xml @@ -39,6 +39,7 @@ android:id="@+id/appBarLayout" android:layout_width="match_parent" android:layout_height="wrap_content" + android:background="?colorSurface" app:liftOnScroll="true"> diff --git a/app/src/main/res/layout/fragment_main_settings.xml b/app/src/main/res/layout/fragment_main_settings.xml index 780f7967..5939e5de 100644 --- a/app/src/main/res/layout/fragment_main_settings.xml +++ b/app/src/main/res/layout/fragment_main_settings.xml @@ -60,7 +60,7 @@ android:textAppearance="@style/TextViewHeadline6" android:textColor="@color/md_white_1000" /> - @@ -17,7 +17,10 @@ android:paddingStart="0dp" android:paddingEnd="8dp"> - - + android:textAppearance="@style/TextViewNormal" + android:textColor="?colorOnSurface" + tools:text="Song name and details" /> - + app:srcCompat="@drawable/ic_skip_previous_white_24dp" + app:tint="?colorOnSurface" /> - - + app:srcCompat="@drawable/ic_skip_next_white_24dp" + app:tint="?colorOnSurface" + tools:tint="?colorOnSurface" /> - + app:srcCompat="@drawable/ic_playlist_play_white_24dp" + app:tint="?colorOnSurface" + tools:tint="?colorOnSurface" /> diff --git a/app/src/main/res/layout/item_contributor.xml b/app/src/main/res/layout/item_contributor.xml index 55e13fad..2a9aa8d8 100644 --- a/app/src/main/res/layout/item_contributor.xml +++ b/app/src/main/res/layout/item_contributor.xml @@ -42,17 +42,16 @@ android:paddingEnd="16dp" android:paddingBottom="8dp"> - - + app:lineHeightHint="24sp" /> \ No newline at end of file diff --git a/app/src/main/res/layout/item_contributor_header.xml b/app/src/main/res/layout/item_contributor_header.xml index bb0f816b..65833a25 100644 --- a/app/src/main/res/layout/item_contributor_header.xml +++ b/app/src/main/res/layout/item_contributor_header.xml @@ -42,18 +42,17 @@ android:paddingEnd="16dp" android:paddingBottom="8dp"> - - + android:layout_height="wrap_content" /> \ No newline at end of file diff --git a/app/src/main/res/layout/item_list.xml b/app/src/main/res/layout/item_list.xml index f7d66d15..d723e39c 100755 --- a/app/src/main/res/layout/item_list.xml +++ b/app/src/main/res/layout/item_list.xml @@ -1,5 +1,5 @@ - + + + + + + + + + + + + + android:orientation="vertical" + android:paddingStart="16dp" + android:paddingEnd="16dp"> - + android:layout_height="wrap_content" + android:ellipsize="end" + android:maxLines="1" + android:textAppearance="@style/TextViewSubtitle1" + android:textColor="?colorOnPrimary" + tools:text="Song name" /> - - - - - - - - - - - - - - - - - - - + android:layout_height="wrap_content" + android:layout_marginTop="2dp" + android:ellipsize="end" + android:maxLines="1" + android:textAppearance="@style/TextViewBody2" + android:textColor="?colorOnBackground" + tools:text="Song artist name " /> - \ No newline at end of file + + + + \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 5f955355..697f01d4 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -46,24 +46,33 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 892f0b3e..737bf956 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -37,9 +37,10 @@ - diff --git a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/views/ATESecondaryTextView.kt b/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/views/ATESecondaryTextView.kt index 55d86cdf..568d65e8 100755 --- a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/views/ATESecondaryTextView.kt +++ b/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/views/ATESecondaryTextView.kt @@ -23,7 +23,7 @@ class ATESecondaryTextView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : BaselineGridTextView(context, attrs, defStyleAttr) { +) : MaterialTextView(context, attrs, defStyleAttr) { init { setTextColor(ThemeStore.textColorSecondary(context)) diff --git a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/util/ATHUtil.kt b/appthemehelper/src/main/java/code/name/monkey/appthemehelper/util/ATHUtil.kt index 9c14ac96..2d9d301c 100755 --- a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/util/ATHUtil.kt +++ b/appthemehelper/src/main/java/code/name/monkey/appthemehelper/util/ATHUtil.kt @@ -1,7 +1,6 @@ package code.name.monkey.appthemehelper.util import android.content.Context -import android.content.res.TypedArray import androidx.annotation.AttrRes /** @@ -10,7 +9,7 @@ import androidx.annotation.AttrRes object ATHUtil { fun isWindowBackgroundDark(context: Context): Boolean { - return !ColorUtil.isColorLight(ATHUtil.resolveColor(context, android.R.attr.windowBackground)) + return !ColorUtil.isColorLight(resolveColor(context, android.R.attr.windowBackground)) } @JvmOverloads diff --git a/appthemehelper/src/main/res/values/attrs.xml b/appthemehelper/src/main/res/values/attrs.xml index 35161101..bce101f2 100755 --- a/appthemehelper/src/main/res/values/attrs.xml +++ b/appthemehelper/src/main/res/values/attrs.xml @@ -36,14 +36,6 @@ - - - - - - - - diff --git a/build.gradle b/build.gradle index c9df4e2c..420527be 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.6.0-alpha11' + classpath 'com.android.tools.build:gradle:3.5.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.android.tools.build:bundletool:0.9.0' }