android/Bootstrap/Makefile.shared | 5 android/experimental/LOAndroid3/res/layout/about.xml | 47 ++++++ android/experimental/LOAndroid3/res/menu/main.xml | 8 - android/experimental/LOAndroid3/res/values/strings.xml | 8 - android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java | 72 +++++++--- solenv/bin/native-code.py | 1 6 files changed, 118 insertions(+), 23 deletions(-)
New commits: commit 614d94a515248b37045e27271c2d39bbe5b8fe3a Author: Tomaž Vajngerl <tomaz.vajng...@collabora.com> Date: Tue Sep 30 13:11:19 2014 +0200 android: about dialog in properties Change-Id: I82961efee6415f07248c79062f2b3b8c58266821 diff --git a/android/experimental/LOAndroid3/res/layout/about.xml b/android/experimental/LOAndroid3/res/layout/about.xml new file mode 100644 index 0000000..f1222dc --- /dev/null +++ b/android/experimental/LOAndroid3/res/layout/about.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:padding="20dip"> + + <TextView + android:id="@+id/about_description" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/app_description" + android:textColor="@android:color/secondary_text_light" + android:textSize="16sp"/> + + <TextView + android:id="@+id/about_credits" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:autoLink="web" + android:paddingTop="20dip" + android:text="@string/app_credits" + android:textColor="@android:color/secondary_text_light" + android:textSize="16dip"/> + + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + + <Button + android:id="@+id/about_license_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="License" + /> + + <Button + android:id="@+id/about_notice_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Notice" + /> + </LinearLayout> + +</LinearLayout> \ No newline at end of file diff --git a/android/experimental/LOAndroid3/res/menu/main.xml b/android/experimental/LOAndroid3/res/menu/main.xml index d51872b..cdf83bb 100644 --- a/android/experimental/LOAndroid3/res/menu/main.xml +++ b/android/experimental/LOAndroid3/res/menu/main.xml @@ -3,11 +3,11 @@ xmlns:tools="http://schemas.android.com/tools" tools:context="org.libreoffice.MainActivity"> - <item android:id="@+id/action_settings" - android:title="@string/action_settings" + <item android:id="@+id/action_about" + android:title="@string/action_about" android:orderInCategory="100" /> - <item android:id="@+id/action_list" - android:title="@string/action_list" + <item android:id="@+id/action_parts" + android:title="@string/action_parts" android:orderInCategory="100" /> </menu> diff --git a/android/experimental/LOAndroid3/res/values/strings.xml b/android/experimental/LOAndroid3/res/values/strings.xml index d69b331..74dee00 100644 --- a/android/experimental/LOAndroid3/res/values/strings.xml +++ b/android/experimental/LOAndroid3/res/values/strings.xml @@ -2,8 +2,9 @@ <resources> <string name="app_name">LibreOffice</string> - <string name="action_settings">Settings</string> - <string name="action_list">Parts</string> + <string name="app_description">Description</string> + <string name="app_credits">Credits</string> + <string name="browser_app_name">LibreOfficeUI</string> <string name="menu_search">Search</string> <string name="list_view">List</string> @@ -16,4 +17,7 @@ <string name="EXPLORER_VIEW_TYPE_KEY">EXPLORER_VIEW_TYPE</string> <string name="CURRENT_DIRECTORY_KEY">CURRENT_DIRECTORY</string> + <string name="action_about">About</string> + <string name="action_parts">Parts</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 b6b892a..cc86e0b 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java @@ -1,6 +1,9 @@ package org.libreoffice; import android.app.Activity; +import android.app.AlertDialog; +import android.content.Intent; +import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.support.v4.widget.DrawerLayout; @@ -10,8 +13,10 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; +import android.widget.Button; import android.widget.ListView; import android.widget.RelativeLayout; +import android.widget.TextView; import org.mozilla.gecko.ZoomConstraints; import org.mozilla.gecko.gfx.GeckoLayerClient; @@ -23,7 +28,7 @@ import java.util.List; public class LibreOfficeMainActivity extends Activity { private static final String LOGTAG = "LibreOfficeMainActivity"; - private static final String DEFAULT_DOC_PATH = "/assets/test1.odt"; + private static final String DEFAULT_DOC_PATH = "/assets/example.odt"; public static LibreOfficeMainActivity mAppContext; @@ -38,6 +43,7 @@ public class LibreOfficeMainActivity extends Activity { private ListView mDrawerList; private List<DocumentPartView> mDocumentPartView = new ArrayList<DocumentPartView>(); private DocumentPartViewListAdpater mDocumentPartViewListAdpater; + private String mInputFile; public static GeckoLayerClient getLayerClient() { return mLayerClient; @@ -56,11 +62,9 @@ public class LibreOfficeMainActivity extends Activity { @Override public boolean onOptionsItemSelected(MenuItem item) { - // Handle action bar item clicks here. The action bar will - // automatically handle clicks on the Home/Up button, so long - // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); - if (id == R.id.action_settings) { + if (id == R.id.action_about) { + showAbout(); return true; } return super.onOptionsItemSelected(item); @@ -69,8 +73,8 @@ public class LibreOfficeMainActivity extends Activity { @Override public boolean onPrepareOptionsMenu(Menu menu) { // If the nav drawer is open, hide action items related to the content view - boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList); - menu.findItem(R.id.action_list).setVisible(!drawerOpen); + boolean isDrawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList); + menu.findItem(R.id.action_parts).setVisible(!isDrawerOpen); return super.onPrepareOptionsMenu(menu); } @@ -82,17 +86,16 @@ public class LibreOfficeMainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { + Log.w(LOGTAG, "onCreate.."); mAppContext = this; super.onCreate(savedInstanceState); mMainHandler = new Handler(); - String inputFile; - if (getIntent().getData() != null) { - inputFile = getIntent().getData().getEncodedPath(); + mInputFile = getIntent().getData().getEncodedPath(); } else { - inputFile = DEFAULT_DOC_PATH; + mInputFile = DEFAULT_DOC_PATH; } setContentView(R.layout.activity_main); @@ -124,15 +127,13 @@ public class LibreOfficeMainActivity extends Activity { mLayerController.setLayerClient(mLayerClient); mGeckoLayout.addView(mLayerController.getView(), 0); - LOKitShell.sendEvent(LOEvent.load(inputFile)); - - Log.w(LOGTAG, "UI almost up"); + LOKitShell.sendEvent(LOEvent.load(mInputFile)); } @Override protected void onResume() { - Log.i(LOGTAG, "Resume.."); super.onResume(); + Log.i(LOGTAG, "onResume.."); } @Override @@ -153,6 +154,47 @@ public class LibreOfficeMainActivity extends Activity { return mDocumentPartViewListAdpater; } + private void showAbout() { + // Inflate the about message contents + View messageView = getLayoutInflater().inflate(R.layout.about, null, false); + + // When linking text, force to always use default color. This works + // around a pressed color state bug. + TextView textView = (TextView) messageView.findViewById(R.id.about_credits); + int defaultColor = textView.getTextColors().getDefaultColor(); + textView.setTextColor(defaultColor); + + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setIcon(R.drawable.lo_icon); + builder.setTitle(R.string.app_name); + builder.setView(messageView); + builder.create(); + builder.show(); + + Button licenseButton = (Button) messageView.findViewById(R.id.about_license_button); + licenseButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(view.getContext(), LibreOfficeMainActivity.class); + //intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + intent.setData(Uri.parse("file:///assets/license.txt")); + startActivity(intent); + } + }); + + Button noticeButton = (Button) messageView.findViewById(R.id.about_notice_button); + noticeButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(view.getContext(), LibreOfficeMainActivity.class); + //intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + intent.setData(Uri.parse("file:///assets/notice.txt")); + startActivity(intent); + } + }); + + } + private class DocumentPartClickListener implements android.widget.AdapterView.OnItemClickListener { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { commit 7b9b64d0f12d1d37368419b368394824005448a2 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.com> Date: Tue Sep 30 13:04:02 2014 +0200 android: add library for text filter (to read text files) Change-Id: Ie63f058463e681b0b4adedc5f0cbc5b0a703601a diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index f67d030..28bbf2b 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -157,6 +157,7 @@ writer_factory_list = [ ("libswdlo.a", "swd_component_getFactory"), ("libswlo.a", "sw_component_getFactory"), ("libwriterfilterlo.a", "writerfilter_component_getFactory"), + ("libtextfdlo.a", "textfd_component_getFactory"), ] writer_constructor_list = [ commit 4181f24eb5c3115975a031114611f3228ad64bbb Author: Tomaž Vajngerl <tomaz.vajng...@collabora.com> Date: Tue Sep 30 13:00:07 2014 +0200 android: copy notice & license into assets (for apk) Change-Id: Ic2289d5ca96d06352c853d7803938a12aa204e73 diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared index a337a80..7095530 100644 --- a/android/Bootstrap/Makefile.shared +++ b/android/Bootstrap/Makefile.shared @@ -130,8 +130,9 @@ copy-stuff: for F in program/services/services ure/share/misc/services; do \ sed -e 's!uri="vnd.sun.star.expand:$$LO_LIB_DIR/!uri="file://$$APP_DATA_DIR/lib/!g' <$(INSTDIR)/$$F.rdb >assets/$$F.rdb; \ done - cp $(SRC_ROOT)/odk/examples/java/DocumentHandling/test/test1.odt \ - assets + cp $(SRC_ROOT)/odk/examples/java/DocumentHandling/test/test1.odt assets/example.odt + cp $(SRC_ROOT)/readlicense_oo/license/LICENSE assets/license.txt + cp $(SRC_ROOT)/readlicense_oo/license/NOTICE assets/notice.txt cp $(WORKDIR)/ComponentTarget/i18npool/util/i18npool.component assets/ComponentTarget/i18npool/util # mkdir -p assets/share/config
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits