From cfc73f3373f49770b859bc68cbf6bd987342f9ad Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Fri, 23 Dec 2022 23:20:26 +0100 Subject: android: Add buttons to increase/decrease indent This adds two buttons to the formatting toolbar to increase/decrease the indent, using the corresponding UNO commands. These can be used when the experimental editing mode for Android Viewer is enabled. The drawable resources were created using the corresponding sifr_svg icons (incrementindent.svg, decrementindent.svg). Change-Id: Id8f0fc9a5ea686b474ec9a4b4dcdf23407e9ac98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144789 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- android/source/res/drawable/ic_decrementindent.xml | 9 +++++++++ android/source/res/drawable/ic_incrementindent.xml | 9 +++++++++ android/source/res/layout/toolbar_bottom.xml | 21 +++++++++++++++++++++ .../java/org/libreoffice/FormattingController.java | 6 ++++++ 4 files changed, 45 insertions(+) create mode 100644 android/source/res/drawable/ic_decrementindent.xml create mode 100644 android/source/res/drawable/ic_incrementindent.xml diff --git a/android/source/res/drawable/ic_decrementindent.xml b/android/source/res/drawable/ic_decrementindent.xml new file mode 100644 index 000000000000..e67a75ad1873 --- /dev/null +++ b/android/source/res/drawable/ic_decrementindent.xml @@ -0,0 +1,9 @@ + + + diff --git a/android/source/res/drawable/ic_incrementindent.xml b/android/source/res/drawable/ic_incrementindent.xml new file mode 100644 index 000000000000..3d8e948488c9 --- /dev/null +++ b/android/source/res/drawable/ic_incrementindent.xml @@ -0,0 +1,9 @@ + + + diff --git a/android/source/res/layout/toolbar_bottom.xml b/android/source/res/layout/toolbar_bottom.xml index 7d420f35cbca..8ac99a28650d 100644 --- a/android/source/res/layout/toolbar_bottom.xml +++ b/android/source/res/layout/toolbar_bottom.xml @@ -269,6 +269,27 @@ android:paddingBottom="12dp" android:paddingTop="12dp" android:src="@drawable/ic_format_bullets" /> + + + + + diff --git a/android/source/src/java/org/libreoffice/FormattingController.java b/android/source/src/java/org/libreoffice/FormattingController.java index 49cffabf72d8..49e81eb69784 100644 --- a/android/source/src/java/org/libreoffice/FormattingController.java +++ b/android/source/src/java/org/libreoffice/FormattingController.java @@ -48,6 +48,8 @@ class FormattingController implements View.OnClickListener { mContext.findViewById(R.id.button_insertFormatListBullets).setOnClickListener(this); mContext.findViewById(R.id.button_insertFormatListNumbering).setOnClickListener(this); + mContext.findViewById(R.id.button_increaseIndent).setOnClickListener(this); + mContext.findViewById(R.id.button_decreaseIndent).setOnClickListener(this); mContext.findViewById(R.id.button_bold).setOnClickListener(this); mContext.findViewById(R.id.button_italic).setOnClickListener(this); @@ -89,6 +91,10 @@ class FormattingController implements View.OnClickListener { LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:DefaultBullet")); } else if (buttonId == R.id.button_insertFormatListNumbering) { LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:DefaultNumbering")); + } else if (buttonId == R.id.button_increaseIndent) { + LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:IncrementIndent")); + } else if (buttonId == R.id.button_decreaseIndent) { + LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:DecrementIndent")); } else if (buttonId == R.id.button_bold) { LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:Bold")); } else if (buttonId == R.id.button_italic) { -- cgit