Skip to content

Commit

Permalink
UX cleanup for Android API level35 changes. Bumb target sdk to 35
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterHasse committed Jan 8, 2025
1 parent 5acb8a7 commit 178e883
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 29 deletions.
31 changes: 23 additions & 8 deletions OpenMNT_logo_no_title.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ android {
defaultConfig {
applicationId "de.fraunhofer.fokus.OpenMobileNetworkToolkit"
minSdk 31
targetSdk 34
targetSdk 35
versionCode 5
versionName "0.5"
resValue("string", "git_hash", getGitHash())
Expand Down
27 changes: 15 additions & 12 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />

<uses-permission android:name="android.permission.MODIFY_PHONE_STATE"
<uses-permission
android:name="android.permission.MODIFY_PHONE_STATE"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.READ_PRECISE_PHONE_STATE"
<uses-permission
android:name="android.permission.READ_PRECISE_PHONE_STATE"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand All @@ -25,7 +26,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.HIDE_OVERLAY_WINDOWS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission
android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
tools:ignore="ProtectedPermissions" />
Expand All @@ -39,12 +40,12 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />

<application
android:description="@string/app_description"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:description="@string/app_description"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:theme="@style/Theme.OpenMobileNetworkToolkit"
android:usesCleartextTraffic="true">
<service
android:name="de.fraunhofer.fokus.OpenMobileNetworkToolkit.OpenMobileNetworkToolkit"
Expand All @@ -63,13 +64,15 @@
<service
android:name="de.fraunhofer.fokus.OpenMobileNetworkToolkit.LoggingService"
android:foregroundServiceType="location" />
<service
android:name="de.fraunhofer.fokus.OpenMobileNetworkToolkit.Ping.PingService" />
<service android:name="de.fraunhofer.fokus.OpenMobileNetworkToolkit.Ping.PingService" />


<service android:name="androidx.work.impl.foreground.SystemForegroundService" android:foregroundServiceType="specialUse">
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="explanation_for_special_use"/>
<service
android:name="androidx.work.impl.foreground.SystemForegroundService"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="explanation_for_special_use" />
</service>


Expand All @@ -85,7 +88,7 @@
<activity
android:name="de.fraunhofer.fokus.OpenMobileNetworkToolkit.MainActivity"
android:exported="true"
android:theme="@style/Theme.OpenMobileNetworkToolkitCarrierSettings.NoActionBar">
android:theme="@style/Theme.OpenMobileNetworkToolkit.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ protected void onCreate(Bundle savedInstanceState) {
// initialize android UX related thing the app needs
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
gv.setLog_status(findViewById(R.id.log_status_icon));

NavHostFragment navHostFragment = (NavHostFragment) getSupportFragmentManager().findFragmentById(R.id.fragmentContainerView);
navController = Objects.requireNonNull(navHostFragment).getNavController();

// create notification channel
CharSequence name = getString(R.string.channel_name);
String description = getString(R.string.channel_description);
Expand Down
53 changes: 53 additions & 0 deletions app/src/main/res/drawable/openmnt_logo_symbol.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!--
~ SPDX-FileCopyrightText: 2023 Peter Hasse <[email protected]>
~ SPDX-FileCopyrightText: 2023 Johann Hackler <[email protected]>
~ SPDX-FileCopyrightText: 2023 Fraunhofer FOKUS
~
~ SPDX-License-Identifier: apache2
-->

<vector xmlns:aapt="http://schemas.android.com/aapt" xmlns:android="http://schemas.android.com/apk/res/android" android:height="17.411764dp" android:viewportHeight="444" android:viewportWidth="612" android:width="24dp">

<group>

<clip-path android:pathData="M0,0h612v444h-612z"/>

<path android:fillType="evenOdd" android:pathData="M116.67,32.63C12.11,137.26 12.1,306.91 116.65,411.55 116.66,411.56 116.67,411.56 116.67,411.57 124.01,419.17 123.8,431.29 116.2,438.63 108.79,445.79 97.04,445.79 89.63,438.63 -29.87,319.05 -29.88,125.16 89.62,5.58 89.62,5.57 89.63,5.57 89.63,5.57 97.23,-1.78 109.34,-1.57 116.67,6.04 123.83,13.45 123.83,25.21 116.67,32.63ZM197.84,113.85C138.11,173.64 138.11,270.56 197.84,330.34 205.32,337.83 205.32,349.96 197.84,357.44 190.36,364.93 178.24,364.93 170.76,357.44 96.06,282.71 96.05,161.54 170.72,86.79 170.73,86.77 170.75,86.76 170.76,86.75 178.24,79.27 190.36,79.27 197.84,86.75 205.32,94.23 205.32,106.37 197.84,113.85ZM414.18,86.75C421.64,79.27 433.75,79.25 441.23,86.72 441.24,86.73 441.25,86.74 441.26,86.75 515.96,161.48 515.97,282.66 441.3,357.41 441.28,357.42 441.27,357.43 441.26,357.44 433.78,364.93 421.66,364.93 414.18,357.44 406.7,349.96 406.7,337.83 414.18,330.34 473.91,270.56 473.91,173.64 414.18,113.85 406.7,106.39 406.69,94.27 414.15,86.78 414.16,86.77 414.17,86.76 414.18,86.75ZM495.35,5.6C502.81,-1.87 514.92,-1.87 522.39,5.6 641.87,125.18 641.87,319.05 522.39,438.63 514.79,445.97 502.68,445.76 495.35,438.16 488.19,430.74 488.19,418.99 495.35,411.57 599.91,306.94 599.92,137.29 495.37,32.65 495.36,32.64 495.35,32.63 495.35,32.63 487.88,25.15 487.88,13.04 495.35,5.57Z">

<aapt:attr name="android:fillColor">

<gradient android:endX="306" android:endY="0" android:startX="306" android:startY="444" android:tileMode="mirror" android:type="linear">

<item android:color="#FF4C4CCC" android:offset="0"/>

<item android:color="#FF4C4CCC" android:offset="0.15"/>

<item android:color="#FF8E2DE2" android:offset="1"/>

</gradient>

</aapt:attr>

</path>

<path android:fillType="evenOdd" android:pathData="M382,222.5C382,264.75 347.97,299 306,299 264.03,299 230,264.75 230,222.5 230,180.25 264.03,146 306,146 347.97,146 382,180.25 382,222.5Z">

<aapt:attr name="android:fillColor">

<gradient android:endX="306" android:endY="0" android:startX="306" android:startY="444" android:tileMode="mirror" android:type="linear">

<item android:color="#FF4C4CCC" android:offset="0"/>

<item android:color="#FF4C4CCC" android:offset="0.15"/>

<item android:color="#FF8E2DE2" android:offset="1"/>

</gradient>

</aapt:attr>

</path>

</group>

</vector>
12 changes: 9 additions & 3 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
android:id="@+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:keepScreenOn="true"
tools:context=".MainActivity">

Expand All @@ -25,13 +26,18 @@
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:navigationIcon="@drawable/openmnt_logo_no_title">
android:layout_height="26dp"
android:visibility="visible"
app:navigationIcon="@drawable/openmnt_logo_symbol"
app:title="OMNT"
app:titleCentered="false"
app:titleMargin="0dp"
app:titleTextColor="@color/purple_200">

<ImageView
android:id="@+id/log_status_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:tint="#40C0C0C0"
app:srcCompat="@drawable/ic_baseline_code_24"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.OpenMobileNetworkToolkit" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<style name="Theme.OpenMobileNetworkToolkit" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/values-v23/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<resources xmlns:tools="http://schemas.android.com/tools">

<style name="Theme.OpenMobileNetworkToolkit" parent="Base.Theme.OpenMobileNetworkToolkit">
<!-- Transparent system bars for edge-to-edge. -->
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">?attr/isLightTheme</item>
</style>
</resources>
6 changes: 3 additions & 3 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

<resources>
<!-- Base application theme. -->
<style name="Theme.OpenMobileNetworkToolkitCarrierSettings" parent="Theme.MaterialComponents.DayNight">
<style name="Base.Theme.OpenMobileNetworkToolkit" parent="Theme.Material3.DayNight.NoActionBar">

</style>

<style name="Theme.OpenMobileNetworkToolkitCarrierSettings.NoActionBar">
<item name="windowActionBar">false</item>
<style name="Theme.OpenMobileNetworkToolkit.NoActionBar">
<item name="windowActionBar">true</item>
<item name="windowNoTitle">true</item>
</style>
</resources>

0 comments on commit 178e883

Please sign in to comment.