[Android] UI: Increase thumbnail size
Sébastien Toque
git at videolan.org
Sat May 5 22:40:18 CEST 2012
android | branch: master | Sébastien Toque <xilasz at gmail.com> | Sat May 5 19:01:32 2012 +0200| [4a9d0d9ac7cefae85fde3a9849e95732d7f4299f] | committer: Sébastien Toque
UI: Increase thumbnail size
> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=4a9d0d9ac7cefae85fde3a9849e95732d7f4299f
---
vlc-android/res/layout/video_list_item.xml | 4 ++--
.../src/org/videolan/vlc/ThumbnailerManager.java | 10 ++++++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/vlc-android/res/layout/video_list_item.xml b/vlc-android/res/layout/video_list_item.xml
index c7a232a..90efd55 100644
--- a/vlc-android/res/layout/video_list_item.xml
+++ b/vlc-android/res/layout/video_list_item.xml
@@ -6,8 +6,8 @@
android:orientation="horizontal"
android:gravity="center_vertical">
<FrameLayout
- android:layout_width="90dip"
- android:layout_height="70dip">
+ android:layout_width="120dip"
+ android:layout_height="80dip">
<ImageView
android:id="@+id/ml_item_thumbnail"
android:layout_width="fill_parent"
diff --git a/vlc-android/src/org/videolan/vlc/ThumbnailerManager.java b/vlc-android/src/org/videolan/vlc/ThumbnailerManager.java
index 09eb48a..727e852 100644
--- a/vlc-android/src/org/videolan/vlc/ThumbnailerManager.java
+++ b/vlc-android/src/org/videolan/vlc/ThumbnailerManager.java
@@ -33,6 +33,7 @@ import org.videolan.vlc.gui.video.VideoListActivity;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
+import android.util.DisplayMetrics;
import android.util.Log;
public class ThumbnailerManager extends Thread {
@@ -46,6 +47,7 @@ public class ThumbnailerManager extends Thread {
private LibVLC mLibVlc;
private VideoListActivity mVideoListActivity;
private int totalCount;
+ private float mDensity;
public ThumbnailerManager(VideoListActivity videoListActivity) {
mVideoListActivity = videoListActivity;
@@ -54,6 +56,10 @@ public class ThumbnailerManager extends Thread {
} catch (LibVlcException e) {
e.printStackTrace();
}
+
+ DisplayMetrics metrics = new DisplayMetrics();
+ mVideoListActivity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
+ mDensity = metrics.density;
start();
}
@@ -116,8 +122,8 @@ public class ThumbnailerManager extends Thread {
MainActivity.sendTextInfo(mVideoListActivity, String.format("%s %s", prefix, item.getFileName()), count, total);
count++;
- int width = 120;
- int height = 120;
+ int width = (int) (120 * mDensity);
+ int height = (int) (120 * mDensity);
// Get the thumbnail.
Bitmap thumbnail = Bitmap.createBitmap(width, height, Config.ARGB_8888);
More information about the Android
mailing list