[Libreoffice-commits] .: 4 commits - android/experimental

Iain Billett iainb at kemper.freedesktop.org
Fri Jun 15 15:19:57 PDT 2012


 android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/res/layout/file_explorer_grid_item.xml            |    4 -
 android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/res/layout/file_list_item.xml                     |   19 ++---
 android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java |   33 ++++++----
 3 files changed, 33 insertions(+), 23 deletions(-)

New commits:
commit 907ad314fb05a06cfeb233bd4265a461e7a5e0e5
Author: Iain Billett <Iain at Iains-MacBook-Pro.local>
Date:   Fri Jun 15 23:18:39 2012 +0100

    Some UI tweeks - trying to get long filenames to display nicely.

diff --git a/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/res/layout/file_explorer_grid_item.xml b/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/res/layout/file_explorer_grid_item.xml
index a53bc1b..ce42e57 100644
--- a/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/res/layout/file_explorer_grid_item.xml
+++ b/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/res/layout/file_explorer_grid_item.xml
@@ -21,7 +21,9 @@
         android:paddingLeft="10dp"
         android:paddingRight="10dp"
         android:layout_gravity="center"
-        android:textSize="15dp" >
+        android:textSize="15dp" 
+        android:textStyle="bold"
+        android:maxLines="2">
     </TextView>
 
 </LinearLayout>
\ No newline at end of file
diff --git a/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/res/layout/file_list_item.xml b/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/res/layout/file_list_item.xml
index 1a424ee..0bff445 100644
--- a/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/res/layout/file_list_item.xml
+++ b/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/res/layout/file_list_item.xml
@@ -12,31 +12,30 @@
     <LinearLayout
         android:layout_width="match_parent"
     	android:layout_height="48dp"
-    	android:orientation="horizontal"
-    	android:layout_weight="3">
+    	android:orientation="horizontal">
 	    <TextView 
 	        android:id="@+id/file_list_item_name"
 	        android:layout_height="48dp"
-	        android:layout_width="match_parent"
-	        android:textSize="16dp"
+	        android:layout_width="0dp"
+	        android:textSize="15dp"
 	        android:textStyle="bold"
-	        android:layout_weight="1"
+	        android:layout_weight="2"
 	        android:gravity="center"/>
 	    <TextView 
 	        android:id="@+id/file_list_item_size"
 	        android:layout_height="48dp"
-	        android:layout_width="match_parent"
-	        android:textSize="16dp"
+	        android:layout_width="0dp"
+	        android:textSize="15dp"
 	        android:textStyle="bold"
 	        android:layout_weight="1"
 	        android:gravity="center"/>
 	    <TextView 
 	        android:id="@+id/file_list_item_date"
 	        android:layout_height="48dp"
-	        android:layout_width="match_parent"
-	        android:textSize="16dp"
+	        android:layout_width="0dp"
+	        android:textSize="15dp"
 	        android:textStyle="bold"
-	        android:layout_weight="1"
+	        android:layout_weight="2"
 	        android:gravity="center"/>
 	</LinearLayout>
 </LinearLayout>
\ No newline at end of file
diff --git a/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java
index 7b178f1..330ffc5 100644
--- a/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -74,11 +74,17 @@ public class LibreOfficeUIActivity extends Activity implements OnNavigationListe
         
         homeDirectory  = new File(Environment.getExternalStorageDirectory(),"LibreOffice");
         homeDirectory.mkdirs();
+        currentDirectory = homeDirectory;
         Intent i = this.getIntent();
         if( i.hasExtra( currentDirectoryKey ) ){
         	currentDirectory = new File( i.getStringExtra( currentDirectoryKey ) );
         }else{
-	        currentDirectory = homeDirectory;
+        	if( savedInstanceState != null){
+	        	if( savedInstanceState.getString( currentDirectoryKey ) != null ){
+	        		currentDirectory = new File( 
+	        				savedInstanceState.getString( currentDirectoryKey ) );
+	        	}
+        	}
         }
         
         if( i.hasExtra( filterModeKey ) ){
@@ -88,7 +94,7 @@ public class LibreOfficeUIActivity extends Activity implements OnNavigationListe
             actionBar.setDisplayHomeAsUpEnabled(true);
         }
 
-    	
+        //createDummyFileSystem();
         createUI();
 	    
     }
@@ -251,6 +257,7 @@ public class LibreOfficeUIActivity extends Activity implements OnNavigationListe
 				File regularDirectory = new File( currentDirectory , "Folder" );
 				regularDirectory.mkdir();
 				new File( regularDirectory , "yetAnotherDoc.odt" ).createNewFile();
