mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
fixes crash in sign up activity in api 21 and 22 (#5311)
* fixes crash in sign up activity * javadoc comments added
This commit is contained in:
parent
19733b3e69
commit
a2ad0394ce
1 changed files with 18 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
package fr.free.nrw.commons.auth;
|
package fr.free.nrw.commons.auth;
|
||||||
|
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
|
|
@ -61,4 +63,20 @@ public class SignupActivity extends BaseActivity {
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Known bug in androidx.appcompat library version 1.1.0 being tracked here
|
||||||
|
* https://issuetracker.google.com/issues/141132133
|
||||||
|
* App tries to put light/dark theme to webview and crashes in the process
|
||||||
|
* This code tries to prevent applying the theme when sdk is between api 21 to 25
|
||||||
|
* @param overrideConfiguration
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void applyOverrideConfiguration(final Configuration overrideConfiguration) {
|
||||||
|
if (Build.VERSION.SDK_INT <= 25 &&
|
||||||
|
(getResources().getConfiguration().uiMode == getApplicationContext().getResources().getConfiguration().uiMode)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.applyOverrideConfiguration(overrideConfiguration);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue