Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Merge branch 'fix/2449_don't-offer-protonmailch-during-registration' …
Browse files Browse the repository at this point in the history
…into 'prerelease'

Disabled the spinner to not allow user to choose any domain other than `protonmail.com` on signup

See merge request android/mail/proton-mail-android!763
  • Loading branch information
ZoricaStojchevska committed Oct 19, 2021
2 parents fd43b77 + a84ffa0 commit 969e9de
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
mRootLayout.getViewTreeObserver().addOnGlobalLayoutListener(this);
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(),R.layout.simple_spinner_item, domains);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mDomainsSpinner.setEnabled(false);
mDomainsSpinner.setAdapter(adapter);
mDomainsSpinner.setOnItemSelectedListener(this);
setUsernameEditTextPadding();
Expand Down Expand Up @@ -197,6 +198,7 @@ public void setDomains(List<String> availableDomains) {
}
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(),R.layout.simple_spinner_item, domains);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mDomainsSpinner.setEnabled(false);
mDomainsSpinner.setAdapter(adapter);
setUsernameEditTextPadding();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
*/
package ch.protonmail.android.core;

import static ch.protonmail.android.api.segments.event.EventManagerKt.PREF_LATEST_EVENT;
import static ch.protonmail.android.core.Constants.FCM_MIGRATION_VERSION;
import static ch.protonmail.android.core.Constants.Prefs.PREF_SENT_TOKEN_TO_SERVER;
import static ch.protonmail.android.core.Constants.Prefs.PREF_TIME_AND_DATE_CHANGED;
import static ch.protonmail.android.core.UserManagerKt.LOGIN_STATE_TO_INBOX;
import static ch.protonmail.android.core.UserManagerKt.PREF_LOGIN_STATE;
import static ch.protonmail.android.core.UserManagerKt.PREF_SHOW_STORAGE_LIMIT_REACHED;
import static ch.protonmail.android.core.UserManagerKt.PREF_SHOW_STORAGE_LIMIT_WARNING;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Application;
Expand Down Expand Up @@ -119,15 +128,6 @@
import studio.forface.viewstatestore.ViewStateStoreConfig;
import timber.log.Timber;

import static ch.protonmail.android.api.segments.event.EventManagerKt.PREF_LATEST_EVENT;
import static ch.protonmail.android.core.Constants.FCM_MIGRATION_VERSION;
import static ch.protonmail.android.core.Constants.Prefs.PREF_SENT_TOKEN_TO_SERVER;
import static ch.protonmail.android.core.Constants.Prefs.PREF_TIME_AND_DATE_CHANGED;
import static ch.protonmail.android.core.UserManagerKt.LOGIN_STATE_TO_INBOX;
import static ch.protonmail.android.core.UserManagerKt.PREF_LOGIN_STATE;
import static ch.protonmail.android.core.UserManagerKt.PREF_SHOW_STORAGE_LIMIT_REACHED;
import static ch.protonmail.android.core.UserManagerKt.PREF_SHOW_STORAGE_LIMIT_WARNING;

@HiltAndroidApp
public class ProtonMailApplication extends Application implements androidx.work.Configuration.Provider {

Expand Down Expand Up @@ -163,7 +163,6 @@ public class ProtonMailApplication extends Application implements androidx.work.
private boolean mUpdateOccurred;
private AllCurrencyPlans mAllCurrencyPlans;
private Organization mOrganization;
private List<String> mAvailableDomains;
private String mCurrentLocale;
private boolean mChangedSystemTimeDate;
private AlertDialog forceUpgradeDialog;
Expand Down Expand Up @@ -400,9 +399,6 @@ public void onPasswordChangeEvent(PasswordChangeEvent event) {

@Subscribe
public void onAvailableDomainsEvent(AvailableDomainsEvent event) {
if (event.getStatus() == Status.SUCCESS) {
this.mAvailableDomains = event.getDomains();
}
}

@Subscribe
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/fragment_create_account.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ along with ProtonMail. If not, see https://www.gnu.org/licenses/.
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@null"
android:layout_marginTop="8dp"/>

</RelativeLayout>
Expand Down

0 comments on commit 969e9de

Please sign in to comment.