Skip to content

Commit 766d5ab

Browse files
authored
Update for Android 15 and Lenovo M10 fix (#89)
* Minimal update for Android 15. Using Android Studio Koala Feature Drop | 2024.1.2 Patch 1 September 17, 2024 with AGP 8.6.1 & gradle 8.7 * Fix for V2 DFU from Lenovo M10
1 parent fdfe6ce commit 766d5ab

18 files changed

+103
-24
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ local.properties
3030
.idea/caches/
3131
.idea/codeStyles/
3232
.idea/deploymentTargetDropDown.xml
33+
.idea/appInsightsSettings.xml
34+
.idea/deploymentTargetSelector.xml
3335
*.iml
3436

3537
# OS-specific files

app/build.gradle

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdk 34
4+
compileSdk 35
55
defaultConfig {
66
applicationId "com.samsung.microbit"
77
minSdkVersion 21
8-
targetSdk 34
8+
targetSdk 35
99
// When target SDK version is 30+,
1010
// requestLegacyExternalStorage will continue to work for 29 Android 10
1111
}
@@ -33,16 +33,16 @@ android {
3333
}
3434

3535
dependencies {
36-
implementation 'androidx.lifecycle:lifecycle-process:2.7.0'
37-
testImplementation 'junit:junit:4.12'
38-
implementation 'androidx.appcompat:appcompat:1.6.1'
39-
implementation 'com.google.android.material:material:1.11.0'
36+
implementation 'androidx.lifecycle:lifecycle-process:2.9.2'
37+
testImplementation 'junit:junit:4.13.2'
38+
implementation 'androidx.appcompat:appcompat:1.7.1'
39+
implementation 'com.google.android.material:material:1.12.0'
4040
implementation 'androidx.cardview:cardview:1.0.0'
41-
implementation 'androidx.recyclerview:recyclerview:1.3.2'
42-
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
41+
implementation 'androidx.recyclerview:recyclerview:1.4.0'
42+
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.29'
4343
implementation 'no.nordicsemi.android:dfu:2.4.1'
4444
implementation project(':pfLibrary')
45-
implementation 'com.google.android.gms:play-services-analytics:18.0.4'
46-
implementation 'com.google.code.gson:gson:2.8.2'
45+
implementation 'com.google.android.gms:play-services-analytics:18.1.1'
46+
implementation 'com.google.code.gson:gson:2.13.1'
4747
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
4848
}

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
<activity
130130
android:name=".ui.activity.NotificationActivity"
131131
android:label="@string/device_details"
132-
android:screenOrientation="portrait"/>
132+
android:configChanges="orientation|screenSize" />
133133
<activity
134134
android:name=".ui.activity.PairingActivity"
135135
android:configChanges="orientation|screenSize|keyboardHidden"
@@ -146,14 +146,12 @@
146146
android:name=".ui.activity.AudioRecorderActivity"
147147
android:configChanges="orientation|screenSize"
148148
android:label="Audio Recorder"
149-
android:launchMode="singleTask"
150-
android:screenOrientation="portrait"/>
149+
android:launchMode="singleTask"/>
151150
<activity
152151
android:name=".ui.activity.HelpWebView"
153152
android:configChanges="orientation|screenSize"
154153
android:label="Help Webview"
155-
android:launchMode="singleTask"
156-
android:screenOrientation="portrait"/>
154+
android:launchMode="singleTask"/>
157155
<activity
158156
android:name=".ui.activity.MakeCodeWebView"
159157
android:configChanges="orientation|screenSize"

app/src/main/java/com/samsung/microbit/ui/activity/AudioRecorderActivity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ public void onClick(View v) {
108108

109109
@Override
110110
protected void onCreate(Bundle savedInstanceState) {
111+
112+
// TODO: EdgeToEdge - Remove once activities handle insets.
113+
// Call before the DecorView is accessed in setContentView
114+
getTheme().applyStyle(R.style.OptOutEdgeToEdgeEnforcement, /* force */ false);
115+
111116
super.onCreate(savedInstanceState);
112117

113118
mLaunchActivity = false;

app/src/main/java/com/samsung/microbit/ui/activity/FetchActivity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@ public void run() {
245245
@Override
246246
protected void onCreate(Bundle savedInstanceState) {
247247
logi("onCreate");
248+
249+
// TODO: EdgeToEdge - Remove once activities handle insets.
250+
// Call before the DecorView is accessed in setContentView
251+
getTheme().applyStyle(R.style.OptOutEdgeToEdgeEnforcement, /* force */ false);
252+
248253
super.onCreate(savedInstanceState);
249254

250255
displayCreate();

app/src/main/java/com/samsung/microbit/ui/activity/HelpWebView.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ protected void onStop() {
2929

3030
@Override
3131
protected void onCreate(Bundle savedInstanceState) {
32+
33+
// TODO: EdgeToEdge - Remove once activities handle insets.
34+
// Call before the DecorView is accessed in setContentView
35+
getTheme().applyStyle(R.style.OptOutEdgeToEdgeEnforcement, /* force */ false);
36+
3237
super.onCreate(savedInstanceState);
3338

3439
setContentView(R.layout.activity_help_web_view);

app/src/main/java/com/samsung/microbit/ui/activity/HomeActivity.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,14 @@ protected void onStop() {
122122

123123
@Override
124124
protected void onCreate(Bundle savedInstanceState) {
125-
super.onCreate(savedInstanceState);
126125
logi("onCreate() :: ");
127126

127+
// TODO: EdgeToEdge - Remove once activities handle insets.
128+
// Call before the DecorView is accessed in setContentView
129+
getTheme().applyStyle(R.style.OptOutEdgeToEdgeEnforcement, /* force */ false);
130+
131+
super.onCreate(savedInstanceState);
132+
128133
setContentView(R.layout.activity_home);
129134

130135
if(savedInstanceState == null) {

app/src/main/java/com/samsung/microbit/ui/activity/MakeCodeWebView.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ protected void onStop() {
6969

7070
@Override
7171
protected void onCreate(Bundle savedInstanceState) {
72+
73+
// TODO: EdgeToEdge - Remove once activities handle insets.
74+
// Call before the DecorView is accessed in setContentView
75+
getTheme().applyStyle(R.style.OptOutEdgeToEdgeEnforcement, /* force */ false);
76+
7277
super.onCreate(savedInstanceState);
7378

7479
activityHandle = this;

app/src/main/java/com/samsung/microbit/ui/activity/NotificationActivity.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22

33
import android.app.Activity;
44
import android.content.Intent;
5+
import android.content.res.Configuration;
56
import android.os.Bundle;
67

8+
import com.samsung.microbit.R;
9+
710
public class NotificationActivity extends Activity {
811

912
@Override
1013
protected void onCreate(Bundle savedInstanceState) {
14+
15+
// TODO: EdgeToEdge - Remove once activities handle insets.
16+
// Call before the DecorView is accessed in setContentView
17+
getTheme().applyStyle(R.style.OptOutEdgeToEdgeEnforcement, /* force */ false);
18+
1119
super.onCreate(savedInstanceState);
1220

1321
// If this activity is the root activity of the task, the app is not running
@@ -23,6 +31,11 @@ protected void onCreate(Bundle savedInstanceState) {
2331
finish();
2432
}
2533

34+
@Override
35+
public void onConfigurationChanged(Configuration newConfig) {
36+
super.onConfigurationChanged(newConfig);
37+
}
38+
2639
@Override
2740
protected void onStart() {
2841
super.onStart();
@@ -33,4 +46,4 @@ protected void onStop() {
3346
super.onStop();
3447
}
3548

36-
}
49+
}

app/src/main/java/com/samsung/microbit/ui/activity/PairingActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,10 @@ public void onPause() {
848848
protected void onCreate(Bundle savedInstanceState) {
849849
logi("onCreate() ::");
850850

851+
// TODO: EdgeToEdge - Remove once activities handle insets.
852+
// Call before the DecorView is accessed in setContentView
853+
getTheme().applyStyle(R.style.OptOutEdgeToEdgeEnforcement, /* force */ false);
854+
851855
super.onCreate(savedInstanceState);
852856

853857
MBApp application = MBApp.getApp();

0 commit comments

Comments
 (0)