android/source/res/drawable/ic_decrementindent.xml                |    9 ++++
 android/source/res/drawable/ic_incrementindent.xml                |    9 ++++
 android/source/res/layout/toolbar_bottom.xml                      |   21 
++++++++++
 android/source/src/java/org/libreoffice/FormattingController.java |    6 ++
 4 files changed, 45 insertions(+)

New commits:
commit cfc73f3373f49770b859bc68cbf6bd987342f9ad
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Dec 23 23:20:26 2022 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Dec 23 23:24:03 2022 +0000

    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 <m.wegh...@posteo.de>

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 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android";
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="m3,3v2h26v-2zM10.5,9c-0.239,0.029 -0.362,0.145 
-0.518,0.328l-6.615,5.896a1,1 0,0 1,-0.002 0.002l-0.002,0.002a1,1 0,0 0,-0.064 
0.059c-0.001,0.001 -0.003,0.003 -0.004,0.004a1,1 0,0 0,-0.057 
0.061c-0.002,0.002 -0.004,0.005 -0.006,0.008a1,1 0,0 0,-0.049 
0.063c-0.002,0.003 -0.004,0.005 -0.006,0.008a1,1 0,0 0,-0.041 
0.066c-0.002,0.003 -0.002,0.007 -0.004,0.01a1,1 0,0 0,-0.037 0.068c-0.002,0.004 
-0.004,0.008 -0.006,0.012a1,1 0,0 0,-0.018 0.043,1 1,0 0,0 -0.021,0.061 1,1 0,0 
0,-0.016 0.049c-0.001,0.004 -0.001,0.008 -0.002,0.012 -0.006,0.023 -0.011,0.046 
-0.016,0.07a1,1 0,0 0,-0.002 0.004c-0.004,0.024 -0.007,0.049 -0.01,0.074a1,1 
0,0 0,-0.006 0.102c-0,0.178 0.048,0.35 0.135,0.5 0.059,0.102 0.135,0.195 
0.229,0.271l0.002,0.002 0.002,0.002 6.615,5.896c0.156,0.183 0.279,0.299 
0.518,0.328h1.5v-7,-7zM14,9v2h15v-2zM14,15v2h15v-2zM14,21v2h15v-2zM3,27v2h20v-2z"
+      android:fillColor="#2e3436"/>
+</vector>
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 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android";
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="m3,3v2h26v-2zM3,9v7,7h1.5c0.239,-0.029 0.362,-0.145 
0.518,-0.328l6.615,-5.896 0.002,-0.002 0.002,-0.002c0.093,-0.077 0.17,-0.169 
0.229,-0.271 0.087,-0.15 0.135,-0.322 0.135,-0.5a1,1 0,0 0,-0.006 
-0.102c-0.003,-0.025 -0.005,-0.05 -0.01,-0.074a1,1 0,0 0,-0.002 
-0.004c-0.004,-0.024 -0.01,-0.047 -0.016,-0.07 -0.001,-0.004 -0.001,-0.008 
-0.002,-0.012a1,1 0,0 0,-0.016 -0.049,1 1,0 0,0 -0.021,-0.061 1,1 0,0 0,-0.018 
-0.043c-0.002,-0.004 -0.004,-0.008 -0.006,-0.012a1,1 0,0 0,-0.037 
-0.068c-0.002,-0.003 -0.002,-0.007 -0.004,-0.01a1,1 0,0 0,-0.041 
-0.066c-0.002,-0.003 -0.004,-0.005 -0.006,-0.008a1,1 0,0 0,-0.049 
-0.063c-0.002,-0.003 -0.004,-0.005 -0.006,-0.008a1,1 0,0 0,-0.057 
-0.061c-0.001,-0.001 -0.003,-0.003 -0.004,-0.004a1,1 0,0 0,-0.064 
-0.059c-0.001,-0.001 -0.001,-0.001 -0.002,-0.002a1,1 0,0 0,-0.002 
-0.002l-6.615,-5.896c-0.156,-0.183 -0.279,-0.299 
-0.518,-0.328zM14,9v2h15v-2zM14,15v2h15v-2zM14,21v2h15v-2zM3,27v2h20v-2z"
+      android:fillColor="#2e3436"/>
+</vector>
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" />
+
+                                    <ImageButton
+                                        android:id="@+id/button_increaseIndent"
+                                        android:layout_width="0dp"
+                                        android:layout_height="wrap_content"
+                                        android:layout_weight="0.25"
+                                        
android:background="@drawable/image_button_background"
+                                        android:paddingBottom="12dp"
+                                        android:paddingTop="12dp"
+                                        
android:src="@drawable/ic_incrementindent" />
+
+                                    <ImageButton
+                                        android:id="@+id/button_decreaseIndent"
+                                        android:layout_width="0dp"
+                                        android:layout_height="wrap_content"
+                                        android:layout_weight="0.25"
+                                        
android:background="@drawable/image_button_background"
+                                        android:paddingBottom="12dp"
+                                        android:paddingTop="12dp"
+                                        
android:src="@drawable/ic_decrementindent" />
+
                                 </LinearLayout>
 
                             </LinearLayout>
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) {

Reply via email to