Improved color performance

This commit is contained in:
h4h13 2019-08-01 19:48:31 +05:30
parent 1b57adde6b
commit 005d8ee6e8
2 changed files with 2 additions and 13 deletions

View file

@ -31,8 +31,6 @@
<p><b><a href="https://github.com/AdrienPoupa/VinylMusicPlayer" title="VinylMusicPlayer"> VinylMusicPlayer</a></b> by Adrien Poupa</p> <p><b><a href="https://github.com/AdrienPoupa/VinylMusicPlayer" title="VinylMusicPlayer"> VinylMusicPlayer</a></b> by Adrien Poupa</p>
<p><b><a href="https://github.com/ReactiveX/RxAndroid" title="RxJava"> RxJava</a></b> by RxJava authors</p> <p><b><a href="https://github.com/ReactiveX/RxAndroid" title="RxJava"> RxJava</a></b> by RxJava authors</p>
<p> <b><a href="https://github.com/afollestad" title="Material Dialogs"> Material Dialogs and Cab</a></b> by Aidan Michael Follestad</p> <p> <b><a href="https://github.com/afollestad" title="Material Dialogs"> Material Dialogs and Cab</a></b> by Aidan Michael Follestad</p>
<p><b><a href="https://github.com/chrisjenx/Calligraphy" title="Calligraphy"> Calligraphy</a></b> by RxJava authors</p>
<p><b><a href="https://github.com/JetradarMobile/android-snowfall" title="Android-Snowfall"> Android-Snowfall</a></b> by JetRadar</p>
<p><b><a href="https://github.com/umano/AndroidSlidingUpPanel" title="Android Sliding Up Panel"> Android Sliding Up Panel</a></b>by The Umano Team</p> <p><b><a href="https://github.com/umano/AndroidSlidingUpPanel" title="Android Sliding Up Panel"> Android Sliding Up Panel</a></b>by The Umano Team</p>
<p><b><a href="http://developer.android.com/tools/support-library/index.html" title="AOSP Support Libraries"> AOSP Support Libraries</a></b>by AOSP contributors</p> <p><b><a href="http://developer.android.com/tools/support-library/index.html" title="AOSP Support Libraries"> AOSP Support Libraries</a></b>by AOSP contributors</p>
<p><b><a href="https://github.com/bumptech/glide" title="Glide"> Glide</a></b> by Sam Judd</p> <p><b><a href="https://github.com/bumptech/glide" title="Glide"> Glide</a></b> by Sam Judd</p>
@ -40,16 +38,12 @@
<p><b><a href="https://github.com/afollestad/material-cab" title="Material Contextual Action Bar"> Material Contextual Action Bar</a></b> by Aidan Michael Follestad</p> <p><b><a href="https://github.com/afollestad/material-cab" title="Material Contextual Action Bar"> Material Contextual Action Bar</a></b> by Aidan Michael Follestad</p>
<p><b><a href="http://square.github.io/okhttp/" title="OkHttp"> OkHttp</a></b> by Square team</p> <p><b><a href="http://square.github.io/okhttp/" title="OkHttp"> OkHttp</a></b> by Square team</p>
<p><b><a href="https://github.com/hdodenhof/CircleImageView" title="CircleImageView"> CircleImageView</a></b> by Henning Dodenhof</p> <p><b><a href="https://github.com/hdodenhof/CircleImageView" title="CircleImageView"> CircleImageView</a></b> by Henning Dodenhof</p>
<p><b><a href="https://github.com/andkulikov/Transitions-Everywhere" title="Transitions Everywhere"> Transitions Everywhere</a></b> by Henning Dodenhof</p>
<p><b><a href="https://github.com/DreaminginCodeZH/MaterialProgressBar" title="MaterialProgressBar"> MaterialProgressBar</a></b> by Zhang Hai</p> <p><b><a href="https://github.com/DreaminginCodeZH/MaterialProgressBar" title="MaterialProgressBar"> MaterialProgressBar</a></b> by Zhang Hai</p>
<p><b><a href="https://github.com/anjlab/android-inapp-billing-v3" title="Android In-App Billing v3 Library"> Android In-App Billing v3 Library</a></b> by Henning Dodenhof</p> <p><b><a href="https://github.com/anjlab/android-inapp-billing-v3" title="Android In-App Billing v3 Library"> Android In-App Billing v3 Library</a></b> by Henning Dodenhof</p>
<p><b><a href="https://github.com/h6ah4i/android-advancedrecyclerview" title="Advanced RecyclerView"> Advanced RecyclerView</a></b> by Haruki Hasegawa</p> <p><b><a href="https://github.com/h6ah4i/android-advancedrecyclerview" title="Advanced RecyclerView"> Advanced RecyclerView</a></b> by Haruki Hasegawa</p>
<p><b><a href="https://github.com/ksoichiro/Android-ObservableScrollView" title="Android-ObservableScrollView"> Android-ObservableScrollView</a></b> by Soichiro Kashima</p> <p><b><a href="https://github.com/ksoichiro/Android-ObservableScrollView" title="Android-ObservableScrollView"> Android-ObservableScrollView</a></b> by Soichiro Kashima</p>
<p><b><a href="https://github.com/ittianyu/BottomNavigationViewEx" title="BottomNavigationViewEx"> BottomNavigationViewEx</a></b> by Ittianyu</p>
<p><b><a href="https://github.com/ebanx/swipe-button" title="Swipe-Button"> Swipe-Button</a></b> by EBANX Team</p>
<p><b><a href="http://www.cufonfonts.com/es/font/14289/circular-std-book" title="Font used"> Font used(CIRCULAR STD BOOK FONT)</a></b> by NIELSON CAETANO</p> <p><b><a href="http://www.cufonfonts.com/es/font/14289/circular-std-book" title="Font used"> Font used(CIRCULAR STD BOOK FONT)</a></b> by NIELSON CAETANO</p>
<p><b><a href="https://materialdesignicons.com" title="Icons"> Icons</a></b> by Austin Andrews</p> <p><b><a href="https://materialdesignicons.com" title="Icons"> Icons</a></b> by Austin Andrews</p>
<p><b><a href="https://github.com/harjot-oberai/Croller" title="Croller"> Croller</a></b> by Harjot Oberai</p>
<p><b><a href="https://www.techjuice.pk" title="City wallpaper"> Material Design City Wallpaper</a></b></p> <p><b><a href="https://www.techjuice.pk" title="City wallpaper"> Material Design City Wallpaper</a></b></p>
</body> </body>

