提交 b009b085 编写于 作者: G guoshuyu

初级版本无缝列表到详情

上级 557dab04
......@@ -169,11 +169,24 @@
android:theme="@style/Theme.AppCompat.Translucent"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait" />
<activity
android:name=".simple.SimpleActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait" />
<activity
android:name=".switchplay.SwitchListVideoActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/Theme.AppCompat.Translucent"
android:screenOrientation="portrait" />
<activity
android:name=".switchplay.SwitchDetailActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/Theme.AppCompat.Translucent"
android:screenOrientation="portrait" />
<meta-data
android:name="android.max_aspect"
android:value="2.1" />
......
......@@ -55,7 +55,7 @@ public class MainActivity extends AppCompatActivity {
@OnClick({R.id.open_btn, R.id.list_btn, R.id.list_btn_2, R.id.list_detail, R.id.clear_cache, R.id.recycler, R.id.recycler_2, R.id.list_detail_list, R.id.web_detail, R.id.danmaku_video, R.id.fragment_video,
R.id.more_type, R.id.input_type, R.id.open_btn_empty, R.id.open_control, R.id.open_filter, R.id.open_btn_pick, R.id.open_btn_auto, R.id.open_scroll, R.id.open_window, R.id.open_btn_ad,
R.id.open_btn_multi, R.id.open_btn_ad2, R.id.open_list_ad, R.id.open_custom_exo, R.id.open_simple})
R.id.open_btn_multi, R.id.open_btn_ad2, R.id.open_list_ad, R.id.open_custom_exo, R.id.open_simple, R.id.open_switch})
public void onClick(View view) {
switch (view.getId()) {
case R.id.open_simple:
......@@ -154,6 +154,9 @@ public class MainActivity extends AppCompatActivity {
//多个同时播放
JumpUtils.goToDetailExoListPlayer(this);
break;
case R.id.open_switch:
JumpUtils.goToSwitch(this);
break;
case R.id.clear_cache:
//清理缓存
GSYVideoManager.instance().clearAllDefaultCache(MainActivity.this);
......
......@@ -6,7 +6,7 @@ import android.widget.AbsListView;
import android.widget.ListView;
import com.example.gsyvideoplayer.R;
import com.example.gsyvideoplayer.simple.adapter.SimpleListVideoModelAdapter;
import com.example.gsyvideoplayer.simple.adapter.SimpleListVideoModeAdapter;
import com.shuyu.gsyvideoplayer.GSYVideoManager;
/**
......@@ -16,7 +16,7 @@ public class SimpleListVideoActivityMode1 extends AppCompatActivity {
ListView videoList;
SimpleListVideoModelAdapter listNormalAdapter;
SimpleListVideoModeAdapter listNormalAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -25,7 +25,7 @@ public class SimpleListVideoActivityMode1 extends AppCompatActivity {
videoList = (ListView)findViewById(R.id.video_list);
listNormalAdapter = new SimpleListVideoModelAdapter(this);
listNormalAdapter = new SimpleListVideoModeAdapter(this);
videoList.setAdapter(listNormalAdapter);
videoList.setOnScrollListener(new AbsListView.OnScrollListener() {
......@@ -41,7 +41,7 @@ public class SimpleListVideoActivityMode1 extends AppCompatActivity {
//当前播放的位置
int position = GSYVideoManager.instance().getPlayPosition();
//对应的播放列表TAG
if (GSYVideoManager.instance().getPlayTag().equals(SimpleListVideoModelAdapter.TAG)
if (GSYVideoManager.instance().getPlayTag().equals(SimpleListVideoModeAdapter.TAG)
&& (position < firstVisibleItem || position > lastVisibleItem)) {
if(GSYVideoManager.isFullState(SimpleListVideoActivityMode1.this)) {
return;
......
......@@ -8,7 +8,7 @@ import android.widget.ListView;
import android.widget.RelativeLayout;
import com.example.gsyvideoplayer.R;
import com.example.gsyvideoplayer.simple.adapter.SimpleListVideoModel2Adapter;
import com.example.gsyvideoplayer.simple.adapter.SimpleListVideoMode2Adapter;
import com.shuyu.gsyvideoplayer.GSYVideoManager;
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack;
import com.shuyu.gsyvideoplayer.utils.CommonUtil;
......@@ -26,7 +26,7 @@ public class SimpleListVideoActivityMode2 extends AppCompatActivity {
GSYVideoHelper smallVideoHelper;
SimpleListVideoModel2Adapter listVideoAdapter;
SimpleListVideoMode2Adapter listVideoAdapter;
GSYVideoHelper.GSYVideoHelperBuilder gsySmallVideoHelperBuilder;
......@@ -59,7 +59,7 @@ public class SimpleListVideoActivityMode2 extends AppCompatActivity {
public void onQuitSmallWidget(String url, Object... objects) {
super.onQuitSmallWidget(url, objects);
//大于0说明有播放,//对应的播放列表TAG
if (smallVideoHelper.getPlayPosition() >= 0 && smallVideoHelper.getPlayTAG().equals(SimpleListVideoModel2Adapter.TAG)) {
if (smallVideoHelper.getPlayPosition() >= 0 && smallVideoHelper.getPlayTAG().equals(SimpleListVideoMode2Adapter.TAG)) {
//当前播放的位置
int position = smallVideoHelper.getPlayPosition();
//不可视的是时候
......@@ -75,7 +75,7 @@ public class SimpleListVideoActivityMode2 extends AppCompatActivity {
smallVideoHelper.setGsyVideoOptionBuilder(gsySmallVideoHelperBuilder);
listVideoAdapter = new SimpleListVideoModel2Adapter(this, smallVideoHelper, gsySmallVideoHelperBuilder);
listVideoAdapter = new SimpleListVideoMode2Adapter(this, smallVideoHelper, gsySmallVideoHelperBuilder);
listVideoAdapter.setRootView(activityListVideo);
videoList.setAdapter(listVideoAdapter);
......@@ -89,7 +89,7 @@ public class SimpleListVideoActivityMode2 extends AppCompatActivity {
SimpleListVideoActivityMode2.this.firstVisibleItem = firstVisibleItem;
lastVisibleItem = firstVisibleItem + visibleItemCount;
//大于0说明有播放,//对应的播放列表TAG
if (smallVideoHelper.getPlayPosition() >= 0 && smallVideoHelper.getPlayTAG().equals(SimpleListVideoModel2Adapter.TAG)) {
if (smallVideoHelper.getPlayPosition() >= 0 && smallVideoHelper.getPlayTAG().equals(SimpleListVideoMode2Adapter.TAG)) {
//当前播放的位置
int position = smallVideoHelper.getPlayPosition();
//不可视的是时候
......
......@@ -16,7 +16,7 @@ import com.shuyu.gsyvideoplayer.utils.OrientationUtils;
import java.util.ArrayList;
import java.util.List;
public class SimpleListVideoModel2Adapter extends BaseAdapter {
public class SimpleListVideoMode2Adapter extends BaseAdapter {
public final static String TAG = "TT22";
......@@ -34,7 +34,7 @@ public class SimpleListVideoModel2Adapter extends BaseAdapter {
private GSYVideoHelper.GSYVideoHelperBuilder gsySmallVideoHelperBuilder;
public SimpleListVideoModel2Adapter(Context context, GSYVideoHelper smallVideoHelper, GSYVideoHelper.GSYVideoHelperBuilder gsySmallVideoHelperBuilder) {
public SimpleListVideoMode2Adapter(Context context, GSYVideoHelper smallVideoHelper, GSYVideoHelper.GSYVideoHelperBuilder gsySmallVideoHelperBuilder) {
super();
this.context = context;
this.smallVideoHelper = smallVideoHelper;
......@@ -67,7 +67,7 @@ public class SimpleListVideoModel2Adapter extends BaseAdapter {
final ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
convertView = inflater.inflate(R.layout.list_video_simple_model2, null);
convertView = inflater.inflate(R.layout.list_video_simple_mode2, null);
holder.videoContainer = (FrameLayout) convertView.findViewById(R.id.list_item_container);
holder.playerBtn = (ImageView) convertView.findViewById(R.id.list_item_btn);
holder.imageView = new ImageView(context);
......
......@@ -15,7 +15,7 @@ import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
import java.util.ArrayList;
import java.util.List;
public class SimpleListVideoModelAdapter extends BaseAdapter {
public class SimpleListVideoModeAdapter extends BaseAdapter {
public static final String TAG = "ListNormalAdapter22";
......@@ -31,7 +31,7 @@ public class SimpleListVideoModelAdapter extends BaseAdapter {
protected boolean isFull;
public SimpleListVideoModelAdapter(Context context) {
public SimpleListVideoModeAdapter(Context context) {
super();
this.context = context;
inflater = LayoutInflater.from(context);
......@@ -61,7 +61,7 @@ public class SimpleListVideoModelAdapter extends BaseAdapter {
final ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
convertView = inflater.inflate(R.layout.list_video_simple_model1, null);
convertView = inflater.inflate(R.layout.list_video_simple_mode1, null);
holder.gsyVideoPlayer = (SampleCoverVideo) convertView.findViewById(R.id.video_item_player);
convertView.setTag(holder);
} else {
......
package com.example.gsyvideoplayer.switchplay;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import com.example.gsyvideoplayer.R;
import com.shuyu.gsyvideoplayer.GSYVideoManager;
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack;
import com.shuyu.gsyvideoplayer.listener.LockClickListener;
import com.shuyu.gsyvideoplayer.utils.OrientationUtils;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
/**
* 切换详情
*/
public class SwitchDetailActivity extends AppCompatActivity {
public static final String URL = "url";
SwitchVideo detailPlayer;
private boolean isPlay = true;
private boolean isPause;
private OrientationUtils orientationUtils;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.switch_activity_detail_player);
detailPlayer = (SwitchVideo) findViewById(R.id.detail_player);
//增加title
detailPlayer.getTitleTextView().setVisibility(View.GONE);
detailPlayer.getBackButton().setVisibility(View.GONE);
//外部辅助的旋转,帮助全屏
orientationUtils = new OrientationUtils(this, detailPlayer);
//初始化不打开外部的旋转
orientationUtils.setEnable(false);
SwitchUtil.optionPlayer(detailPlayer, getIntent().getStringExtra(URL), true, "这是title");
SwitchUtil.clonePlayState(detailPlayer);
detailPlayer.setIsTouchWiget(true);
detailPlayer.setVideoAllCallBack(new GSYSampleCallBack() {
@Override
public void onPrepared(String url, Object... objects) {
super.onPrepared(url, objects);
//开始播放了才能旋转和全屏
orientationUtils.setEnable(true);
}
@Override
public void onQuitFullscreen(String url, Object... objects) {
super.onQuitFullscreen(url, objects);
if (orientationUtils != null) {
orientationUtils.backToProtVideo();
}
}
});
detailPlayer.getFullscreenButton().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//直接横屏
orientationUtils.resolveByClick();
//第一个true是否需要隐藏actionbar,第二个true是否需要隐藏statusbar
detailPlayer.startWindowFullscreen(SwitchDetailActivity.this, true, true);
}
});
detailPlayer.setSurfaceToPlay();
}
@Override
public void onBackPressed() {
if (orientationUtils != null) {
orientationUtils.backToProtVideo();
}
if (GSYVideoManager.backFromWindowFull(this)) {
return;
}
super.onBackPressed();
}
@Override
protected void onPause() {
detailPlayer.getCurrentPlayer().onVideoPause();
super.onPause();
isPause = true;
}
@Override
protected void onResume() {
detailPlayer.getCurrentPlayer().onVideoResume(false);
super.onResume();
isPause = false;
}
@Override
protected void onDestroy() {
super.onDestroy();
detailPlayer.getGSYVideoManager().setListener(detailPlayer.getGSYVideoManager().lastListener());
detailPlayer.getGSYVideoManager().setLastListener(null);
GSYVideoManager.releaseAllVideos();
if (orientationUtils != null)
orientationUtils.releaseListener();
SwitchUtil.release();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
//如果旋转了就全屏
if (isPlay && !isPause) {
detailPlayer.onConfigurationChanged(this, newConfig, orientationUtils, true, true);
}
}
}
package com.example.gsyvideoplayer.switchplay;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.AbsListView;
import android.widget.ListView;
import com.example.gsyvideoplayer.R;
import com.example.gsyvideoplayer.simple.adapter.SimpleListVideoModeAdapter;
import com.shuyu.gsyvideoplayer.GSYVideoManager;
/**
* 可切换列表
*/
public class SwitchListVideoActivity extends AppCompatActivity {
ListView videoList;
SwitchListVideoAdapter listNormalAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list_video);
videoList = (ListView)findViewById(R.id.video_list);
listNormalAdapter = new SwitchListVideoAdapter(this);
videoList.setAdapter(listNormalAdapter);
videoList.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
int lastVisibleItem = firstVisibleItem + visibleItemCount;
//大于0说明有播放
if (GSYVideoManager.instance().getPlayPosition() >= 0) {
//当前播放的位置
int position = GSYVideoManager.instance().getPlayPosition();
//对应的播放列表TAG
if (GSYVideoManager.instance().getPlayTag().equals(SwitchListVideoAdapter.TAG)
&& (position < firstVisibleItem || position > lastVisibleItem)) {
if(GSYVideoManager.isFullState(SwitchListVideoActivity.this)) {
return;
}
//如果滑出去了上面和下面就是否,和今日头条一样
GSYVideoManager.releaseAllVideos();
listNormalAdapter.notifyDataSetChanged();
}
}
}
});
}
@Override
public void onBackPressed() {
if (GSYVideoManager.backFromWindowFull(this)) {
return;
}
super.onBackPressed();
}
@Override
protected void onPause() {
super.onPause();
//GSYVideoManager.onPause();
}
@Override
protected void onResume() {
super.onResume();
//GSYVideoManager.onResume();
}
@Override
protected void onDestroy() {
super.onDestroy();
GSYVideoManager.releaseAllVideos();
}
}
package com.example.gsyvideoplayer.switchplay;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import com.example.gsyvideoplayer.R;
import com.example.gsyvideoplayer.model.VideoModel;
import com.shuyu.gsyvideoplayer.utils.OrientationUtils;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
import java.util.ArrayList;
import java.util.List;
public class SwitchListVideoAdapter extends BaseAdapter {
public static final String TAG = "SwitchListVideoAdapter";
private List<VideoModel> list = new ArrayList<>();
private LayoutInflater inflater;
private Context context;
private StandardGSYVideoPlayer curPlayer;
protected OrientationUtils orientationUtils;
protected boolean isPlay;
protected boolean isFull;
public SwitchListVideoAdapter(Context context) {
super();
this.context = context;
inflater = LayoutInflater.from(context);
for (int i = 0; i < 40; i++) {
list.add(new VideoModel());
}
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
final ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
convertView = inflater.inflate(R.layout.switch_list_video_item, null);
holder.gsyVideoPlayer = (SwitchVideo) convertView.findViewById(R.id.video_item_player);
holder.imageView = new ImageView(context);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
final String urlH = "http://9890.vod.myqcloud.com/9890_4e292f9a3dd011e6b4078980237cc3d3.f20.mp4";
final String urlV = "http://7xse1z.com1.z0.glb.clouddn.com/1491813192";
final String url = (position % 2 == 0) ? urlH : urlV;
final int coverId = (position % 2 == 0) ? R.mipmap.xxx1 : R.mipmap.xxx2;
//防止错位设置
holder.gsyVideoPlayer.setPlayTag(TAG);
holder.gsyVideoPlayer.setPlayPosition(position);
SwitchUtil.optionPlayer(holder.gsyVideoPlayer, url, true, "这是title");
holder.gsyVideoPlayer.setUpLazy(url, true, null, null, "这是title");
//增加封面
holder.imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
holder.imageView.setImageResource(coverId);
if (holder.imageView.getParent() != null) {
ViewGroup viewGroup = (ViewGroup) holder.imageView.getParent();
viewGroup.removeView(holder.imageView);
}
holder.gsyVideoPlayer.setThumbImageView(holder.imageView);
holder.gsyVideoPlayer.getThumbImageViewLayout().setVisibility(View.VISIBLE);
return convertView;
}
class ViewHolder {
SwitchVideo gsyVideoPlayer;
ImageView imageView;
}
}
package com.example.gsyvideoplayer.switchplay;
import android.content.Context;
import android.content.Intent;
import android.view.View;
public class SwitchUtil {
private static SwitchVideo sSwitchVideo;
public static void optionPlayer(final SwitchVideo gsyVideoPlayer, String url, boolean cache, String title) {
//增加title
gsyVideoPlayer.getTitleTextView().setVisibility(View.GONE);
//设置返回键
gsyVideoPlayer.getBackButton().setVisibility(View.GONE);
//设置全屏按键功能
gsyVideoPlayer.getFullscreenButton().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
gsyVideoPlayer.startWindowFullscreen(gsyVideoPlayer.getContext(), false, true);
}
});
//是否根据视频尺寸,自动选择竖屏全屏或者横屏全屏
gsyVideoPlayer.setAutoFullWithSize(true);
//音频焦点冲突时是否释放
gsyVideoPlayer.setReleaseWhenLossAudio(false);
//全屏动画
gsyVideoPlayer.setShowFullAnimation(false);
//小屏时不触摸滑动
gsyVideoPlayer.setIsTouchWiget(false);
gsyVideoPlayer.setSwitchUrl(url);
gsyVideoPlayer.setSwitchCache(cache);
gsyVideoPlayer.setSwitchTitle(title);
}
public static void gotoDetail(Context context, String url) {
Intent intent = new Intent(context, SwitchDetailActivity.class);
intent.putExtra(SwitchDetailActivity.URL, url);
context.startActivity(intent);
}
public static void savePlayState(SwitchVideo switchVideo) {
sSwitchVideo = switchVideo.saveState();
}
public static void clonePlayState(SwitchVideo switchVideo) {
switchVideo.cloneState(sSwitchVideo);
}
public static void release() {
sSwitchVideo = null;
}
}
package com.example.gsyvideoplayer.switchplay;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
import com.example.gsyvideoplayer.R;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
public class SwitchVideo extends StandardGSYVideoPlayer {
private TextView detailBtn;
public SwitchVideo(Context context, Boolean fullFlag) {
super(context, fullFlag);
}
public SwitchVideo(Context context) {
super(context);
}
public SwitchVideo(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void init(Context context) {
super.init(context);
detailBtn = (TextView) findViewById(R.id.detail_btn);
detailBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (isInPlayingState()) {
SwitchUtil.savePlayState(SwitchVideo.this);
getGSYVideoManager().setLastListener(SwitchVideo.this);
SwitchUtil.gotoDetail(getContext(), mOriginUrl);
}
}
});
if (mIfCurrentIsFullscreen) {
detailBtn.setVisibility(GONE);
}
}
@Override
public int getLayoutId() {
return R.layout.switch_video;
}
public void setSwitchUrl(String url) {
mUrl = url;
mOriginUrl = url;
}
public void setSwitchCache(boolean cache) {
mCache = cache;
}
public void setSwitchTitle(String title) {
mTitle = title;
}
public void setSurfaceToPlay() {
addTextureView();
getGSYVideoManager().setListener(this);
checkoutState();
}
public SwitchVideo saveState() {
SwitchVideo switchVideo = new SwitchVideo(getContext());
cloneParams(this, switchVideo);
return switchVideo;
}
public void cloneState(SwitchVideo switchVideo) {
cloneParams(switchVideo, this);
}
}
......@@ -32,6 +32,7 @@ import com.example.gsyvideoplayer.ScrollingActivity;
import com.example.gsyvideoplayer.WebDetailActivity;
import com.example.gsyvideoplayer.WindowActivity;
import com.example.gsyvideoplayer.exo.DetailExoListPlayer;
import com.example.gsyvideoplayer.switchplay.SwitchListVideoActivity;
/**
* Created by shuyu on 2016/11/11.
......@@ -324,4 +325,10 @@ public class JumpUtils {
activity.startActivity(intent);
}
public static void goToSwitch(Activity activity) {
Intent intent = new Intent(activity, SwitchListVideoActivity.class);
activity.startActivity(intent);
}
}
......@@ -180,6 +180,14 @@
android:text="多任务支持" />
<Button
android:id="@+id/open_switch"
android:layout_width="240dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="列表详情切换" />
<Button
android:id="@+id/open_list_ad"
android:layout_width="240dp"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_detail_player"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:id="@+id/post_detail_nested_scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/post_media_height" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/detail_text"
android:textSize="16sp" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<com.example.gsyvideoplayer.switchplay.SwitchVideo
android:id="@+id/detail_player"
android:layout_width="match_parent"
android:layout_height="@dimen/post_media_height" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.example.gsyvideoplayer.switchplay.SwitchVideo
android:id="@+id/video_item_player"
android:layout_width="match_parent"
android:layout_height="@dimen/post_media_height" />
</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="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
<RelativeLayout
android:id="@+id/surface_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
</RelativeLayout>
<RelativeLayout
android:id="@+id/thumb"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#000000"
android:scaleType="fitCenter" />
<LinearLayout
android:id="@+id/layout_bottom"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:background="#99000000"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="invisible">
<TextView
android:id="@+id/current"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:text="00:00"
android:textColor="#ffffff" />
<SeekBar
android:id="@+id/progress"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1.0"
android:background="@null"
android:max="100"
android:maxHeight="4dp"
android:minHeight="4dp"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:progressDrawable="@drawable/video_seek_progress"
android:thumb="@drawable/video_seek_thumb" />
<TextView
android:id="@+id/total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:text="00:00"
android:textColor="#ffffff" />
<ImageView
android:id="@+id/fullscreen"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingRight="16dp"
android:scaleType="center"
android:src="@drawable/video_enlarge" />
</LinearLayout>
<ProgressBar
android:id="@+id/bottom_progressbar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="1.5dp"
android:layout_alignParentBottom="true"
android:max="100"
android:progressDrawable="@drawable/video_progress" />
<ImageView
android:id="@+id/back_tiny"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="6dp"
android:layout_marginTop="6dp"
android:visibility="gone" />
<LinearLayout
android:id="@+id/layout_top"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/video_title_bg"
android:gravity="center_vertical">
<ImageView
android:id="@+id/back"
android:layout_width="48dp"
android:layout_height="48dp"
android:paddingLeft="10dp"
android:scaleType="centerInside"
android:src="@drawable/video_back" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:textColor="@android:color/white"
android:textSize="18sp" />
</LinearLayout>
<moe.codeest.enviews.ENDownloadView
android:id="@+id/loading"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:visibility="invisible" />
<moe.codeest.enviews.ENPlayView
android:id="@+id/start"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical" />
<ImageView
android:id="@+id/small_close"
android:layout_width="30dp"
android:layout_height="30dp"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:scaleType="centerInside"
android:src="@drawable/video_small_close"
android:visibility="gone" />
<ImageView
android:id="@+id/lock_screen"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="50dp"
android:scaleType="centerInside"
android:src="@drawable/unlock"
android:visibility="gone" />
<TextView
android:id="@+id/detail_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#0F999999"
android:layout_marginLeft="15dp"
android:padding="10dp"
android:text="详情"
android:layout_centerVertical="true"
android:textColor="#FFFFFF" />
</RelativeLayout>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册