Kitchensink

pull/210/head
M66B 2 years ago
parent fd44e663c4
commit 49962289d7

@ -105,6 +105,7 @@ import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.FilterQueryProvider;
import android.widget.HorizontalScrollView;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.MultiAutoCompleteTextView;
@ -267,8 +268,7 @@ public class FragmentCompose extends FragmentBase {
private ImageButton ibReferenceImages;
private View vwAnchor;
private TextViewAutoCompleteAction etSearch;
private BottomNavigationView style_bar;
private BottomNavigationView block_bar;
private HorizontalScrollView style_bar;
private BottomNavigationView media_bar;
private BottomNavigationView bottom_navigation;
private ContentLoadingProgressBar pbWait;
@ -287,7 +287,6 @@ public class FragmentCompose extends FragmentBase {
private String display_font;
private boolean dsn = true;
private Integer encrypt = null;
private boolean block = false;
private boolean media = true;
private boolean compact = false;
private int zoom = 0;
@ -347,11 +346,9 @@ public class FragmentCompose extends FragmentBase {
final Context context = getContext();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean experiments = prefs.getBoolean("experiments", false);
compose_font = prefs.getString("compose_font", "");
display_font = prefs.getString("display_font", "");
block = experiments && prefs.getBoolean("compose_block", false);
media = prefs.getBoolean("compose_media", true);
compact = prefs.getBoolean("compose_compact", false);
zoom = prefs.getInt("compose_zoom", compact ? 0 : 1);
@ -401,7 +398,6 @@ public class FragmentCompose extends FragmentBase {
vwAnchor = view.findViewById(R.id.vwAnchor);
etSearch = view.findViewById(R.id.etSearch);
style_bar = view.findViewById(R.id.style_bar);
block_bar = view.findViewById(R.id.block_bar);
media_bar = view.findViewById(R.id.media_bar);
bottom_navigation = view.findViewById(R.id.bottom_navigation);
@ -630,10 +626,8 @@ public class FragmentCompose extends FragmentBase {
return;
if (styling != selection) {
styling = selection;
media_bar.getMenu().clear();
media_bar.inflateMenu(styling
? R.menu.action_compose_style_alt
: R.menu.action_compose_media);
media_bar.setVisibility(styling ? View.GONE : View.VISIBLE);
style_bar.setVisibility(styling ? View.VISIBLE : View.GONE);
invalidateOptionsMenu();
}
}
@ -1051,81 +1045,7 @@ public class FragmentCompose extends FragmentBase {
}
});
style_bar.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
int action = item.getItemId();
return onActionStyle(action, style_bar.findViewById(action));
}
});
block_bar.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
int action = item.getItemId();
if (action == R.id.menu_blockquote) {
Pair<Integer, Integer> block = StyleHelper.getParagraph(etBody, true);
if (block == null)
return false;
StyleHelper.setBlockQuote(etBody, block.first, block.second, false);
return true;
} else {
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(getContext(), getViewLifecycleOwner(), block_bar.findViewById(action));
if (action == R.id.menu_alignment)
popupMenu.inflate(R.menu.popup_style_alignment);
else if (action == R.id.menu_list)
popupMenu.inflate(R.menu.popup_style_list);
else if (action == R.id.menu_indentation)
popupMenu.inflate(R.menu.popup_style_indentation);
Menu menu = popupMenu.getMenu();
Editable edit = etBody.getText();
Pair<Integer, Integer> b = StyleHelper.getParagraph(etBody, true);
BulletSpan[] bullets = (b == null ? null : edit.getSpans(b.first, b.second, BulletSpan.class));
IndentSpan[] indents = (b == null ? null : edit.getSpans(b.first, b.second, IndentSpan.class));
if (b == null ||
(action == R.id.menu_list && indents.length > 0) ||
(action == R.id.menu_indentation && bullets.length > 0)) {
for (int i = 0; i < menu.size(); i++)
menu.getItem(i).setEnabled(false);
} else {
if (action == R.id.menu_list) {
Pair<Integer, Integer> p = StyleHelper.getParagraph(etBody, false);
Integer maxLevel = (p == null ? null : StyleHelper.getMaxListLevel(edit, p.first, p.second));
menu.findItem(R.id.menu_style_list_increase).setEnabled(maxLevel != null);
menu.findItem(R.id.menu_style_list_decrease).setEnabled(maxLevel != null && maxLevel > 0);
} else if (action == R.id.menu_indentation)
popupMenu.getMenu().findItem(R.id.menu_style_indentation_decrease).setEnabled(indents.length > 0);
}
popupMenu.insertIcons(getContext());
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
int itemId = item.getItemId();
boolean level = (itemId == R.id.menu_style_list_decrease || itemId == R.id.menu_style_list_increase);
Pair<Integer, Integer> block = StyleHelper.getParagraph(etBody, !level);
if (block == null)
return false;
if (action == R.id.menu_alignment)
StyleHelper.setAlignment(item.getItemId(), etBody, block.first, block.second, false);
else if (action == R.id.menu_list) {
if (level)
StyleHelper.setListLevel(itemId, etBody, block.first, block.second, false);
else
StyleHelper.setList(itemId, etBody, block.first, block.second, false);
} else if (action == R.id.menu_indentation)
StyleHelper.setIndentation(item.getItemId(), etBody, block.first, block.second, false);
return true;
}
});
popupMenu.show();
return true;
}
}
});
StyleHelper.wire(getViewLifecycleOwner(), view, etBody);
media_bar.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
@ -1146,8 +1066,8 @@ public class FragmentCompose extends FragmentBase {
} else if (action == R.id.menu_link) {
onActionLink();
return true;
}
return onActionStyle(action, media_bar.findViewById(action));
} else
return false;
}
});
@ -1211,7 +1131,6 @@ public class FragmentCompose extends FragmentBase {
tvReference.setVisibility(View.GONE);
etSearch.setVisibility(View.GONE);
style_bar.setVisibility(View.GONE);
block_bar.setVisibility(View.GONE);
media_bar.setVisibility(View.GONE);
bottom_navigation.setVisibility(View.GONE);
pbWait.setVisibility(View.VISIBLE);
@ -2062,7 +1981,6 @@ public class FragmentCompose extends FragmentBase {
menu.findItem(R.id.menu_send_chips).setChecked(send_chips);
menu.findItem(R.id.menu_send_dialog).setChecked(send_dialog);
menu.findItem(R.id.menu_image_dialog).setChecked(image_dialog);
menu.findItem(R.id.menu_block).setChecked(block).setVisible(experiments);
menu.findItem(R.id.menu_media).setChecked(media);
menu.findItem(R.id.menu_compact).setChecked(compact);
@ -2135,9 +2053,6 @@ public class FragmentCompose extends FragmentBase {
} else if (itemId == R.id.menu_image_dialog) {
onMenuImageDialog();
return true;
} else if (itemId == R.id.menu_block) {
onMenuBlockBar();
return true;
} else if (itemId == R.id.menu_media) {
onMenuMediaBar();
return true;
@ -2294,14 +2209,6 @@ public class FragmentCompose extends FragmentBase {
prefs.edit().putBoolean("image_dialog", !image_dialog).apply();
}
private void onMenuBlockBar() {
block = !block;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
prefs.edit().putBoolean("compose_block", block).apply();
block_bar.setVisibility(block ? View.VISIBLE : View.GONE);
invalidateOptionsMenu();
}
private void onMenuMediaBar() {
media = !media;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
@ -2789,11 +2696,6 @@ public class FragmentCompose extends FragmentBase {
}.execute(this, args, "compose:lt");
}
private boolean onActionStyle(int action, View anchor) {
Log.i("Style action=" + action);
return StyleHelper.apply(-1, action, getViewLifecycleOwner(), anchor, etBody);
}
private void onActionRecordAudio() {
// https://developer.android.com/reference/android/provider/MediaStore.Audio.Media.html#RECORD_SOUND_ACTION
PackageManager pm = getContext().getPackageManager();
@ -7003,7 +6905,6 @@ public class FragmentCompose extends FragmentBase {
@Override
protected void onPostExecute(Bundle args) {
pbWait.setVisibility(View.GONE);
block_bar.setVisibility(block ? View.VISIBLE : View.GONE);
media_bar.setVisibility(media ? View.VISIBLE : View.GONE);
bottom_navigation.getMenu().findItem(R.id.action_undo).setVisible(draft.revision > 1);
bottom_navigation.getMenu().findItem(R.id.action_redo).setVisible(draft.revision < draft.revisions);

@ -89,6 +89,49 @@ public class StyleHelper {
InsertedSpan.class
));
private static Integer[] ids = new Integer[]{
R.id.menu_bold,
R.id.menu_italic,
R.id.menu_underline,
R.id.menu_style_size,
R.id.menu_style_background,
R.id.menu_style_color,
R.id.menu_style_font,
R.id.menu_style_align,
R.id.menu_style_list,
R.id.menu_style_indentation,
R.id.menu_style_blockquote,
R.id.menu_style_mark,
R.id.menu_style_subscript,
R.id.menu_style_superscript,
R.id.menu_style_strikethrough,
R.id.menu_style_password,
R.id.menu_style_code,
R.id.menu_style_clear
};
static void wire(LifecycleOwner owner, View view, EditText etBody) {
View.OnClickListener styleListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
StyleHelper.apply(-1, v.getId(), owner, v, etBody);
}
};
for (int id : ids) {
View v = view.findViewById(id);
v.setOnClickListener(styleListener);
if (id == R.id.menu_style_password)
v.setVisibility(
!BuildConfig.PLAY_STORE_RELEASE && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
? View.VISIBLE : View.GONE);
else if (id == R.id.menu_style_code)
v.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
}
}
static boolean apply(int groupId, int itemId, LifecycleOwner owner, View anchor, EditText etBody, Object... args) {
Log.i("Style action=" + groupId + ":" + itemId);
@ -158,6 +201,46 @@ public class StyleHelper {
etBody.setSelection(start, end);
return true;
} else if (itemId == R.id.menu_style_size) {
Context context = anchor.getContext();
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, owner, anchor);
int[] ids = new int[]{
R.id.menu_style_size_xsmall,
R.id.menu_style_size_small,
R.id.menu_style_size_medium,
R.id.menu_style_size_large,
R.id.menu_style_size_xlarge
};
int[] titles = new int[]{
R.string.title_style_size_xsmall,
R.string.title_style_size_small,
R.string.title_style_size_medium,
R.string.title_style_size_large,
R.string.title_style_size_xlarge};
float[] sizes = new float[]{
HtmlHelper.FONT_XSMALL,
HtmlHelper.FONT_SMALL,
1.0f,
HtmlHelper.FONT_LARGE,
HtmlHelper.FONT_XLARGE};
for (int i = 0; i < ids.length; i++) {
SpannableStringBuilder ssb = new SpannableStringBuilderEx(context.getString(titles[i]));
ssb.setSpan(new RelativeSizeSpan(sizes[i]), 0, ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
popupMenu.getMenu().add(R.id.group_style_size, ids[i], i, ssb);
}
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
return StyleHelper.apply(R.id.group_style_size, item.getItemId(), owner, anchor, etBody);
}
});
popupMenu.show();
} else if (groupId == R.id.group_style_size) {
Float size;
if (itemId == R.id.menu_style_size_xsmall)
@ -241,15 +324,78 @@ public class StyleHelper {
builder.build().show();
return true;
} else if (itemId == R.id.menu_style_font) {
Context context = anchor.getContext();
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, owner, anchor);
List<FontDescriptor> fonts = getFonts(context, false);
for (int i = 0; i < fonts.size(); i++) {
FontDescriptor font = fonts.get(i);
SpannableStringBuilder ssb = new SpannableStringBuilderEx(font.toString());
ssb.setSpan(getTypefaceSpan(font.type, context), 0, ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
popupMenu.getMenu().add(font.custom ? R.id.group_style_font_custom : R.id.group_style_font_standard, i, 0, ssb)
.setIntent(new Intent().putExtra("face", font.type));
}
popupMenu.getMenu().add(R.id.group_style_font_standard, fonts.size(), 0, R.string.title_style_font_default)
.setIntent(new Intent());
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
return setFont(etBody, start, end, item.getIntent().getStringExtra("face"));
}
});
popupMenu.show();
} else if (groupId == R.id.group_style_font_standard ||
groupId == R.id.group_style_font_custom) {
Log.breadcrumb("style", "action", "font");
return setFont(etBody, start, end, (String) args[0]);
} else if (itemId == R.id.menu_style_align) {
Context context = anchor.getContext();
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, owner, anchor);
popupMenu.inflate(R.menu.popup_style_alignment);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
return StyleHelper.apply(R.id.group_style_align, item.getItemId(), owner, anchor, etBody);
}
});
popupMenu.insertIcons(context);
popupMenu.show();
} else if (groupId == R.id.group_style_align) {
return setAlignment(itemId, etBody, start, end, true);
} else if (itemId == R.id.menu_style_list) {
Context context = anchor.getContext();
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, owner, anchor);
popupMenu.inflate(R.menu.popup_style_list);
Integer maxLevel = getMaxListLevel(edit, start, end);
IndentSpan[] indents = edit.getSpans(start, end, IndentSpan.class);
popupMenu.getMenu().findItem(R.id.menu_style_list_bullets).setEnabled(indents.length == 0);
popupMenu.getMenu().findItem(R.id.menu_style_list_numbered).setEnabled(indents.length == 0);
popupMenu.getMenu().findItem(R.id.menu_style_list_increase).setEnabled(indents.length == 0 && maxLevel != null);
popupMenu.getMenu().findItem(R.id.menu_style_list_decrease).setEnabled(indents.length == 0 && maxLevel != null && maxLevel > 0);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
return StyleHelper.apply(R.id.group_style_list, item.getItemId(), owner, anchor, etBody);
}
});
popupMenu.insertIcons(context);
popupMenu.show();
} else if (groupId == R.id.group_style_list) {
if (itemId == R.id.menu_style_list_increase ||
itemId == R.id.menu_style_list_decrease)
@ -257,34 +403,56 @@ public class StyleHelper {
else
return setList(itemId, etBody, start, end, true);
} else if (itemId == R.id.menu_style_indentation) {
Context context = anchor.getContext();
PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(context, owner, anchor);
popupMenu.inflate(R.menu.popup_style_indentation);
Integer maxLevel = getMaxListLevel(edit, start, end);
IndentSpan[] indents = edit.getSpans(start, end, IndentSpan.class);
popupMenu.getMenu().findItem(R.id.menu_style_indentation_increase).setEnabled(maxLevel == null);
popupMenu.getMenu().findItem(R.id.menu_style_indentation_decrease).setEnabled(indents.length > 0);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
return StyleHelper.apply(R.id.group_style_indentation, item.getItemId(), owner, anchor, etBody);
}
});
popupMenu.insertIcons(context);
popupMenu.show();
} else if (groupId == R.id.group_style_indentation) {
return setIndentation(itemId, etBody, start, end, true);
} else if (groupId == R.id.group_style_blockquote) {
} else if (itemId == R.id.menu_style_blockquote || groupId == R.id.group_style_blockquote) {
return setBlockQuote(etBody, start, end, true);
} else if (groupId == R.id.group_style_mark) {
return setMark(etBody, start, end);
} else if (itemId == R.id.menu_style_mark || groupId == R.id.group_style_mark) {
return setMark(etBody, start, end, itemId == R.id.menu_style_mark);
} else if (groupId == R.id.group_style_subscript) {
return setSubscript(etBody, start, end);
} else if (itemId == R.id.menu_style_subscript || groupId == R.id.group_style_subscript) {
return setSubscript(etBody, start, end, itemId == R.id.menu_style_subscript);
} else if (groupId == R.id.group_style_superscript) {
return setSuperscript(etBody, start, end);
} else if (itemId == R.id.menu_style_superscript || groupId == R.id.group_style_superscript) {
return setSuperscript(etBody, start, end, itemId == R.id.menu_style_superscript);
} else if (groupId == R.id.group_style_strikethrough) {
return setStrikeThrough(etBody, start, end);
} else if (itemId == R.id.menu_style_strikethrough || groupId == R.id.group_style_strikethrough) {
return setStrikeThrough(etBody, start, end, itemId == R.id.menu_style_strikethrough);
} else if (groupId == R.id.group_style_password) {
} else if (itemId == R.id.menu_style_password || groupId == R.id.group_style_password) {
return setPassword(owner, etBody, start, end);
} else if (groupId == R.id.group_style_code) {
} else if (itemId == R.id.menu_style_code || groupId == R.id.group_style_code) {
Log.breadcrumb("style", "action", "code");
setSize(etBody, start, end, HtmlHelper.FONT_SMALL);
setFont(etBody, start, end, "monospace");
return true;
} else if (groupId == R.id.group_style_clear) {
} else if (itemId == R.id.menu_style_clear || groupId == R.id.group_style_clear) {
return clear(etBody, start, end);
} else if (itemId == R.id.menu_style) {
@ -321,7 +489,7 @@ public class StyleHelper {
}
}
List<FontDescriptor> fonts = getFonts(anchor.getContext(), false);
List<FontDescriptor> fonts = getFonts(context, false);
SubMenu smenu = popupMenu.getMenu().findItem(R.id.menu_style_font).getSubMenu();
for (int i = 0; i < fonts.size(); i++) {
FontDescriptor font = fonts.get(i);
@ -702,7 +870,7 @@ public class StyleHelper {
return true;
}
static boolean setMark(EditText etBody, int start, int end) {
static boolean setMark(EditText etBody, int start, int end, boolean select) {
Log.breadcrumb("style", "action", "mark");
boolean has = false;
@ -722,12 +890,12 @@ public class StyleHelper {
edit.setSpan(new MarkSpan(), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
etBody.setText(edit);
etBody.setSelection(end);
etBody.setSelection(select ? start : end, end);
return true;
}
static boolean setSubscript(EditText etBody, int start, int end) {
static boolean setSubscript(EditText etBody, int start, int end, boolean select) {
Log.breadcrumb("style", "action", "subscript");
boolean has = false;
@ -747,12 +915,12 @@ public class StyleHelper {
edit.setSpan(new SubscriptSpanEx(), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
etBody.setText(edit);
etBody.setSelection(start, end);
etBody.setSelection(select ? start : end, end);
return true;
}
static boolean setSuperscript(EditText etBody, int start, int end) {
static boolean setSuperscript(EditText etBody, int start, int end, boolean select) {
Log.breadcrumb("style", "action", "superscript");
boolean has = false;
@ -768,18 +936,16 @@ public class StyleHelper {
has = true;
}
if (!has) {
if (!has)
edit.setSpan(new SuperscriptSpanEx(), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
edit.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_SMALL), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
etBody.setText(edit);
etBody.setSelection(start, end);
etBody.setSelection(select ? start : end, end);
return true;
}
static boolean setStrikeThrough(EditText etBody, int start, int end) {
static boolean setStrikeThrough(EditText etBody, int start, int end, boolean select) {
Log.breadcrumb("style", "action", "strike");
boolean has = false;
@ -799,7 +965,7 @@ public class StyleHelper {
edit.setSpan(new StrikethroughSpan(), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
etBody.setText(edit);
etBody.setSelection(start, end);
etBody.setSelection(select ? start : end, end);
return true;
}

@ -22,7 +22,7 @@
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/block_bar"
app:layout_constraintBottom_toTopOf="@+id/style_bar"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
@ -581,31 +581,294 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<com.google.android.material.bottomnavigation.BottomNavigationView
<HorizontalScrollView
android:id="@+id/style_bar"
android:layout_width="0dp"
android:layout_height="36dp"
android:background="?attr/colorActionBackground"
app:itemIconTint="@color/action_foreground"
app:itemTextColor="@color/action_foreground"
app:labelVisibilityMode="unlabeled"
app:layout_constraintBottom_toTopOf="@+id/block_bar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:menu="@menu/action_compose_style" />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/block_bar"
android:layout_width="0dp"
android:layout_height="36dp"
android:layout_height="wrap_content"
android:background="?attr/colorActionBackground"
app:itemIconTint="@color/action_foreground"
app:itemTextColor="@color/action_foreground"
app:labelVisibilityMode="unlabeled"
android:scrollbars="none"
app:layout_constraintBottom_toTopOf="@+id/media_bar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:menu="@menu/action_compose_paragraph" />
app:layout_constraintStart_toStartOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<ImageButton
android:id="@+id/menu_bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_bold"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_format_bold_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_italic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_italic"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_italic"
app:layout_constraintStart_toEndOf="@id/menu_bold"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_format_italic_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_underline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_underline"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_underline"
app:layout_constraintStart_toEndOf="@id/menu_italic"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_format_underlined_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_size"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_size"
app:layout_constraintStart_toEndOf="@id/menu_underline"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_format_size_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_background"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_background"
app:layout_constraintStart_toEndOf="@id/menu_style_size"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_format_paint_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_color"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_color"
app:layout_constraintStart_toEndOf="@id/menu_style_background"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_palette_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_font"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_font"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_font"
app:layout_constraintStart_toEndOf="@id/menu_style_color"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_text_format_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_align"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_align"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_align"
app:layout_constraintStart_toEndOf="@id/menu_style_font"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_format_align_center_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_list"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_list"
app:layout_constraintStart_toEndOf="@id/menu_style_align"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_format_list_bulleted_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_indentation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_indentation"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_indentation"
app:layout_constraintStart_toEndOf="@id/menu_style_list"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_format_indent_increase_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_blockquote"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_blockquote"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_blockquote"
app:layout_constraintStart_toEndOf="@id/menu_style_indentation"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_format_quote_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_mark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_mark"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_mark"
app:layout_constraintStart_toEndOf="@id/menu_style_blockquote"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_border_color_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_subscript"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_subscript"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_subscript"
app:layout_constraintStart_toEndOf="@id/menu_style_mark"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_subscript_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_superscript"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_superscript"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_superscript"
app:layout_constraintStart_toEndOf="@id/menu_style_subscript"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_superscript_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_strikethrough"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_strikethrough"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_strikethrough"
app:layout_constraintStart_toEndOf="@id/menu_style_superscript"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_format_strikethrough_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_protect"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_protect"
app:layout_constraintStart_toEndOf="@id/menu_style_strikethrough"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_lock_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_code"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_code"
app:layout_constraintStart_toEndOf="@id/menu_style_password"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_code_24"
app:tint="@color/action_foreground" />
<ImageButton
android:id="@+id/menu_style_clear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_style_clear"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_style_clear"
app:layout_constraintStart_toEndOf="@id/menu_style_code"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_format_clear_24"
app:tint="@color/action_foreground" />
</androidx.constraintlayout.widget.ConstraintLayout>
</HorizontalScrollView>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/media_bar"

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_alignment"
android:icon="@drawable/twotone_format_align_center_24"
android:title="@string/title_style_align" />
<item
android:id="@+id/menu_list"
android:icon="@drawable/twotone_format_list_bulleted_24"
android:title="@string/title_style_list" />
<item
android:id="@+id/menu_indentation"
android:icon="@drawable/twotone_format_indent_increase_24"
android:title="@string/title_style_indentation" />
<item
android:id="@+id/menu_blockquote"
android:icon="@drawable/twotone_format_quote_24"
android:title="@string/title_style_blockquote" />
</menu>

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_bold"
android:icon="@drawable/twotone_format_bold_24"
android:title="@string/title_style_bold" />
<item
android:id="@+id/menu_italic"
android:icon="@drawable/twotone_format_italic_24"
android:title="@string/title_style_italic" />
<item
android:id="@+id/menu_underline"
android:icon="@drawable/twotone_format_underlined_24"
android:title="@string/title_style_underline" />
<item
android:id="@+id/menu_style"
android:icon="@drawable/twotone_text_format_24_options"
android:title="@string/title_style" />
</menu>

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_bold"
android:icon="@drawable/twotone_format_bold_24"
android:title="@string/title_style_bold" />
<item
android:id="@+id/menu_italic"
android:icon="@drawable/twotone_format_italic_24"
android:title="@string/title_style_italic" />
<item
android:id="@+id/menu_underline"
android:icon="@drawable/twotone_format_underlined_24"
android:title="@string/title_style_underline" />
<item
android:id="@+id/menu_style"
android:icon="@drawable/twotone_text_format_24_options"
android:title="@string/title_style" />
<item
android:id="@+id/menu_link"
android:icon="@drawable/twotone_insert_link_45_24"
android:title="@string/title_style_link" />
</menu>

@ -51,14 +51,6 @@
android:title="@string/title_image_dialog"
app:showAsAction="never" />
<item
android:id="@+id/menu_block"
android:checkable="true"
android:checked="false"
android:icon="@drawable/twotone_format_list_bulleted_24"
android:title="@string/title_block_toolbar"
app:showAsAction="never" />
<item
android:id="@+id/menu_media"
android:checkable="true"

@ -1498,7 +1498,6 @@
<string name="title_save_drafts">Save drafts on the server</string>
<string name="title_send_dialog">Show send options</string>
<string name="title_image_dialog">Show image options</string>
<string name="title_block_toolbar">Block toolbar</string>
<string name="title_media_toolbar">Media toolbar</string>
<string name="title_manage_local_contacts">Manage local contacts</string>
<string name="title_insert_contact_group">Insert contact group</string>

Loading…
Cancel
Save