+				new File( regularDirectory , "some really long file name.ods" ).createNewFile();
 				File anotherRegularDirectory = new File( regularDirectory , "AnotherFolder" );
 				anotherRegularDirectory.mkdir();
 				new File( anotherRegularDirectory , "yetAnotherDoc2.odt" ).createNewFile();
@@ -293,7 +300,8 @@ public class LibreOfficeUIActivity extends Activity implements OnNavigationListe
 		openDirectory( currentDirectory );// Uses filter mode 
 		return true;
 	}
-	class ListItemAdapter implements ListAdapter{
+	
+class ListItemAdapter implements ListAdapter{
 		private Context mContext;
 		private File[] filePaths;
 		private final long KB = 1024;
commit 889ff81df60fd13a4e121536e86d84147fc29b02
Author: Iain Billett <Iain at Iains-MacBook-Pro.local>
Date:   Fri Jun 15 21:59:09 2012 +0100

    Fixed folder navigation in list view.

diff --git a/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java
index 5548589..7b178f1 100644
--- a/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -342,8 +342,11 @@ public class LibreOfficeUIActivity extends Activity implements OnNavigationListe
 				
 				public void onClick(View v) {
 					Log.d("LIST", "click!");
-					
-					open( filePaths[ pos ].getName() );
+					if(filePaths[ pos ].isDirectory() ){
+						openDirectory( filePaths[ pos ] );
+					}else{
+						open( filePaths[ pos ].getName() );
+					}
 				}
 			});
 			
commit d848fac2d7232a0055fc236d8522f705a4c7e069
Author: Iain Billett <Iain at Iains-MacBook-Pro.local>
Date:   Fri Jun 15 21:54:25 2012 +0100

    Fixed view type persistence problem.

diff --git a/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java
index 2e90e13..5548589 100644
--- a/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -38,8 +38,6 @@ public class LibreOfficeUIActivity extends Activity implements OnNavigationListe
     private String tag = "file_manager";
     private File homeDirectory;//make final?
 	private File currentDirectory;
-	private String filter = "";
-	private String[] filters = {"all",".odt",".ods",".odp"};
 	private int filterMode = FileUtilities.ALL;
 	private int viewType = 0;
 	FileFilter fileFilter;
@@ -49,8 +47,8 @@ public class LibreOfficeUIActivity extends Activity implements OnNavigationListe
 	private ActionBar actionBar;
 	private SharedPreferences prefs;
 	
-	private String currentDirectoryKey = "CURRENT_DIRECTORY";
-	private String filterModeKey = "FILTER_MODE";
+	private static final String currentDirectoryKey = "CURRENT_DIRECTORY";
+	private static final String filterModeKey = "FILTER_MODE";
 	public static final String EXPLORER_VIEW_TYPE = "EXPLORER_VIEW_TYPE";
 	public static final String EXPLORER_PREFS = "EXPLORER_PREFS";
 	
@@ -274,6 +272,7 @@ public class LibreOfficeUIActivity extends Activity implements OnNavigationListe
     	// TODO Auto-generated method stub
     	super.onSaveInstanceState(outState);
     	outState.putString( currentDirectoryKey , currentDirectory.getAbsolutePath() );
+    	prefs.edit().putInt(EXPLORER_VIEW_TYPE, viewType).commit();
     }
     
     @Override
@@ -285,7 +284,6 @@ public class LibreOfficeUIActivity extends Activity implements OnNavigationListe
     
     @Override
     protected void onPause() {
-    	// TODO need to save fileSystem state here.
     	
     	super.onPause();
     }
commit 2b8b4343250b0f564d74d0535b870c156319f8df
Author: Iain Billett <Iain at Iains-MacBook-Pro.local>
Date:   Fri Jun 15 21:25:31 2012 +0100

    Fix view toggle menu item label.

diff --git a/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java
index 633044e..2e90e13 100644
--- a/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/experimental/GSoC-2012-eclipse-workspace/LibreOfficeUI/src/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -176,9 +176,9 @@ public class LibreOfficeUIActivity extends Activity implements OnNavigationListe
         
         MenuItem item = (MenuItem)menu.findItem(R.id.menu_view_toggle);
         if( viewType == GRID_VIEW){
-        	item.setTitle(R.string.grid_view);
-        }else{
         	item.setTitle(R.string.list_view);
+        }else{
+        	item.setTitle(R.string.grid_view);
         }
         return true;
     }


More information about the Libreoffice-commits mailing list