mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-04 07:17:12 +01:00
Delete webView.getSettings().setDomStorageEnabled(true); in LoginActivity to fix wrong password error. Show an info to guide users how to type in 2FA code.
This commit is contained in:
parent
f37a46e2c2
commit
5f18f7df64
@ -4,6 +4,7 @@ import android.app.Activity;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -12,10 +13,12 @@ import android.view.MenuItem;
|
|||||||
import android.webkit.CookieManager;
|
import android.webkit.CookieManager;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||||
|
|
||||||
import com.google.android.material.appbar.AppBarLayout;
|
import com.google.android.material.appbar.AppBarLayout;
|
||||||
import com.r0adkll.slidr.Slidr;
|
import com.r0adkll.slidr.Slidr;
|
||||||
@ -40,6 +43,7 @@ import ml.docilealligator.infinityforreddit.R;
|
|||||||
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
|
import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase;
|
||||||
import ml.docilealligator.infinityforreddit.Utils.APIUtils;
|
import ml.docilealligator.infinityforreddit.Utils.APIUtils;
|
||||||
import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
|
import ml.docilealligator.infinityforreddit.Utils.SharedPreferencesUtils;
|
||||||
|
import ml.docilealligator.infinityforreddit.Utils.Utils;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
@ -47,10 +51,14 @@ import retrofit2.Retrofit;
|
|||||||
|
|
||||||
public class LoginActivity extends BaseActivity {
|
public class LoginActivity extends BaseActivity {
|
||||||
|
|
||||||
|
@BindView(R.id.coordinator_layout_login_activity)
|
||||||
|
CoordinatorLayout coordinatorLayout;
|
||||||
@BindView(R.id.appbar_layout_login_activity)
|
@BindView(R.id.appbar_layout_login_activity)
|
||||||
AppBarLayout appBarLayout;
|
AppBarLayout appBarLayout;
|
||||||
@BindView(R.id.toolbar_login_activity)
|
@BindView(R.id.toolbar_login_activity)
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
|
@BindView(R.id.two_fa_infO_text_view_login_activity)
|
||||||
|
TextView twoFAInfoTextView;
|
||||||
@BindView(R.id.webview_login_activity)
|
@BindView(R.id.webview_login_activity)
|
||||||
WebView webView;
|
WebView webView;
|
||||||
@Inject
|
@Inject
|
||||||
@ -95,7 +103,6 @@ public class LoginActivity extends BaseActivity {
|
|||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
webView.getSettings().setJavaScriptEnabled(true);
|
webView.getSettings().setJavaScriptEnabled(true);
|
||||||
webView.getSettings().setDomStorageEnabled(true);
|
|
||||||
|
|
||||||
Uri baseUri = Uri.parse(APIUtils.OAUTH_URL);
|
Uri baseUri = Uri.parse(APIUtils.OAUTH_URL);
|
||||||
Uri.Builder uriBuilder = baseUri.buildUpon();
|
Uri.Builder uriBuilder = baseUri.buildUpon();
|
||||||
@ -223,7 +230,11 @@ public class LoginActivity extends BaseActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void applyCustomTheme() {
|
protected void applyCustomTheme() {
|
||||||
|
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
|
||||||
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar);
|
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
|
@Override
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/coordinator_layout_login_activity"
|
||||||
tools:application="ml.docilealligator.infinityforreddit.Activity.LoginActivity">
|
tools:application="ml.docilealligator.infinityforreddit.Activity.LoginActivity">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
@ -22,10 +23,28 @@
|
|||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<ml.docilealligator.infinityforreddit.CustomView.LollipopBugFixedWebView
|
<LinearLayout
|
||||||
android:id="@+id/webview_login_activity"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
android:orientation="vertical"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/two_fa_infO_text_view_login_activity"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:drawablePadding="32dp"
|
||||||
|
android:text="@string/login_activity_2fa_prompt"
|
||||||
|
android:textSize="?attr/font_default"
|
||||||
|
android:fontFamily="?attr/font_family" />
|
||||||
|
|
||||||
|
<ml.docilealligator.infinityforreddit.CustomView.LollipopBugFixedWebView
|
||||||
|
android:id="@+id/webview_login_activity"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
@ -847,7 +847,7 @@
|
|||||||
<string name="load_video_in_redgifs">Try loading the video on Redgifs</string>
|
<string name="load_video_in_redgifs">Try loading the video on Redgifs</string>
|
||||||
|
|
||||||
<string name="top_score">%1$s pts</string>
|
<string name="top_score">%1$s pts</string>
|
||||||
<!-- TODO: Remove or change this placeholder text -->
|
|
||||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
<string name="login_activity_2fa_prompt">If you have 2-factor authentication enabled, kindly type your password like the following: <password>:<2FA code>.\nExample: yourpass:123456</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<Preference
|
<Preference
|
||||||
app:title="@string/settings_time_format_title"
|
app:title="@string/settings_time_format_title"
|
||||||
app:fragment="ml.docilealligator.infinityforreddit.Settings.TimeFormatPreferenceFragment" />
|
app:fragment="ml.docilealligator.infinityforreddit.Settings.TimeFormatPreferenceFragment" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
app:defaultValue="false"
|
app:defaultValue="false"
|
||||||
app:key="vote_buttons_on_the_right"
|
app:key="vote_buttons_on_the_right"
|
||||||
|
Loading…
Reference in New Issue
Block a user