Commit 6f21a921 authored by Geoffrey Métais's avatar Geoffrey Métais

Better style and properties

Fix center HUD + fitsSystemWindow on Android 4 phones
All android version inherit the same style for player
parent cb305f00
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" > android:layout_height="fill_parent" >
<!-- <!--
the double FrameLayout is necessary here to do cropping on the bottom right the double FrameLayout is necessary here to do cropping on the bottom right
...@@ -34,55 +34,53 @@ ...@@ -34,55 +34,53 @@
</FrameLayout> </FrameLayout>
<RelativeLayout <RelativeLayout
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true" > 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_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" />
<include layout="@layout/player_hud"/>
</RelativeLayout> </RelativeLayout>
<!--<fragment--> <!--<fragment-->
<!--android:name="org.videolan.vlc.gui.video.AdvancedOptionsFragment"--> <!--android:name="org.videolan.vlc.gui.video.AdvancedOptionsFragment"-->
<!--android:layout_width="600dp"--> <!--android:layout_width="600dp"-->
<!--android:layout_height="match_parent"--> <!--android:layout_height="match_parent"-->
<!--android:layout_alignParentRight="true"/>--> <!--android:layout_alignParentRight="true"/>-->
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -3,16 +3,15 @@ ...@@ -3,16 +3,15 @@
android:id="@+id/progress_overlay" android:id="@+id/progress_overlay"
android:layout_width="800dp" android:layout_width="800dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="@bool/center_hud"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:visibility="invisible"
android:alpha="0.55" android:alpha="0.55"
android:background="@drawable/rounded_corners" android:background="@drawable/rounded_corners"
android:layout_centerHorizontal="true"
android:paddingTop="@dimen/overlay_padding_top" android:paddingTop="@dimen/overlay_padding_top"
android:paddingBottom="@dimen/overlay_padding_bottom" android:paddingBottom="@dimen/overlay_padding_bottom"
android:layout_marginBottom="@dimen/overlay_margin" android:layout_marginBottom="@dimen/overlay_margin"
android:layout_marginRight="2dp" android:layout_marginRight="@dimen/overlay_margin"
android:layout_marginLeft="2dp"> android:layout_marginLeft="@dimen/overlay_margin">
<SeekBar <SeekBar
android:id="@+id/player_overlay_seekbar" android:id="@+id/player_overlay_seekbar"
......
<?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>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<bool name="list_mode">false</bool> <bool name="center_hud">true</bool>
</resources> </resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="list_mode">false</bool>
</resources>
\ No newline at end of file
...@@ -4,13 +4,7 @@ ...@@ -4,13 +4,7 @@
<style name="Theme.VLC" parent="Theme.VLC.17"/> <style name="Theme.VLC" parent="Theme.VLC.17"/>
<style name="Theme.VLC.Black" parent="Theme.VLC.Black.17"/> <style name="Theme.VLC.Black" parent="Theme.VLC.Black.17"/>
<style name="Theme.VLC.Player.17" parent="Theme.AppCompat"> <style name="Theme.VLC.Player.17" parent="Theme.VLC.Player.7">
<item name="android:windowBackground">@color/black</item>
<item name="windowActionBarOverlay">true</item>
<item name="video_player_overlay">@color/transparent_gray</item>
<item name="status_bar_overlay">@android:color/transparent</item>
<item name="advanced_options_style">@style/Theme.VLC.AdvancedOptionsBlack</item>
<item name="android:fontFamily">sans-serif-light</item> <item name="android:fontFamily">sans-serif-light</item>
<item name="android:textViewStyle">@style/RobotoTextViewStyle</item> <item name="android:textViewStyle">@style/RobotoTextViewStyle</item>
<item name="android:buttonStyle">@style/RobotoButtonStyle</item> <item name="android:buttonStyle">@style/RobotoButtonStyle</item>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<bool name="list_mode">true</bool> <bool name="list_mode">true</bool>
<bool name="center_hud">false</bool>
</resources> </resources>
\ No newline at end of file
...@@ -157,7 +157,8 @@ ...@@ -157,7 +157,8 @@
<item name="android:windowBackground">@color/background_common</item> <item name="android:windowBackground">@color/background_common</item>
</style> </style>
<style name="Theme.VLC.Player" parent="Theme.AppCompat"> <style name="Theme.VLC.Player" parent="Theme.VLC.Player.7"/>
<style name="Theme.VLC.Player.7" parent="Theme.AppCompat">
<item name="android:windowNoTitle">true</item> <item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item> <item name="android:windowFullscreen">true</item>
<item name="android:windowBackground">@color/black</item> <item name="android:windowBackground">@color/black</item>
......
...@@ -326,7 +326,7 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay ...@@ -326,7 +326,7 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
mBattery = (TextView) findViewById(R.id.player_overlay_battery); mBattery = (TextView) findViewById(R.id.player_overlay_battery);
mOverlayProgress = findViewById(R.id.progress_overlay); mOverlayProgress = findViewById(R.id.progress_overlay);
//Manually set opacity, because aplha tag is SDK 11+ //Manually set opacity, because aplha tag is SDK 11+
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1){ if (!LibVlcUtil.isHoneycombOrLater()){
Drawable background = mOverlayProgress.getBackground(); Drawable background = mOverlayProgress.getBackground();
background.setAlpha(140); //255 is max (visible) background.setAlpha(140); //255 is max (visible)
} }
......
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