diff options
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/activities/LoginActivity.java | 48 | ||||
-rw-r--r-- | app/src/main/res/values-cs/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-de/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-el/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-es/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-fr/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-it/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-pl/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-pt-rBR/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-ro/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-ru/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-tr-rTR/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-uk/strings.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values-zh-rCN/strings.xml | 1 | ||||
-rw-r--r-- | 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."</string> <string name="reddit_gallery_item_caption_hint">"Popis (max 180 znaků)"</string> <string name="reddit_gallery_item_url_hint">"URL"</string> <string name="user_agreement_dialog_title">"Smlouva s uživatelem"</string> - <string name="user_agreement_message">"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)"</string> <string name="agree">"Souhlasím"</string> <string name="do_not_agree">"Nesouhlasit"</string> <string name="option_1_hint">"Možnost 1 (Povinná)"</string> 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."</string> <string name="reddit_gallery_item_caption_hint">"Titel (max 180 Buchstaben)"</string> <string name="reddit_gallery_item_url_hint">"Url"</string> <string name="user_agreement_dialog_title">"Nutzungsbedingungen"</string> - <string name="user_agreement_message">"Du musst Reddit Nutzungsbedingungen (%1$s) und Infinity for reddit's Datenschutz-Bestimmungen (%2$s) zustimmen bevor du dich anmelden kannst."</string> <string name="agree">"Zustimmen"</string> <string name="do_not_agree">"Nicht zustimmen"</string> <string name="option_1_hint">"Option 1 (notwendig)"</string> 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 <string name="reddit_gallery_item_caption_hint">"Περιγραφή (έως 180 χαρακτήρες)"</string> <string name="reddit_gallery_item_url_hint">"Url"</string> <string name="user_agreement_dialog_title">"Συμφωνητικό Χρήστη"</string> - <string name="user_agreement_message">"Πρέπει να συμφωνήσετε με το Συμφωνητικό Χρήστη (%1$s) και την Πολιτική Απορρήτου του Infinity για το Reddit (%2$s) πριν συνδεθείτε."</string> <string name="agree">"Συμφωνώ"</string> <string name="do_not_agree">"Δεν Συμφωνώ"</string> <string name="option_1_hint">"Επιλογή 1 (Απαιτείται)"</string> 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."</string> <string name="reddit_gallery_item_caption_hint">"Subtítulo (máximo 180 caracteres)"</string> <string name="reddit_gallery_item_url_hint">"Url"</string> <string name="user_agreement_dialog_title">"Acuerdo del usuario"</string> - <string name="user_agreement_message">"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."</string> <string name="agree">"Aceptar"</string> <string name="do_not_agree">"Rechazar"</string> <string name="option_1_hint">"Opción 1 (Obligatorio)"</string> 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."</string> <string name="reddit_gallery_item_caption_hint">"Sous titres (Maximum 180 caractères)"</string> <string name="reddit_gallery_item_url_hint">"Url"</string> <string name="user_agreement_dialog_title">"Accord d'utilisation"</string> - <string name="user_agreement_message">"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."</string> <string name="agree">"J'accepte"</string> <string name="do_not_agree">"Je n’accepte pas"</string> <string name="option_1_hint">"Option 1 (Requise)"</string> 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."</string> <string name="reddit_gallery_item_caption_hint">"Didascalia (max 180 caratteri)"</string> <string name="reddit_gallery_item_url_hint">"URL"</string> <string name="user_agreement_dialog_title">"Accordo per gli utenti"</string> - <string name="user_agreement_message">"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."</string> <string name="agree">"Accetto"</string> <string name="do_not_agree">"Non accetto"</string> <string name="option_1_hint">"Opzione 1 (richiesta)"</string> 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."</string> <string name="reddit_gallery_item_caption_hint">"Podpis (maks. 180 znaków)"</string> <string name="reddit_gallery_item_url_hint">"Url"</string> <string name="user_agreement_dialog_title">"Umowa użytkownika"</string> - <string name="user_agreement_message">"Musisz zaakceptować Umowę użytkownika Reddit (%1$s) i politykę prywatności Infinity for Reddit (%2$s) przed zalogowaniem się."</string> <string name="agree">"Zgadzam się"</string> <string name="do_not_agree">"Nie zgadzam się"</string> <string name="option_1_hint">"Opcja 1 (Wymagane)"</string> 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."</string> <string name="reddit_gallery_item_caption_hint">"Legenda (até 180 caracteres)"</string> <string name="reddit_gallery_item_url_hint">"URL"</string> <string name="user_agreement_dialog_title">"Acordo de Usuário"</string> - <string name="user_agreement_message">"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."</string> <string name="agree">"Concordar"</string> <string name="do_not_agree">"Discordar"</string> <string name="option_1_hint">"Opção 1 (exigida)"</string> 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."</string> <string name="reddit_gallery_item_caption_hint">"Notiță (maxim 180 caractere)"</string> <string name="reddit_gallery_item_url_hint">"Adresă"</string> <string name="user_agreement_dialog_title">"Acordul Utilizatorului"</string> - <string name="user_agreement_message">"Trebuie să fii de acord cu Acordul Utilizatorului Reddit (%1$s) și Politica Reddit de Confidențialitate (%2$s) înainte să te autentifici."</string> <string name="agree">"Sunt de acord"</string> <string name="do_not_agree">"Nu sunt de acord"</string> <string name="option_1_hint">"Opțiunea 1 (Obligatoriu)"</string> 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 <string name="reddit_gallery_item_caption_hint">"Подпись (не более 180 символов)"</string> <string name="reddit_gallery_item_url_hint">"URL"</string> <string name="user_agreement_dialog_title">"Пользовательское соглашение"</string> - <string name="user_agreement_message">"Перед входом вам необходимо принять Пользовательское соглашение Reddit (%1$s) и Политику конфиденциальности Infinity для Reddit (%2$s)."</string> <string name="agree">"Принимаю"</string> <string name="do_not_agree">"Не принимаю"</string> <string name="option_1_hint">"Вариант 1 (обязательно)"</string> 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."</string> <string name="reddit_gallery_item_caption_hint">"Altyazı (en fazla 180 karakter)"</string> <string name="reddit_gallery_item_url_hint">"Bağlantı Adresi"</string> <string name="user_agreement_dialog_title">"Kullanıcı Sözleşmesi"</string> - <string name="user_agreement_message">"Giriş yapmadan önce Reddit Kullanıcı Sözleşmesini (%1$s) ve Infinity for Reddit Gizlilik Politikasını (%2$s) kabul etmeniz gerekir."</string> <string name="agree">"Kabul et"</string> <string name="do_not_agree">"Kabul etme"</string> <string name="option_1_hint">"Seçenek 1 (Zorunlu)"</string> 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 <string name="reddit_gallery_item_caption_hint">"Заголовок (не більше 180 знаків)"</string> <string name="reddit_gallery_item_url_hint">"URL"</string> <string name="user_agreement_dialog_title">"Угода користувача"</string> - <string name="user_agreement_message">"Перед входом погодьтеся на Умови користувача Reddit (%1$s) та Політику приватності Infinity for Reddit (%2$s)."</string> <string name="agree">"Погоджуюся"</string> <string name="do_not_agree">"Не погоджуюся"</string> <string name="option_1_hint">"Варіант 1 (обовʼязково)"</string> 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 视频分辨率较低。 <string name="reddit_gallery_item_caption_hint">"标题(最多 180 个字符)"</string> <string name="reddit_gallery_item_url_hint">"URL"</string> <string name="user_agreement_dialog_title">"用户协议"</string> - <string name="user_agreement_message">"在登录之前,您需要同意 Reddit 用户协议(%1$s)和 Infinity for Reddit 的隐私政策(%2$s)"</string> <string name="agree">"同意"</string> <string name="do_not_agree">"不同意"</string> <string name="option_1_hint">"选项 1(必须)"</string> 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 @@ <string name="reddit_gallery_item_url_hint">Url</string> <string name="user_agreement_dialog_title">User Agreement</string> - <string name="user_agreement_message">You need to agree to Reddit User Agreement (%1$s) and Infinity for Reddit\'s Privacy Policy (%2$s) before logging in.</string> + <string name="user_agreement_message">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.</string> <string name="agree">Agree</string> <string name="do_not_agree">Don\'t Agree</string> |