close notification action

This commit is contained in:
jens 2022-01-14 19:57:32 +01:00
parent e6a7e2c5b5
commit 724192e80b

View File

@ -160,6 +160,9 @@ public class Action
{ {
StringBuilder returnString = new StringBuilder(); StringBuilder returnString = new StringBuilder();
try
{
switch (getAction()) switch (getAction())
{ {
case setWifi: case setWifi:
@ -291,9 +294,30 @@ public class Action
returnString.append(" / " + Integer.parseInt(parameter2) + "%"); 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 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, "; ")); returnString.append(": " + parameter2.replace(Action.actionParameter2Split, "; "));
}
catch (Exception e)
{
returnString.append(": " + Miscellaneous.getAnyContext().getResources().getString(R.string.error));
}
return returnString.toString(); return returnString.toString();
} }