View file

@ -16,7 +16,6 @@ package code.name.monkey.retromusic.glide
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.widget.ImageView import android.widget.ImageView
import androidx.palette.graphics.Palette
import code.name.monkey.appthemehelper.util.ATHUtil import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.glide.palette.BitmapPaletteTarget import code.name.monkey.retromusic.glide.palette.BitmapPaletteTarget
@ -44,16 +43,12 @@ abstract class RetroMusicColoredTarget(view: ImageView) : BitmapPaletteTarget(vi
glideAnimation: Transition<in BitmapPaletteWrapper>?) { glideAnimation: Transition<in BitmapPaletteWrapper>?) {
super.onResourceReady(resource, glideAnimation) super.onResourceReady(resource, glideAnimation)
val defaultColor = defaultFooterColor val defaultColor = defaultFooterColor
val primaryColor = getColor(resource.palette, defaultColor)
val dominantColor = getDominantColor(resource.bitmap, defaultColor)
onColorReady(if (PreferenceUtil.getInstance().isDominantColor) onColorReady(if (PreferenceUtil.getInstance().isDominantColor)
dominantColor getDominantColor(resource.bitmap, defaultColor)
else else
primaryColor) getColor(resource.palette, defaultColor))
} }
abstract fun onColorReady(color: Int) abstract fun onColorReady(color: Int)