[Libreoffice-commits] core.git: Branch 'feature/droid_calcimpress3' - 2 commits - android/experimental

Jan Holesovsky kendy at collabora.com
Thu Oct 9 22:35:24 PDT 2014


 android/experimental/LOAndroid3/res/layout/document_viewer.xml                         |   34 
 android/experimental/LOAndroid3/res/layout/file_explorer_grid_item.xml                 |   10 
 android/experimental/LOAndroid3/res/layout/file_grid.xml                               |   22 
 android/experimental/LOAndroid3/res/layout/file_list.xml                               |   10 
 android/experimental/LOAndroid3/res/layout/file_list_item.xml                          |   58 
 android/experimental/LOAndroid3/res/layout/main.xml                                    |    2 
 android/experimental/LOAndroid3/res/layout/navigation_grid_item.xml                    |   20 
 android/experimental/LOAndroid3/res/values/arrays.xml                                  |    6 
 android/experimental/LOAndroid3/res/xml/libreoffice_preferences.xml                    |   24 
 android/experimental/LOAndroid3/src/java/org/libreoffice/android/DocumentLoader.java   |  186 +-
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/FileUtilities.java         |  121 -
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/GridItemAdapter.java       |  177 +
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java |  893 ++++------
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/ListItemAdapter.java       |  274 +--
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/PageView.java              |   86 
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/PreferenceEditor.java      |   20 
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/WriterViewerActivity.java  |   55 
 17 files changed, 1007 insertions(+), 991 deletions(-)

New commits:
commit 492cfffd5490272d993753af1d6e7240743c9a3a
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Oct 10 07:34:44 2014 +0200

    More tabs -> spaces.
    
    Change-Id: I9a3e104b05479413dc314f299824a48ead004693

diff --git a/android/experimental/LOAndroid3/res/layout/document_viewer.xml b/android/experimental/LOAndroid3/res/layout/document_viewer.xml
index 62f5556..b4f4501 100644
--- a/android/experimental/LOAndroid3/res/layout/document_viewer.xml
+++ b/android/experimental/LOAndroid3/res/layout/document_viewer.xml
@@ -7,27 +7,27 @@
  -->
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="wrap_content"
-    android:layout_height="match_parent" 
+    android:layout_height="match_parent"
     android:id="@+id/document_viewer_root">
-    <ViewFlipper 
+    <ViewFlipper
         android:id="@+id/page_flipper"
         android:layout_width="match_parent"
-	    android:layout_height="match_parent" >
-        
+        android:layout_height="match_parent" >
+
     </ViewFlipper>
-    <HorizontalScrollView 
+    <HorizontalScrollView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-		android:layout_alignBottom="@id/page_flipper"
-		android:scrollbarAlwaysDrawHorizontalTrack="true"
-		android:background="#aa000000">
-		<LinearLayout
-	   	    android:id="@+id/navigator"
-		    android:layout_width="wrap_content"
-		    android:layout_height="120dp"
-		    android:layout_margin="15dp"
-		    android:orientation="horizontal">
-		</LinearLayout>
-	</HorizontalScrollView >
+        android:layout_alignBottom="@id/page_flipper"
+        android:scrollbarAlwaysDrawHorizontalTrack="true"
+        android:background="#aa000000">
+        <LinearLayout
+            android:id="@+id/navigator"
+            android:layout_width="wrap_content"
+            android:layout_height="120dp"
+            android:layout_margin="15dp"
+            android:orientation="horizontal">
+        </LinearLayout>
+    </HorizontalScrollView>
 
-</RelativeLayout>
\ No newline at end of file
+</RelativeLayout>
diff --git a/android/experimental/LOAndroid3/res/layout/file_explorer_grid_item.xml b/android/experimental/LOAndroid3/res/layout/file_explorer_grid_item.xml
index 585a805..e4569e0 100644
--- a/android/experimental/LOAndroid3/res/layout/file_explorer_grid_item.xml
+++ b/android/experimental/LOAndroid3/res/layout/file_explorer_grid_item.xml
@@ -10,15 +10,15 @@
     android:layout_height="match_parent"
     android:paddingTop="10dp"
     android:orientation="vertical" >
-    
-	<ImageView
+
+    <ImageView
         android:id="@+id/grid_item_image"
         android:layout_width="100dp"
         android:layout_height="142dp"
         android:scaleType="fitStart"
         android:layout_gravity="center">
     </ImageView>
- 
+
     <TextView
         android:id="@+id/grid_item_label"
         android:layout_width="wrap_content"
@@ -28,9 +28,9 @@
         android:paddingRight="10dp"
         android:paddingTop="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
+</LinearLayout>
diff --git a/android/experimental/LOAndroid3/res/layout/file_grid.xml b/android/experimental/LOAndroid3/res/layout/file_grid.xml
index 72eb661..42b745b 100644
--- a/android/experimental/LOAndroid3/res/layout/file_grid.xml
+++ b/android/experimental/LOAndroid3/res/layout/file_grid.xml
@@ -12,16 +12,16 @@
 
     <GridView
         android:id="@+id/file_explorer_grid_view"
-    	android:layout_width="fill_parent" 
-	    android:layout_height="fill_parent"
-	    android:columnWidth="120dp"
-	    android:numColumns="auto_fit"
-	    android:verticalSpacing="10dp"
-	    android:horizontalSpacing="10dp"
-	    android:stretchMode="columnWidth"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:columnWidth="120dp"
+        android:numColumns="auto_fit"
+        android:verticalSpacing="10dp"
+        android:horizontalSpacing="10dp"
+        android:stretchMode="columnWidth"
         android:background="#ffeeeeee"
-	    android:gravity="center">
+        android:gravity="center">
     </GridView>
-	
-	
-</LinearLayout>
\ No newline at end of file
+
+
+</LinearLayout>
diff --git a/android/experimental/LOAndroid3/res/layout/file_list.xml b/android/experimental/LOAndroid3/res/layout/file_list.xml
index 6fe21b6..48dfb1e 100644
--- a/android/experimental/LOAndroid3/res/layout/file_list.xml
+++ b/android/experimental/LOAndroid3/res/layout/file_list.xml
@@ -10,11 +10,11 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical" >
-    
+
     <ListView
         android:id="@+id/file_explorer_list_view"
-    	android:layout_width="fill_parent" 
-	    android:layout_height="fill_parent"
-	 ></ListView>
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent">
+    </ListView>
 
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/android/experimental/LOAndroid3/res/layout/file_list_item.xml b/android/experimental/LOAndroid3/res/layout/file_list_item.xml
index 07a6f42..91d84fd 100644
--- a/android/experimental/LOAndroid3/res/layout/file_list_item.xml
+++ b/android/experimental/LOAndroid3/res/layout/file_list_item.xml
@@ -9,7 +9,7 @@
     android:layout_width="match_parent"
     android:layout_height="48dp"
     android:orientation="horizontal" >
-    <ImageView 
+    <ImageView
         android:id="@+id/file_list_item_icon"
         android:layout_height="match_parent"
         android:layout_width="32dp"
@@ -17,31 +17,31 @@
         android:layout_gravity="center"/>
     <LinearLayout
         android:layout_width="match_parent"
-    	android:layout_height="48dp"
-    	android:orientation="horizontal">
-	    <TextView 
-	        android:id="@+id/file_list_item_name"
-	        android:layout_height="48dp"
-	        android:layout_width="0dp"
-	        android:textSize="15dp"
-	        android:textStyle="bold"
-	        android:layout_weight="2"
-	        android:gravity="center"/>
-	    <TextView 
-	        android:id="@+id/file_list_item_size"
-	        android:layout_height="48dp"
-	        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="0dp"
-	        android:textSize="15dp"
-	        android:textStyle="bold"
-	        android:layout_weight="2"
-	        android:gravity="center"/>
-	</LinearLayout>
-</LinearLayout>
\ No newline at end of file
+        android:layout_height="48dp"
+        android:orientation="horizontal">
+        <TextView
+            android:id="@+id/file_list_item_name"
+            android:layout_height="48dp"
+            android:layout_width="0dp"
+            android:textSize="15dp"
+            android:textStyle="bold"
+            android:layout_weight="2"
+            android:gravity="center"/>
+        <TextView
+            android:id="@+id/file_list_item_size"
+            android:layout_height="48dp"
+            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="0dp"
+            android:textSize="15dp"
+            android:textStyle="bold"
+            android:layout_weight="2"
+            android:gravity="center"/>
+    </LinearLayout>
+</LinearLayout>
diff --git a/android/experimental/LOAndroid3/res/layout/main.xml b/android/experimental/LOAndroid3/res/layout/main.xml
index 75768c3..0264e28 100644
--- a/android/experimental/LOAndroid3/res/layout/main.xml
+++ b/android/experimental/LOAndroid3/res/layout/main.xml
@@ -17,6 +17,6 @@
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         />
-    
+
 
 </LinearLayout>
\ No newline at end of file
diff --git a/android/experimental/LOAndroid3/res/layout/navigation_grid_item.xml b/android/experimental/LOAndroid3/res/layout/navigation_grid_item.xml
index 8b305e1..20ad60f 100644
--- a/android/experimental/LOAndroid3/res/layout/navigation_grid_item.xml
+++ b/android/experimental/LOAndroid3/res/layout/navigation_grid_item.xml
@@ -9,15 +9,15 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="150dp"
     android:layout_height="150dp"
-	android:layout_gravity="center"
-	android:background="#00880000"
+    android:layout_gravity="center"
+    android:background="#00880000"
     android:orientation="vertical" >
     <!-- Can I give all thumbs the same ID? works in grid adapter "getView" -->
-	<ImageView 
-	    android:src="@drawable/dummy_page"
-	    android:id="@+id/thumbnail"
-		android:layout_width="120dp"
-		android:layout_height="120dp"
-		android:layout_margin="15dp"
-		android:layout_gravity="center"/>
-</LinearLayout>
\ No newline at end of file
+    <ImageView
+        android:src="@drawable/dummy_page"
+        android:id="@+id/thumbnail"
+        android:layout_width="120dp"
+        android:layout_height="120dp"
+        android:layout_margin="15dp"
+        android:layout_gravity="center"/>
+</LinearLayout>
diff --git a/android/experimental/LOAndroid3/res/values/arrays.xml b/android/experimental/LOAndroid3/res/values/arrays.xml
index 67a157d..0d698c7 100644
--- a/android/experimental/LOAndroid3/res/values/arrays.xml
+++ b/android/experimental/LOAndroid3/res/values/arrays.xml
@@ -29,7 +29,7 @@
         <item >0</item>
         <item >1</item>
     </string-array>
-    
+
     <!-- Preference Name Arrays -->
     <string-array name="file_view_modes">
         <item >EVERYTHING</item>
@@ -51,6 +51,6 @@
         <item >Largest First</item>
         <item >Smallest First</item>
     </string-array>
-    
-    
+
+
 </resources>
\ No newline at end of file
diff --git a/android/experimental/LOAndroid3/res/xml/libreoffice_preferences.xml b/android/experimental/LOAndroid3/res/xml/libreoffice_preferences.xml
index d19d9e6..f6da06f 100644
--- a/android/experimental/LOAndroid3/res/xml/libreoffice_preferences.xml
+++ b/android/experimental/LOAndroid3/res/xml/libreoffice_preferences.xml
@@ -1,21 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
-    <ListPreference 
+    <ListPreference
         android:title="Default File Filter"
         android:summary="Set which files to show by default"
