notification dismiss with button

development-stable
jens 7 months ago
parent d154a3d64f
commit 1ecc61452f

@ -16,7 +16,9 @@ import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.Spinner;
import android.widget.TextView;
@ -39,10 +41,11 @@ public class ActivityManageActionCloseNotification extends Activity
boolean edit = false;
ProgressDialog progressDialog = null;
EditText etNotificationTitle, etNotificationText;
EditText etNotificationTitle, etNotificationText, etNotificationDismissalButtonText;
Button bSelectApp, bSaveActionCloseNotification;
Spinner spinnerTitleDirection, spinnerTextDirection;
TextView tvSelectedApplication;
RadioButton rbNotificationDismissSimple, rbNotificationDismissButton;
private static List<PackageInfo> pInfos = null;
@ -262,6 +265,10 @@ public class ActivityManageActionCloseNotification extends Activity
spinnerTitleDirection = (Spinner)findViewById(R.id.spinnerTitleDirection);
spinnerTextDirection = (Spinner)findViewById(R.id.spinnerTextDirection);
tvSelectedApplication = (TextView)findViewById(R.id.etActivityOrActionPath);
etNotificationDismissalButtonText = (EditText)findViewById(R.id.etNotificationDismissalButtonText);
rbNotificationDismissSimple = (RadioButton)findViewById(R.id.rbNotificationDismissSimple);
rbNotificationDismissButton = (RadioButton)findViewById(R.id.rbNotificationDismissButton);
directions = new String[] {
getResources().getString(R.string.directionStringEquals),
@ -333,6 +340,15 @@ public class ActivityManageActionCloseNotification extends Activity
}
});
rbNotificationDismissSimple.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener()
{
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b)
{
etNotificationDismissalButtonText.setEnabled(!b);
}
});
Intent i = getIntent();
if(!StringUtils.isBlank(i.getStringExtra(ActivityManageRule.intentNameActionParameter2)))
{

@ -149,6 +149,41 @@
</TableRow>>
<ImageView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_marginVertical="@dimen/default_margin"
android:background="#aa000000" />
<TableRow>
<RadioGroup>
<RadioButton
android:id="@+id/rbNotificationDismissSimple"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/simplyDismissNotification" />
<RadioButton
android:id="@+id/rbNotificationDismissButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/clickNotificationButton" />
</RadioGroup>
<EditText
android:layout_gravity="bottom"
android:id="@+id/etNotificationDismissalButtonText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:inputType="text" />
</TableRow>
</TableLayout>
<Button

@ -841,4 +841,6 @@
<string name="wakeLockTimeout">Specify timeout</string>
<string name="wakeLockExplanation">Activate will keep the screen on while deactivate will let it turn off. For keeping it on you can either enter a duration after which it may turn off again or you can keep it on indefinitely. In the latter case you would need to create another keep-awake action (in this or another rule) in which you select deactivate.</string>
<string name="mayUseRegularExpressions">You may also enter a regular expression here.</string>
<string name="simplyDismissNotification">Simply dismiss</string>
<string name="clickNotificationButton">Click a button</string>
</resources>
Loading…
Cancel
Save