Search in sources :

Example 1 with MultiSheetView

use of com.simplecity.multisheetview.ui.view.MultiSheetView in project Shuttle by timusus.

the class MiniPlayerFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.fragment_mini_player, container, false);
    unbinder = ButterKnife.bind(this, rootView);
    rootView.setOnClickListener(v -> {
        MultiSheetView multiSheetView = MultiSheetView.getParentMultiSheetView(rootView);
        if (multiSheetView != null) {
            multiSheetView.expandSheet(MultiSheetView.Sheet.FIRST);
        }
    });
    rootView.setOnTouchListener(new OnSwipeTouchListener(getActivity()));
    playPauseView.setOnClickListener(v -> {
        playPauseView.toggle();
        playPauseView.postDelayed(() -> presenter.togglePlayback(), 200);
    });
    progressBar.setMax(1000);
    disposable.add(Aesthetic.get(getContext()).colorPrimary().compose(distinctToMainThread()).subscribe(color -> {
        boolean isDark = !Util.isColorLight(color);
        trackName.setTextColor(isDark ? Color.WHITE : Color.BLACK);
        artistName.setTextColor(isDark ? Color.WHITE : Color.BLACK);
        ViewBackgroundAction.create(rootView).accept(color);
    }, onErrorLogAndRethrow()));
    return rootView;
}
Also used : R(com.simplecity.amp_library.R) Context(android.content.Context) GestureDetector(android.view.GestureDetector) Bundle(android.os.Bundle) ProgressBar(android.widget.ProgressBar) ButterKnife(butterknife.ButterKnife) ImageView(android.widget.ImageView) Rx.onErrorLogAndRethrow(com.afollestad.aesthetic.Rx.onErrorLogAndRethrow) BindView(butterknife.BindView) Inject(javax.inject.Inject) Song(com.simplecity.amp_library.model.Song) Aesthetic(com.afollestad.aesthetic.Aesthetic) Priority(com.bumptech.glide.Priority) MotionEvent(android.view.MotionEvent) DiskCacheStrategy(com.bumptech.glide.load.engine.DiskCacheStrategy) ViewBackgroundAction(com.afollestad.aesthetic.ViewBackgroundAction) View(android.view.View) Unbinder(butterknife.Unbinder) PlaceholderProvider(com.simplecity.amp_library.utils.PlaceholderProvider) Rx.distinctToMainThread(com.afollestad.aesthetic.Rx.distinctToMainThread) MultiSheetView(com.simplecity.multisheetview.ui.view.MultiSheetView) LayoutInflater(android.view.LayoutInflater) PlayPauseView(com.simplecity.amp_library.ui.views.PlayPauseView) ViewGroup(android.view.ViewGroup) Color(android.graphics.Color) ShuttleApplication(com.simplecity.amp_library.ShuttleApplication) CompositeDisposable(io.reactivex.disposables.CompositeDisposable) TextView(android.widget.TextView) Glide(com.bumptech.glide.Glide) FragmentModule(com.simplecity.amp_library.dagger.module.FragmentModule) PlayerPresenter(com.simplecity.amp_library.ui.presenters.PlayerPresenter) Util(com.afollestad.aesthetic.Util) PlayerViewAdapter(com.simplecity.amp_library.ui.views.PlayerViewAdapter) Nullable(android.support.annotation.Nullable) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) MultiSheetView(com.simplecity.multisheetview.ui.view.MultiSheetView)

Aggregations

Context (android.content.Context)1 Color (android.graphics.Color)1 Bundle (android.os.Bundle)1 Nullable (android.support.annotation.Nullable)1 GestureDetector (android.view.GestureDetector)1 LayoutInflater (android.view.LayoutInflater)1 MotionEvent (android.view.MotionEvent)1 View (android.view.View)1 ViewGroup (android.view.ViewGroup)1 ImageView (android.widget.ImageView)1 ProgressBar (android.widget.ProgressBar)1 TextView (android.widget.TextView)1 BindView (butterknife.BindView)1 ButterKnife (butterknife.ButterKnife)1 Unbinder (butterknife.Unbinder)1 Aesthetic (com.afollestad.aesthetic.Aesthetic)1 Rx.distinctToMainThread (com.afollestad.aesthetic.Rx.distinctToMainThread)1 Rx.onErrorLogAndRethrow (com.afollestad.aesthetic.Rx.onErrorLogAndRethrow)1 Util (com.afollestad.aesthetic.Util)1 ViewBackgroundAction (com.afollestad.aesthetic.ViewBackgroundAction)1