forked from jens/Automation
Donate button
This commit is contained in:
parent
5fdc68e396
commit
06d63826e6
@ -44,7 +44,7 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
|
||||
private static ActivityMainScreen activityMainScreenInstance = null;
|
||||
private ToggleButton toggleService, tbLockSound;
|
||||
private Button bShowHelp, bPrivacy, bSettingsErase, bAddSoundLockTIme;
|
||||
private Button bShowHelp, bPrivacy, bSettingsErase, bAddSoundLockTIme, bDonate;
|
||||
private TextView tvActivePoi, tvClosestPoi, tvLastRule, tvMainScreenNotePermissions, tvMainScreenNoteFeaturesFromOtherFlavor, tvMainScreenNoteLocationImpossibleBlameGoogle, tvMainScreenNoteNews, tvlockSoundDuration;
|
||||
private static boolean updateNoteDisplayed = false;
|
||||
|
||||
@ -82,6 +82,12 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
tvlockSoundDuration = (TextView)findViewById(R.id.tvlockSoundDuration);
|
||||
tbLockSound = (ToggleButton) findViewById(R.id.tbLockSound);
|
||||
toggleService = (ToggleButton) findViewById(R.id.tbArmMastListener);
|
||||
|
||||
bDonate = (Button)findViewById(R.id.bDonate);
|
||||
|
||||
if(!BuildConfig.FLAVOR.equalsIgnoreCase("googlePlayFlavor"))
|
||||
bDonate.setVisibility(View.VISIBLE);
|
||||
|
||||
toggleService.setChecked(AutomationService.isMyServiceRunning(this));
|
||||
toggleService.setOnCheckedChangeListener(new OnCheckedChangeListener()
|
||||
{
|
||||
@ -111,6 +117,18 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
}
|
||||
});
|
||||
|
||||
bDonate.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
String privacyPolicyUrl = "https://server47.de/donate";
|
||||
|
||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(privacyPolicyUrl));
|
||||
startActivity(browserIntent);
|
||||
}
|
||||
});
|
||||
|
||||
tbLockSound.setOnCheckedChangeListener(new OnCheckedChangeListener()
|
||||
{
|
||||
@Override
|
||||
|
@ -819,7 +819,15 @@ public class XmlFileInterface
|
||||
// Starts by looking for the entry tag
|
||||
if (name.equals("Trigger"))
|
||||
{
|
||||
triggerCollection.add(readTrigger(parser));
|
||||
try
|
||||
{
|
||||
triggerCollection.add(readTrigger(parser));
|
||||
}
|
||||
catch (IllegalArgumentException | NullPointerException e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "XMLFileInterface", "Unknown trigger found in config file. File was probably created by a newer program version. Details: " + Log.getStackTraceString(e), 1);
|
||||
Miscellaneous.messageBox(context.getString(R.string.error), context.getString(R.string.elementSkipped), context).show();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1055,7 +1063,15 @@ public class XmlFileInterface
|
||||
// Starts by looking for the entry tag
|
||||
if (name.equals("Action"))
|
||||
{
|
||||
actionCollection.add(readAction(parser));
|
||||
try
|
||||
{
|
||||
actionCollection.add(readAction(parser));
|
||||
}
|
||||
catch (IllegalArgumentException | NullPointerException e)
|
||||
{
|
||||
Miscellaneous.logEvent("e", "XMLFileInterface", "Unknown action found in config file. File was probably created by a newer program version. Details: " + Log.getStackTraceString(e), 1);
|
||||
Miscellaneous.messageBox(context.getString(R.string.error), context.getString(R.string.elementSkipped), context).show();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1065,7 +1081,6 @@ public class XmlFileInterface
|
||||
return (actionCollection);
|
||||
}
|
||||
|
||||
|
||||
private static Action readAction(XmlPullParser parser) throws IOException, XmlPullParserException
|
||||
{
|
||||
/* FILE EXAMPE:
|
||||
|
@ -333,6 +333,14 @@
|
||||
android:layout_gravity="top"
|
||||
android:text="@string/settings" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bDonate"
|
||||
android:visibility="gone"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:text="@string/donate" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -706,4 +706,6 @@
|
||||
<string name="repeatEveryXseconds">Repeat every x seconds</string>
|
||||
<string name="repeatEveryXsecondsWithVariable">repeat every %1$s seconds</string>
|
||||
<string name="enterRepetitionTime">You need to enter a positive non-decimal value for reptition time.</string>
|
||||
<string name="elementSkipped">An element of the configuration file could not be read. The file may have been created by a newer program version.</string>
|
||||
<string name="donate">Donate</string>
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user