Skip to content

Commit

Permalink
UX improvements. Disbaled currently not used menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterHasse committed Jan 10, 2025
1 parent e68be6a commit 3bcc69c
Show file tree
Hide file tree
Showing 12 changed files with 356 additions and 48 deletions.
173 changes: 173 additions & 0 deletions OpenMNT_logo_titel_right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,20 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
saveTextInputToSharedPreferences(input, "ping_input");
boolean pingRunning = spg.getSharedPreference(SPType.ping_sp).getBoolean("ping_running", false);
if (pingRunning && PingService.isRunning()) {
v.findViewById(R.id.ping_start).setBackgroundColor(getResources().getColor(R.color.teal_200, null));
v.findViewById(R.id.ping_start).setBackgroundColor(getResources().getColor(R.color.purple_500, null));
} else {
v.findViewById(R.id.ping_stop).setBackgroundColor(getResources().getColor(R.color.teal_200, null));
v.findViewById(R.id.ping_stop).setBackgroundColor(getResources().getColor(R.color.purple_500, null));
}
spg.setListener((sharedPreferences, key) -> {
if (key != null && key.equals("ping_running")) {
boolean isRunning = sharedPreferences.getBoolean("ping_running", false);
handleInput(isRunning);
if (isRunning) {
v.findViewById(R.id.ping_start).setBackgroundColor(getResources().getColor(R.color.teal_200, null));
v.findViewById(R.id.ping_start).setBackgroundColor(getResources().getColor(R.color.purple_500, null));
v.findViewById(R.id.ping_stop).setBackgroundColor(Color.TRANSPARENT);
} else {
v.findViewById(R.id.ping_start).setBackgroundColor(Color.TRANSPARENT);
v.findViewById(R.id.ping_stop).setBackgroundColor(getResources().getColor(R.color.teal_200, null));
v.findViewById(R.id.ping_stop).setBackgroundColor(getResources().getColor(R.color.purple_500, null));
}

}
Expand All @@ -145,14 +145,14 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
switch (checkedId) {
case R.id.ping_start:
startPingService();
v.findViewById(R.id.ping_start).setBackgroundColor(getResources().getColor(R.color.teal_200, null));
v.findViewById(R.id.ping_start).setBackgroundColor(getResources().getColor(R.color.purple_500, null));
v.findViewById(R.id.ping_stop).setBackgroundColor(Color.TRANSPARENT);
spg.getSharedPreference(SPType.ping_sp).edit().putBoolean("ping_running", true).apply();

break;
case R.id.ping_stop:
v.findViewById(R.id.ping_start).setBackgroundColor(Color.TRANSPARENT);
v.findViewById(R.id.ping_stop).setBackgroundColor(getResources().getColor(R.color.teal_200, null));
v.findViewById(R.id.ping_stop).setBackgroundColor(getResources().getColor(R.color.purple_500, null));
stopPingService();
spg.getSharedPreference(SPType.ping_sp).edit().putBoolean("ping_running", false).apply();
break;
Expand Down
83 changes: 83 additions & 0 deletions app/src/main/res/drawable/openmnt_logo_titel_right.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<!--
~ 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="24dp" android:viewportHeight="444" android:viewportWidth="1577" android:width="85.24324dp">

<group>

<clip-path android:pathData="M644.4,-357.5h990v841h-990z"/>

<path android:fillType="evenOdd" android:pathData="m811.3,134.1c-22.3,0 -40.4,8 -54.3,24.1 -13.9,16.1 -20.9,37.2 -20.9,63.3 0,26.1 6.8,47.2 20.3,63.1 13.6,15.9 31.2,23.9 53,23.9 23.3,0 41.6,-7.6 55,-22.8 13.4,-15.2 20.1,-36.4 20.1,-63.8 0,-28 -6.5,-49.7 -19.5,-64.9 -13,-15.3 -31,-22.9 -53.8,-22.9zM1429.3,115.2h147.2v22.5L1515.2,137.6L1515.2,327.3L1490.4,327.3L1490.4,137.6h-61.1zM1224,115.2h32.3l106.2,166.4c4.4,6.9 7.3,11.6 8.6,14.2h0.6c-1,-6.1 -1.5,-16.5 -1.5,-31.2L1370.2,115.2h24.9L1395.1,327.3L1364.6,327.3L1255.4,158.2c-2.8,-4.2 -5,-8.7 -6.8,-13.3h-0.9c0.8,4.5 1.2,14.3 1.2,29.1v153.3h-24.9zM952,115.2h32.8l65.1,147.9c5,11.4 8.3,19.8 9.8,25.5h0.9c4.2,-11.6 7.7,-20.3 10.2,-26l66.4,-147.4h31.1L1168.3,327.3L1143.6,327.3L1143.6,185c0,-11.3 0.7,-25 2.1,-41.3h-0.6c-2.4,9.6 -4.5,16.4 -6.4,20.6l-72.5,163L1054.1,327.3L981.8,165.5c-2.1,-4.7 -4.2,-12 -6.4,-21.8h-0.6c0.8,8.5 1.2,22.3 1.2,41.6v142h-24zM813.1,111.6c29.3,0 52.9,9.9 70.8,29.6 17.9,19.7 26.9,45.5 26.9,77.4 0,34.6 -9.2,62 -27.5,82.1 -18.3,20.1 -42.9,30.2 -73.7,30.2 -30.1,0 -54.2,-9.9 -72.3,-29.7C719.2,281.3 710.1,255.5 710.1,223.8c0,-34.1 9.2,-61.3 27.7,-81.7 18.4,-20.3 43.5,-30.5 75.3,-30.5z">

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

<gradient android:endX="494.7" android:endY="389.8" android:startX="494.7" android:startY="752.8" android:tileMode="mirror" android:type="linear">

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

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

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

</gradient>

</aapt:attr>

</path>

</group>

<group>

<clip-path android:pathData="M-177,0h990v841h-990z"/>

<path android:fillType="evenOdd" android:pathData="m116.7,32.6c-104.6,104.6 -104.6,274.3 -0,378.9 0,0 0,0 0,0 7.3,7.6 7.1,19.7 -0.5,27.1 -7.4,7.2 -19.2,7.2 -26.6,0C-29.9,319 -29.9,125.2 89.6,5.6c0,-0 0,-0 0,-0 7.6,-7.3 19.7,-7.1 27,0.5 7.2,7.4 7.2,19.2 0,26.6zM197.8,113.8c-59.7,59.8 -59.7,156.7 0,216.5 7.5,7.5 7.5,19.6 0,27.1 -7.5,7.5 -19.6,7.5 -27.1,0 -74.7,-74.7 -74.7,-195.9 -0,-270.7 0,-0 0,-0 0,-0 7.5,-7.5 19.6,-7.5 27.1,0 7.5,7.5 7.5,19.6 0,27.1zM414.2,86.8c7.5,-7.5 19.6,-7.5 27,-0 0,0 0,0 0,0 74.7,74.7 74.7,195.9 0,270.7 -0,0 -0,0 -0,0 -7.5,7.5 -19.6,7.5 -27.1,0 -7.5,-7.5 -7.5,-19.6 0,-27.1 59.7,-59.8 59.7,-156.7 0,-216.5 -7.5,-7.5 -7.5,-19.6 -0,-27.1 0,-0 0,-0 0,-0zM495.4,5.6c7.5,-7.5 19.6,-7.5 27,0 119.5,119.6 119.5,313.4 0,433 -7.6,7.3 -19.7,7.1 -27,-0.5 -7.2,-7.4 -7.2,-19.2 0,-26.6 104.6,-104.6 104.6,-274.3 0,-378.9 -0,-0 -0,-0 -0,-0 -7.5,-7.5 -7.5,-19.6 0,-27.1z">

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

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

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

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

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

</gradient>

</aapt:attr>

</path>

</group>

<group>

<clip-path android:pathData="M-177,0h990v841h-990z"/>

<path android:fillType="evenOdd" android:pathData="m382,222.5c0,42.3 -34,76.5 -76,76.5 -42,0 -76,-34.3 -76,-76.5 0,-42.3 34,-76.5 76,-76.5 42,0 76,34.3 76,76.5z">

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

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

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

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

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

</gradient>

</aapt:attr>

</path>

</group>

</vector>
8 changes: 3 additions & 5 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@
android:layout_width="match_parent"
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">
app:navigationIcon="@drawable/openmnt_logo_titel_right"
app:title=" "
app:titleCentered="false">

<ImageView
android:id="@+id/log_status_icon"
Expand Down
38 changes: 22 additions & 16 deletions app/src/main/res/layout/fragment_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,33 @@
~ SPDX-License-Identifier: BSD-3-Clause-Clear
-->

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/about_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".AboutFragment">

<TextView
android:id="@+id/about_text_box"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.493"
tools:text="@string/appinfo" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/about_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:text="@string/about_title"
android:textAlignment="center"
android:textSize="20sp" />

<TextView
android:id="@+id/about_text_box"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
13 changes: 8 additions & 5 deletions app/src/main/res/layout/fragment_carrier_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@
android:id="@+id/carrier_settings_fragment_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:paddingLeft="16dp"
android:text="Carrier Settings"
android:textStyle="bold" />
android:textAlignment="center"
android:textSize="20sp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="horizontal">

<Button
android:id="@+id/button_read_carrier_settings"
Expand All @@ -38,9 +41,9 @@

<EditText
android:id="@+id/carrier_settings_filter"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="10"
android:autofillHints="filter string"
android:hint="filter string"></EditText>
</LinearLayout>
Expand Down
Loading

0 comments on commit 3bcc69c

Please sign in to comment.