aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-07-19 06:12:26 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-07-19 06:12:26 +0000
commit5f18f7df646ce5d2637b29fca557ca00766682c7 (patch)
tree193958ddb26b815e6a8cb277ac3e2b2b3a8161ab /app/src/main/java/ml
parentf37a46e2c234fe50efcc867fdd224a14dcbfe45e (diff)
downloadinfinity-for-reddit-5f18f7df646ce5d2637b29fca557ca00766682c7.tar
infinity-for-reddit-5f18f7df646ce5d2637b29fca557ca00766682c7.tar.gz
infinity-for-reddit-5f18f7df646ce5d2637b29fca557ca00766682c7.tar.bz2
infinity-for-reddit-5f18f7df646ce5d2637b29fca557ca00766682c7.tar.lz
infinity-for-reddit-5f18f7df646ce5d2637b29fca557ca00766682c7.tar.xz
infinity-for-reddit-5f18f7df646ce5d2637b29fca557ca00766682c7.tar.zst
infinity-for-reddit-5f18f7df646ce5d2637b29fca557ca00766682c7.zip
Delete webView.getSettings().setDomStorageEnabled(true); in LoginActivity to fix wrong password error. Show an info to guide users how to type in 2FA code.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java
index 4d88df67..a0c51bb3 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LoginActivity.java
@@ -4,6 +4,7 @@ import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
@@ -12,10 +13,12 @@ import android.view.MenuItem;
import android.webkit.CookieManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;
+import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.Toolbar;
+import androidx.coordinatorlayout.widget.CoordinatorLayout;
import com.google.android.material.appbar.AppBarLayout;
import com.r0adkll.slidr.Slidr;
@@ -40,6 +43,7 @@ import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
import ml.docilealligator.infinityforreddit.Utils.APIUtils;
import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
+import ml.docilealligator.infinityforreddit.Utils.Utils;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@@ -47,10 +51,14 @@ import retrofit2.Retrofit;
public class LoginActivity extends BaseActivity {
+ @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;
@Inject
@@ -95,7 +103,6 @@ public class LoginActivity extends BaseActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
webView.getSettings().setJavaScriptEnabled(true);
- webView.getSettings().setDomStorageEnabled(true);
Uri baseUri = Uri.parse(APIUtils.OAUTH_URL);
Uri.Builder uriBuilder = baseUri.buildUpon();
@@ -223,7 +230,11 @@ public class LoginActivity extends BaseActivity {
@Override
protected void applyCustomTheme() {
+ coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar);
+ twoFAInfoTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
+ Drawable infoDrawable = Utils.getTintedDrawable(this, R.drawable.ic_info_preference_24dp, mCustomThemeWrapper.getPrimaryIconColor());
+ twoFAInfoTextView.setCompoundDrawablesWithIntrinsicBounds(infoDrawable, null, null, null);
}
@Override