From bcc3163a4a028526cd1dad86cc7a452d952d704f Mon Sep 17 00:00:00 2001
From: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Date: Wed, 11 Mar 2015 17:23:25 +0900
Subject: android: add bold selection to toolbar (experimental)

Change-Id: Ie9fa613659db9dcc174851d7c02587bef6b67cef
---
 android/experimental/LOAndroid3/res/menu/main.xml                  | 7 +++++++
 android/experimental/LOAndroid3/res/values/strings.xml             | 1 +
 .../src/java/org/libreoffice/LibreOfficeMainActivity.java          | 4 ++++
 3 files changed, 12 insertions(+)

(limited to 'android')

diff --git a/android/experimental/LOAndroid3/res/menu/main.xml b/android/experimental/LOAndroid3/res/menu/main.xml
index cdf83bbac6a6..52f4ebc40c9a 100644
--- a/android/experimental/LOAndroid3/res/menu/main.xml
+++ b/android/experimental/LOAndroid3/res/menu/main.xml
@@ -3,6 +3,13 @@
     xmlns:tools="http://schemas.android.com/tools"
     tools:context="org.libreoffice.MainActivity">
 
+
+    <item android:id="@+id/action_bold"
+          android:title="@string/action_bold"
+          android:icon="@drawable/ic_format_bold_grey600_24dp"
+          android:orderInCategory="100"
+          app:showAsAction="always"/>
+
     <item android:id="@+id/action_about"
         android:title="@string/action_about"
         android:orderInCategory="100" />
diff --git a/android/experimental/LOAndroid3/res/values/strings.xml b/android/experimental/LOAndroid3/res/values/strings.xml
index 5e5e80ea628a..e2c6ffc69698 100644
--- a/android/experimental/LOAndroid3/res/values/strings.xml
+++ b/android/experimental/LOAndroid3/res/values/strings.xml
@@ -34,5 +34,6 @@
     <!-- Document provider names -->
     <string name="local_documents">Local documents</string>
     <string name="local_file_system">Local file system</string>
+    <string name="action_bold">Bold</string>
 
 </resources>
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
index 4695b1b4dc6c..c0e481071ac0 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -18,6 +18,7 @@ import android.view.inputmethod.InputMethodManager;
 import android.widget.AdapterView;
 import android.widget.ListView;
 import android.widget.RelativeLayout;
+import android.widget.Toast;
 
 import org.mozilla.gecko.TextSelection;
 import org.mozilla.gecko.ZoomConstraints;
@@ -75,6 +76,9 @@ public class LibreOfficeMainActivity extends ActionBarActivity {
     public boolean onOptionsItemSelected(MenuItem item) {
         int id = item.getItemId();
         switch (id) {
+            case R.id.action_bold:
+                Toast.makeText(this,"set text to bold", Toast.LENGTH_LONG).show();
+                return true;
             case R.id.action_about:
                 mAbout.showAbout();
                 return true;
-- 
cgit