Skip to content

Commit fffa14a

Browse files
committed
Fix compatibility crash when inflating preferences on all platforms
1 parent 15f5b76 commit fffa14a

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

app/build.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ repositories {
99
android {
1010
namespace 'net.i2p.android.router'
1111
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION as String)
12+
buildFeatures {
13+
viewBinding true
14+
}
1215
defaultConfig {
1316
versionCode Integer.parseInt(project.I2P_ANDROID_VERSION_CODE as String)
1417
versionName "$I2P_ANDROID_VERSION"
@@ -66,10 +69,10 @@ android {
6669
}
6770

6871
dependencies {
69-
implementation "androidx.appcompat:appcompat:1.5.1"
70-
implementation "androidx.preference:preference:1.2.0"
71-
implementation "androidx.annotation:annotation:1.5.0"
72-
implementation 'androidx.recyclerview:recyclerview:1.0.0'
72+
implementation "androidx.appcompat:appcompat:1.7.1"
73+
implementation "androidx.preference:preference:1.2.1"
74+
implementation "androidx.annotation:annotation:1.9.1"
75+
implementation 'androidx.recyclerview:recyclerview:1.4.0'
7376
// Local dependencies
7477
implementation project(':lib:client')
7578
implementation project(':lib:helper')

app/src/main/java/net/i2p/android/preferences/util/SummaryEditTextPreference.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package net.i2p.android.preferences.util;
22

3+
import android.annotation.TargetApi;
34
import android.content.Context;
45
//import android.support.v7.preference.EditTextPreference;
5-
import android.preference.EditTextPreference;
6+
import androidx.preference.EditTextPreference;
67
import android.util.AttributeSet;
78

89
public class SummaryEditTextPreference extends EditTextPreference {
@@ -15,8 +16,13 @@ public SummaryEditTextPreference(Context context, AttributeSet attrs) {
1516
super(context, attrs);
1617
}
1718

18-
public SummaryEditTextPreference(Context context, AttributeSet attrs, int defStyle) {
19-
super(context, attrs, defStyle);
19+
public SummaryEditTextPreference(Context context, AttributeSet attrs, int defStyleAttr) {
20+
super(context, attrs, defStyleAttr);
21+
}
22+
23+
@TargetApi(21)
24+
public SummaryEditTextPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
25+
super(context, attrs, defStyleAttr, defStyleRes);
2026
}
2127

2228
@Override

0 commit comments

Comments
 (0)