Rule improvements

This commit is contained in:
M66B
2019-01-21 18:37:09 +00:00
parent 84895b6077
commit 7f2b54f28b
3 changed files with 17 additions and 3 deletions

View File

@@ -48,6 +48,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.fragment.app.FragmentTransaction;
public class FragmentRule extends FragmentBase {
private ViewGroup view;
@@ -270,7 +271,13 @@ public class FragmentRule extends FragmentBase {
etHeader.setText(jheader == null ? null : jheader.getString("value"));
cbHeader.setChecked(jheader != null && jheader.getBoolean("regex"));
if (rule != null) {
if (rule == null) {
for (int pos = 0; pos < adapterIdentity.getCount(); pos++)
if (adapterIdentity.getItem(pos).primary) {
spIdent.setSelection(pos);
break;
}
} else {
int type = jaction.getInt("type");
switch (type) {
case EntityRule.TYPE_MOVE:
@@ -376,6 +383,13 @@ public class FragmentRule extends FragmentBase {
}
private void onActionSave() {
if (!Helper.isPro(getContext())) {
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentPro()).addToBackStack("pro");
fragmentTransaction.commit();
return;
}
try {
Helper.setViewsEnabled(view, false);