Search in sources :

Example 1 with WizardPageView

use of com.frostwire.android.gui.views.WizardPageView in project frostwire by frostwire.

the class WizardActivity method initComponents.

@Override
protected void initComponents(Bundle savedInstanceState) {
    buttonPrevious = findView(R.id.activity_wizard_button_previous);
    buttonPrevious.setOnClickListener(v -> previousPage());
    buttonNext = findView(R.id.activity_wizard_button_next);
    buttonNext.setOnClickListener(v -> nextPage());
    viewFlipper = findView(R.id.activity_wizard_view_flipper);
    int count = viewFlipper.getChildCount();
    for (int i = 0; i < count; i++) {
        View view = viewFlipper.getChildAt(i);
        if (view instanceof WizardPageView) {
            ((WizardPageView) view).setOnCompleteListener(completeListener);
        }
        view.setTag(i);
    }
    setupViewPage();
}
Also used : WizardPageView(com.frostwire.android.gui.views.WizardPageView) WizardPageView(com.frostwire.android.gui.views.WizardPageView) View(android.view.View)

Example 2 with WizardPageView

use of com.frostwire.android.gui.views.WizardPageView in project frostwire by frostwire.

the class WizardActivity method setupViewPage.

private void setupViewPage() {
    View view = viewFlipper.getCurrentView();
    currentPageView = view;
    if (view instanceof WizardPageView) {
        WizardPageView pageView = (WizardPageView) view;
        buttonPrevious.setVisibility(pageView.hasPrevious() ? View.VISIBLE : View.INVISIBLE);
        buttonNext.setText(pageView.hasNext() ? R.string.wizard_next : R.string.wizard_finish);
        buttonNext.setEnabled(false);
        pageView.load();
    } else {
        buttonPrevious.setVisibility(View.VISIBLE);
        buttonNext.setEnabled(true);
    }
}
Also used : WizardPageView(com.frostwire.android.gui.views.WizardPageView) WizardPageView(com.frostwire.android.gui.views.WizardPageView) View(android.view.View)

Example 3 with WizardPageView

use of com.frostwire.android.gui.views.WizardPageView in project frostwire by frostwire.

the class WizardActivity method onBackPressed.

@Override
public void onBackPressed() {
    final View view = viewFlipper.getCurrentView();
    if (view instanceof WizardPageView && !((WizardPageView) view).hasPrevious()) {
        UIUtils.sendShutdownIntent(this);
        finish();
    } else {
        previousPage();
    }
}
Also used : WizardPageView(com.frostwire.android.gui.views.WizardPageView) WizardPageView(com.frostwire.android.gui.views.WizardPageView) View(android.view.View)

Example 4 with WizardPageView

use of com.frostwire.android.gui.views.WizardPageView in project frostwire by frostwire.

the class WizardActivity method nextPage.

private void nextPage() {
    View view = viewFlipper.getCurrentView();
    if (view instanceof WizardPageView) {
        WizardPageView pageView = (WizardPageView) view;
        pageView.finish();
        if (!pageView.hasNext()) {
            ConfigurationManager CM = ConfigurationManager.instance();
            CM.setBoolean(Constants.PREF_KEY_GUI_TOS_ACCEPTED, true);
            CM.setBoolean(Constants.PREF_KEY_GUI_INITIAL_SETTINGS_COMPLETE, true);
            CM.setLong(Constants.PREF_KEY_GUI_INSTALLATION_TIMESTAMP, System.currentTimeMillis());
        } else {
            viewFlipper.showNext();
            setupViewPage();
        }
    } else {
        viewFlipper.showNext();
        setupViewPage();
    }
}
Also used : WizardPageView(com.frostwire.android.gui.views.WizardPageView) WizardPageView(com.frostwire.android.gui.views.WizardPageView) View(android.view.View) ConfigurationManager(com.frostwire.android.core.ConfigurationManager)

Aggregations

View (android.view.View)4 WizardPageView (com.frostwire.android.gui.views.WizardPageView)4 ConfigurationManager (com.frostwire.android.core.ConfigurationManager)1