Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
19fadacc
Commit
19fadacc
authored
May 05, 2012
by
Sébastien Toque
Browse files
UI Preview: add a landscape layout
parent
cf7fe169
Changes
3
Hide whitespace changes
Inline
Side-by-side
vlc-android/AndroidManifest.xml
View file @
19fadacc
...
...
@@ -62,8 +62,7 @@
android:theme=
"@android:style/Theme.NoTitleBar"
/>
<activity
android:name=
".gui.video.MediaInfoActivity"
android:theme=
"@android:style/Theme.NoTitleBar"
android:configChanges=
"orientation|screenSize"
/>
android:theme=
"@android:style/Theme.NoTitleBar"
/>
<activity
android:name=
".gui.video.VideoPlayerActivity"
android:configChanges=
"orientation|screenSize"
...
...
vlc-android/res/layout-land/media_info.xml
0 → 100644
View file @
19fadacc
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"fill_parent"
android:layout_height=
"48dip"
android:background=
"@drawable/header"
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"fill_parent"
android:scaleType=
"centerInside"
android:src=
"@drawable/header_logo"
/>
</LinearLayout>
<TextView
android:id=
"@+id/title"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/video_list_length_bg"
android:textAppearance=
"?android:attr/textAppearanceMedium"
/>
<LinearLayout
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:orientation=
"horizontal"
>
<FrameLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_weight=
"1"
>
<ProgressBar
style=
"?android:attr/progressBarStyleLarge"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
/>
<ImageView
android:id=
"@+id/image"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:scaleType=
"fitCenter"
/>
<ImageButton
android:id=
"@+id/play"
android:layout_width=
"50dip"
android:layout_height=
"50dip"
android:layout_gravity=
"bottom|left"
android:layout_margin=
"10dip"
android:background=
"@drawable/ic_play"
android:onClick=
"onPlayClick"
android:visibility=
"invisible"
/>
<TextView
android:id=
"@+id/length"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom|right"
android:layout_margin=
"10dip"
android:background=
"@drawable/video_list_length_bg"
android:textAppearance=
"?android:attr/textAppearanceMedium"
/>
</FrameLayout>
<ListView
android:id=
"@id/android:list"
android:layout_width=
"0dp"
android:layout_height=
"fill_parent"
android:layout_weight=
"1"
android:cacheColorHint=
"#00000000"
android:divider=
"#00000000"
android:fastScrollEnabled=
"true"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
vlc-android/src/org/videolan/vlc/gui/video/MediaInfoActivity.java
View file @
19fadacc
...
...
@@ -43,7 +43,9 @@ import android.widget.ImageView;
import
android.widget.TextView
;
public
class
MediaInfoActivity
extends
ListActivity
{
public
final
static
String
TAG
=
"VLC/MediaInfoActivity"
;
public
static
final
String
KEY
=
"MediaInfoActivity.image"
;
private
Media
mItem
;
private
Bitmap
mImage
;
private
ImageButton
mPlayButton
;
...
...
@@ -56,6 +58,9 @@ public class MediaInfoActivity extends ListActivity {
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
media_info
);
if
(
savedInstanceState
!=
null
)
mImage
=
savedInstanceState
.
getParcelable
(
KEY
);
String
MRL
=
getIntent
().
getExtras
().
getString
(
"itemLocation"
);
if
(
MRL
==
null
)
return
;
...
...
@@ -77,6 +82,12 @@ public class MediaInfoActivity extends ListActivity {
new
Thread
(
mLoadImage
).
start
();
}
@Override
protected
void
onSaveInstanceState
(
Bundle
outState
)
{
super
.
onSaveInstanceState
(
outState
);
outState
.
putParcelable
(
KEY
,
mImage
);
}
public
void
onPlayClick
(
View
v
)
{
Intent
intent
=
new
Intent
(
this
,
VideoPlayerActivity
.
class
);
intent
.
putExtra
(
"itemLocation"
,
mItem
.
getLocation
());
...
...
@@ -96,20 +107,22 @@ public class MediaInfoActivity extends ListActivity {
mTracks
=
mLibVlc
.
readTracksInfo
(
mItem
.
getLocation
());
mHandler
.
sendEmptyMessage
(
NEW_TEXT
);
int
width
=
Math
.
min
(
getWindowManager
().
getDefaultDisplay
().
getWidth
(),
getWindowManager
().
getDefaultDisplay
().
getHeight
());
int
height
=
width
*
9
/
16
;
if
(
mImage
==
null
)
{
int
width
=
Math
.
min
(
getWindowManager
().
getDefaultDisplay
().
getWidth
(),
getWindowManager
().
getDefaultDisplay
().
getHeight
());
int
height
=
width
*
9
/
16
;
// Get the thumbnail.
mImage
=
Bitmap
.
createBitmap
(
width
,
height
,
Config
.
ARGB_8888
);
// Get the thumbnail.
mImage
=
Bitmap
.
createBitmap
(
width
,
height
,
Config
.
ARGB_8888
);
byte
[]
b
=
mLibVlc
.
getThumbnail
(
mItem
.
getLocation
(),
width
,
height
);
byte
[]
b
=
mLibVlc
.
getThumbnail
(
mItem
.
getLocation
(),
width
,
height
);
if
(
b
==
null
)
// We were not able to create a thumbnail for this item.
return
;
if
(
b
==
null
)
// We were not able to create a thumbnail for this item.
return
;
mImage
.
copyPixelsFromBuffer
(
ByteBuffer
.
wrap
(
b
));
mImage
=
Util
.
cropBorders
(
mImage
,
width
,
height
);
mImage
.
copyPixelsFromBuffer
(
ByteBuffer
.
wrap
(
b
));
mImage
=
Util
.
cropBorders
(
mImage
,
width
,
height
);
}
mHandler
.
sendEmptyMessage
(
NEW_IMAGE
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment