use of com.foobnix.pdf.search.activity.msg.FlippingStart 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() {
}
});
}
Aggregations