Skip to content

Commit

Permalink
futuer UX tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterHasse committed Jan 13, 2025
1 parent 64fe7b3 commit 7801e90
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.ArrayList;
import java.util.List;

import de.fraunhofer.fokus.OpenMobileNetworkToolkit.DataProvider.DataProvider;
import de.fraunhofer.fokus.OpenMobileNetworkToolkit.GlobalVars;
import de.fraunhofer.fokus.OpenMobileNetworkToolkit.Preferences.SPType;
import de.fraunhofer.fokus.OpenMobileNetworkToolkit.Preferences.SharedPreferencesGrouper;
Expand All @@ -42,19 +43,22 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
if (sub_select != null) {
ArrayList<String> entries = new ArrayList<>();
ArrayList<String> entryValues = new ArrayList<>();
List<SubscriptionInfo> subscriptions = GlobalVars.getInstance().get_dp().getSubscriptions();
for (SubscriptionInfo info : subscriptions) {
entries.add(info.getDisplayName().toString());
entryValues.add(String.valueOf(info.getSubscriptionId()));
}
CharSequence[] entries_char = entries.toArray(new CharSequence[0]);
CharSequence[] entryValues_char = entryValues.toArray(new CharSequence[0]);
DataProvider dp = GlobalVars.getInstance().get_dp();
if (dp != null) {
List<SubscriptionInfo> subscriptions = GlobalVars.getInstance().get_dp().getSubscriptions();
for (SubscriptionInfo info : subscriptions) {
entries.add(info.getDisplayName().toString());
entryValues.add(String.valueOf(info.getSubscriptionId()));
}
CharSequence[] entries_char = entries.toArray(new CharSequence[0]);
CharSequence[] entryValues_char = entryValues.toArray(new CharSequence[0]);
sub_select.setEntries(entries_char);
sub_select.setEntryValues(entryValues_char);
sub_select.setOnPreferenceChangeListener((preference, newValue) -> {
Toast.makeText(requireContext().getApplicationContext(), "Subscription Changed, please restart OMNT", Toast.LENGTH_SHORT).show();
return true;
});
}
}

Preference button = pfm.findPreference("reset_modem");
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="26dp"
android:layout_height="28dp"
android:layout_marginLeft="16dp"
android:visibility="visible"
app:navigationIcon="@drawable/openmnt_logo_titel_right"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<com.google.android.material.tabs.TabLayout
android:id="@+id/home_tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="28dp"
app:tabMode="auto" />

<androidx.viewpager2.widget.ViewPager2
Expand Down

0 comments on commit 7801e90

Please sign in to comment.