forked from jens/Automation
close notification action
This commit is contained in:
parent
e6a7e2c5b5
commit
724192e80b
@ -160,6 +160,9 @@ public class Action
|
||||
{
|
||||
StringBuilder returnString = new StringBuilder();
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
switch (getAction())
|
||||
{
|
||||
case setWifi:
|
||||
@ -291,9 +294,30 @@ public class Action
|
||||
|
||||
returnString.append(" / " + Integer.parseInt(parameter2) + "%");
|
||||
}
|
||||
else if (this.getAction().equals(Action_Enum.closeNotification))
|
||||
{
|
||||
returnString.append(" " + Miscellaneous.getAnyContext().getResources().getString(R.string.from) + " ");
|
||||
|
||||
String parts[] = this.getParameter2().split(Action.actionParameter2Split);
|
||||
if (parts[0].equals("-1"))
|
||||
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.anyApp));
|
||||
else
|
||||
if (parameter2 != null && parameter2.length() > 0)
|
||||
returnString.append(parts[0]);
|
||||
|
||||
if (!StringUtils.isBlank(parts[2]))
|
||||
returnString.append(", " + Miscellaneous.getAnyContext().getResources().getString(R.string.title) + " " + parts[1] + " " + parts[2]);
|
||||
|
||||
if (!StringUtils.isBlank(parts[3]))
|
||||
returnString.append(", " + Miscellaneous.getAnyContext().getResources().getString(R.string.text) + " " + parts[2] + " " + parts[3]);
|
||||
|
||||
}
|
||||
else if (parameter2 != null && parameter2.length() > 0)
|
||||
returnString.append(": " + parameter2.replace(Action.actionParameter2Split, "; "));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
returnString.append(": " + Miscellaneous.getAnyContext().getResources().getString(R.string.error));
|
||||
}
|
||||
|
||||
return returnString.toString();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user