Exemplo n.º 1
0
 @Override
 protected void onAttachedToWindow() {
   super.onAttachedToWindow();
   seekBar.setOnSeekArcChangeListener(presenter);
   if (!isInEditMode()) presenter.takeView(this);
   subscribeClicks();
 }
Exemplo n.º 2
0
 @Override
 protected void onFinishInflate() {
   super.onFinishInflate();
   ButterKnife.inject(this);
   String pickedview = settings.getString(NOW_PLAYING_VIEW, NOW_PLAYING_VIEW_ARTWORK);
   switch (pickedview) {
     case NOW_PLAYING_VIEW_VIS_CIRCLE:
     case NOW_PLAYING_VIEW_VIS_CIRCLE_BAR:
     case NOW_PLAYING_VIEW_VIS_LINES:
       visualizerView =
           ViewUtils.inflate(getContext(), R.layout.now_playing_visualization, placeholder, false);
       placeholder.addView(visualizerView);
       initVisualizer(pickedview);
       break;
     case NOW_PLAYING_VIEW_ARTWORK:
     default:
       artwork = ViewUtils.inflate(getContext(), R.layout.now_playing_artwork, placeholder, false);
       placeholder.addView(artwork);
       initArtwork();
       break;
   }
   if (!VersionUtils.hasLollipop()) {
     seekBar
         .getThumb()
         .mutate()
         .setColorFilter(ThemeUtils.getColorAccent(getContext()), PorterDuff.Mode.SRC_IN);
   }
   PlaybackDrawableTint.repeatDrawable36(repeat);
   PlaybackDrawableTint.shuffleDrawable36(shuffle);
   if (!isInEditMode()) presenter.takeView(this);
 }
Exemplo n.º 3
0
 @Override
 protected void onDetachedFromWindow() {
   super.onDetachedFromWindow();
   unsubscribeClicks();
   presenter.dropView(this);
   seekBar.setOnSeekArcChangeListener(null);
   destroyVisualizer();
 }