[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/experimental

Jack Leigh jack.leigh at collabora.com
Wed Mar 25 01:26:58 PDT 2015


 android/experimental/LOAndroid3/res/layout/activity_document_browser.xml               |   36 ++++++++++
 android/experimental/LOAndroid3/res/layout/file_grid.xml                               |   20 +----
 android/experimental/LOAndroid3/res/layout/file_list.xml                               |   20 +----
 android/experimental/LOAndroid3/res/values-v21/themes.xml                              |   10 ++
 android/experimental/LOAndroid3/res/values/themes.xml                                  |    2 
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java |   12 ++-
 6 files changed, 64 insertions(+), 36 deletions(-)

New commits:
commit 291f766d1ab276d4ae8146e666b45bf3e3e8035d
Author: Jack Leigh <jack.leigh at collabora.com>
Date:   Fri Mar 20 16:14:19 2015 +0000

    android: Migrate to Toolbar in file browser
    
    Change-Id: Ib5e3d0d39268437c179973ba4e785a719cdc351a
    Reviewed-on: https://gerrit.libreoffice.org/14949
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/android/experimental/LOAndroid3/res/layout/activity_document_browser.xml b/android/experimental/LOAndroid3/res/layout/activity_document_browser.xml
new file mode 100644
index 0000000..f54591b
--- /dev/null
+++ b/android/experimental/LOAndroid3/res/layout/activity_document_browser.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ This file is part of the LibreOffice project.
+
+ This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ -->
+<android.support.v4.widget.DrawerLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/drawer_layout"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <!-- The content -->
+    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:id="@+id/browser_main_content"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical" >
+
+        <include layout="@layout/toolbar"/>
+
+    </LinearLayout>
+
+    <!-- The navigation drawer -->
+    <ListView android:id="@+id/left_drawer"
+        android:layout_width="240dp"
+        android:layout_height="match_parent"
+        android:layout_gravity="start"
+        android:choiceMode="singleChoice"
+        android:divider="@android:color/transparent"
+        android:dividerHeight="0dp"
+        android:background="#111"/>
+
+</android.support.v4.widget.DrawerLayout>
diff --git a/android/experimental/LOAndroid3/res/layout/file_grid.xml b/android/experimental/LOAndroid3/res/layout/file_grid.xml
index ec7fdd0..1885bd3 100644
--- a/android/experimental/LOAndroid3/res/layout/file_grid.xml
+++ b/android/experimental/LOAndroid3/res/layout/file_grid.xml
@@ -5,13 +5,11 @@
  License, v. 2.0. If a copy of the MPL was not distributed with this
  file, You can obtain one at http://mozilla.org/MPL/2.0/.
  -->
-<android.support.v4.widget.DrawerLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/drawer_layout"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:orientation="vertical" >
 
-    <!-- The main content view -->
     <GridView
         android:id="@+id/file_explorer_grid_view"
         android:layout_width="fill_parent"
@@ -24,14 +22,4 @@
         android:gravity="center">
     </GridView>
 
-    <!-- The navigation drawer -->
-    <ListView android:id="@+id/left_drawer"
-        android:layout_width="240dp"
-        android:layout_height="match_parent"
-        android:layout_gravity="start"
-        android:choiceMode="singleChoice"
-        android:divider="@android:color/transparent"
-        android:dividerHeight="0dp"
-        android:background="#111"/>
-
-</android.support.v4.widget.DrawerLayout>
+</LinearLayout>
diff --git a/android/experimental/LOAndroid3/res/layout/file_list.xml b/android/experimental/LOAndroid3/res/layout/file_list.xml
index dd5346f..48dfb1e 100644
--- a/android/experimental/LOAndroid3/res/layout/file_list.xml
+++ b/android/experimental/LOAndroid3/res/layout/file_list.xml
@@ -6,27 +6,15 @@
  License, v. 2.0. If a copy of the MPL was not distributed with this
  file, You can obtain one at http://mozilla.org/MPL/2.0/.
  -->
-<android.support.v4.widget.DrawerLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/drawer_layout"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:orientation="vertical" >
 
-    <!-- The main content view -->
     <ListView
         android:id="@+id/file_explorer_list_view"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent">
     </ListView>
 
-    <!-- The navigation drawer -->
-    <ListView android:id="@+id/left_drawer"
-        android:layout_width="240dp"
-        android:layout_height="match_parent"
-        android:layout_gravity="start"
-        android:choiceMode="singleChoice"
-        android:divider="@android:color/transparent"
-        android:dividerHeight="0dp"
-        android:background="#111"/>
-
-</android.support.v4.widget.DrawerLayout>
+</LinearLayout>
diff --git a/android/experimental/LOAndroid3/res/values-v21/themes.xml b/android/experimental/LOAndroid3/res/values-v21/themes.xml
index 917f41b..441ed82 100644
--- a/android/experimental/LOAndroid3/res/values-v21/themes.xml
+++ b/android/experimental/LOAndroid3/res/values-v21/themes.xml
@@ -7,4 +7,12 @@
         <item name="android:windowSharedElementEnterTransition">@android:transition/move</item>
         <item name="android:windowSharedElementExitTransition">@android:transition/move</item>
     </style>
-</resources>
\ No newline at end of file
+
+    <style name="BrowserTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
+        <item name="android:windowContentTransitions">true</item>
+        <item name="android:windowAllowEnterTransitionOverlap">true</item>
+        <item name="android:windowAllowReturnTransitionOverlap">true</item>
+        <item name="android:windowSharedElementEnterTransition">@android:transition/move</item>
+        <item name="android:windowSharedElementExitTransition">@android:transition/move</item>
+    </style>
+</resources>
diff --git a/android/experimental/LOAndroid3/res/values/themes.xml b/android/experimental/LOAndroid3/res/values/themes.xml
index 1468013..478aeb7e 100644
--- a/android/experimental/LOAndroid3/res/values/themes.xml
+++ b/android/experimental/LOAndroid3/res/values/themes.xml
@@ -7,6 +7,6 @@
         <item name="windowActionBar">false</item>
     </style>
 
-    <style name="BrowserTheme" parent="Theme.AppCompat.Light">
+    <style name="BrowserTheme" parent="Theme.AppCompat.Light.NoActionBar">
     </style>
 </resources>
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
index fe96cc6..e41846b 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -24,6 +24,7 @@ import android.preference.PreferenceManager;
 import android.support.v4.widget.DrawerLayout;
 import android.support.v7.app.ActionBar;
 import android.support.v7.app.ActionBarActivity;
+import android.support.v7.widget.Toolbar;
 import android.util.Log;
 import android.view.ContextMenu;
 import android.view.ContextMenu.ContextMenuInfo;
@@ -41,6 +42,7 @@ import android.widget.AdapterView.OnItemClickListener;
 import android.widget.ArrayAdapter;
 import android.widget.GridView;
 import android.widget.ImageView;
+import android.widget.LinearLayout;
 import android.widget.ListAdapter;
 import android.widget.ListView;
 import android.widget.TextView;
@@ -112,6 +114,10 @@ public class LibreOfficeUIActivity extends ActionBarActivity implements ActionBa
 
     public void createUI() {
 
+        setContentView(R.layout.activity_document_browser);
+
+        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
         ActionBar actionBar = getSupportActionBar();
         actionBar.setDisplayShowTitleEnabled(false); //This should show current directory if anything
 
@@ -123,9 +129,11 @@ public class LibreOfficeUIActivity extends ActionBarActivity implements ActionBa
         actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
         actionBar.setListNavigationCallbacks(list, this);
 
+        LinearLayout content = (LinearLayout) findViewById(R.id.browser_main_content);
+
         if( viewMode == GRID_VIEW){
             // code to make a grid view
-            setContentView(R.layout.file_grid);
+            getLayoutInflater().inflate(R.layout.file_grid, content);
             gv = (GridView)findViewById(R.id.file_explorer_grid_view);
             gv.setOnItemClickListener(new OnItemClickListener() {
                 public void onItemClick(AdapterView<?> parent, View view,
@@ -136,7 +144,7 @@ public class LibreOfficeUIActivity extends ActionBarActivity implements ActionBa
             actionBar.setSelectedNavigationItem( filterMode + 1 );//This triggers the listener which modifies the view.
             registerForContextMenu(gv);
         }else{
-            setContentView(R.layout.file_list);
+            getLayoutInflater().inflate(R.layout.file_list, content);
             lv = (ListView)findViewById( R.id.file_explorer_list_view);
             lv.setClickable(true);
             actionBar.setSelectedNavigationItem( filterMode + 1 );


More information about the Libreoffice-commits mailing list