-        android:entries="@array/FilterTypeNames" 
-        android:entryValues="@array/FilterTypeStringValues" 
+        android:entries="@array/FilterTypeNames"
+        android:entryValues="@array/FilterTypeStringValues"
         android:key="FILTER_MODE"/>
-    <ListPreference 
-        android:summary="Select how to order files; A-Z, by size, etc." 
-        android:key="SORT_MODE" 
+    <ListPreference
+        android:summary="Select how to order files; A-Z, by size, etc."
+        android:key="SORT_MODE"
         android:title="File Order" android:entries="@array/SortModeNames" android:entryValues="@array/SortModeStringValues"/>
-    <ListPreference 
-        android:entries="@array/ViewModeNames" 
-        android:entryValues="@array/ViewModeStringValues" 
-        android:title="Default File Explorer View" 
-        android:key="EXPLORER_VIEW_TYPE" 
+    <ListPreference
+        android:entries="@array/ViewModeNames"
+        android:entryValues="@array/ViewModeStringValues"
+        android:title="Default File Explorer View"
+        android:key="EXPLORER_VIEW_TYPE"
         android:summary="View files as a grid or in a list. #not functional, yet."/>
-    
+
 
 </PreferenceScreen>
\ No newline at end of file
commit 2abf8ad064417e08698710f3b2fcee25b3c59363
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Oct 10 07:23:57 2014 +0200

    Kill trailing whitespace, tabs -> spaces, add modelines.
    
    Change-Id: I24154279154ba2a9d1ba6cab81d066fcba23cb4e

diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/android/DocumentLoader.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/android/DocumentLoader.java
index 2b64514..9b970a2 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/android/DocumentLoader.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/android/DocumentLoader.java
@@ -66,7 +66,7 @@ import android.view.View;
 import android.view.View.OnClickListener;
 import android.widget.BaseAdapter;
 import android.view.View.OnClickListener;
-// Obsolete? 
+// Obsolete?
 import android.widget.AdapterView.OnItemClickListener;
 import android.widget.GridView;
 import android.widget.AdapterView;
@@ -110,7 +110,7 @@ public class DocumentLoader
     extends Activity
 {
     private static final String TAG = "DocumentLoader";
-    
+
     // Size of a small virtual (bitmap) device used to find out page count and
     // page sizes
     private static final int SMALLSIZE = 128;
@@ -140,7 +140,7 @@ public class DocumentLoader
     DocumentViewer documentViewer;
 
     Bundle extras;
-    
+
     LinearLayout ll ;
     LayoutInflater inflater ;
 
@@ -172,29 +172,28 @@ public class DocumentLoader
             }
             return false;
         }
-        
+
         @Override
-        public boolean onSingleTapUp(MotionEvent event){
-        	if( getActionBar().isShowing() ){
-        		getActionBar().hide();
-        	}else{
-        		getActionBar().show();
-        	}	
-        	return true;
+        public boolean onSingleTapUp(MotionEvent event) {
+            if (getActionBar().isShowing()) {
+                getActionBar().hide();
+            } else {
+                getActionBar().show();
+            }
+            return true;
         }
-        
+
         @Override
-        public boolean onDoubleTap(MotionEvent event){
-        LinearLayout ll = (LinearLayout)findViewById( R.id.navigator);
-        	if( ll.isShown() ){
-        		ll.setVisibility( View.GONE );
-        	}else{
-        		ll.setVisibility( View.VISIBLE );
-        	}
-        	return true;	
+        public boolean onDoubleTap(MotionEvent event) {
+            LinearLayout ll = (LinearLayout)findViewById( R.id.navigator);
+            if (ll.isShown()) {
+                ll.setVisibility( View.GONE );
+            } else {
+                ll.setVisibility( View.VISIBLE );
+            }
+            return true;
         }
-        
-        
+
     }
 
     class ScaleListener implements OnTouchListener
@@ -648,14 +647,14 @@ public class DocumentLoader
         }
 
         int getPage(){
-        	return this.currentPageNumber;
+            return this.currentPageNumber;
         }
-        
+
         PageViewer(int number , int width , int height)
         {
             super(DocumentLoader.this);
             if( number < 0)
-            	return;
+                return;
             this.width = width ;
             this.height = height;
             // Render in a bit better quality, so it makes sense to zoom.
@@ -684,7 +683,7 @@ public class DocumentLoader
         final int defaultWidthPx = 120;
         final int defaultHeightPx = 120;
         final int thumbnailPaddingDp = 10;
-        		
+
         class ThumbLoadTask
             extends AsyncTask<Integer, Void, Integer>
         {
@@ -710,14 +709,14 @@ public class DocumentLoader
                     return;
 
                 //ImageView imageView = new ImageView(DocumentLoader.this);
-                
-				ImageView thumbImage = new ImageView(DocumentLoader.this);//(ImageView)findViewById( R.id.thumbnail );
+
+                ImageView thumbImage = new ImageView(DocumentLoader.this);//(ImageView)findViewById( R.id.thumbnail );
                 thumbImage.setImageBitmap(bm);
                 int paddingPx = (int) (thumbnailPaddingDp* scale + 0.5f);
                 thumbImage.setPadding( paddingPx , 0 , paddingPx , 0 );
                 thumbImage.setScaleY(-1);
 
-				Log.i( TAG, Integer.toString( thumbImage.getWidth() ) );
+                Log.i( TAG, Integer.toString( thumbImage.getWidth() ) );
                 if (getChildCount() == 1)
                     removeViewAt(0);
                 addView(thumbImage, matchParent);
@@ -747,43 +746,43 @@ public class DocumentLoader
             scale = getContext().getResources().getDisplayMetrics().density;
             widthInPx = (int) (widthInDp * scale + 0.5f);
             heightInPx = (int) (heightInDp* scale + 0.5f);
-			waitView = new TextView( DocumentLoader.this );
+            waitView = new TextView( DocumentLoader.this );
             thumbnailView = inflater.inflate( R.layout.navigation_grid_item , null);
 
             display(number);
-            
-            
+
+
         }
-        
+
         ThumbnailView(int number)
         {
             super(DocumentLoader.this);
             scale = getContext().getResources().getDisplayMetrics().density;
             widthInPx = defaultWidthPx;
             heightInPx = defaultHeightPx;
-			waitView = new TextView( DocumentLoader.this );
+            waitView = new TextView( DocumentLoader.this );
             thumbnailView = inflater.inflate( R.layout.navigation_grid_item , null);
 
             display(number);
-            
-            
+
+
         }
     }
 
     class DocumentLoadTask
         extends AsyncTask<String, Integer, Integer>
     {
-    	ProgressBar progressView; 
+        ProgressBar progressView;
 
         protected void onPreExecute (){//TODO have another go at putting in a progress bar (shouldn't waste time on it now)
             matchParent = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
 
-    		TextView waitView = new TextView(DocumentLoader.this);
+            TextView waitView = new TextView(DocumentLoader.this);
             waitView.setTextSize(24);
             waitView.setGravity(Gravity.CENTER);
             waitView.setBackgroundColor(Color.WHITE);
             waitView.setTextColor(Color.BLACK);
-    		waitView.setText("Page " + (1) + ", wait...");
+            waitView.setText("Page " + (1) + ", wait...");
 
             progressView = new ProgressBar( DocumentLoader.this, null, android.R.attr.progressBarStyleHorizontal);
             progressView.setProgress( 10 );
@@ -792,9 +791,9 @@ public class DocumentLoader
             flipper.addView( waitView , 0 , matchParent);
             flipper.showNext();
             currentPage = 0;
-    	}
-        
-    	protected Integer doInBackground(String... params)
+        }
+
+        protected Integer doInBackground(String... params)
         {
             try {
                 String url = params[0];
@@ -862,7 +861,7 @@ public class DocumentLoader
         }
 
         protected void onProgressUpdate(Integer progress){
-        	progressView.setProgress( progress.intValue() );
+            progressView.setProgress( progress.intValue() );
         }
 
         protected void onPostExecute(Integer result){
@@ -872,19 +871,19 @@ public class DocumentLoader
             documentViewer = new DocumentViewer( (ViewFlipper)findViewById( R.id.page_flipper ) );
             ll = (LinearLayout)findViewById( R.id.navigator);
             inflater = (LayoutInflater) getApplicationContext().getSystemService(
-				Context.LAYOUT_INFLATER_SERVICE);
-			for( int i = 0; i < result.intValue() ; i++ ){
-				ThumbnailView thumb = new ThumbnailView( i , (int)(120.0f / Math.sqrt(2) ) , 120 );
-				final int pos = i;
-				thumb.setOnClickListener(new OnClickListener() {
-			
-					@Override
-					public void onClick(View v) {
+                    Context.LAYOUT_INFLATER_SERVICE);
+            for( int i = 0; i < result.intValue() ; i++ ){
+                ThumbnailView thumb = new ThumbnailView( i , (int)(120.0f / Math.sqrt(2) ) , 120 );
+                final int pos = i;
+                thumb.setOnClickListener(new OnClickListener() {
+
+                    @Override
+                    public void onClick(View v) {
                         documentViewer.open( pos );
-					}
-				});
-				ll.addView ( thumb );
-			}
+                    }
+                });
+                ll.addView ( thumb );
+            }
         }
     }
 
@@ -1084,7 +1083,7 @@ public class DocumentLoader
     {
         super.onCreate(savedInstanceState);
 
-		extras = getIntent().getExtras();
+        extras = getIntent().getExtras();
 
         gestureDetector = new GestureDetector(this, new GestureListener());
         scaleDetector = new ScaleListener();
@@ -1138,9 +1137,9 @@ public class DocumentLoader
             // Load the wanted document
             new DocumentLoadTask().executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, "file://" + input);
 
-			/*
+            /*
             //flipper = new ViewFlipper(this);
-			flipper = (ViewFlipper)findViewById( R.id.page_flipper );
+            flipper = (ViewFlipper)findViewById( R.id.page_flipper );
             matchParent = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
 
             // should have document load task publish pageCount before this happens: Shouldn't try to pre-fetch
@@ -1154,26 +1153,26 @@ public class DocumentLoader
 
             ll = (LinearLayout)findViewById( R.id.navigator);
             inflater = (LayoutInflater) getApplicationContext().getSystemService(
-				Context.LAYOUT_INFLATER_SERVICE);
-
-			
-			
-			for( int i = 0; i < 2 ; i++ ){
-				ThumbnailView thumb = new ThumbnailView( i , (int)(120.0f / Math.sqrt(2) ) , 120 );
-				final int pos = i;
-				thumb.setOnClickListener(new OnClickListener() {
-			
-					@Override
-					public void onClick(View v) {
-						// TODO Auto-generated method stub
-						Log.d("nav" , Integer.toString( pos ) );
-						
-					}
-				});
-				ll.addView ( thumb );
-			}*/
-            
-	    	
+                Context.LAYOUT_INFLATER_SERVICE);
+
+
+
+            for( int i = 0; i < 2 ; i++ ){
+                ThumbnailView thumb = new ThumbnailView( i , (int)(120.0f / Math.sqrt(2) ) , 120 );
+                final int pos = i;
+                thumb.setOnClickListener(new OnClickListener() {
+
+                    @Override
+                    public void onClick(View v) {
+                        // TODO Auto-generated method stub
+                        Log.d("nav" , Integer.toString( pos ) );
+
+                    }
+                });
+                ll.addView ( thumb );
+            }*/
+
+
         }
         catch (Exception e) {
             e.printStackTrace(System.err);
@@ -1236,22 +1235,23 @@ public class DocumentLoader
             return true;
         return false;
     }
