|
|
@ -264,8 +264,10 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> {
|
|
|
|
if (TextUtils.isEmpty(method))
|
|
|
|
if (TextUtils.isEmpty(method))
|
|
|
|
method = "GET";
|
|
|
|
method = "GET";
|
|
|
|
setAction(getAction(type), method + " " + url);
|
|
|
|
setAction(getAction(type), method + " " + url);
|
|
|
|
} else
|
|
|
|
} else {
|
|
|
|
setAction(getAction(type), null);
|
|
|
|
boolean seen = jaction.optBoolean("seen");
|
|
|
|
|
|
|
|
setAction(getAction(type), seen ? context.getString(R.string.title_rule_seen) : null, null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (type == EntityRule.TYPE_MOVE || type == EntityRule.TYPE_COPY ||
|
|
|
|
if (type == EntityRule.TYPE_MOVE || type == EntityRule.TYPE_COPY ||
|
|
|
|
(type == EntityRule.TYPE_ANSWER && TextUtils.isEmpty(to))) {
|
|
|
|
(type == EntityRule.TYPE_ANSWER && TextUtils.isEmpty(to))) {
|
|
|
@ -302,7 +304,9 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> {
|
|
|
|
if (id != AdapterRule.this.getItemId(pos))
|
|
|
|
if (id != AdapterRule.this.getItemId(pos))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
setAction(getAction(args.getInt("type")), value);
|
|
|
|
boolean seen = jaction.optBoolean("seen");
|
|
|
|
|
|
|
|
setAction(getAction(args.getInt("type")),
|
|
|
|
|
|
|
|
seen ? context.getString(R.string.title_rule_seen) : null, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -565,16 +569,24 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void setAction(int resid, String value) {
|
|
|
|
private void setAction(int resid, String value) {
|
|
|
|
if (TextUtils.isEmpty(value))
|
|
|
|
setAction(resid, null, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void setAction(int resid, String extra, String value) {
|
|
|
|
|
|
|
|
if (TextUtils.isEmpty(extra) && TextUtils.isEmpty(value))
|
|
|
|
tvAction.setText(resid);
|
|
|
|
tvAction.setText(resid);
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
SpannableStringBuilder ssb = new SpannableStringBuilderEx();
|
|
|
|
SpannableStringBuilder ssb = new SpannableStringBuilderEx();
|
|
|
|
ssb.append(context.getString(resid));
|
|
|
|
ssb.append(context.getString(resid));
|
|
|
|
|
|
|
|
if (extra != null)
|
|
|
|
|
|
|
|
ssb.append('+').append(extra);
|
|
|
|
|
|
|
|
if (value != null) {
|
|
|
|
ssb.append(" \"");
|
|
|
|
ssb.append(" \"");
|
|
|
|
int start = ssb.length();
|
|
|
|
int start = ssb.length();
|
|
|
|
ssb.append(value);
|
|
|
|
ssb.append(value);
|
|
|
|
ssb.setSpan(new StyleSpan(Typeface.ITALIC), start, ssb.length(), 0);
|
|
|
|
ssb.setSpan(new StyleSpan(Typeface.ITALIC), start, ssb.length(), 0);
|
|
|
|
ssb.append("\"");
|
|
|
|
ssb.append("\"");
|
|
|
|
|
|
|
|
}
|
|
|
|
tvAction.setText(ssb);
|
|
|
|
tvAction.setText(ssb);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|