switch to horizontal progress bar
This commit is contained in:
parent
94f244089b
commit
6bfb72c356
3 changed files with 23 additions and 7 deletions
|
|
@ -274,7 +274,7 @@ public class CardPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
|
||||||
public void onColorChanged(int color) {
|
public void onColorChanged(int color) {
|
||||||
animateColorChange(color);
|
animateColorChange(color);
|
||||||
playbackControlsFragment.setDark(ColorUtil.isColorLight(color));
|
playbackControlsFragment.setDark(ColorUtil.isColorLight(color));
|
||||||
playbackControlsFragment.updateBufferingIndicatorColor(ColorUtil.invertColor(color));
|
playbackControlsFragment.updateBufferingIndicatorColor(color);
|
||||||
getCallbacks().onPaletteColorChanged();
|
getCallbacks().onPaletteColorChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,10 +134,13 @@ public class CardPlayerPlaybackControlsFragment extends AbsMusicServiceFragment
|
||||||
} else {
|
} else {
|
||||||
playerFabPlayPauseDrawable.setPlay(animate);
|
playerFabPlayPauseDrawable.setPlay(animate);
|
||||||
}
|
}
|
||||||
binding.playerBufferingIndicator.setVisibility(MusicPlayerRemote.isBuffering() ? View.VISIBLE : View.GONE);
|
|
||||||
|
binding.progressBarLoading.setVisibility(MusicPlayerRemote.isBuffering() ? View.VISIBLE : View.GONE);
|
||||||
|
binding.progressBarPlaying.setVisibility(MusicPlayerRemote.isBuffering() ? View.GONE : View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateBufferingIndicatorColor(int color) {
|
public void updateBufferingIndicatorColor(int color) {
|
||||||
|
binding.playerBufferingIndicator.setProgressBackgroundTintList(ColorStateList.valueOf(getResources().getColor(android.R.color.transparent)));
|
||||||
binding.playerBufferingIndicator.setIndeterminateTintList(ColorStateList.valueOf(color));
|
binding.playerBufferingIndicator.setIndeterminateTintList(ColorStateList.valueOf(color));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,24 @@
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
android:id="@+id/progress_bar_loading"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/progress_container_height"
|
||||||
|
android:background="@color/twenty_percent_black_overlay">
|
||||||
|
|
||||||
|
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
|
||||||
|
android:id="@+id/player_buffering_indicator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/progress_container_height"
|
||||||
|
android:indeterminate="true"
|
||||||
|
app:mpb_progressStyle="horizontal"
|
||||||
|
app:mpb_useIntrinsicPadding="false"
|
||||||
|
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/progress_bar_playing"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/progress_container_height"
|
android:layout_height="@dimen/progress_container_height"
|
||||||
android:background="@color/twenty_percent_black_overlay">
|
android:background="@color/twenty_percent_black_overlay">
|
||||||
|
|
@ -122,11 +140,6 @@
|
||||||
app:elevation="4dp"
|
app:elevation="4dp"
|
||||||
app:pressedTranslationZ="2dp" />
|
app:pressedTranslationZ="2dp" />
|
||||||
|
|
||||||
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
|
|
||||||
android:id="@+id/player_buffering_indicator"
|
|
||||||
android:layout_width="74dp"
|
|
||||||
android:layout_height="74dp"
|
|
||||||
android:layout_centerInParent="true" />
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue