From f851293b53b7a956f9ff6afe0a641c5777716dc4 Mon Sep 17 00:00:00 2001
From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>
Date: Sat, 2 Mar 2024 22:20:25 -0500
Subject: Add a message about subscription in LoginActivity.
---
.../activities/LoginActivity.java | 48 ++++++++--------------
app/src/main/res/values-cs/strings.xml | 1 -
app/src/main/res/values-de/strings.xml | 1 -
app/src/main/res/values-el/strings.xml | 1 -
app/src/main/res/values-es/strings.xml | 1 -
app/src/main/res/values-fr/strings.xml | 1 -
app/src/main/res/values-it/strings.xml | 1 -
app/src/main/res/values-pl/strings.xml | 1 -
app/src/main/res/values-pt-rBR/strings.xml | 1 -
app/src/main/res/values-ro/strings.xml | 1 -
app/src/main/res/values-ru/strings.xml | 1 -
app/src/main/res/values-tr-rTR/strings.xml | 1 -
app/src/main/res/values-uk/strings.xml | 1 -
app/src/main/res/values-zh-rCN/strings.xml | 1 -
app/src/main/res/values/strings.xml | 2 +-
15 files changed, 18 insertions(+), 45 deletions(-)
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LoginActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LoginActivity.java
index 81b1002c..41f74bbc 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LoginActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LoginActivity.java
@@ -21,13 +21,9 @@ import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
-import androidx.appcompat.widget.Toolbar;
-import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.app.ActivityCompat;
-import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
-import com.google.android.material.floatingactionbutton.FloatingActionButton;
import org.json.JSONException;
import org.json.JSONObject;
@@ -39,7 +35,6 @@ import java.util.concurrent.Executor;
import javax.inject.Inject;
import javax.inject.Named;
-import butterknife.BindView;
import butterknife.ButterKnife;
import me.saket.bettermovementmethod.BetterLinkMovementMethod;
import ml.docilealligator.infinityforreddit.FetchMyInfo;
@@ -50,6 +45,7 @@ import ml.docilealligator.infinityforreddit.apis.RedditAPI;
import ml.docilealligator.infinityforreddit.asynctasks.ParseAndInsertNewAccount;
import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
import ml.docilealligator.infinityforreddit.customviews.slidr.Slidr;
+import ml.docilealligator.infinityforreddit.databinding.ActivityLoginBinding;
import ml.docilealligator.infinityforreddit.utils.APIUtils;
import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils;
import ml.docilealligator.infinityforreddit.utils.Utils;
@@ -63,18 +59,6 @@ public class LoginActivity extends BaseActivity {
private static final String ENABLE_DOM_STATE = "EDS";
private static final String IS_AGREE_TO_USER_AGGREMENT_STATE = "IATUAS";
- @BindView(R.id.coordinator_layout_login_activity)
- CoordinatorLayout coordinatorLayout;
- @BindView(R.id.appbar_layout_login_activity)
- AppBarLayout appBarLayout;
- @BindView(R.id.toolbar_login_activity)
- Toolbar toolbar;
- @BindView(R.id.two_fa_infO_text_view_login_activity)
- TextView twoFAInfoTextView;
- @BindView(R.id.webview_login_activity)
- WebView webView;
- @BindView(R.id.fab_login_activity)
- FloatingActionButton fab;
@Inject
@Named("no_oauth")
Retrofit mRetrofit;
@@ -96,6 +80,7 @@ public class LoginActivity extends BaseActivity {
private String authCode;
private boolean enableDom = false;
private boolean isAgreeToUserAgreement = false;
+ private ActivityLoginBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -104,9 +89,10 @@ public class LoginActivity extends BaseActivity {
setImmersiveModeNotApplicable();
super.onCreate(savedInstanceState);
+ binding = ActivityLoginBinding.inflate(getLayoutInflater());
try {
- setContentView(R.layout.activity_login);
+ setContentView(binding.getRoot());
} catch (InflateException ie) {
Log.e("LoginActivity", "Failed to inflate LoginActivity: " + ie.getMessage());
Toast.makeText(LoginActivity.this, R.string.no_system_webview_error, Toast.LENGTH_SHORT).show();
@@ -122,7 +108,7 @@ public class LoginActivity extends BaseActivity {
Slidr.attach(this);
}
- setSupportActionBar(toolbar);
+ setSupportActionBar(binding.toolbarLoginActivity);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
@@ -131,7 +117,7 @@ public class LoginActivity extends BaseActivity {
isAgreeToUserAgreement = savedInstanceState.getBoolean(IS_AGREE_TO_USER_AGGREMENT_STATE);
}
- fab.setOnClickListener(view -> {
+ binding.fabLoginActivity.setOnClickListener(view -> {
new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme)
.setTitle(R.string.have_trouble_login_title)
.setMessage(R.string.have_trouble_login_message)
@@ -144,11 +130,11 @@ public class LoginActivity extends BaseActivity {
});
if (enableDom) {
- twoFAInfoTextView.setVisibility(View.GONE);
+ binding.twoFaInfOTextViewLoginActivity.setVisibility(View.GONE);
}
- webView.getSettings().setJavaScriptEnabled(true);
- webView.getSettings().setDomStorageEnabled(enableDom);
+ binding.webviewLoginActivity.getSettings().setJavaScriptEnabled(true);
+ binding.webviewLoginActivity.getSettings().setDomStorageEnabled(enableDom);
Uri baseUri = Uri.parse(APIUtils.OAUTH_URL);
Uri.Builder uriBuilder = baseUri.buildUpon();
@@ -164,8 +150,8 @@ public class LoginActivity extends BaseActivity {
CookieManager.getInstance().removeAllCookies(aBoolean -> {
});
- webView.loadUrl(url);
- webView.setWebViewClient(new WebViewClient() {
+ binding.webviewLoginActivity.loadUrl(url);
+ binding.webviewLoginActivity.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.contains("&code=") || url.contains("?code=")) {
@@ -319,14 +305,14 @@ public class LoginActivity extends BaseActivity {
@Override
protected void applyCustomTheme() {
- coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
- applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
- twoFAInfoTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
+ binding.coordinatorLayoutLoginActivity.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
+ applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(binding.appbarLayoutLoginActivity, null, binding.toolbarLoginActivity);
+ binding.twoFaInfOTextViewLoginActivity.setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
Drawable infoDrawable = Utils.getTintedDrawable(this, R.drawable.ic_info_preference_24dp, mCustomThemeWrapper.getPrimaryIconColor());
- twoFAInfoTextView.setCompoundDrawablesWithIntrinsicBounds(infoDrawable, null, null, null);
- applyFABTheme(fab);
+ binding.twoFaInfOTextViewLoginActivity.setCompoundDrawablesWithIntrinsicBounds(infoDrawable, null, null, null);
+ applyFABTheme(binding.fabLoginActivity);
if (typeface != null) {
- twoFAInfoTextView.setTypeface(typeface);
+ binding.twoFaInfOTextViewLoginActivity.setTypeface(typeface);
}
}
diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml
index a4e58e8b..1f8c3217 100644
--- a/app/src/main/res/values-cs/strings.xml
+++ b/app/src/main/res/values-cs/strings.xml
@@ -1222,7 +1222,6 @@ Pokud ano, přejmenujte je, než povolíte Material You."
"Popis (max 180 znaků)"
"URL"
"Smlouva s uživatelem"
- "Před přihlášením musíte souhlasit se Smlovou s uživatelem Redditu (%1$s) a Zásadami ochrany osobních údajů aplikace Infinity for Reddit (%2$s)"
"Souhlasím"
"Nesouhlasit"
"Možnost 1 (Povinná)"
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 1ea7625f..dc8905cd 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -1263,7 +1263,6 @@ Antippen zum Wiederholen."
"Titel (max 180 Buchstaben)"
"Url"
"Nutzungsbedingungen"
- "Du musst Reddit Nutzungsbedingungen (%1$s) und Infinity for reddit's Datenschutz-Bestimmungen (%2$s) zustimmen bevor du dich anmelden kannst."
"Zustimmen"
"Nicht zustimmen"
"Option 1 (notwendig)"
diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml
index 448886e5..2e9a811d 100644
--- a/app/src/main/res/values-el/strings.xml
+++ b/app/src/main/res/values-el/strings.xml
@@ -1150,7 +1150,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd
"Περιγραφή (έως 180 χαρακτήρες)"
"Url"
"Συμφωνητικό Χρήστη"
- "Πρέπει να συμφωνήσετε με το Συμφωνητικό Χρήστη (%1$s) και την Πολιτική Απορρήτου του Infinity για το Reddit (%2$s) πριν συνδεθείτε."
"Συμφωνώ"
"Δεν Συμφωνώ"
"Επιλογή 1 (Απαιτείται)"
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 0ce96613..e019710e 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -1272,7 +1272,6 @@ Toque para volver a intentarlo."
"Subtítulo (máximo 180 caracteres)"
"Url"
"Acuerdo del usuario"
- "Tienes que aceptar el Acuerdo de usuario de Reddit (%1$s) y la Política de privacidad de Infinity para Reddit (%2$s) antes de iniciar sesión."
"Aceptar"
"Rechazar"
"Opción 1 (Obligatorio)"
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 3b34a2e1..9219d343 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -1349,7 +1349,6 @@ Cliquer pour réessayer."
"Sous titres (Maximum 180 caractères)"
"Url"
"Accord d'utilisation"
- "Vous devez accepter l'accord d'utilisation de Reddit (%1$s) et la politique de confidentialité d'Infinity for Reddit (%2$s), avant de vous connecter."
"J'accepte"
"Je n’accepte pas"
"Option 1 (Requise)"
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 6b502b83..f639c35d 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -1154,7 +1154,6 @@ Premi per riprovare."
"Didascalia (max 180 caratteri)"
"URL"
"Accordo per gli utenti"
- "Devi accettare l'Accordo per l'utente di Reddit (%1$s) e l'Informativa sulla privacy di Infinity for Reddit (%2$s) prima di accedere."
"Accetto"
"Non accetto"
"Opzione 1 (richiesta)"
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 1780f959..97da0690 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -1182,7 +1182,6 @@ Brak podglądu w Ostatnich aplikacjach."
"Podpis (maks. 180 znaków)"
"Url"
"Umowa użytkownika"
- "Musisz zaakceptować Umowę użytkownika Reddit (%1$s) i politykę prywatności Infinity for Reddit (%2$s) przed zalogowaniem się."
"Zgadzam się"
"Nie zgadzam się"
"Opcja 1 (Wymagane)"
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index a0278fe9..af71be19 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -1198,7 +1198,6 @@ Toque para tentar de novo."
"Legenda (até 180 caracteres)"
"URL"
"Acordo de Usuário"
- "Você deve concordar com o Acordo de Usuário do Reddit (%1$s) e com a Política de Privacidade do Infinity for Reddit (%2$s) antes da autenticação."
"Concordar"
"Discordar"
"Opção 1 (exigida)"
diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml
index 56d77f34..876cd319 100644
--- a/app/src/main/res/values-ro/strings.xml
+++ b/app/src/main/res/values-ro/strings.xml
@@ -1214,7 +1214,6 @@ Apasă pentru a reîncerca."
"Notiță (maxim 180 caractere)"
"Adresă"
"Acordul Utilizatorului"
- "Trebuie să fii de acord cu Acordul Utilizatorului Reddit (%1$s) și Politica Reddit de Confidențialitate (%2$s) înainte să te autentifici."
"Sunt de acord"
"Nu sunt de acord"
"Opțiunea 1 (Obligatoriu)"
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 7b2f5d77..94908ce3 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -1232,7 +1232,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd
"Подпись (не более 180 символов)"
"URL"
"Пользовательское соглашение"
- "Перед входом вам необходимо принять Пользовательское соглашение Reddit (%1$s) и Политику конфиденциальности Infinity для Reddit (%2$s)."
"Принимаю"
"Не принимаю"
"Вариант 1 (обязательно)"
diff --git a/app/src/main/res/values-tr-rTR/strings.xml b/app/src/main/res/values-tr-rTR/strings.xml
index 798f5071..62751dcc 100644
--- a/app/src/main/res/values-tr-rTR/strings.xml
+++ b/app/src/main/res/values-tr-rTR/strings.xml
@@ -1242,7 +1242,6 @@ Tekrar denemek için tıklayın."
"Altyazı (en fazla 180 karakter)"
"Bağlantı Adresi"
"Kullanıcı Sözleşmesi"
- "Giriş yapmadan önce Reddit Kullanıcı Sözleşmesini (%1$s) ve Infinity for Reddit Gizlilik Politikasını (%2$s) kabul etmeniz gerekir."
"Kabul et"
"Kabul etme"
"Seçenek 1 (Zorunlu)"
diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml
index 8b5773a6..aaff92f8 100644
--- a/app/src/main/res/values-uk/strings.xml
+++ b/app/src/main/res/values-uk/strings.xml
@@ -1216,7 +1216,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd
"Заголовок (не більше 180 знаків)"
"URL"
"Угода користувача"
- "Перед входом погодьтеся на Умови користувача Reddit (%1$s) та Політику приватності Infinity for Reddit (%2$s)."
"Погоджуюся"
"Не погоджуюся"
"Варіант 1 (обовʼязково)"
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index b433a0a0..5260a84e 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -1233,7 +1233,6 @@ Reddit 视频分辨率较低。
"标题(最多 180 个字符)"
"URL"
"用户协议"
- "在登录之前,您需要同意 Reddit 用户协议(%1$s)和 Infinity for Reddit 的隐私政策(%2$s)"
"同意"
"不同意"
"选项 1(必须)"
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index b1bbaa47..49d8971f 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1285,7 +1285,7 @@
Url
User Agreement
- You need to agree to Reddit User Agreement (%1$s) and Infinity for Reddit\'s Privacy Policy (%2$s) before logging in.
+ You need to agree to Reddit User Agreement (%1$s) and Infinity for Reddit\'s Privacy Policy (%2$s) before logging in.\n\nFrom now on, you will need a monthly subscription to access the Reddit API within Infinity for Reddit and this is because Reddit has started charging for API access since July 1st, 2023.
Agree
Don\'t Agree
--
cgit v1.2.3