From 382f9f744652d6ae1482910ec62513d6ea94863c Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sun, 19 Mar 2017 23:16:02 +0100 Subject: tdf#106317 bottom tabbar, grow/shrink font, insert line,rect - added some initial implementation of the bottom tab-bar, which has 3 tabs - character, paragraph, insert - insert has not (completely) working insert line and rect shapes - add ability to shring/grow font as alternative to select its size Change-Id: If039f985403a8155d1e011953043f2979b4bfa91 --- android/source/res/drawable/ic_grow.xml | 16 + android/source/res/drawable/ic_line.xml | 12 + android/source/res/drawable/ic_rect.xml | 13 + android/source/res/drawable/ic_shrink.xml | 16 + android/source/res/layout/toolbar_bottom.xml | 451 +++++++++++++-------- android/source/res/values/dimens.xml | 1 + .../java/org/libreoffice/FormattingController.java | 19 +- .../org/libreoffice/LibreOfficeMainActivity.java | 20 + 8 files changed, 386 insertions(+), 162 deletions(-) create mode 100644 android/source/res/drawable/ic_grow.xml create mode 100644 android/source/res/drawable/ic_line.xml create mode 100644 android/source/res/drawable/ic_rect.xml create mode 100644 android/source/res/drawable/ic_shrink.xml (limited to 'android') diff --git a/android/source/res/drawable/ic_grow.xml b/android/source/res/drawable/ic_grow.xml new file mode 100644 index 000000000000..fd169434d7ea --- /dev/null +++ b/android/source/res/drawable/ic_grow.xml @@ -0,0 +1,16 @@ + + + + diff --git a/android/source/res/drawable/ic_line.xml b/android/source/res/drawable/ic_line.xml new file mode 100644 index 000000000000..639ba2dbf690 --- /dev/null +++ b/android/source/res/drawable/ic_line.xml @@ -0,0 +1,12 @@ + + + diff --git a/android/source/res/drawable/ic_rect.xml b/android/source/res/drawable/ic_rect.xml new file mode 100644 index 000000000000..241759ff00c3 --- /dev/null +++ b/android/source/res/drawable/ic_rect.xml @@ -0,0 +1,13 @@ + + + diff --git a/android/source/res/drawable/ic_shrink.xml b/android/source/res/drawable/ic_shrink.xml new file mode 100644 index 000000000000..db0348437f16 --- /dev/null +++ b/android/source/res/drawable/ic_shrink.xml @@ -0,0 +1,16 @@ + + + + diff --git a/android/source/res/layout/toolbar_bottom.xml b/android/source/res/layout/toolbar_bottom.xml index dc17a721ac2e..15ff06886efe 100644 --- a/android/source/res/layout/toolbar_bottom.xml +++ b/android/source/res/layout/toolbar_bottom.xml @@ -1,191 +1,320 @@ - - + + + android:layout_height="match_parent"> - - - - - - - - - - - - + android:layout_height="match_parent" + android:orientation="vertical"> - + - - - - - - - - - - + - + - + + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + diff --git a/android/source/res/values/dimens.xml b/android/source/res/values/dimens.xml index 7c48f2bc14f3..3de476c0cc42 100644 --- a/android/source/res/values/dimens.xml +++ b/android/source/res/values/dimens.xml @@ -8,4 +8,5 @@ 8dp 8dp 32dp + 256dp diff --git a/android/source/src/java/org/libreoffice/FormattingController.java b/android/source/src/java/org/libreoffice/FormattingController.java index ea8b6fb54e85..cecb0dd469e4 100644 --- a/android/source/src/java/org/libreoffice/FormattingController.java +++ b/android/source/src/java/org/libreoffice/FormattingController.java @@ -15,7 +15,6 @@ import org.libreoffice.kit.Document; mContext = context; mContext.findViewById(R.id.button_insertFormatListBullets).setOnClickListener(this); - mContext.findViewById(R.id.button_insertFormatListNumbering).setOnClickListener(this); mContext.findViewById(R.id.button_bold).setOnClickListener(this); @@ -27,6 +26,12 @@ import org.libreoffice.kit.Document; mContext.findViewById(R.id.button_align_center).setOnClickListener(this); mContext.findViewById(R.id.button_align_right).setOnClickListener(this); mContext.findViewById(R.id.button_align_justify).setOnClickListener(this); + + mContext.findViewById(R.id.button_insert_line).setOnClickListener(this); + mContext.findViewById(R.id.button_insert_rect).setOnClickListener(this); + + mContext.findViewById(R.id.button_font_shrink).setOnClickListener(this); + mContext.findViewById(R.id.button_font_grow).setOnClickListener(this); } @Override @@ -73,6 +78,18 @@ import org.libreoffice.kit.Document; case R.id.button_align_justify: LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:JustifyPara")); break; + case R.id.button_insert_line: + LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:Line")); + break; + case R.id.button_insert_rect: + LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:Rect")); + break; + case R.id.button_font_shrink: + LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:Shrink")); + break; + case R.id.button_font_grow: + LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:Grow")); + break; } } diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java index d88e7eabe270..02129e50a7e8 100755 --- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java +++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java @@ -23,6 +23,7 @@ import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.ListView; +import android.widget.TabHost; import android.widget.Toast; import org.libreoffice.overlay.DocumentOverlay; @@ -95,6 +96,7 @@ public class LibreOfficeMainActivity extends AppCompatActivity { private boolean isFormattingToolbarOpen = false; private boolean isSearchToolbarOpen = false; private boolean isDocumentChanged = false; + @Override public void onCreate(Bundle savedInstanceState) { Log.w(LOGTAG, "onCreate.."); @@ -185,6 +187,24 @@ public class LibreOfficeMainActivity extends AppCompatActivity { mDocumentOverlay = new DocumentOverlay(this, layerView); mToolbarController.setupToolbars(); + + TabHost host = (TabHost) findViewById(R.id.toolbarTabHost); + host.setup(); + + TabHost.TabSpec spec = host.newTabSpec("Character"); + spec.setContent(R.id.tab_character); + spec.setIndicator("Character"); + host.addTab(spec); + + spec = host.newTabSpec("Paragraph"); + spec.setContent(R.id.tab_paragraph); + spec.setIndicator("Paragraph"); + host.addTab(spec); + + spec = host.newTabSpec("Insert"); + spec.setContent(R.id.tab_insert); + spec.setIndicator("Insert"); + host.addTab(spec); } public RectF getCurrentCursorPosition() { -- cgit