Commit bb8b2992 authored by Georg Koppen's avatar Georg Koppen Committed by Matthew Finkel
Browse files

Revert "Bug 1587631 - Add FxA entrypoint option for panel configurations. r=petru, a=RyanVM"

This reverts commit 484ec940.
parent bd931dc9
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ class FirstrunPagerConfig {
    static final String KEY_IMAGE = "panelImage";
    static final String KEY_MESSAGE = "panelMessage";
    static final String KEY_SUBTEXT = "panelDescription";
    static final String KEY_ENTRYPOINT = "panelFxaEntrypoint";

    static List<FirstrunPanelConfig> getDefault(Context context, final boolean useLocalValues) {
        final List<FirstrunPanelConfig> panels = new LinkedList<>();
@@ -47,11 +46,11 @@ class FirstrunPagerConfig {
        private Bundle args;

        FirstrunPanelConfig(String resource, String title) {
            this(resource, title, -1, null, null, true, null);
            this(resource, title, -1, null, null, true);
        }

        private FirstrunPanelConfig(String classname, String title, int image, String message,
                                    String subtext, boolean isCustom, String entrypoint) {
                                    String subtext, boolean isCustom) {
            this.classname = classname;
            this.title = title;

@@ -60,9 +59,6 @@ class FirstrunPagerConfig {
                args.putInt(KEY_IMAGE, image);
                args.putString(KEY_MESSAGE, message);
                args.putString(KEY_SUBTEXT, subtext);
                if (entrypoint != null) {
                    args.putString(KEY_ENTRYPOINT, entrypoint);
                }
            }
        }

@@ -76,8 +72,7 @@ class FirstrunPagerConfig {
                panelConfig = new RemoteFirstRunPanelConfig().getPanelConfig(context, wantedPanelConfig, useLocalValues);
            }
            return new FirstrunPanelConfig(panelConfig.getClassName(), panelConfig.getTitle(),
                    panelConfig.getImage(), panelConfig.getMessage(), panelConfig.getText(), false,
                    panelConfig.getEntrypoint());
                    panelConfig.getImage(), panelConfig.getMessage(), panelConfig.getText(), false);
        }


+1 −7
Original line number Diff line number Diff line
@@ -32,9 +32,6 @@ public class FirstrunPanel extends Fragment {
    protected boolean showBrowserHint = true;
    public static final String NO_MESSAGE = "";

    //Default FxA entrypoint
    protected String entrypoint = FxAccountConstants.ENDPOINT_FIRSTRUN;

    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstance) {
        final ViewGroup root = (ViewGroup) inflater.inflate(R.layout.firstrun_basepanel_checkable_fragment, container, false);
@@ -43,9 +40,6 @@ public class FirstrunPanel extends Fragment {
            final int image = args.getInt(FirstrunPagerConfig.KEY_IMAGE);
            final String message = args.getString(FirstrunPagerConfig.KEY_MESSAGE);
            final String subtext = args.getString(FirstrunPagerConfig.KEY_SUBTEXT);
            if (args.containsKey(FirstrunPagerConfig.KEY_ENTRYPOINT)) {
                entrypoint = args.getString(FirstrunPagerConfig.KEY_ENTRYPOINT);
            }

            ((ImageView) root.findViewById(R.id.firstrun_image)).setImageDrawable(getResources().getDrawable(image));
            ((TextView) root.findViewById(R.id.firstrun_text)).setText(message);
@@ -69,7 +63,7 @@ public class FirstrunPanel extends Fragment {
            showBrowserHint = false;

            final Intent intent = new Intent(FxAccountConstants.ACTION_FXA_GET_STARTED);
            intent.putExtra(FxAccountWebFlowActivity.EXTRA_ENDPOINT, entrypoint);
            intent.putExtra(FxAccountWebFlowActivity.EXTRA_ENDPOINT, FxAccountConstants.ENDPOINT_FIRSTRUN);
            intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
            startActivity(intent);

+1 −4
Original line number Diff line number Diff line
@@ -29,9 +29,6 @@ public class LastPanel extends FirstrunPanel {
            final int image = args.getInt(FirstrunPagerConfig.KEY_IMAGE);
            final String message = args.getString(FirstrunPagerConfig.KEY_MESSAGE);
            final String subtext = args.getString(FirstrunPagerConfig.KEY_SUBTEXT);
            if (args.containsKey(FirstrunPagerConfig.KEY_ENTRYPOINT)) {
                entrypoint = args.getString(FirstrunPagerConfig.KEY_ENTRYPOINT);
            }

            ((ImageView) root.findViewById(R.id.firstrun_image)).setImageDrawable(getResources().getDrawable(image));
            ((TextView) root.findViewById(R.id.firstrun_subtext)).setText(subtext);
@@ -55,7 +52,7 @@ public class LastPanel extends FirstrunPanel {
            showBrowserHint = false;

            final Intent intent = new Intent(FxAccountConstants.ACTION_FXA_GET_STARTED);
            intent.putExtra(FxAccountWebFlowActivity.EXTRA_ENDPOINT, entrypoint);
            intent.putExtra(FxAccountWebFlowActivity.EXTRA_ENDPOINT, FxAccountConstants.ENDPOINT_FIRSTRUN);
            intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
            startActivity(intent);

+4 −9
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@ import android.content.res.Resources;
import android.support.annotation.NonNull;

import org.mozilla.gecko.R;
import org.mozilla.gecko.fxa.FxAccountConstants;
import org.mozilla.gecko.util.OnboardingResources;

public class LocalFirstRunPanelProvider implements FirstRunPanelConfigProviderStrategy {
@@ -24,8 +23,7 @@ public class LocalFirstRunPanelProvider implements FirstRunPanelConfigProviderSt
                    return new PanelConfig(type, useLocalValues, resources.getString(R.string.firstrun_panel_title_welcome),
                            onboardingUtil.getWelcomeMessage(),
                            onboardingUtil.getWelcomeSubtext(),
                            R.drawable.firstrun_welcome2,
                            FxAccountConstants.ENDPOINT_FIRSTRUN + "-welcome");
                            R.drawable.firstrun_welcome2);
                case PRIVACY:
                case CUSTOMIZE:
                case LAST_CUSTOMIZE:
@@ -34,20 +32,17 @@ public class LocalFirstRunPanelProvider implements FirstRunPanelConfigProviderSt
                    return new PanelConfig(type, useLocalValues, onboardingUtil.getSyncTitle(),
                            FirstrunPanel.NO_MESSAGE,
                            onboardingUtil.getSyncSubtext(),
                            onboardingUtil.getSyncImageResId(),
                            FxAccountConstants.ENDPOINT_FIRSTRUN + "-sync");
                            onboardingUtil.getSyncImageResId());
                case SEND_TAB:
                    return new PanelConfig(type, useLocalValues, context.getString(R.string.firstrun_sendtab_title),
                            FirstrunPanel.NO_MESSAGE,
                            context.getString(R.string.firstrun_sendtab_message),
                            R.drawable.firstrun_sendtab,
                            FxAccountConstants.ENDPOINT_FIRSTRUN + "-sendtab");
                            R.drawable.firstrun_sendtab);
                default:    // This will also be the case for "WELCOME"
                    return new PanelConfig(type, useLocalValues, resources.getString(R.string.firstrun_panel_title_welcome),
                            onboardingUtil.getWelcomeMessage(),
                            onboardingUtil.getWelcomeSubtext(),
                            R.drawable.firstrun_welcome2,
                            FxAccountConstants.ENDPOINT_FIRSTRUN + "-welcome");
                            R.drawable.firstrun_welcome2);
            }

        // Show the previous Onboarding experience. Same old screens, imagery and strings.
+0 −15
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ public class PanelConfig {
    private final String message;
    private final String text;
    private final int image;
    private String entrypoint;

    public PanelConfig(TYPE type, boolean useLocalValues, String title, String message, String text, int image) {
        this.type = type;
@@ -30,16 +29,6 @@ public class PanelConfig {
        this.image = image;
    }

    public PanelConfig(TYPE type, boolean useLocalValues, String title, String message, String text, int image, String entrypoint) {
        this.type = type;
        this.useLocalValues = useLocalValues;
        this.title = title;
        this.message = message;
        this.text = text;
        this.image = image;
        this.entrypoint = entrypoint;
    }

    public String getClassName() {
        switch (type) {
            case WELCOME:
@@ -80,8 +69,4 @@ public class PanelConfig {
    public int getImage() {
        return image;
    }

    public String getEntrypoint() {
        return entrypoint;
    }
}
Loading