summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrainbreaker <gautamprajapati06@gmail.com>2017-03-28 01:02:29 +0530
committerTomaž Vajngerl <quikee@gmail.com>2017-03-30 20:16:06 +0000
commit72b9fe1d470ea0d22f433598b1d2f68d1be12057 (patch)
treed427326091715173b6057ae6ac7a00c41d7c5119
parentbb3715b6283f0d828be92065016d7b65d8671088 (diff)
Add superscript and subscript text formatting options
This commit adds superscript and subscript text formatting options in formatting toolbar Change-Id: Id6966eb11b71b269431a21f46bd7c597fdcdb08c Reviewed-on: https://gerrit.libreoffice.org/35778 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--android/source/res/drawable/ic_subscript.xml10
-rw-r--r--android/source/res/drawable/ic_superscript.xml20
-rw-r--r--android/source/res/layout/toolbar_bottom.xml22
-rw-r--r--android/source/src/java/org/libreoffice/FormattingController.java9
4 files changed, 60 insertions, 1 deletions
diff --git a/android/source/res/drawable/ic_subscript.xml b/android/source/res/drawable/ic_subscript.xml
new file mode 100644
index 000000000000..7a379cf5007f
--- /dev/null
+++ b/android/source/res/drawable/ic_subscript.xml
@@ -0,0 +1,10 @@
+<vector android:autoMirrored="true" android:height="24dp"
+ android:viewportHeight="24.0" android:viewportWidth="24.0"
+ android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillAlpha="1" android:fillColor="#1d99f3"
+ android:pathData="m16,15 l0,2 0,1 0,2 0,1 1,0 2,0c1.108,0 2,-0.892 2,-2 0,-0.811 -0.481,-1.502 -1.172,-1.816 0.106,-0.206 0.172,-0.435 0.172,-0.684 0,-0.831 -0.669,-1.5 -1.5,-1.5l-1.5,0 -1,0zM17,16 L18.5,16c0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5l-1.5,0 0,-1zM17,18 L18.5,18 19,18c0.554,0 1,0.446 1,1 0,0.554 -0.446,1 -1,1l-2,0 0,-2z"
+ android:strokeAlpha="1" android:strokeColor="#00000000"
+ android:strokeLineCap="butt" android:strokeLineJoin="miter" android:strokeWidth="1"/>
+ <path android:fillAlpha="1" android:fillColor="#4d4d4d"
+ android:pathData="m10.91,5 l-3.314,9.594 -0.123,0.406 -1.473,4 1.658,0 1.625,-4.438c-0.004,-0.001 7.111,0.004 7.111,0.004l-3.305,-9.566 -0.215,0 -1.75,0zM12.016,6.938 L14.195,13.281 9.805,13.281z" android:strokeColor="#00000000"/>
+</vector>
diff --git a/android/source/res/drawable/ic_superscript.xml b/android/source/res/drawable/ic_superscript.xml
new file mode 100644
index 000000000000..aa18a305d2cb
--- /dev/null
+++ b/android/source/res/drawable/ic_superscript.xml
@@ -0,0 +1,20 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:pathData="m16,3 l0,2 0,1 0,2 0,1 1,0 2,0c1.108,0 2,-0.892 2,-2 0,-0.811 -0.481,-1.502 -1.172,-1.816 0.106,-0.206 0.172,-0.435 0.172,-0.684 0,-0.831 -0.669,-1.5 -1.5,-1.5l-1.5,0 -1,0zM17,4 L18.5,4c0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5l-1.5,0 0,-1zM17,6 L18.5,6 19,6c0.554,0 1,0.446 1,1 0,0.554 -0.446,1 -1,1l-2,0 0,-2z"
+ android:strokeLineCap="butt"
+ android:fillAlpha="1"
+ android:strokeColor="#00000000"
+ android:fillColor="#1d99f3"
+ android:strokeWidth="1"
+ android:strokeLineJoin="miter"
+ android:strokeAlpha="1"/>
+ <path
+ android:pathData="m10.911,5 l-3.315,9.594 -0.123,0.406 -1.473,4 1.657,0 1.627,-4.438 5.432,0 1.627,4.438 1.657,0 -1.473,-4 -0.123,-0.406 -3.315,-9.594 -0.215,0 -1.749,0 -0.215,0zM12.015,6.938 L14.194,13.281 9.806,13.281 12.015,6.938z"
+ android:fillAlpha="1"
+ android:strokeColor="#00000000"
+ android:fillColor="#4d4d4d"/>
+</vector>
diff --git a/android/source/res/layout/toolbar_bottom.xml b/android/source/res/layout/toolbar_bottom.xml
index 15ff06886efe..c412678f7817 100644
--- a/android/source/res/layout/toolbar_bottom.xml
+++ b/android/source/res/layout/toolbar_bottom.xml
@@ -121,7 +121,7 @@
android:id="@+id/font_size_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_weight="0.80"
+ android:layout_weight="0.60"
android:minHeight="50dip" />
<ImageButton
@@ -144,6 +144,26 @@
android:paddingTop="12dp"
android:src="@drawable/ic_grow" />
+ <ImageButton
+ android:id="@+id/button_subscript"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="0.10"
+ android:background="@drawable/image_button_background"
+ android:paddingBottom="12dp"
+ android:paddingTop="12dp"
+ android:src="@drawable/ic_subscript" />
+
+ <ImageButton
+ android:id="@+id/button_superscript"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="0.10"
+ android:background="@drawable/image_button_background"
+ android:paddingBottom="12dp"
+ android:paddingTop="12dp"
+ android:src="@drawable/ic_superscript" />
+
</LinearLayout>
</LinearLayout>
</ScrollView>
diff --git a/android/source/src/java/org/libreoffice/FormattingController.java b/android/source/src/java/org/libreoffice/FormattingController.java
index cecb0dd469e4..b7e5398963dc 100644
--- a/android/source/src/java/org/libreoffice/FormattingController.java
+++ b/android/source/src/java/org/libreoffice/FormattingController.java
@@ -32,6 +32,9 @@ import org.libreoffice.kit.Document;
mContext.findViewById(R.id.button_font_shrink).setOnClickListener(this);
mContext.findViewById(R.id.button_font_grow).setOnClickListener(this);
+
+ mContext.findViewById(R.id.button_subscript).setOnClickListener(this);
+ mContext.findViewById(R.id.button_superscript).setOnClickListener(this);
}
@Override
@@ -90,6 +93,12 @@ import org.libreoffice.kit.Document;
case R.id.button_font_grow:
LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:Grow"));
break;
+ case R.id.button_subscript:
+ LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:SubScript"));
+ break;
+ case R.id.button_superscript:
+ LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:SuperScript"));
+ break;
}
}