Experiment: template button / composer

This commit is contained in:
M66B 2024-02-24 11:32:13 +01:00
parent f370b741d8
commit b1c7cc3409
2 changed files with 22 additions and 0 deletions

View File

@ -256,6 +256,7 @@ public class FragmentCompose extends FragmentBase {
private TextView tvPlainTextOnly;
private EditTextCompose etBody;
private ImageView ivMarkdown;
private ImageButton ibTemplate;
private TextView tvNoInternet;
private TextView tvSignature;
private CheckBox cbSignature;
@ -415,6 +416,7 @@ public class FragmentCompose extends FragmentBase {
tvPlainTextOnly = view.findViewById(R.id.tvPlainTextOnly);
etBody = view.findViewById(R.id.etBody);
ivMarkdown = view.findViewById(R.id.ivMarkdown);
ibTemplate = view.findViewById(R.id.ibTemplate);
tvNoInternet = view.findViewById(R.id.tvNoInternet);
tvSignature = view.findViewById(R.id.tvSignature);
cbSignature = view.findViewById(R.id.cbSignature);
@ -815,6 +817,14 @@ public class FragmentCompose extends FragmentBase {
}
});
ibTemplate.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
ibTemplate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onMenuAnswerInsert(v);
}
});
if (compose_color != Color.TRANSPARENT)
tvSignature.setTextColor(compose_color);
tvSignature.setTypeface(StyleHelper.getTypeface(compose_font, getContext()));

View File

@ -360,6 +360,18 @@
app:srcCompat="@drawable/twotone_data_array_24"
app:tint="?attr/colorSeparator" />
<ImageButton
android:id="@+id/ibTemplate"
android:layout_width="36dp"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/menu_answers"
android:padding="3dp"
android:tooltipText="@string/menu_answers"
app:layout_constraintBottom_toBottomOf="@id/etBody"
app:layout_constraintEnd_toEndOf="@id/etBody"
app:srcCompat="@drawable/twotone_text_snippet_24" />
<TextView
android:id="@+id/tvNoInternet"
android:layout_width="wrap_content"