Skip to content

Commit 32f6f51

Browse files
committed
refactor: replace non-FLOSS library for 3rd party library screen with FLOSS library
fixes: #2644
1 parent 844ac12 commit 32f6f51

File tree

8 files changed

+13
-27
lines changed

8 files changed

+13
-27
lines changed

app/build.gradle.kts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id("com.android.application")
3-
id("com.google.android.gms.oss-licenses-plugin")
3+
id("com.mikepenz.aboutlibraries.plugin")
44
}
55

66
apply(plugin = "realm-android")
@@ -124,6 +124,5 @@ dependencies {
124124
implementation("com.github.realm:realm-android-adapters:v4.0.0")
125125

126126
// OSS license plugin
127-
implementation("com.google.android.gms:play-services-oss-licenses:17.1.0")
128-
127+
implementation("com.mikepenz:aboutlibraries:11.6.3")
129128
}

app/src/debug/AndroidManifest.xml

-6
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,6 @@
130130
<activity
131131
android:name=".activity.DustSensorActivity"
132132
android:screenOrientation="fullSensor" />
133-
<activity
134-
android:name="com.google.android.gms.oss.licenses.OssLicensesMenuActivity"
135-
android:theme="@style/OssLicenseScreenTheme" />
136-
<activity
137-
android:name="com.google.android.gms.oss.licenses.OssLicensesActivity"
138-
android:theme="@style/OssLicenseScreenTheme" />
139133

140134
<receiver android:name=".receivers.USBDetachReceiver" />
141135

app/src/main/AndroidManifest.xml

-6
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,6 @@
127127
<activity
128128
android:name=".activity.DustSensorActivity"
129129
android:screenOrientation="fullSensor" />
130-
<activity
131-
android:name="com.google.android.gms.oss.licenses.OssLicensesMenuActivity"
132-
android:theme="@style/OssLicenseScreenTheme" />
133-
<activity
134-
android:name="com.google.android.gms.oss.licenses.OssLicensesActivity"
135-
android:theme="@style/OssLicenseScreenTheme" />
136130

137131
<receiver android:name=".receivers.USBDetachReceiver" />
138132

app/src/main/java/io/pslab/activity/MainActivity.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
import androidx.fragment.app.Fragment;
3535
import androidx.fragment.app.FragmentTransaction;
3636

37-
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity;
3837
import com.google.android.material.navigation.NavigationView;
3938
import com.google.android.material.snackbar.Snackbar;
39+
import com.mikepenz.aboutlibraries.LibsBuilder;
4040

4141
import java.io.IOException;
4242

@@ -334,8 +334,9 @@ public boolean onNavigationItemSelected(@NonNull MenuItem item) {
334334
}
335335
break;
336336
case R.id.nav_third_party_libs:
337-
OssLicensesMenuActivity.setActivityTitle(getString(R.string.third_party_libs));
338-
startActivity(new Intent(MainActivity.this, OssLicensesMenuActivity.class));
337+
new LibsBuilder()
338+
.withActivityTitle(getString(R.string.third_party_libs))
339+
.start(MainActivity.this);
339340
break;
340341
default:
341342
navItemIndex = 0;

app/src/main/res/values-v21/styles.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<resources>
22

3-
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
3+
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar.Bridge">
44
<item name="colorPrimary">@color/colorPrimary</item>
55
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
66
<item name="colorAccent">@color/colorAccent</item>

app/src/main/res/values/strings.xml

+4
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,10 @@
10951095
<string name="distance">Distance</string>
10961096
<string name="distance_unit">(mm)</string>
10971097

1098+
<string name="aboutLibraries_description_showIcon">true</string>
1099+
<string name="aboutLibraries_description_showVersion">true</string>
1100+
<string name="aboutLibraries_description_text">Below is a list of the third-party open source software libraries used in the PSLab app.</string>
1101+
10981102
<string name="legacy_title">Legacy Firmware Detected</string>
10991103
<string name="legacy_message">We have detected that your PSLab device is running legacy firmware. Please note that support for this firmware has ended. For the best experience and continued support, please update your device to the latest firmware version.</string>
11001104
<string name="pin_esp_name" translatable="false">ESP</string>

app/src/main/res/values/styles.xml

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<resources>
22

33
<!-- Base application theme. -->
4-
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
4+
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar.Bridge">
55
<!-- Customize your theme here. -->
66
<item name="colorPrimary">@color/colorPrimary</item>
77
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
@@ -16,11 +16,6 @@
1616
<item name="colorPrimaryDark">@color/darkWhite</item>
1717
</style>
1818

19-
<style name="OssLicenseScreenTheme" parent="AppTheme">
20-
<item name="windowActionBar">true</item>
21-
<item name="windowNoTitle">false</item>
22-
</style>
23-
2419
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
2520

2621
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light">

build.gradle.kts

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ buildscript {
55
}
66
dependencies {
77
classpath("io.realm:realm-gradle-plugin:10.19.0")
8-
classpath("com.google.android.gms:oss-licenses-plugin:0.10.6")
9-
108
}
119
}
1210

1311
plugins {
1412
id("com.android.application") version "8.8.2" apply false
13+
id("com.mikepenz.aboutlibraries.plugin") version "11.6.3"
1514
}

0 commit comments

Comments
 (0)