|
|
|
@ -84,6 +84,8 @@ import android.view.inputmethod.InputMethodManager;
|
|
|
|
|
import android.webkit.MimeTypeMap;
|
|
|
|
|
import android.widget.AdapterView;
|
|
|
|
|
import android.widget.ArrayAdapter;
|
|
|
|
|
import android.widget.CheckBox;
|
|
|
|
|
import android.widget.CompoundButton;
|
|
|
|
|
import android.widget.EditText;
|
|
|
|
|
import android.widget.FilterQueryProvider;
|
|
|
|
|
import android.widget.ImageButton;
|
|
|
|
@ -172,6 +174,7 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
private EditTextCompose etBody;
|
|
|
|
|
private TextView tvNoInternet;
|
|
|
|
|
private TextView tvSignature;
|
|
|
|
|
private CheckBox cbSignature;
|
|
|
|
|
private TextView tvReference;
|
|
|
|
|
private ImageButton ibCloseRefHint;
|
|
|
|
|
private ImageButton ibReferenceEdit;
|
|
|
|
@ -265,6 +268,7 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
etBody = view.findViewById(R.id.etBody);
|
|
|
|
|
tvNoInternet = view.findViewById(R.id.tvNoInternet);
|
|
|
|
|
tvSignature = view.findViewById(R.id.tvSignature);
|
|
|
|
|
cbSignature = view.findViewById(R.id.cbSignature);
|
|
|
|
|
tvReference = view.findViewById(R.id.tvReference);
|
|
|
|
|
ibCloseRefHint = view.findViewById(R.id.ibCloseRefHint);
|
|
|
|
|
ibReferenceEdit = view.findViewById(R.id.ibReferenceEdit);
|
|
|
|
@ -346,6 +350,39 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
cbSignature.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
|
args.putLong("id", working);
|
|
|
|
|
args.putBoolean("signature", checked);
|
|
|
|
|
|
|
|
|
|
new SimpleTask<Integer>() {
|
|
|
|
|
@Override
|
|
|
|
|
protected Integer onExecute(Context context, Bundle args) {
|
|
|
|
|
long id = args.getLong("id");
|
|
|
|
|
boolean signature = args.getBoolean("signature");
|
|
|
|
|
|
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
|
return db.message().setMessageSignature(id, signature);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onExecuted(Bundle args, Integer count) {
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
boolean signature = args.getBoolean("signature");
|
|
|
|
|
tvSignature.setAlpha(signature ? 1.0f : Helper.LOW_LIGHT);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onException(Bundle args, Throwable ex) {
|
|
|
|
|
Helper.unexpectedError(getFragmentManager(), ex);
|
|
|
|
|
}
|
|
|
|
|
}.execute(FragmentCompose.this, args, "draft:signature");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ibCloseRefHint.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
@ -2999,6 +3036,9 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
etBody.setSelection(0);
|
|
|
|
|
grpBody.setVisibility(View.VISIBLE);
|
|
|
|
|
|
|
|
|
|
cbSignature.setChecked(draft.signature);
|
|
|
|
|
tvSignature.setAlpha(draft.signature ? 1.0f : Helper.LOW_LIGHT);
|
|
|
|
|
|
|
|
|
|
boolean ref_has_images = args.getBoolean("ref_has_images");
|
|
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
|