-    
+
     @Override
-	public boolean onOptionsItemSelected(MenuItem item) {
-	    switch (item.getItemId()) {
-	        case android.R.id.home:
-	            // app icon in action bar clicked; go home
-	            Intent intent = new Intent(this, LibreOfficeUIActivity.class);
-	            intent.putExtras( extras );
-	            //intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
-	            startActivity(intent);
-	            return true;
-	        default:
-	            return super.onOptionsItemSelected(item);
-	    }
-	}
-    
+    public boolean onOptionsItemSelected(MenuItem item)
+    {
+        switch (item.getItemId()) {
+            case android.R.id.home:
+                // app icon in action bar clicked; go home
+                Intent intent = new Intent(this, LibreOfficeUIActivity.class);
+                intent.putExtras( extras );
+                //intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+                startActivity(intent);
+                return true;
+            default:
+                return super.onOptionsItemSelected(item);
+        }
+    }
+
 }
 
 // vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/FileUtilities.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/FileUtilities.java
index 4f10363..bb3a365 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/FileUtilities.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/FileUtilities.java
@@ -66,7 +66,7 @@ public class FileUtilities {
         mExtnMap.put(".svg",  DRAWING);
         mExtnMap.put(".vsd",  DRAWING);
         mExtnMap.put(".wpg",  DRAWING);
-	// FIXME: we need to expand this ...
+        // FIXME: we need to expand this ...
     }
 
     private static final String getExtension(String filename)
