diff --git a/app/src/main/java/com/jens/automation2/ActivityMainScreen.java b/app/src/main/java/com/jens/automation2/ActivityMainScreen.java index 56e5559..6a984c4 100644 --- a/app/src/main/java/com/jens/automation2/ActivityMainScreen.java +++ b/app/src/main/java/com/jens/automation2/ActivityMainScreen.java @@ -42,7 +42,7 @@ public class ActivityMainScreen extends ActivityGeneric ToggleButton toggleService, tbLockSound; Button bShowHelp, bPrivacy, bAddSoundLockTIme, bDonate, bControlCenter; - TextView tvActivePoi, tvClosestPoi, tvLastRule, tvMainScreenNotePermissions, tvMainScreenNoteFeaturesFromOtherFlavor, tvMainScreenNoteLocationImpossibleBlameGoogle, tvMainScreenNoteNews, tvLockSoundDuration; + TextView tvActivePoi, tvClosestPoi, tvLastRule, tvLastProfile, tvMainScreenNotePermissions, tvMainScreenNoteFeaturesFromOtherFlavor, tvMainScreenNoteLocationImpossibleBlameGoogle, tvMainScreenNoteNews, tvLockSoundDuration; ListView lvRuleHistory; ArrayAdapter ruleHistoryListViewAdapter; @@ -68,7 +68,8 @@ public class ActivityMainScreen extends ActivityGeneric tvActivePoi = (TextView) findViewById(R.id.tvActivePoi); tvClosestPoi = (TextView) findViewById(R.id.tvClosestPoi); lvRuleHistory = (ListView) findViewById(R.id.lvRuleHistory); - tvLastRule = (TextView) findViewById(R.id.tvTimeFrameHelpText); + tvLastRule = (TextView) findViewById(R.id.tvLastRule); + tvLastProfile = (TextView)findViewById(R.id.tvLastProfile); tvMainScreenNotePermissions = (TextView) findViewById(R.id.tvMainScreenNotePermissions); tvMainScreenNoteFeaturesFromOtherFlavor = (TextView) findViewById(R.id.tvMainScreenNoteFeaturesFromOtherFlavor); tvMainScreenNoteLocationImpossibleBlameGoogle = (TextView) findViewById(R.id.tvMainScreenNoteLocationImpossibleBlameGoogle); @@ -365,6 +366,16 @@ public class ActivityMainScreen extends ActivityGeneric { activityMainScreenInstance.tvLastRule.setText("n./a."); } + + try + { + activityMainScreenInstance.tvLastProfile.setText(Profile.getLastActivatedProfile().getName()); + activityMainScreenInstance.updateListView(); + } + catch (Exception e) + { + activityMainScreenInstance.tvLastRule.setText("n./a."); + } } else { @@ -373,6 +384,7 @@ public class ActivityMainScreen extends ActivityGeneric activityMainScreenInstance.tvActivePoi.setText(activityMainScreenInstance.getResources().getString(R.string.serviceNotRunning)); activityMainScreenInstance.tvClosestPoi.setText(""); activityMainScreenInstance.tvLastRule.setText(""); + activityMainScreenInstance.tvLastProfile.setText(""); } // uiUpdateRunning = true; diff --git a/app/src/main/java/com/jens/automation2/Profile.java b/app/src/main/java/com/jens/automation2/Profile.java index 468cea7..ac29817 100644 --- a/app/src/main/java/com/jens/automation2/Profile.java +++ b/app/src/main/java/com/jens/automation2/Profile.java @@ -776,4 +776,11 @@ public class Profile implements Comparable return this.oldName; } + public static Profile getLastActivatedProfile() + { + if(Profile.profileActivationHistory != null && Profile.profileActivationHistory.size() > 0) + return Profile.profileActivationHistory.get(Profile.profileActivationHistory.size() - 1); + else + return null; + } } diff --git a/app/src/main/res/layout/activity_manage_specific_poi.xml b/app/src/main/res/layout/activity_manage_specific_poi.xml index 13f70f0..c13d41c 100644 --- a/app/src/main/res/layout/activity_manage_specific_poi.xml +++ b/app/src/main/res/layout/activity_manage_specific_poi.xml @@ -46,7 +46,7 @@ android:orientation="horizontal" > diff --git a/app/src/main/res/layout/main_overview_layout.xml b/app/src/main/res/layout/main_overview_layout.xml index b71ca26..32129c9 100644 --- a/app/src/main/res/layout/main_overview_layout.xml +++ b/app/src/main/res/layout/main_overview_layout.xml @@ -193,7 +193,7 @@ android:textAppearance="?android:attr/textAppearanceLarge" /> + + + + + + + Check frequency [ms] Milliseconds between checks Getting the location does not seem to be working on Android 12 devices currently. If it isn\'t working for you, I\'m sorry. I\'ll try to fix this as soon as I know the cause. So if the donut doesn\'t stop spinning, you know why. + Last profile: \ No newline at end of file