show profile on main screen
This commit is contained in:
parent
d402986dc3
commit
da244d1bbe
@ -42,7 +42,7 @@ public class ActivityMainScreen extends ActivityGeneric
|
|||||||
|
|
||||||
ToggleButton toggleService, tbLockSound;
|
ToggleButton toggleService, tbLockSound;
|
||||||
Button bShowHelp, bPrivacy, bAddSoundLockTIme, bDonate, bControlCenter;
|
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;
|
ListView lvRuleHistory;
|
||||||
ArrayAdapter<Rule> ruleHistoryListViewAdapter;
|
ArrayAdapter<Rule> ruleHistoryListViewAdapter;
|
||||||
@ -68,7 +68,8 @@ public class ActivityMainScreen extends ActivityGeneric
|
|||||||
tvActivePoi = (TextView) findViewById(R.id.tvActivePoi);
|
tvActivePoi = (TextView) findViewById(R.id.tvActivePoi);
|
||||||
tvClosestPoi = (TextView) findViewById(R.id.tvClosestPoi);
|
tvClosestPoi = (TextView) findViewById(R.id.tvClosestPoi);
|
||||||
lvRuleHistory = (ListView) findViewById(R.id.lvRuleHistory);
|
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);
|
tvMainScreenNotePermissions = (TextView) findViewById(R.id.tvMainScreenNotePermissions);
|
||||||
tvMainScreenNoteFeaturesFromOtherFlavor = (TextView) findViewById(R.id.tvMainScreenNoteFeaturesFromOtherFlavor);
|
tvMainScreenNoteFeaturesFromOtherFlavor = (TextView) findViewById(R.id.tvMainScreenNoteFeaturesFromOtherFlavor);
|
||||||
tvMainScreenNoteLocationImpossibleBlameGoogle = (TextView) findViewById(R.id.tvMainScreenNoteLocationImpossibleBlameGoogle);
|
tvMainScreenNoteLocationImpossibleBlameGoogle = (TextView) findViewById(R.id.tvMainScreenNoteLocationImpossibleBlameGoogle);
|
||||||
@ -365,6 +366,16 @@ public class ActivityMainScreen extends ActivityGeneric
|
|||||||
{
|
{
|
||||||
activityMainScreenInstance.tvLastRule.setText("n./a.");
|
activityMainScreenInstance.tvLastRule.setText("n./a.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
activityMainScreenInstance.tvLastProfile.setText(Profile.getLastActivatedProfile().getName());
|
||||||
|
activityMainScreenInstance.updateListView();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
activityMainScreenInstance.tvLastRule.setText("n./a.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -373,6 +384,7 @@ public class ActivityMainScreen extends ActivityGeneric
|
|||||||
activityMainScreenInstance.tvActivePoi.setText(activityMainScreenInstance.getResources().getString(R.string.serviceNotRunning));
|
activityMainScreenInstance.tvActivePoi.setText(activityMainScreenInstance.getResources().getString(R.string.serviceNotRunning));
|
||||||
activityMainScreenInstance.tvClosestPoi.setText("");
|
activityMainScreenInstance.tvClosestPoi.setText("");
|
||||||
activityMainScreenInstance.tvLastRule.setText("");
|
activityMainScreenInstance.tvLastRule.setText("");
|
||||||
|
activityMainScreenInstance.tvLastProfile.setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
// uiUpdateRunning = true;
|
// uiUpdateRunning = true;
|
||||||
|
@ -776,4 +776,11 @@ public class Profile implements Comparable<Profile>
|
|||||||
return this.oldName;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
android:orientation="horizontal" >
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvTimeFrameHelpText"
|
android:id="@+id/tvLastRule"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:text="@string/latitude"
|
android:text="@string/latitude"
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvTimeFrameHelpText"
|
android:id="@+id/tvLastRule"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/end"
|
android:text="@string/end"
|
||||||
|
@ -151,7 +151,7 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_margin="10dp" >
|
android:layout_margin="10dp" >
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvTimeFrameHelpText"
|
android:id="@+id/tvLastRule"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/helpTextTimeFrame" />
|
android:text="@string/helpTextTimeFrame" />
|
||||||
|
@ -193,7 +193,7 @@
|
|||||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvTimeFrameHelpText"
|
android:id="@+id/tvLastRule"
|
||||||
android:layout_width="0dip"
|
android:layout_width="0dip"
|
||||||
android:layout_weight="5"
|
android:layout_weight="5"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -204,6 +204,34 @@
|
|||||||
android:textSize="20dp" />
|
android:textSize="20dp" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="top"
|
||||||
|
android:layout_marginTop="20dp" >
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dip"
|
||||||
|
android:layout_weight="5"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right"
|
||||||
|
android:text="@string/lastProfile"
|
||||||
|
android:scrollHorizontally="false"
|
||||||
|
android:singleLine="false"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvLastProfile"
|
||||||
|
android:layout_width="0dip"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_weight="5"
|
||||||
|
android:scrollHorizontally="false"
|
||||||
|
android:singleLine="false"
|
||||||
|
android:text="n./a."
|
||||||
|
android:textSize="20dp" />
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
android:background="@color/barBackgroundColor" >
|
android:background="@color/barBackgroundColor" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvTimeFrameHelpText"
|
android:id="@+id/tvLastRule"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/ruleList"
|
android:text="@string/ruleList"
|
||||||
|
@ -795,4 +795,5 @@
|
|||||||
<string name="musicCheckFrequencyTitle">Check frequency [ms]</string>
|
<string name="musicCheckFrequencyTitle">Check frequency [ms]</string>
|
||||||
<string name="musicCheckFrequencySummary">Milliseconds between checks</string>
|
<string name="musicCheckFrequencySummary">Milliseconds between checks</string>
|
||||||
<string name="locationNotWorkingOn12">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.</string>
|
<string name="locationNotWorkingOn12">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.</string>
|
||||||
|
<string name="lastProfile">Last profile:</string>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in New Issue
Block a user