mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-19 05:39:10 +00:00
fix crash on older devices
This commit is contained in:
parent
3dd1548c9f
commit
945b5b7f6c
6 changed files with 19 additions and 11 deletions
|
@ -9,7 +9,7 @@ android {
|
|||
applicationId "org.dslul.openboard.inputmethod.latin"
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 31
|
||||
versionCode 17
|
||||
versionCode 18
|
||||
versionName '1.4.4'
|
||||
}
|
||||
|
||||
|
@ -23,9 +23,6 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
aaptOptions {
|
||||
noCompress 'dict'
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
ndkBuild {
|
||||
|
@ -38,13 +35,16 @@ android {
|
|||
}
|
||||
|
||||
ndkVersion '21.3.6528147'
|
||||
androidResources {
|
||||
noCompress 'dict'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.google.code.findbugs:jsr305:3.0.2'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.1' // Replaces recyclerview:1.0.0 included by above dependency
|
||||
implementation 'androidx.core:core-ktx:1.5.0'
|
||||
implementation 'androidx.core:core-ktx:1.7.0'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation 'androidx.viewpager2:viewpager2:1.0.0'
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import android.content.DialogInterface;
|
|||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceFragment;
|
||||
|
@ -95,8 +96,9 @@ public final class CustomInputStyleSettingsFragment extends PreferenceFragment
|
|||
@Override
|
||||
public void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getPreferenceManager().setStorageDeviceProtected();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
getPreferenceManager().setStorageDeviceProtected();
|
||||
}
|
||||
mPrefs = getPreferenceManager().getSharedPreferences();
|
||||
RichInputMethodManager.init(getActivity());
|
||||
mRichImm = RichInputMethodManager.getInstance();
|
||||
|
|
|
@ -21,6 +21,7 @@ import android.content.Context;
|
|||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.ListPreference;
|
||||
import android.preference.Preference;
|
||||
|
@ -100,7 +101,9 @@ public abstract class SubScreenFragment extends PreferenceFragment
|
|||
@Override
|
||||
public void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getPreferenceManager().setStorageDeviceProtected();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
getPreferenceManager().setStorageDeviceProtected();
|
||||
}
|
||||
mSharedPreferenceChangeListener = new OnSharedPreferenceChangeListener() {
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(final SharedPreferences prefs, final String key) {
|
||||
|
|
|
@ -20,6 +20,7 @@ import android.app.Activity;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceFragment;
|
||||
|
@ -51,7 +52,9 @@ public class UserDictionaryList extends PreferenceFragment {
|
|||
@Override
|
||||
public void onCreate(final Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
getPreferenceManager().setStorageDeviceProtected();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
getPreferenceManager().setStorageDeviceProtected();
|
||||
}
|
||||
setPreferenceScreen(getPreferenceManager().createPreferenceScreen(getActivity()));
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ buildscript {
|
|||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.2.1'
|
||||
classpath 'com.android.tools.build:gradle:7.0.4'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
|
||||
|
|
Loading…
Add table
Reference in a new issue