Commit cb305f00 authored by Geoffrey Métais's avatar Geoffrey Métais

New player for old phones

parent e9c5d0e7
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent" >
<!--
the double FrameLayout is necessary here to do cropping on the bottom right
(which requires the surface not be centered), while keeping the result centered
-->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false" >
<FrameLayout
android:id="@+id/player_surface_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:foregroundGravity="clip_horizontal|clip_vertical" >
<SurfaceView
android:id="@+id/player_surface"
android:layout_width="1dp"
android:layout_height="1dp" />
<SurfaceView
android:id="@+id/subtitles_surface"
android:layout_width="1dp"
android:layout_height="1dp"
android:visibility="invisible" />
</FrameLayout>
</FrameLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true" >
<include
android:id="@+id/player_overlay_tips"
android:layout_width="match_parent"
android:layout_height="match_parent"
layout="@layout/player_tips" />
<ImageView
android:id="@+id/player_overlay_loading"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerHorizontal="true"
android:layout_above="@+id/player_overlay_loading_text"
android:src="@drawable/ic_cone_o" />
<TextView
android:id="@+id/player_overlay_loading_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/player_overlay_info"
android:layout_centerHorizontal="true"
android:textAppearance="@style/TextAppearance.AppCompat.SearchResult.Title" />
<TextView
android:id="@+id/player_overlay_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/progress_overlay"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:background="@drawable/video_list_length_bg"
android:padding="5dp"
android:textColor="#ffffff"
android:textSize="36sp"
android:visibility="invisible" />
<!-- Media HUD -->
<include layout="@layout/player_hud"/>
</RelativeLayout>
<!--<fragment-->
<!--android:name="org.videolan.vlc.gui.video.AdvancedOptionsFragment"-->
<!--android:layout_width="600dp"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_alignParentRight="true"/>-->
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
android:layout_height="match_parent" >
<!--
the double FrameLayout is necessary here to do cropping on the bottom right
(which requires the surface not be centered), while keeping the result centered
-->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
......@@ -23,149 +24,65 @@
android:id="@+id/player_surface"
android:layout_width="1dp"
android:layout_height="1dp" />
<SurfaceView
android:id="@+id/subtitles_surface"
android:layout_width="1dp"
android:layout_height="1dp" />
android:layout_height="1dp"
android:visibility="invisible" />
</FrameLayout>
</FrameLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true" >
<include
android:id="@+id/player_overlay_tips"
android:layout_width="match_parent"
android:layout_height="match_parent"
layout="@layout/player_tips" />
<ImageView
android:id="@+id/player_overlay_loading"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerHorizontal="true"
android:layout_above="@+id/player_overlay_loading_text"
android:src="@drawable/ic_cone_o" />
<TextView
android:id="@+id/player_overlay_loading_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/player_overlay_info"
android:layout_centerHorizontal="true"
android:textAppearance="@style/TextAppearance.AppCompat.SearchResult.Title" />
<TextView
android:id="@+id/player_overlay_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/progress_overlay"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:background="@drawable/video_list_length_bg"
android:padding="5dp"
android:textColor="#ffffff"
android:textSize="36sp"
android:visibility="invisible" />
<!-- Media HUD -->
<include layout="@layout/player_hud"/>
<include
android:id="@+id/player_overlay_tips"
android:layout_width="match_parent"
android:layout_height="match_parent"
layout="@layout/player_tips" />
<ImageView
android:id="@+id/player_overlay_play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/ic_pause_circle"
android:visibility="invisible" />
<ImageView
android:id="@+id/player_overlay_loading"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerInParent="true"
android:src="@drawable/ic_cone_o" />
<TextView
android:id="@+id/player_overlay_loading_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/player_overlay_loading"
android:layout_centerHorizontal="true"
android:textSize="20sp"
android:text="@string/please_wait" />
<TextView
android:id="@+id/player_overlay_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/player_overlay_play"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:background="@drawable/video_list_length_bg"
android:padding="5dp"
android:textColor="#ffffff"
android:textSize="36sp"
android:visibility="invisible" />
<!-- <include layout="@layout/player_overlay_header" /> -->
<RelativeLayout
android:id="@+id/progress_overlay"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="?attr/video_player_overlay"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:visibility="invisible" >
<ImageView
android:id="@+id/lock_overlay_button"
android:layout_width="40dip"
android:layout_height="40dip"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:src="@drawable/ic_lock" />
<ImageView
android:id="@+id/player_overlay_backward"
android:layout_width="40dip"
android:layout_height="40dip"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:layout_toRightOf="@+id/lock_overlay_button"
android:src="@drawable/ic_backward_w"
android:visibility="gone"/>
<TextView
android:id="@+id/player_overlay_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:layout_toRightOf="@+id/player_overlay_backward"
android:clickable="true"
android:text="@string/time_0"
android:textColor="#ffffff"
android:textSize="15sp" />
<SeekBar
android:id="@+id/player_overlay_seekbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/player_overlay_length"
android:layout_toRightOf="@+id/player_overlay_time"
android:maxHeight="2dip"
android:minHeight="2dip"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:progressDrawable="@drawable/po_seekbar"
android:thumb="@drawable/seekbar_thumb" />
<TextView
android:id="@+id/player_overlay_length"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_toLeftOf="@+id/player_overlay_forward"
android:clickable="true"
android:text="@string/time_0"
android:textColor="#ffffff"
android:textSize="15sp" />
<ImageView
android:id="@+id/player_overlay_forward"
android:layout_width="40dip"
android:layout_height="40dip"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_toLeftOf="@+id/player_overlay_size"
android:src="@drawable/ic_forward_w"
android:visibility="gone"/>
<ImageView
android:id="@+id/player_overlay_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:src="@drawable/ic_crop_circle" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
<!--<fragment-->
<!--android:name="org.videolan.vlc.gui.video.AdvancedOptionsFragment"-->
<!--android:layout_width="600dp"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_alignParentRight="true"/>-->
</RelativeLayout>
\ No newline at end of file
......@@ -10,7 +10,9 @@
android:layout_centerHorizontal="true"
android:paddingTop="@dimen/overlay_padding_top"
android:paddingBottom="@dimen/overlay_padding_bottom"
android:layout_marginBottom="20dp">
android:layout_marginBottom="@dimen/overlay_margin"
android:layout_marginRight="2dp"
android:layout_marginLeft="2dp">
<SeekBar
android:id="@+id/player_overlay_seekbar"
......@@ -19,6 +21,7 @@
android:maxHeight="@dimen/seekbar_height"
android:minHeight="@dimen/seekbar_height"
android:layout_alignParentTop="true"
android:layout_marginBottom="5dp"
android:progressDrawable="@drawable/po_seekbar"
android:thumb="@drawable/seekbar_thumb"
android:focusable="true"/>
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<!--
the double FrameLayout is necessary here to do cropping on the bottom right
(which requires the surface not be centered), while keeping the result centered
-->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false" >
<FrameLayout
android:id="@+id/player_surface_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:foregroundGravity="clip_horizontal|clip_vertical" >
<SurfaceView
android:id="@+id/player_surface"
android:layout_width="1dp"
android:layout_height="1dp" />
<SurfaceView
android:id="@+id/subtitles_surface"
android:layout_width="1dp"
android:layout_height="1dp" />
</FrameLayout>
</FrameLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true" >
<include
android:id="@+id/player_overlay_tips"
android:layout_width="match_parent"
android:layout_height="match_parent"
layout="@layout/player_tips" />
<ImageView
android:id="@+id/player_overlay_play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/ic_pause_circle"
android:visibility="invisible" />
<ImageView
android:id="@+id/player_overlay_loading"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerInParent="true"
android:src="@drawable/ic_cone_o" />
<TextView
android:id="@+id/player_overlay_loading_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/player_overlay_loading"
android:layout_centerHorizontal="true"
android:textSize="20sp"
android:text="@string/please_wait" />
<TextView
android:id="@+id/player_overlay_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/player_overlay_play"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:background="@drawable/video_list_length_bg"
android:padding="5dp"
android:textColor="#ffffff"
android:textSize="36sp"
android:visibility="invisible" />
<!-- <include layout="@layout/player_overlay_header" /> -->
<RelativeLayout
android:id="@+id/progress_overlay"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="?attr/video_player_overlay"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:visibility="invisible" >
<ImageView
android:id="@+id/lock_overlay_button"
android:layout_width="40dip"
android:layout_height="40dip"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:src="@drawable/ic_lock" />
<ImageView
android:id="@+id/player_overlay_backward"
android:layout_width="40dip"
android:layout_height="40dip"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:layout_toRightOf="@+id/lock_overlay_button"
android:src="@drawable/ic_backward_w"
android:visibility="gone"/>
<TextView
android:id="@+id/player_overlay_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:layout_toRightOf="@+id/player_overlay_backward"
android:clickable="true"
android:text="@string/time_0"
android:textColor="#ffffff"
android:textSize="15sp" />
<SeekBar
android:id="@+id/player_overlay_seekbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/player_overlay_length"
android:layout_toRightOf="@+id/player_overlay_time"
android:maxHeight="2dip"
android:minHeight="2dip"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:progressDrawable="@drawable/po_seekbar"
android:thumb="@drawable/seekbar_thumb" />
<TextView
android:id="@+id/player_overlay_length"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_toLeftOf="@+id/player_overlay_forward"
android:clickable="true"
android:text="@string/time_0"
android:textColor="#ffffff"
android:textSize="15sp" />
<ImageView
android:id="@+id/player_overlay_forward"
android:layout_width="40dip"
android:layout_height="40dip"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_toLeftOf="@+id/player_overlay_size"
android:src="@drawable/ic_forward_w"
android:visibility="gone"/>
<ImageView
android:id="@+id/player_overlay_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:src="@drawable/ic_crop_circle" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
<resources>
<!-- Video Player -->
<dimen name="media_ctrl_margin_top">30dp</dimen>
<dimen name="images_margin_sides">60dp</dimen>
<dimen name="overlay_margin">5dp</dimen>
</resources>
\ No newline at end of file
......@@ -7,5 +7,6 @@
<dimen name="grid_card_vertical_spacing">10dp</dimen>
<!-- Video Player -->
<dimen name="media_ctrl_margin_top">30dp</dimen>
<dimen name="images_margin_sides">50dp</dimen>
<dimen name="images_margin_sides">60dp</dimen>
<dimen name="overlay_margin">10dp</dimen>
</resources>
\ No newline at end of file
......@@ -14,8 +14,9 @@
<!-- Video Player -->
<dimen name="overlay_padding_bottom">15dip</dimen>
<dimen name="overlay_padding_top">20dip</dimen>
<dimen name="overlay_padding_top">10dip</dimen>
<dimen name="overlay_padding_sides">5dp</dimen>
<dimen name="overlay_margin">2dp</dimen>
<dimen name="seekbar_height">2dip</dimen>
<dimen name="seekbar_padding_sides">5dip</dimen>
......
......@@ -73,6 +73,7 @@ import android.content.res.Configuration;
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.media.AudioManager.OnAudioFocusChangeListener;
import android.media.MediaRouter;
......@@ -167,7 +168,6 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
private static final int FADE_OUT_INFO = 4;
private boolean mDragging;
private boolean mShowing;
;
private int mUiVisibility = -1;
private SeekBar mSeekbar;
private TextView mTitle;
......@@ -325,6 +325,11 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
mSysTime = (TextView) findViewById(R.id.player_overlay_systime);
mBattery = (TextView) findViewById(R.id.player_overlay_battery);
mOverlayProgress = findViewById(R.id.progress_overlay);
//Manually set opacity, because aplha tag is SDK 11+
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1){
Drawable background = mOverlayProgress.getBackground();
background.setAlpha(140); //255 is max (visible)
}
mOverlayBackground = findViewById(R.id.player_overlay_background);
// Position and remaining time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment