diff options
author | Iain Billett <iainbillett@gmail.com> | 2012-07-13 16:38:25 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-08-07 15:23:53 +0100 |
commit | 97576def7d008661bf7fdc3700b56b77b88e97e6 (patch) | |
tree | 14f2766fef24cc0244d9183e923ccb2f4344d61f /android | |
parent | 5f3a75f97e4c4235c865c2687c3bfca37e19811b (diff) |
Some work on styling. Fix filter exception.
Change-Id: Ibf03680a29a0e7d5a484fedfa25863e88e063581
Diffstat (limited to 'android')
4 files changed, 29 insertions, 10 deletions
diff --git a/android/experimental/LibreOffice4Android/AndroidManifest.xml b/android/experimental/LibreOffice4Android/AndroidManifest.xml index 4991caeb8d16..1bb2a227fb6d 100644 --- a/android/experimental/LibreOffice4Android/AndroidManifest.xml +++ b/android/experimental/LibreOffice4Android/AndroidManifest.xml @@ -28,7 +28,8 @@ <!-- File Explorer Activities taken from eclipse workspace --> <activity android:name=".ui.LibreOfficeUIActivity" - android:label="@string/app_name" > + android:label="@string/app_name" + android:theme="@style/FileExplorer"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> diff --git a/android/experimental/LibreOffice4Android/res/values/styles.xml b/android/experimental/LibreOffice4Android/res/values/styles.xml index 26f8cf212f1f..ea1d1548a224 100644 --- a/android/experimental/LibreOffice4Android/res/values/styles.xml +++ b/android/experimental/LibreOffice4Android/res/values/styles.xml @@ -5,10 +5,19 @@ <item name="android:windowActionModeOverlay">true</item> <item name="android:actionBarStyle">@style/TransparentDarkActionBar</item> </style> + + <style name="FileExplorer" parent="@android:style/Theme.Holo.Light"> + <item name="android:actionBarStyle">@style/DarkActionBar</item> + </style> + <style name="TransparentDarkActionBar" parent="@android:style/Widget.Holo.ActionBar"> <item name="android:background">#bb000000</item> </style> - + <style name="DarkActionBar" parent="@android:style/Widget.Holo.ActionBar"> + <item name="android:background">#ff333333</item> + <item name="android:textColor">#dddddd</item> + </style> + <style name="grayBackground"> <item name="android:background">#dd000000</item> </style> diff --git a/android/experimental/LibreOffice4Android/src/org/libreoffice/android/DocumentLoader.java b/android/experimental/LibreOffice4Android/src/org/libreoffice/android/DocumentLoader.java index e883bb189af1..f26eedbc3b8a 100644 --- a/android/experimental/LibreOffice4Android/src/org/libreoffice/android/DocumentLoader.java +++ b/android/experimental/LibreOffice4Android/src/org/libreoffice/android/DocumentLoader.java @@ -1110,21 +1110,28 @@ public class DocumentLoader // Could easily make a new (larger) thumb but recycling // should be faster & more efficient, better for the environment ;-) //ll = (LinearLayout)findViewById( R.id.navigator); - Bitmap bmp = ( (ThumbnailView)ll.getChildAt( 0 ) ).getBitmap(); +// Bitmap bmp = ( (ThumbnailView)ll.getChildAt( 0 ) ).getBitmap(); + + ByteBuffer bb = renderPage( 0 , 100 , (int)( 100*Math.sqrt(2) ) ); +// bb.flip(); + Bitmap bmp = Bitmap.createBitmap( 100, (int)( 100*Math.sqrt(2) ), Bitmap.Config.ARGB_8888); + bmp.copyPixelsFromBuffer(bb); + File file = new File(extras.getString("input")); Log.i(TAG ,"onDestroy " + extras.getString("input")); File dir = file.getParentFile(); - String[] nameComponents = file.getName().split("[.]"); - for(String str : nameComponents){ - Log.i(TAG,"onDestroy " + str); - } File thumbnailFile = new File( dir , "." + file.getName().split("[.]")[0] + ".png"); try { - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + /*(ByteArrayOutputStream bytes = new ByteArrayOutputStream(); bmp.compress(Bitmap.CompressFormat.JPEG, 40, bytes); - thumbnailFile.createNewFile(); + if( !thumbnailFile.isFile() ) + thumbnailFile.createNewFile(); + FileOutputStream fo = new FileOutputStream( thumbnailFile ); + fo.write(bytes.toByteArray());*/ + if( !thumbnailFile.isFile() ) + thumbnailFile.createNewFile(); FileOutputStream fo = new FileOutputStream( thumbnailFile ); - fo.write(bytes.toByteArray()); + bmp.compress(Bitmap.CompressFormat.PNG, 40, fo); } catch (IOException e) { // TODO: handle exception } diff --git a/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/FileUtilities.java b/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/FileUtilities.java index 50fc6cbdc51c..28511589c010 100644 --- a/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/FileUtilities.java +++ b/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/FileUtilities.java @@ -124,6 +124,8 @@ public class FileUtilities { public boolean accept(File pathname) { if (pathname.isDirectory()) return true; + if( lookupExtension( pathname.getName() ) == UNKNOWN) + return false;// Thubnails will be unknown, for example. return doAccept(pathname.getName(), mode, ""); } }; |