@@ -133,67 +133,68 @@ public class FileUtilities {
 
     static FilenameFilter getFilenameFilter(final int mode)
     {
-	return new FilenameFilter() {
-	    public boolean accept(File dir, String filename) {
-		if( new File( dir , filename ).isDirectory() )
-		    return true;
-		return doAccept(filename, mode, "");
-	    }
-	};
+        return new FilenameFilter() {
+            public boolean accept(File dir, String filename) {
+                if( new File( dir , filename ).isDirectory() )
+                    return true;
+                return doAccept(filename, mode, "");
+            }
+        };
     }
 
-	static void sortFiles(File[] files , int sortMode){
-		// Should really change all this to a switch statement...
-		if( sortMode == SORT_AZ ){
-			Arrays.sort( files , new Comparator<File>() {
-				public int compare(File lhs, File rhs) {
-					return lhs.getName().compareTo( rhs.getName() );
-				}
-			});
-			return;
-		}
-		if( sortMode == SORT_ZA ){
-			Arrays.sort( files , new Comparator<File>() {
-				public int compare(File lhs, File rhs) {
-					return rhs.getName().compareTo( lhs.getName() );
-				}
-			});
-			return;
-		}
-		if( sortMode == SORT_OLDEST ){
-			Arrays.sort( files , new Comparator<File>() {
-				public int compare(File lhs, File rhs) {
-					return Long.valueOf( lhs.lastModified() ).compareTo( rhs.lastModified() );
-				}
-			});
-			return;
-		}
-		if( sortMode == SORT_NEWEST ){
-			Arrays.sort( files , new Comparator<File>() {
-				public int compare(File lhs, File rhs) {
-					return Long.valueOf( rhs.lastModified() ).compareTo( lhs.lastModified() );
-				}
-			});
-			return;
-		}
-		if( sortMode == SORT_LARGEST ){
-			Arrays.sort( files , new Comparator<File>() {
-				public int compare(File lhs, File rhs) {
-					return Long.valueOf( rhs.length() ).compareTo( lhs.length() );
-				}
-			});
-			return;
-		}
-		if( sortMode == SORT_SMALLEST ){
-			Arrays.sort( files , new Comparator<File>() {
-				public int compare(File lhs, File rhs) {
-					return Long.valueOf( lhs.length() ).compareTo( rhs.length() );
-				}
-			});
-			return;
-		}
-		return;
-	}
+    static void sortFiles(File[] files , int sortMode)
+    {
+        // Should really change all this to a switch statement...
+        if( sortMode == SORT_AZ ){
+            Arrays.sort( files , new Comparator<File>() {
+                public int compare(File lhs, File rhs) {
+                    return lhs.getName().compareTo( rhs.getName() );
+                }
+            });
+            return;
+        }
+        if( sortMode == SORT_ZA ){
+            Arrays.sort( files , new Comparator<File>() {
+                public int compare(File lhs, File rhs) {
+                    return rhs.getName().compareTo( lhs.getName() );
+                }
+            });
+            return;
+        }
+        if( sortMode == SORT_OLDEST ){
+            Arrays.sort( files , new Comparator<File>() {
+                public int compare(File lhs, File rhs) {
+                    return Long.valueOf( lhs.lastModified() ).compareTo( rhs.lastModified() );
+                }
+            });
+            return;
+        }
+        if( sortMode == SORT_NEWEST ){
+            Arrays.sort( files , new Comparator<File>() {
+                public int compare(File lhs, File rhs) {
+                    return Long.valueOf( rhs.lastModified() ).compareTo( lhs.lastModified() );
+                }
+            });
+            return;
+        }
+        if( sortMode == SORT_LARGEST ){
+            Arrays.sort( files , new Comparator<File>() {
+                public int compare(File lhs, File rhs) {
+                    return Long.valueOf( rhs.length() ).compareTo( lhs.length() );
+                }
+            });
+            return;
+        }
+        if( sortMode == SORT_SMALLEST ){
+            Arrays.sort( files , new Comparator<File>() {
+                public int compare(File lhs, File rhs) {
+                    return Long.valueOf( lhs.length() ).compareTo( rhs.length() );
+                }
+            });
+            return;
+        }
+        return;
+    }
 
     static boolean isHidden( File file ){
         if( file.getName().startsWith(".") )
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/GridItemAdapter.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/GridItemAdapter.java
index 1210e0e..22f7b9b 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/GridItemAdapter.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/GridItemAdapter.java
@@ -1,3 +1,4 @@
+/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -30,95 +31,95 @@ import android.graphics.Canvas;
 import android.graphics.Paint;
 import android.graphics.Color;
 
-public class GridItemAdapter extends BaseAdapter{
-	Context mContext;
-	File[] filePaths;
-	File currentDirectory;
+public class GridItemAdapter extends BaseAdapter {
+    Context mContext;
+    File[] filePaths;
+    File currentDirectory;
     String TAG = "GridItemAdapter";
 
-	public GridItemAdapter(Context mContext, File[] filePaths) {
-		this.mContext = mContext;
-		this.filePaths = filePaths;
-		for(File fn : filePaths){
+    public GridItemAdapter(Context mContext, File[] filePaths) {
+        this.mContext = mContext;
+        this.filePaths = filePaths;
+        for(File fn : filePaths){
             Log.d(TAG, fn.getName());
-		}
-	}
-
-	public GridItemAdapter(Context mContext, File currentDirectory) {
-		this.mContext = mContext;
-		this.currentDirectory = currentDirectory;
-		filePaths = currentDirectory.listFiles();
-	}
-
-	public GridItemAdapter(Context mContext, File currentDirectory, File[] filteredFiles)
-	{
-		this.mContext = mContext;
-		this.currentDirectory = currentDirectory;
-		filePaths = filteredFiles;
-	}
-
-	public int getCount() {
-		return filePaths.length;
-	}
-
-	public Object getItem(int position) {
-		return null;//filePaths[ position ];
-	}
+        }
+    }
 
-    public long getItemId(int position) {
-		// TODO Auto-generated method stub
-		return 0;
-	}
+    public GridItemAdapter(Context mContext, File currentDirectory) {
+        this.mContext = mContext;
+        this.currentDirectory = currentDirectory;
+        filePaths = currentDirectory.listFiles();
+    }
 
-	public View getView(int position, View convertView, ViewGroup parent)
-	{
-		LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(
-				Context.LAYOUT_INFLATER_SERVICE);
+    public GridItemAdapter(Context mContext, File currentDirectory, File[] filteredFiles)
+    {
+        this.mContext = mContext;
+        this.currentDirectory = currentDirectory;
+        filePaths = filteredFiles;
+    }
 
-			View gridView;
+    public int getCount() {
+        return filePaths.length;
+    }
 
-			if (convertView == null) {
-                    gridView = new View(mContext);
-			} else {
-				gridView = (View) convertView;
-			}
+    public Object getItem(int position) {
+        return null;//filePaths[ position ];
+    }
 
-			// get layout from mobile.xml
-			gridView = inflater.inflate(R.layout.file_explorer_grid_item, null);
+    public long getItemId(int position) {
+        // TODO Auto-generated method stub
+        return 0;
+    }
 
-            // set value into textview
-            TextView textView = (TextView) gridView
-                    .findViewById(R.id.grid_item_label);
+    public View getView(int position, View convertView, ViewGroup parent)
+    {
+        LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(
+                Context.LAYOUT_INFLATER_SERVICE);
+
+        View gridView;
+
+        if (convertView == null) {
+            gridView = new View(mContext);
+        } else {
+            gridView = (View) convertView;
+        }
+
+        // get layout from mobile.xml
+        gridView = inflater.inflate(R.layout.file_explorer_grid_item, null);
+
+        // set value into textview
+        TextView textView = (TextView) gridView
+            .findViewById(R.id.grid_item_label);
+        textView.setText(filePaths[position].getName());
+        // set image based on selected text
+        ImageView imageView = (ImageView) gridView
+            .findViewById(R.id.grid_item_image);
+        if( filePaths[position].isDirectory() ) // Is a folder
+        {
+            // Default view is a generic folder icon.
+            imageView.setImageResource(R.drawable.folder);
+            // How should we handle empty folders / folders with no thumbnails? -> new files
+            gridView =  inflater.inflate(R.layout.file_explorer_folder_icon, null);
+            org.libreoffice.ui.FolderIconView icon =
+                (org.libreoffice.ui.FolderIconView)gridView.findViewById(R.id.folder_icon);
+            icon.setDir( filePaths[position]);
+            textView = (TextView) gridView.findViewById(R.id.grid_item_label);
             textView.setText(filePaths[position].getName());
-            // set image based on selected text
-            ImageView imageView = (ImageView) gridView
-                    .findViewById(R.id.grid_item_image);
-            if( filePaths[position].isDirectory() ) // Is a folder
-            {
-                // Default view is a generic folder icon.
-                imageView.setImageResource(R.drawable.folder);
-                // How should we handle empty folders / folders with no thumbnails? -> new files
-                gridView =  inflater.inflate(R.layout.file_explorer_folder_icon, null);
-                org.libreoffice.ui.FolderIconView icon =
-                    (org.libreoffice.ui.FolderIconView)gridView.findViewById(R.id.folder_icon);
-                icon.setDir( filePaths[position]);
-                textView = (TextView) gridView.findViewById(R.id.grid_item_label);
-                textView.setText(filePaths[position].getName());
-                return gridView;
+            return gridView;
+        }
+        else
+        {
+            File thumbnailFile = new File( filePaths[position].getParent() , "."
+                    + filePaths[position].getName().split("[.]")[0] + ".png");
+            BitmapFactory factory = new BitmapFactory();
+            Bitmap thumb = factory.decodeFile( thumbnailFile.getAbsolutePath() );
+            if(thumb != null){
+                Log.i( "GRID" , "true" );
+            }else{
+                Log.i( "GRID" , thumbnailFile.getAbsolutePath() );
             }
-            else
+            switch (FileUtilities.getType(filePaths[position].getName()))
             {
-                File thumbnailFile = new File( filePaths[position].getParent() , "."
-            + filePaths[position].getName().split("[.]")[0] + ".png");
-                BitmapFactory factory = new BitmapFactory();
-                Bitmap thumb = factory.decodeFile( thumbnailFile.getAbsolutePath() );
-                if(thumb != null){
-                    Log.i( "GRID" , "true" );
-                }else{
-                    Log.i( "GRID" , thumbnailFile.getAbsolutePath() );
-                }
-                switch (FileUtilities.getType(filePaths[position].getName()))
-                {
                 case FileUtilities.DOC:
                     if( thumb != null){
                         imageView.setImageBitmap( thumb );
@@ -126,22 +127,24 @@ public class GridItemAdapter extends BaseAdapter{
                     }
                     imageView.setImageResource(R.drawable.writer);
                     break;
-			    case FileUtilities.CALC:
+                case FileUtilities.CALC:
                     imageView.setImageResource(R.drawable.calc);
                     break;
-			    case FileUtilities.DRAWING: // FIXME: only for now ...
-			    case FileUtilities.IMPRESS:
+                case FileUtilities.DRAWING: // FIXME: only for now ...
+                case FileUtilities.IMPRESS:
                     imageView.setImageResource(R.drawable.impress);
                     break;
-			    case FileUtilities.UNKNOWN:
-			    default:
-				    break; // FIXME something prettier ?
-			    }
-			}
-			return gridView;
-	}
+                case FileUtilities.UNKNOWN:
+                default:
+                    break; // FIXME something prettier ?
+            }
+        }
+        return gridView;
+    }
 
     public void update(){
         this.notifyDataSetChanged();
     }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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 db3559e..02eddb3 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -1,3 +1,4 @@
+/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -86,30 +87,30 @@ import java.nio.ByteOrder;
 
 public class LibreOfficeUIActivity extends Activity implements ActionBar.OnNavigationListener {
     private String tag = "file_manager";
-	private SharedPreferences prefs;
+    private SharedPreferences prefs;
     private File homeDirectory;
-	private File currentDirectory;
-	private int filterMode = FileUtilities.ALL;
-	private int viewMode;
-	private int sortMode;
-	
-	FileFilter fileFilter;
-	FilenameFilter filenameFilter;
-	private File[] filePaths;
-	
-	
-	private static final String CURRENT_DIRECTORY_KEY = "CURRENT_DIRECTORY";
-	private static final String FILTER_MODE_KEY = "FILTER_MODE";
-	public static final String EXPLORER_VIEW_TYPE_KEY = "EXPLORER_VIEW_TYPE";
-	public static final String EXPLORER_PREFS_KEY = "EXPLORER_PREFS";
-	public static final String SORT_MODE_KEY = "SORT_MODE";
-	
-	public static final int GRID_VIEW = 0;
-	public static final int LIST_VIEW = 1;
-	
-	GridView gv;
-	ListView lv;
-	
+    private File currentDirectory;
+    private int filterMode = FileUtilities.ALL;
+    private int viewMode;
+    private int sortMode;
+
+    FileFilter fileFilter;
+    FilenameFilter filenameFilter;
+    private File[] filePaths;
+
+
+    private static final String CURRENT_DIRECTORY_KEY = "CURRENT_DIRECTORY";
+    private static final String FILTER_MODE_KEY = "FILTER_MODE";
+    public static final String EXPLORER_VIEW_TYPE_KEY = "EXPLORER_VIEW_TYPE";
+    public static final String EXPLORER_PREFS_KEY = "EXPLORER_PREFS";
+    public static final String SORT_MODE_KEY = "SORT_MODE";
+
+    public static final int GRID_VIEW = 0;
+    public static final int LIST_VIEW = 1;
+
+    GridView gv;
+    ListView lv;
+
     private static final String TAG = "ThumbnailGenerator";
     private static final int SMALLSIZE = 128;
 
@@ -134,21 +135,21 @@ public class LibreOfficeUIActivity extends Activity implements ActionBar.OnNavig
         homeDirectory.mkdirs();
         currentDirectory = homeDirectory;
         //Load default settings
-        
+
         Bootstrap.setup(this);
 
         Bootstrap.putenv("SAL_LOG=yes");
 
     }
-    
+
     public void createUI(){
         ActionBar actionBar = getActionBar();
         actionBar.setDisplayShowTitleEnabled(false);//This should show current directory if anything
         /*actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
-        SpinnerAdapter mSpinnerAdapter = ArrayAdapter.createFromResource(this, R.array.file_view_modes,
-                android.R.layout.simple_spinner_dropdown_item);
-        actionBar.setListNavigationCallbacks(mSpinnerAdapter, this);
-        */
+          SpinnerAdapter mSpinnerAdapter = ArrayAdapter.createFromResource(this, R.array.file_view_modes,
+          android.R.layout.simple_spinner_dropdown_item);
+          actionBar.setListNavigationCallbacks(mSpinnerAdapter, this);
+          */
         //make the navigation spinner
         Context context = actionBar.getThemedContext();
         ArrayAdapter<CharSequence> list = ArrayAdapter.createFromResource(context, R.array.file_view_modes, android.R.layout.simple_spinner_item);
@@ -170,38 +171,38 @@ public class LibreOfficeUIActivity extends Activity implements ActionBar.OnNavig
             actionBar.setDisplayHomeAsUpEnabled(true);
         }
 
-    	if( viewMode == GRID_VIEW){
-	        // code to make a grid view
-        	setContentView(R.layout.file_grid);
-	    	gv = (GridView)findViewById(R.id.file_explorer_grid_view);
-        	filePaths = currentDirectory.listFiles( FileUtilities.getFileFilter( filterMode ) );
-	        gv.setOnItemClickListener(new OnItemClickListener() {
-	            public void onItemClick(AdapterView<?> parent, View view,
-	                int position, long id) {
-	            	File file = filePaths[position];
-	            	if(!file.isDirectory()){
+        if( viewMode == GRID_VIEW){
+            // code to make a grid view
+            setContentView(R.layout.file_grid);
+            gv = (GridView)findViewById(R.id.file_explorer_grid_view);
+            filePaths = currentDirectory.listFiles( FileUtilities.getFileFilter( filterMode ) );
+            gv.setOnItemClickListener(new OnItemClickListener() {
+                public void onItemClick(AdapterView<?> parent, View view,
+                    int position, long id) {
+                    File file = filePaths[position];
+                    if(!file.isDirectory()){
                         open(file);
-	            	}else{
+                    }else{
                         openDirectory( file );
-	            	}
-	            		
-	            }
-	          });
-	        gv.setAdapter( new GridItemAdapter(getApplicationContext(), currentDirectory, filePaths ) );
-	        actionBar.setSelectedNavigationItem( filterMode + 1 );//This triggers the listener which modifies the view.
+                    }
+
+                }
+            });
+            gv.setAdapter( new GridItemAdapter(getApplicationContext(), currentDirectory, filePaths ) );
+            actionBar.setSelectedNavigationItem( filterMode + 1 );//This triggers the listener which modifies the view.
         }else{
-        	setContentView(R.layout.file_list);
-        	lv = (ListView)findViewById( R.id.file_explorer_list_view);
-        	lv.setClickable(true);
-        	filePaths = currentDirectory.listFiles( FileUtilities.getFileFilter( filterMode ) );
-        	lv.setAdapter( new ListItemAdapter(getApplicationContext(), filePaths) );
-        	actionBar.setSelectedNavigationItem( filterMode + 1 );
+            setContentView(R.layout.file_list);
+            lv = (ListView)findViewById( R.id.file_explorer_list_view);
+            lv.setClickable(true);
+            filePaths = currentDirectory.listFiles( FileUtilities.getFileFilter( filterMode ) );
+            lv.setAdapter( new ListItemAdapter(getApplicationContext(), filePaths) );
+            actionBar.setSelectedNavigationItem( filterMode + 1 );
         }
-    	
+
     }
-    
+
     public void openDirectory(File dir ){
-    	currentDirectory = dir; 
+        currentDirectory = dir;
         if( !currentDirectory.equals( homeDirectory )){
             ActionBar actionBar = getActionBar();
             actionBar.setDisplayHomeAsUpEnabled(true);
@@ -209,68 +210,68 @@ public class LibreOfficeUIActivity extends Activity implements ActionBar.OnNavig
             ActionBar actionBar = getActionBar();
             actionBar.setDisplayHomeAsUpEnabled( false );
         }
-    	filePaths = currentDirectory.listFiles( FileUtilities.getFileFilter( filterMode ) );
-    	FileUtilities.sortFiles( filePaths, sortMode );
-/*
-    	for( int i = 0; i < fileNames.length; i++){
-            fileNames[ i ] = filePaths[ i ].getName();
-            if( !FileUtilities.hasThumbnail( filePaths[ i ] ) )
-            {
-                new ThumbnailGenerator( filePaths[ i ] );
-            }
-    	}
-*/
-    	if( viewMode == GRID_VIEW){
-    		gv.setAdapter( new GridItemAdapter(getApplicationContext(), currentDirectory, filePaths ) );
-    	}else{
-    		lv.setAdapter( new ListItemAdapter(getApplicationContext(), filePaths) );
-    	}
+        filePaths = currentDirectory.listFiles( FileUtilities.getFileFilter( filterMode ) );
+        FileUtilities.sortFiles( filePaths, sortMode );
+        /*
+           for( int i = 0; i < fileNames.length; i++){
+           fileNames[ i ] = filePaths[ i ].getName();
+           if( !FileUtilities.hasThumbnail( filePaths[ i ] ) )
+           {
+           new ThumbnailGenerator( filePaths[ i ] );
+           }
+           }
+           */
+        if( viewMode == GRID_VIEW){
+            gv.setAdapter( new GridItemAdapter(getApplicationContext(), currentDirectory, filePaths ) );
+        }else{
+            lv.setAdapter( new ListItemAdapter(getApplicationContext(), filePaths) );
+        }
     }
-    
+
     public void open(File file) {
         Intent i = new Intent(Intent.ACTION_VIEW, Uri.fromFile(file));
         i.setComponent(new ComponentName(
-                "org.libreoffice",
-                "org.libreoffice.LibreOfficeMainActivity"));
+                    "org.libreoffice",
+                    "org.libreoffice.LibreOfficeMainActivity"));
         startActivity(i);
     }
-    
+
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         MenuInflater inflater = getMenuInflater();
         inflater.inflate(R.menu.view_menu, menu);
-        
+
         MenuItem item = (MenuItem)menu.findItem(R.id.menu_view_toggle);
         if( viewMode == GRID_VIEW){
-        	item.setTitle(R.string.list_view);
-        	item.setIcon( R.drawable.light_view_as_list );
+            item.setTitle(R.string.list_view);
+            item.setIcon( R.drawable.light_view_as_list );
         }else{
-        	item.setTitle(R.string.grid_view);
-        	item.setIcon( R.drawable.light_view_as_grid );
+            item.setTitle(R.string.grid_view);
+            item.setIcon( R.drawable.light_view_as_grid );
         }
         return true;
     }
-    
+
     public boolean onOptionsItemSelected(MenuItem item) {
-	    switch (item.getItemId()) {
-	        case android.R.id.home:
-	            if( !currentDirectory.equals( homeDirectory ) ){
-	            	openDirectory( currentDirectory.getParentFile() );
-	            }
-	            break;
-	        case R.id.menu_view_toggle:
-	        	if( viewMode == GRID_VIEW){
-	        		viewMode = LIST_VIEW;
-	        		item.setTitle(R.string.grid_view);//Button points to next view.
-	            	item.setIcon( R.drawable.light_view_as_grid );
-	        		
-	        	}else{
-	        		viewMode = GRID_VIEW;
-	        		item.setTitle(R.string.list_view);//Button points to next view.
-	            	item.setIcon( R.drawable.light_view_as_list );
-	        	}
-	        	createUI();
-	        	break;
+        switch (item.getItemId()) {
+            case android.R.id.home:
+                if( !currentDirectory.equals( homeDirectory ) ){
+                    openDirectory( currentDirectory.getParentFile() );
+                }
+                break;
+            case R.id.menu_view_toggle:
+                if( viewMode == GRID_VIEW){
+                    viewMode = LIST_VIEW;
+                    item.setTitle(R.string.grid_view);//Button points to next view.
+                    item.setIcon( R.drawable.light_view_as_grid );
+
+                }else{
+                    viewMode = GRID_VIEW;
+                    item.setTitle(R.string.list_view);//Button points to next view.
+                    item.setIcon( R.drawable.light_view_as_list );
+                }
+                createUI();
+                break;
             case R.id.menu_sort_size:
             case R.id.menu_sort_az:
             case R.id.menu_sort_modified:
@@ -279,11 +280,11 @@ public class LibreOfficeUIActivity extends Activity implements ActionBar.OnNavig
             default:
                 return super.onOptionsItemSelected(item);
         }
-	    return true;
-	}
-    
+        return true;
+    }
+
     public void createDummyFileSystem(){
-    	boolean mExternalStorageAvailable = false;
+        boolean mExternalStorageAvailable = false;
         boolean mExternalStorageWriteable = false;
         String state = Environment.getExternalStorageState();
 
@@ -295,145 +296,145 @@ public class LibreOfficeUIActivity extends Activity implements ActionBar.OnNavig
         } else {
             mExternalStorageAvailable = mExternalStorageWriteable = false;
         }
-        if( mExternalStorageAvailable && mExternalStorageWriteable ){//can also check if its writeable 
-        	Log.d(tag, Boolean.toString( currentDirectory.mkdir() ) );
-        	try {
-        		File[] removeList = currentDirectory.listFiles();
-        		for(File item : removeList){
-        			if(item.isDirectory())
-        				continue;//Log.d(tag, item.getPath());
-        			item.delete();
-        		}
-        		new File( currentDirectory , "d0.odp" ).createNewFile();
-				new File( currentDirectory , "d1.odt" ).createNewFile();
-				new File( currentDirectory , "d2.odt" ).createNewFile();
-				new File( currentDirectory , "d3.odp" ).createNewFile();
-				new File( currentDirectory , "d4.ods" ).createNewFile();
-				new File( currentDirectory , "d5.odt" ).createNewFile();
-				new File( currentDirectory , "d6.odp" ).createNewFile();
-				new File( currentDirectory , "d7.odt" ).createNewFile();
-				new File( currentDirectory , "d8.odt" ).createNewFile();
-				new File( currentDirectory , "d9.odp" ).createNewFile();
-				new File( currentDirectory , "d10.odp" ).createNewFile();
-				new File( currentDirectory , "d11.odt" ).createNewFile();
-				new File( currentDirectory , "d12.odt" ).createNewFile();
-				new File( currentDirectory , "d13.odp" ).createNewFile();
-				new File( currentDirectory , "d14.ods" ).createNewFile();
-				new File( currentDirectory , "d15.odt" ).createNewFile();
-				File templatesDirectory = new File( currentDirectory , "Templates" );
-				templatesDirectory.mkdir();
-				new File( templatesDirectory , "template1.odt" ).createNewFile();
-				new File( templatesDirectory , "template2.odt" ).createNewFile();
-				new File( templatesDirectory , "template3.ods" ).createNewFile();
-				new File( templatesDirectory , "template4.odp" ).createNewFile();
-				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();
-				//Should put a folder in at some stage.
-				
-			} catch (IOException e) {
-				Log.d(tag, "file io failure");
-				e.printStackTrace();
-			}
-        	//Log.d(tag, fileStore.toString());
+        if( mExternalStorageAvailable && mExternalStorageWriteable ){//can also check if its writeable
+            Log.d(tag, Boolean.toString( currentDirectory.mkdir() ) );
+            try {
+                File[] removeList = currentDirectory.listFiles();
+                for(File item : removeList){
+                    if(item.isDirectory())
+                        continue;//Log.d(tag, item.getPath());
+                    item.delete();
+                }
+                new File( currentDirectory , "d0.odp" ).createNewFile();
+                new File( currentDirectory , "d1.odt" ).createNewFile();
+                new File( currentDirectory , "d2.odt" ).createNewFile();
+                new File( currentDirectory , "d3.odp" ).createNewFile();
+                new File( currentDirectory , "d4.ods" ).createNewFile();
+                new File( currentDirectory , "d5.odt" ).createNewFile();
+                new File( currentDirectory , "d6.odp" ).createNewFile();
+                new File( currentDirectory , "d7.odt" ).createNewFile();
+                new File( currentDirectory , "d8.odt" ).createNewFile();
+                new File( currentDirectory , "d9.odp" ).createNewFile();
+                new File( currentDirectory , "d10.odp" ).createNewFile();
+                new File( currentDirectory , "d11.odt" ).createNewFile();
+                new File( currentDirectory , "d12.odt" ).createNewFile();
+                new File( currentDirectory , "d13.odp" ).createNewFile();
+                new File( currentDirectory , "d14.ods" ).createNewFile();
+                new File( currentDirectory , "d15.odt" ).createNewFile();
+                File templatesDirectory = new File( currentDirectory , "Templates" );
+                templatesDirectory.mkdir();
+                new File( templatesDirectory , "template1.odt" ).createNewFile();
+                new File( templatesDirectory , "template2.odt" ).createNewFile();
+                new File( templatesDirectory , "template3.ods" ).createNewFile();
+                new File( templatesDirectory , "template4.odp" ).createNewFile();
+                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();
+                //Should put a folder in at some stage.
+
+            } catch (IOException e) {
+                Log.d(tag, "file io failure");
+                e.printStackTrace();
+            }
+            //Log.d(tag, fileStore.toString());
         }
         else{
-        	Log.d(tag, "No External Storage");
+            Log.d(tag, "No External Storage");
         }
     }
-    
+
     @SuppressWarnings("unused")//see android:onClick properties in view_menu.xml
-	public void sortFiles(MenuItem item){
-		switch ( item.getItemId() ) {
-			case R.id.menu_sort_az:
-				if( sortMode == FileUtilities.SORT_AZ ){
-					sortMode = FileUtilities.SORT_ZA;
-				}else{
-					sortMode = FileUtilities.SORT_AZ;
-				}
-				break;
-			case R.id.menu_sort_modified:
-				if( sortMode == FileUtilities.SORT_NEWEST ){
-					sortMode = FileUtilities.SORT_OLDEST;
-				}else{
-					sortMode = FileUtilities.SORT_NEWEST;
-				}
-				break;
-			case R.id.menu_sort_size:
-				if( sortMode == FileUtilities.SORT_LARGEST ){
-					sortMode = FileUtilities.SORT_SMALLEST;
-				}else{
-					sortMode = FileUtilities.SORT_LARGEST;
-				}
-				break;
-			default:
-				break;
-		}
-		this.onResume();
+    public void sortFiles(MenuItem item){
+        switch ( item.getItemId() ) {
+            case R.id.menu_sort_az:
+                if( sortMode == FileUtilities.SORT_AZ ){
+                    sortMode = FileUtilities.SORT_ZA;
+                }else{
+                    sortMode = FileUtilities.SORT_AZ;
+                }
+                break;
+            case R.id.menu_sort_modified:
+                if( sortMode == FileUtilities.SORT_NEWEST ){
+                    sortMode = FileUtilities.SORT_OLDEST;
+                }else{
+                    sortMode = FileUtilities.SORT_NEWEST;
+                }
+                break;
+            case R.id.menu_sort_size:
+                if( sortMode == FileUtilities.SORT_LARGEST ){
+                    sortMode = FileUtilities.SORT_SMALLEST;
+                }else{
+                    sortMode = FileUtilities.SORT_LARGEST;
+                }
+                break;
+            default:
+                break;
+        }
+        this.onResume();
     }
-    
+
     public void readPreferences(){
-    	prefs = getSharedPreferences(EXPLORER_PREFS_KEY, MODE_PRIVATE);
+        prefs = getSharedPreferences(EXPLORER_PREFS_KEY, MODE_PRIVATE);
         viewMode = prefs.getInt( EXPLORER_VIEW_TYPE_KEY, GRID_VIEW);
         sortMode = prefs.getInt( SORT_MODE_KEY, FileUtilities.SORT_AZ );
         SharedPreferences defaultPrefs = PreferenceManager.getDefaultSharedPreferences( getBaseContext() );
         filterMode = Integer.valueOf( defaultPrefs.getString( FILTER_MODE_KEY , "-1") );
         sortMode = Integer.valueOf( defaultPrefs.getString( SORT_MODE_KEY , "-1") );
     }
-    
+
     public void editPreferences(MenuItem item){
-    	startActivity( new Intent( this , PreferenceEditor.class) );
+        startActivity( new Intent( this , PreferenceEditor.class) );
     }
-    
+
     @Override
     protected void onSaveInstanceState(Bundle outState) {
-    	// TODO Auto-generated method stub
-    	super.onSaveInstanceState(outState);
-    	outState.putString( CURRENT_DIRECTORY_KEY , currentDirectory.getAbsolutePath() );
-    	outState.putInt( FILTER_MODE_KEY , filterMode );
-    	outState.putInt( EXPLORER_VIEW_TYPE_KEY , viewMode );
-
-    	Log.d(tag, currentDirectory.toString() + Integer.toString(filterMode ) + Integer.toString(viewMode) );
-    	//prefs.edit().putInt(EXPLORER_VIEW_TYPE, viewType).commit();
-    	Log.d(tag, "savedInstanceSate");
+        // TODO Auto-generated method stub
+        super.onSaveInstanceState(outState);
+        outState.putString( CURRENT_DIRECTORY_KEY , currentDirectory.getAbsolutePath() );
+        outState.putInt( FILTER_MODE_KEY , filterMode );
+        outState.putInt( EXPLORER_VIEW_TYPE_KEY , viewMode );
+
+        Log.d(tag, currentDirectory.toString() + Integer.toString(filterMode ) + Integer.toString(viewMode) );
+        //prefs.edit().putInt(EXPLORER_VIEW_TYPE, viewType).commit();
+        Log.d(tag, "savedInstanceSate");
     }
-    
+
     @Override
     protected void onRestoreInstanceState(Bundle savedInstanceState) {
-    	// TODO Auto-generated method stub
-    	super.onRestoreInstanceState(savedInstanceState);
-    	if( savedInstanceState.isEmpty() ){
-    		return;
-    	}
-    	currentDirectory = new File( savedInstanceState.getString( CURRENT_DIRECTORY_KEY ) );
-    	filterMode = savedInstanceState.getInt( FILTER_MODE_KEY , FileUtilities.ALL ) ;
-    	viewMode = savedInstanceState.getInt( EXPLORER_VIEW_TYPE_KEY , GRID_VIEW );
-    	//openDirectory( currentDirectory );
-    	Log.d(tag, "onRestoreInstanceState");
-    	Log.d(tag, currentDirectory.toString() + Integer.toString(filterMode ) + Integer.toString(viewMode) );
+        // TODO Auto-generated method stub
+        super.onRestoreInstanceState(savedInstanceState);
+        if( savedInstanceState.isEmpty() ){
+            return;
+        }
+        currentDirectory = new File( savedInstanceState.getString( CURRENT_DIRECTORY_KEY ) );
+        filterMode = savedInstanceState.getInt( FILTER_MODE_KEY , FileUtilities.ALL ) ;
+        viewMode = savedInstanceState.getInt( EXPLORER_VIEW_TYPE_KEY , GRID_VIEW );
+        //openDirectory( currentDirectory );
+        Log.d(tag, "onRestoreInstanceState");
+        Log.d(tag, currentDirectory.toString() + Integer.toString(filterMode ) + Integer.toString(viewMode) );
     }
-    
+
     @Override
     protected void onPause() {
-    	//prefs.edit().putInt(EXPLORER_VIEW_TYPE, viewType).commit();
-    	super.onPause();
-    	Log.d(tag, "onPause");
+        //prefs.edit().putInt(EXPLORER_VIEW_TYPE, viewType).commit();
+        super.onPause();
+        Log.d(tag, "onPause");
     }
-    
+
     @Override
     protected void onResume() {
-    	// TODO Auto-generated method stub
-    	super.onResume();
-    	Log.d(tag, "onResume");
-    	readPreferences();// intent values take precedence over prefs?
-    	Intent i = this.getIntent();
+        // TODO Auto-generated method stub
+        super.onResume();
+        Log.d(tag, "onResume");
+        readPreferences();// intent values take precedence over prefs?
+        Intent i = this.getIntent();
         if( i.hasExtra( CURRENT_DIRECTORY_KEY ) ){
-        	currentDirectory = new File( i.getStringExtra( CURRENT_DIRECTORY_KEY ) );
-        	Log.d(tag, CURRENT_DIRECTORY_KEY);
+            currentDirectory = new File( i.getStringExtra( CURRENT_DIRECTORY_KEY ) );
+            Log.d(tag, CURRENT_DIRECTORY_KEY);
         }
         if( i.hasExtra( FILTER_MODE_KEY ) ){
             filterMode = i.getIntExtra( FILTER_MODE_KEY, FileUtilities.ALL);
@@ -443,183 +444,183 @@ public class LibreOfficeUIActivity extends Activity implements ActionBar.OnNavig
             viewMode = i.getIntExtra( EXPLORER_VIEW_TYPE_KEY, GRID_VIEW);
             Log.d(tag, EXPLORER_VIEW_TYPE_KEY);
         }
-    	createUI();
-    	openDirectory( currentDirectory );
+        createUI();
+        openDirectory( currentDirectory );
     }
-    
+
     @Override
     protected void onStart() {
-    	// TODO Auto-generated method stub
-    	super.onStart();
-    	Log.d(tag, "onStart");
+        // TODO Auto-generated method stub
+        super.onStart();
+        Log.d(tag, "onStart");
     }
-    
+
     @Override
     protected void onStop() {
-    	// TODO Auto-generated method stub
-    	super.onStop();
-    	Log.d(tag, "onStop");
+        // TODO Auto-generated method stub
+        super.onStop();
+        Log.d(tag, "onStop");
     }
-    
+
     @Override
     protected void onDestroy() {
-    	// TODO Auto-generated method stub
-    	super.onDestroy();
-    	
-    	Log.d(tag, "onDestroy");
+        // TODO Auto-generated method stub
+        super.onDestroy();
+
+        Log.d(tag, "onDestroy");
+    }
+
+    public boolean onNavigationItemSelected(int itemPosition, long itemId) {
+        filterMode = itemPosition -1; //bit of a hack, I know. -1 is ALL 0 Docs etc
+        openDirectory( currentDirectory );// Uses filter mode
+        return true;
     }
-     
-	public boolean onNavigationItemSelected(int itemPosition, long itemId) {
-		filterMode = itemPosition -1; //bit of a hack, I know. -1 is ALL 0 Docs etc
-		openDirectory( currentDirectory );// Uses filter mode 
-		return true;
-	}
-	
+
     private int dpToPx( int dp ){
         final float scale = getApplicationContext().getResources().getDisplayMetrics().density;
         return (int) (dp * scale + 0.5f);
     }
 
-class ListItemAdapter implements ListAdapter{
-		private Context mContext;
-		private File[] filePaths;
-		private final long KB = 1024;
-		private final long MB = 1048576;
-		
-		public ListItemAdapter(Context mContext, File[] filePaths) {
-			this.mContext = mContext;
-			this.filePaths = filePaths;
-		}
-		
-		public int getCount() {
-			// TODO Auto-generated method stub
-			return filePaths.length;
-		}
-
-		public Object getItem(int arg0) {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		public long getItemId(int arg0) {
-			// TODO Auto-generated method stub
-			return 0;
-		}
-
-		public int getItemViewType(int arg0) {
-			// TODO Auto-generated method stub
-			return 0;
-		}
-
-		public View getView(int position, View convertView, ViewGroup parent) {
-			LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(
-					Context.LAYOUT_INFLATER_SERVICE);
-			
-			View listItem;
-	 
-			if (convertView == null) {
-				listItem = new View(mContext);
-				listItem = inflater.inflate(R.layout.file_list_item, null);
-			} else {
-				listItem = (View) convertView;
-			}
-			final int pos = position;
-			listItem.setClickable(true);
-			listItem.setOnClickListener(new OnClickListener() {
-				
-				public void onClick(View v) {
-					Log.d("LIST", "click!");
-					if(filePaths[ pos ].isDirectory() ){
-						openDirectory( filePaths[ pos ] );
-					}else{
+    class ListItemAdapter implements ListAdapter{
+        private Context mContext;
+        private File[] filePaths;
+        private final long KB = 1024;
+        private final long MB = 1048576;
+
+        public ListItemAdapter(Context mContext, File[] filePaths) {
+            this.mContext = mContext;
+            this.filePaths = filePaths;
+        }
+
+        public int getCount() {
+            // TODO Auto-generated method stub
+            return filePaths.length;
+        }
+
+        public Object getItem(int arg0) {
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+        public long getItemId(int arg0) {
+            // TODO Auto-generated method stub
+            return 0;
+        }
+
+        public int getItemViewType(int arg0) {
+            // TODO Auto-generated method stub
+            return 0;
+        }
+
+        public View getView(int position, View convertView, ViewGroup parent) {
+            LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(
+                    Context.LAYOUT_INFLATER_SERVICE);
+
+            View listItem;
+
+            if (convertView == null) {
+                listItem = new View(mContext);
+                listItem = inflater.inflate(R.layout.file_list_item, null);
+            } else {
+                listItem = (View) convertView;
+            }
+            final int pos = position;
+            listItem.setClickable(true);
+            listItem.setOnClickListener(new OnClickListener() {
+
+                public void onClick(View v) {
+                    Log.d("LIST", "click!");
+                    if(filePaths[ pos ].isDirectory() ){
+                        openDirectory( filePaths[ pos ] );
+                    }else{
                         open( filePaths[ pos ] );
-					}
-				}
-			});
-			
-			
-			
-			// set value into textview
-			TextView filename = (TextView) listItem.findViewById(R.id.file_list_item_name);
-			filename.setText( filePaths[ position ].getName() );
-			//filename.setClickable(true);
-			
-			TextView fileSize = (TextView) listItem.findViewById(R.id.file_list_item_size);
-			//TODO Give size in KB , MB as appropriate.
-			String size = "0B";
-			long length = filePaths[ position ].length();
-			if( length < KB ){
-				size = Long.toString( length ) + "B";
-			}
-			if( length >= KB && length < MB){
-				size = Long.toString( length/KB ) + "KB";
-			}
-			if( length >= MB){
-				size = Long.toString( length/MB ) + "MB";
-			}
-			fileSize.setText( size );
-			//fileSize.setClickable(true);
-			
-			TextView fileDate = (TextView) listItem.findViewById(R.id.file_list_item_date);
-			SimpleDateFormat df = new SimpleDateFormat("dd MMM yyyy hh:ss");
-			Date date = new Date( filePaths[ position ].lastModified() );
-			//TODO format date
-			fileDate.setText( df.format( date ) );
-			
-			// set image based on selected text
-			ImageView imageView = (ImageView) listItem.findViewById(R.id.file_list_item_icon);
-			if( filePaths[position].getName().endsWith(".odt") ){
-				imageView.setImageResource(R.drawable.writer);
-			}
-			if( filePaths[position].getName().endsWith(".ods") ){
-				imageView.setImageResource(R.drawable.calc);
-			}
-			if( filePaths[position].getName().endsWith(".odp") ){
-				imageView.setImageResource(R.drawable.impress);
-			}
-			if( filePaths[position].isDirectory() ){
-				//Eventually have thumbnails of each sub file on a black circle
-				//For now just a folder icon
-				imageView.setImageResource(R.drawable.folder);
-			}
-			//imageView.setClickable(true);
-			return listItem;
-		}
-
-		public int getViewTypeCount() {
-			// TODO Auto-generated method stub
-			return 1;
-		}
-
-		public boolean hasStableIds() {
-			// TODO Auto-generated method stub
-			return false;
-		}
-
-		public boolean isEmpty() {
-			// TODO Auto-generated method stub
-			return false;
-		}
-
-		public void registerDataSetObserver(DataSetObserver arg0) {
-			// TODO Auto-generated method stub
-			
-		}
-
-		public void unregisterDataSetObserver(DataSetObserver arg0) {
-			// TODO Auto-generated method stub
-			
-		}
-
-		public boolean areAllItemsEnabled() {
-			// TODO Auto-generated method stub
-			return false;
-		}
-
-		public boolean isEnabled(int position) {
-			// TODO Auto-generated method stub
-			return false;
-		}
+                    }
+                }
+            });
+
+
+
+            // set value into textview
+            TextView filename = (TextView) listItem.findViewById(R.id.file_list_item_name);
+            filename.setText( filePaths[ position ].getName() );
+            //filename.setClickable(true);
+
+            TextView fileSize = (TextView) listItem.findViewById(R.id.file_list_item_size);
+            //TODO Give size in KB , MB as appropriate.
+            String size = "0B";
+            long length = filePaths[ position ].length();
+            if( length < KB ){
+                size = Long.toString( length ) + "B";
+            }
+            if( length >= KB && length < MB){
+                size = Long.toString( length/KB ) + "KB";
+            }
+            if( length >= MB){
+                size = Long.toString( length/MB ) + "MB";
+            }
+            fileSize.setText( size );
+            //fileSize.setClickable(true);
+
+            TextView fileDate = (TextView) listItem.findViewById(R.id.file_list_item_date);
+            SimpleDateFormat df = new SimpleDateFormat("dd MMM yyyy hh:ss");
+            Date date = new Date( filePaths[ position ].lastModified() );
+            //TODO format date
+            fileDate.setText( df.format( date ) );
+
+            // set image based on selected text
+            ImageView imageView = (ImageView) listItem.findViewById(R.id.file_list_item_icon);
+            if( filePaths[position].getName().endsWith(".odt") ){
+                imageView.setImageResource(R.drawable.writer);
+            }
+            if( filePaths[position].getName().endsWith(".ods") ){
+                imageView.setImageResource(R.drawable.calc);
+            }
+            if( filePaths[position].getName().endsWith(".odp") ){
+                imageView.setImageResource(R.drawable.impress);
+            }
+            if( filePaths[position].isDirectory() ){
+                //Eventually have thumbnails of each sub file on a black circle
+                //For now just a folder icon
+                imageView.setImageResource(R.drawable.folder);
+            }
+            //imageView.setClickable(true);
+            return listItem;
+        }
+
+        public int getViewTypeCount() {
+            // TODO Auto-generated method stub
+            return 1;
+        }
+
+        public boolean hasStableIds() {
+            // TODO Auto-generated method stub
+            return false;
+        }
+
+        public boolean isEmpty() {
+            // TODO Auto-generated method stub
+            return false;
+        }
+
+        public void registerDataSetObserver(DataSetObserver arg0) {
+            // TODO Auto-generated method stub
+
+        }
+
+        public void unregisterDataSetObserver(DataSetObserver arg0) {
+            // TODO Auto-generated method stub
+
+        }
+
+        public boolean areAllItemsEnabled() {
+            // TODO Auto-generated method stub
+            return false;
+        }
+
+        public boolean isEnabled(int position) {
+            // TODO Auto-generated method stub
+            return false;
+        }
 
     }
 
@@ -628,15 +629,14 @@ class ListItemAdapter implements ListAdapter{
 
         ThumbnailGenerator( File file ){
             this.file = file;
-                String input = file.getAbsolutePath();
-                if (input == null)
-                    input = "/assets/test1.odt";
-                // Load the wanted document
-                new DocumentLoadTask().executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, "file://" + input);
+            String input = file.getAbsolutePath();
+            if (input == null)
+                input = "/assets/test1.odt";
+            // Load the wanted document
+            new DocumentLoadTask().executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, "file://" + input);
         }
 
-        class DocumentLoadTask
-            extends AsyncTask<String, Void, Integer>
+        class DocumentLoadTask extends AsyncTask<String, Void, Integer>
         {
 
             ByteBuffer renderPage(int number, int width , int height)
@@ -698,9 +698,9 @@ class ListItemAdapter implements ListAdapter{
                         Log.i(TAG, "w,h Scaling with " + scaleNumerator + "/" + scaleDenominator);
 
                         device = toolkit.createScreenCompatibleDeviceUsingBuffer(width, height,
-                                                                                 scaleNumerator, scaleDenominator,
-                                                                                 0, 0,
-                                                                                 wrapped_bb);
+                                scaleNumerator, scaleDenominator,
+                                0, 0,
+                                wrapped_bb);
                     }
 
                     // Update the property that points to the device
@@ -785,9 +785,9 @@ class ListItemAdapter implements ListAdapter{
                     toolkit = (XToolkitExperimental) UnoRuntime.queryInterface(XToolkitExperimental.class, toolkitService);
 
                     renderable = (XRenderable) UnoRuntime.queryInterface(XRenderable.class, doc);
-		    if (renderable == null)
-			// some serious error with the rendering backend
-			return new Integer(0);
+                    if (renderable == null)
+                        // some serious error with the rendering backend
+                        return new Integer(0);
 
                     // Set up dummySmallDevice and use it to find out the number
                     // of pages ("renderers").
@@ -817,14 +817,14 @@ class ListItemAdapter implements ListAdapter{
                     finish();
                 }
                 return new Integer( 0 );
-        }
+            }
 
             protected void onPostExecute(Integer result){
 
-		if (renderable == null) {
+                if (renderable == null) {
                     Log.i(TAG, "Document is un-renderable");
-		    return; // TODO: check if this falls-back to a sensible image
-		}
+                    return; // TODO: check if this falls-back to a sensible image
+                }
 
                 int widthInPx = dpToPx( 100 );
                 int heightInPx = dpToPx( (int)( 100*Math.sqrt(2) ) );
@@ -868,75 +868,74 @@ class ListItemAdapter implements ListAdapter{
                     // TODO: handle exception
                 }
                 ( (GridItemAdapter)gv.getAdapter() ).update();
-        }
+            }
         }
 
-        class MyXController
-            implements XController
+        class MyXController implements XController
         {
 
-        XFrame frame;
-        XModel model;
+            XFrame frame;
+            XModel model;
 
-        public void attachFrame(XFrame frame)
-        {
-            Log.i(TAG, "attachFrame");
-            this.frame = frame;
-        }
+            public void attachFrame(XFrame frame)
+            {
+                Log.i(TAG, "attachFrame");
+                this.frame = frame;
+            }
 
-        public boolean attachModel(XModel model)
-        {
-            Log.i(TAG, "attachModel");
-            this.model = model;
-            return true;
-        }
+            public boolean attachModel(XModel model)
+            {
+                Log.i(TAG, "attachModel");
+                this.model = model;
+                return true;
+            }
 
-        public boolean suspend(boolean doSuspend)
-        {
-            Log.i(TAG, "suspend");
-            return false;
-        }
+            public boolean suspend(boolean doSuspend)
+            {
+                Log.i(TAG, "suspend");
+                return false;
+            }
 
-        public Object getViewData()
-        {
-            Log.i(TAG, "getViewData");
-            return null;
-        }
+            public Object getViewData()
+            {
+                Log.i(TAG, "getViewData");
+                return null;
+            }
 
-        public void restoreViewData(Object data)
-        {
-            Log.i(TAG, "restoreViewData");
-        }
+            public void restoreViewData(Object data)
+            {
+                Log.i(TAG, "restoreViewData");
+            }
 
-        public XModel getModel()
-        {
-            Log.i(TAG, "getModel");
-            return model;
-        }
+            public XModel getModel()
+            {
+                Log.i(TAG, "getModel");
+                return model;
+            }
 
-        public XFrame getFrame()
-        {
-            Log.i(TAG, "getFrame");
-            return frame;
-        }
+            public XFrame getFrame()
+            {
+                Log.i(TAG, "getFrame");
+                return frame;
+            }
 
-        public void dispose()
-        {
-            Log.i(TAG, "dispose");
-        }
+            public void dispose()
+            {
+                Log.i(TAG, "dispose");
+            }
 
-        public void addEventListener(XEventListener listener)
-        {
-            Log.i(TAG, "addEventListener");
-        }
+            public void addEventListener(XEventListener listener)
+            {
+                Log.i(TAG, "addEventListener");
+            }
 
-        public void removeEventListener(XEventListener listener)
-        {
-            Log.i(TAG, "removeEventListener");
+            public void removeEventListener(XEventListener listener)
+            {
+                Log.i(TAG, "removeEventListener");
+            }
         }
-    }
 
     }
 }
 
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/ListItemAdapter.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/ListItemAdapter.java
index cd3330c..79e3c04 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/ListItemAdapter.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/ListItemAdapter.java
@@ -1,3 +1,4 @@
+/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -25,144 +26,145 @@ import android.widget.ListAdapter;
 import android.widget.TextView;
 
 /*Currently this is class is not used but instead is implemented as an inner class in LibreOfficeUI.
- * This is because I can't get the onItemClickListener to fire on the listview so I need to set an 
- * onClick listener in the adapter. ( I've tried turning off the focusability etc of the listitem 
+ * This is because I can't get the onItemClickListener to fire on the listview so I need to set an
+ * onClick listener in the adapter. ( I've tried turning off the focusability etc of the listitem
  * contents but no dice...) */
 public class ListItemAdapter implements ListAdapter{
-	private Context mContext;
-	private File[] filePaths;
-	private final long KB = 1024;
-	private final long MB = 1048576;
-	
-	public ListItemAdapter(Context mContext, File[] filePaths) {
-		this.mContext = mContext;
-		this.filePaths = filePaths;
-	}
-	
-	public int getCount() {
-		// TODO Auto-generated method stub
-		return filePaths.length;
-	}
-
-	public Object getItem(int arg0) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	public long getItemId(int arg0) {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	public int getItemViewType(int arg0) {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	public View getView(int position, View convertView, ViewGroup parent) {
-		LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(
-				Context.LAYOUT_INFLATER_SERVICE);
-		
-		View listItem;
- 
-		if (convertView == null) {
-			listItem = new View(mContext);
-			listItem = inflater.inflate(R.layout.file_list_item, null);
-		} else {
-			listItem = (View) convertView;
-		}
-		
-		listItem.setClickable(true);
-		listItem.setOnClickListener(new OnClickListener() {
-			
-			public void onClick(View v) {
-				Log.d("LIST", "click!");
-			}
-		});
-		
-		
-		
-		// set value into textview
-		TextView filename = (TextView) listItem.findViewById(R.id.file_list_item_name);
-		filename.setText( filePaths[ position ].getName() );
-		//filename.setClickable(true);
-		
-		TextView fileSize = (TextView) listItem.findViewById(R.id.file_list_item_size);
-		//TODO Give size in KB , MB as appropriate.
-		String size = "0B";
-		long length = filePaths[ position ].length();
-		if( length < KB ){
-			size = Long.toString( length ) + "B";
-		}
-		if( length >= KB && length < MB){
-			size = Long.toString( length/KB ) + "KB";
-		}
-		if( length >= MB){
-			size = Long.toString( length/MB ) + "MB";
-		}
-		fileSize.setText( size );
-		//fileSize.setClickable(true);
-		
-		TextView fileDate = (TextView) listItem.findViewById(R.id.file_list_item_date);
-		SimpleDateFormat df = new SimpleDateFormat("dd MMM yyyy hh:ss");
-		Date date = new Date( filePaths[ position ].lastModified() );
-		//TODO format date
-		fileDate.setText( df.format( date ) );
-		
-		// set image based on selected text
-		ImageView imageView = (ImageView) listItem.findViewById(R.id.file_list_item_icon);
-		if( filePaths[position].getName().endsWith(".odt") ){
-			imageView.setImageResource(R.drawable.writer);
-		}
-		if( filePaths[position].getName().endsWith(".ods") ){
-			imageView.setImageResource(R.drawable.calc);
-		}
-		if( filePaths[position].getName().endsWith(".odp") ){
-			imageView.setImageResource(R.drawable.impress);
-		}
-		if( filePaths[position].isDirectory() ){
-			//Eventually have thumbnails of each sub file on a black circle
-			//For now just a folder icon
-			imageView.setImageResource(R.drawable.folder);
-		}
-		//imageView.setClickable(true);
-		return listItem;
-	}
-
-	public int getViewTypeCount() {
-		// TODO Auto-generated method stub
-		return 1;
-	}
-
-	public boolean hasStableIds() {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-	public boolean isEmpty() {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-	public void registerDataSetObserver(DataSetObserver arg0) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	public void unregisterDataSetObserver(DataSetObserver arg0) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	public boolean areAllItemsEnabled() {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-	public boolean isEnabled(int position) {
-		// TODO Auto-generated method stub
-		return false;
-	}
+    private Context mContext;
+    private File[] filePaths;
+    private final long KB = 1024;
+    private final long MB = 1048576;
+
+    public ListItemAdapter(Context mContext, File[] filePaths) {
+        this.mContext = mContext;
+        this.filePaths = filePaths;
+    }
+
+    public int getCount() {
+        // TODO Auto-generated method stub
+        return filePaths.length;
+    }
+
+    public Object getItem(int arg0) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public long getItemId(int arg0) {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public int getItemViewType(int arg0) {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public View getView(int position, View convertView, ViewGroup parent) {
+        LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(
+                Context.LAYOUT_INFLATER_SERVICE);
+
+        View listItem;
+
+        if (convertView == null) {
+            listItem = new View(mContext);
+            listItem = inflater.inflate(R.layout.file_list_item, null);
+        } else {
+            listItem = (View) convertView;
+        }
+
+        listItem.setClickable(true);
+        listItem.setOnClickListener(new OnClickListener() {
+
+            public void onClick(View v) {
+                Log.d("LIST", "click!");
+            }
+        });
+
+
+
+        // set value into textview
+        TextView filename = (TextView) listItem.findViewById(R.id.file_list_item_name);
+        filename.setText( filePaths[ position ].getName() );
+        //filename.setClickable(true);
+
+        TextView fileSize = (TextView) listItem.findViewById(R.id.file_list_item_size);
+        //TODO Give size in KB , MB as appropriate.
+        String size = "0B";
+        long length = filePaths[ position ].length();
+        if( length < KB ){
+            size = Long.toString( length ) + "B";
+        }
+        if( length >= KB && length < MB){
+            size = Long.toString( length/KB ) + "KB";
+        }
+        if( length >= MB){
+            size = Long.toString( length/MB ) + "MB";
+        }
+        fileSize.setText( size );
+        //fileSize.setClickable(true);
+
+        TextView fileDate = (TextView) listItem.findViewById(R.id.file_list_item_date);
+        SimpleDateFormat df = new SimpleDateFormat("dd MMM yyyy hh:ss");
+        Date date = new Date( filePaths[ position ].lastModified() );
+        //TODO format date
+        fileDate.setText( df.format( date ) );
+
+        // set image based on selected text
+        ImageView imageView = (ImageView) listItem.findViewById(R.id.file_list_item_icon);
+        if( filePaths[position].getName().endsWith(".odt") ){
+            imageView.setImageResource(R.drawable.writer);
+        }
+        if( filePaths[position].getName().endsWith(".ods") ){
+            imageView.setImageResource(R.drawable.calc);
+        }
+        if( filePaths[position].getName().endsWith(".odp") ){
+            imageView.setImageResource(R.drawable.impress);
+        }
+        if( filePaths[position].isDirectory() ){
+            //Eventually have thumbnails of each sub file on a black circle
+            //For now just a folder icon
+            imageView.setImageResource(R.drawable.folder);
+        }
+        //imageView.setClickable(true);
+        return listItem;
+    }
+
+    public int getViewTypeCount() {
+        // TODO Auto-generated method stub
+        return 1;
+    }
+
+    public boolean hasStableIds() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public boolean isEmpty() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public void registerDataSetObserver(DataSetObserver arg0) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void unregisterDataSetObserver(DataSetObserver arg0) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public boolean areAllItemsEnabled() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public boolean isEnabled(int position) {
+        // TODO Auto-generated method stub
+        return false;
+    }
 
 }
 
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/PageView.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/PageView.java
index 59033e1..76b1a1c 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/PageView.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/PageView.java
@@ -1,3 +1,5 @@
+/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
 package org.libreoffice.ui;
 
 import org.libreoffice.R;
@@ -13,53 +15,55 @@ import android.util.Log;
 import android.view.View;
 
 public class PageView extends View{
-	private Bitmap bmp;
-	private Paint mPaintBlack;
-	private String tag = "PageView";
-	
-	public PageView(Context context ) {
-		super(context);
-		bmp = BitmapFactory.decodeResource(getResources(), R.drawable.dummy_page);
-		intialise();
-	}
-	public PageView(Context context, AttributeSet attrs) {
+    private Bitmap bmp;
+    private Paint mPaintBlack;
+    private String tag = "PageView";
+
+    public PageView(Context context ) {
+        super(context);
+        bmp = BitmapFactory.decodeResource(getResources(), R.drawable.dummy_page);
+        intialise();
+    }
+    public PageView(Context context, AttributeSet attrs) {
         super(context, attrs);
-		bmp = BitmapFactory.decodeResource(getResources(), R.drawable.dummy_page);
-		Log.d( tag , bmp.toString());
-		intialise();
+        bmp = BitmapFactory.decodeResource(getResources(), R.drawable.dummy_page);
+        Log.d( tag , bmp.toString());
+        intialise();
     }
     public PageView(Context context, AttributeSet attrs, int defStyle) {
         super(context, attrs, defStyle);
-		bmp = BitmapFactory.decodeResource(getResources(), R.drawable.dummy_page);//load a "page"
-		intialise();
+        bmp = BitmapFactory.decodeResource(getResources(), R.drawable.dummy_page);//load a "page"
+        intialise();
     }
-    
+
     private void intialise(){
-    	mPaintBlack = new Paint();
-    	mPaintBlack.setARGB(255, 0, 0, 0);
-    	Log.d(tag, " Doing some set-up");
+        mPaintBlack = new Paint();
+        mPaintBlack.setARGB(255, 0, 0, 0);
+        Log.d(tag, " Doing some set-up");
+    }
+
+    public void setBitmap(Bitmap bmp){
+        this.bmp = bmp;
+    }
+
+    @Override
+    protected void onDraw(Canvas canvas) {
+        super.onDraw(canvas);
+        Log.d(tag, "Draw");
+        Log.d(tag, Integer.toString(bmp.getHeight()));
+        if( bmp != null ){
+            int horizontalMargin = (int) (canvas.getWidth()*0.1);
+            //int verticalMargin = (int) (canvas.getHeight()*0.1);
+            int verticalMargin = horizontalMargin;
+            canvas.drawBitmap(bmp, new Rect(0, 0, bmp.getWidth(), bmp.getHeight()),
+                    new Rect(horizontalMargin,verticalMargin,canvas.getWidth()-horizontalMargin,
+                        canvas.getHeight()-verticalMargin),
+                    mPaintBlack);//
+        }
+        if( bmp == null)
+            canvas.drawText("Bmp is null!", 100, 100, new Paint());
     }
-	
-	public void setBitmap(Bitmap bmp){
-		this.bmp = bmp;
-	}
-	
-	@Override
-	protected void onDraw(Canvas canvas) {
-		super.onDraw(canvas);
-		Log.d(tag, "Draw");
-		Log.d(tag, Integer.toString(bmp.getHeight()));
-		if( bmp != null ){
-			int horizontalMargin = (int) (canvas.getWidth()*0.1);
-			//int verticalMargin = (int) (canvas.getHeight()*0.1);
-			int verticalMargin = horizontalMargin;
-			canvas.drawBitmap(bmp, new Rect(0, 0, bmp.getWidth(), bmp.getHeight()), 
-					new Rect(horizontalMargin,verticalMargin,canvas.getWidth()-horizontalMargin,
-							canvas.getHeight()-verticalMargin),
-					mPaintBlack);//
-		}
-		if( bmp == null)
-			canvas.drawText("Bmp is null!", 100, 100, new Paint());
-	}
 
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/PreferenceEditor.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/PreferenceEditor.java
index b479bae..23d7a12 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/PreferenceEditor.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/PreferenceEditor.java
@@ -1,3 +1,4 @@
+/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -5,6 +6,7 @@
  * 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/.
  */
+
 package org.libreoffice.ui;
 
 import org.libreoffice.R;
@@ -16,12 +18,14 @@ import android.preference.Preference.OnPreferenceClickListener;
 import android.preference.PreferenceActivity;
 
 public class PreferenceEditor extends PreferenceActivity {
-	public final static String FilterTypePrefKey = "FilterTypePreference";
-	
-	@Override
-	protected void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-		addPreferencesFromResource( R.xml.libreoffice_preferences );
-		//mPrefs = getSharedPreferences( LibreOfficeUIActivity.EXPLORER_PREFS_KEY , MODE_PRIVATE );
-	}
+    public final static String FilterTypePrefKey = "FilterTypePreference";
+
+    @Override
+        protected void onCreate(Bundle savedInstanceState) {
+            super.onCreate(savedInstanceState);
+            addPreferencesFromResource( R.xml.libreoffice_preferences );
+            //mPrefs = getSharedPreferences( LibreOfficeUIActivity.EXPLORER_PREFS_KEY , MODE_PRIVATE );
+        }
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/WriterViewerActivity.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/WriterViewerActivity.java
index 9119ea4..56a2038 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/WriterViewerActivity.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/WriterViewerActivity.java
@@ -1,3 +1,4 @@
+/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -17,31 +18,33 @@ import android.os.Bundle;
 import android.view.MenuItem;
 
 public class WriterViewerActivity extends Activity{
-	private Bundle extras;
-	
-	@Override
-	protected void onCreate(Bundle savedInstanceState) {
-		// TODO Auto-generated method stub
-		super.onCreate(savedInstanceState);
-		extras = getIntent().getExtras();
-		setContentView(R.layout.main);
-	    ActionBar actionBar = getActionBar();
-	    actionBar.setDisplayHomeAsUpEnabled(true);
-	}
-	
-	@Override
-	public boolean onOptionsItemSelected(MenuItem item) {
-	    switch (item.getItemId()) {
-	        case android.R.id.home:
-	            // app icon in action bar clicked; go home
-	            Intent intent = new Intent(this, LibreOfficeUIActivity.class);
-	            intent.putExtras( extras );
-	            //intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
-	            startActivity(intent);
-	            return true;
-	        default:
-	            return super.onOptionsItemSelected(item);
-	    }
-	}
+    private Bundle extras;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        // TODO Auto-generated method stub
+        super.onCreate(savedInstanceState);
+        extras = getIntent().getExtras();
+        setContentView(R.layout.main);
+        ActionBar actionBar = getActionBar();
+        actionBar.setDisplayHomeAsUpEnabled(true);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        switch (item.getItemId()) {
+            case android.R.id.home:
+                // app icon in action bar clicked; go home
+                Intent intent = new Intent(this, LibreOfficeUIActivity.class);
+                intent.putExtras( extras );
+                //intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+                startActivity(intent);
+                return true;
+            default:
+                return super.onOptionsItemSelected(item);
+        }
+    }
 
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list