Search in sources :

Example 1 with FlippingStop

use of com.foobnix.pdf.search.activity.msg.FlippingStop in project LibreraReader by foobnix.

the class DragingDialogs method pageFlippingDialog.

public static void pageFlippingDialog(final FrameLayout anchor, final DocumentController controller, final Runnable onRefresh) {
    new DragingPopup(anchor.getContext().getString(R.string.automatic_page_flipping), anchor, 300, 300) {

        @Override
        public View getContentView(LayoutInflater inflater) {
            View inflate = inflater.inflate(R.layout.dialog_flipping_pages, null, false);
            CheckBox isScrollAnimation = (CheckBox) inflate.findViewById(R.id.isScrollAnimation);
            isScrollAnimation.setVisibility(AppState.get().isAlwaysOpenAsMagazine ? View.VISIBLE : View.GONE);
            isScrollAnimation.setChecked(AppState.get().isScrollAnimation);
            isScrollAnimation.setOnCheckedChangeListener(new OnCheckedChangeListener() {

                @Override
                public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) {
                    AppState.get().isScrollAnimation = isChecked;
                }
            });
            CheckBox isLoopAutoplay = (CheckBox) inflate.findViewById(R.id.isLoopAutoplay);
            isLoopAutoplay.setChecked(AppState.get().isLoopAutoplay);
            isLoopAutoplay.setOnCheckedChangeListener(new OnCheckedChangeListener() {

                @Override
                public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) {
                    AppState.get().isLoopAutoplay = isChecked;
                }
            });
            CheckBox isShowToolBar = (CheckBox) inflate.findViewById(R.id.isShowToolBar);
            isShowToolBar.setChecked(AppState.get().isShowToolBar);
            isShowToolBar.setOnCheckedChangeListener(new OnCheckedChangeListener() {

                @Override
                public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) {
                    AppState.get().isShowToolBar = isChecked;
                    if (onRefresh != null) {
                        onRefresh.run();
                    }
                }
            });
            final CustomSeek flippingInterval = (CustomSeek) inflate.findViewById(R.id.flippingInterval);
            flippingInterval.init(1, 240, AppState.get().flippingInterval);
            flippingInterval.setOnSeekChanged(new IntegerResponse() {

                @Override
                public boolean onResultRecive(int result) {
                    flippingInterval.setValueText("" + result);
                    AppState.get().flippingInterval = result;
                    return false;
                }
            });
            flippingInterval.setValueText("" + AppState.get().flippingInterval);
            inflate.findViewById(R.id.flippingStart).setOnClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {
                    EventBus.getDefault().post(new FlippingStart());
                }
            });
            inflate.findViewById(R.id.flippingStop).setOnClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {
                    EventBus.getDefault().post(new FlippingStop());
                }
            });
            return inflate;
        }
    }.show("pageFlippingDialog").setOnCloseListener(new Runnable() {

        @Override
        public void run() {
        }
    });
}
Also used : OnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener) IntegerResponse(com.foobnix.android.utils.IntegerResponse) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) GridView(android.widget.GridView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView) AbsListView(android.widget.AbsListView) SuppressLint(android.annotation.SuppressLint) CheckBox(android.widget.CheckBox) LayoutInflater(android.view.LayoutInflater) OnClickListener(android.view.View.OnClickListener) FlippingStop(com.foobnix.pdf.search.activity.msg.FlippingStop) FlippingStart(com.foobnix.pdf.search.activity.msg.FlippingStart) CompoundButton(android.widget.CompoundButton)

Aggregations

SuppressLint (android.annotation.SuppressLint)1 RecyclerView (android.support.v7.widget.RecyclerView)1 LayoutInflater (android.view.LayoutInflater)1 View (android.view.View)1 OnClickListener (android.view.View.OnClickListener)1 AbsListView (android.widget.AbsListView)1 AdapterView (android.widget.AdapterView)1 CheckBox (android.widget.CheckBox)1 CompoundButton (android.widget.CompoundButton)1 OnCheckedChangeListener (android.widget.CompoundButton.OnCheckedChangeListener)1 GridView (android.widget.GridView)1 ImageView (android.widget.ImageView)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 IntegerResponse (com.foobnix.android.utils.IntegerResponse)1 FlippingStart (com.foobnix.pdf.search.activity.msg.FlippingStart)1 FlippingStop (com.foobnix.pdf.search.activity.msg.FlippingStop)1