add video player

This commit is contained in:
lixiaopeng
2020-01-03 19:17:11 +08:00
parent a0aa63b89b
commit 22ee937899
17 changed files with 480 additions and 193 deletions

28
.idea/gradle.xml generated
View File

@@ -3,11 +3,33 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<compositeConfiguration>
<compositeBuild compositeDefinitionSource="SCRIPT" />
</compositeConfiguration>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/foudations" />
<option value="$PROJECT_DIR$/foudations/mogo-commons" />
<option value="$PROJECT_DIR$/foudations/mogo-connection" />
<option value="$PROJECT_DIR$/foudations/mogo-utils" />
<option value="$PROJECT_DIR$/libraries" />
<option value="$PROJECT_DIR$/libraries/map-amap" />
<option value="$PROJECT_DIR$/libraries/mogo-map" />
<option value="$PROJECT_DIR$/libraries/mogo-map-api" />
<option value="$PROJECT_DIR$/modules" />
<option value="$PROJECT_DIR$/modules/mogo-module-apps" />
<option value="$PROJECT_DIR$/modules/mogo-module-common" />
<option value="$PROJECT_DIR$/modules/mogo-module-main" />
<option value="$PROJECT_DIR$/modules/mogo-module-map" />
<option value="$PROJECT_DIR$/modules/mogo-module-navi" />
<option value="$PROJECT_DIR$/modules/mogo-module-service" />
<option value="$PROJECT_DIR$/modules/mogo-module-tanlu" />
<option value="$PROJECT_DIR$/services" />
<option value="$PROJECT_DIR$/services/mogo-service" />
<option value="$PROJECT_DIR$/services/mogo-service-api" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="testRunner" value="PLATFORM" />
</GradleProjectSettings>

View File

@@ -2,6 +2,7 @@
apply from: "config.gradle"
apply from: "javadoc.gradle"
buildscript {
ext.kotlin_version = '1.3.61'
ext.kotlin_version = '1.3.61+'
repositories {
maven {

View File

@@ -1,4 +1,6 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'com.alibaba.arouter'
android {
@@ -30,6 +32,13 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogomap
@@ -48,6 +57,14 @@ dependencies {
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.arouter
annotationProcessor rootProject.ext.dependencies.aroutercompiler
implementation 'com.shuyu:gsyVideoPlayer-armv7a:7.1.1'
implementation 'com.shuyu:gsyVideoPlayer-arm64:7.1.1'
implementation 'com.shuyu:gsyVideoPlayer-java:7.1.1'
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
repositories {
mavenCentral()
}

View File

@@ -1,13 +1,11 @@
package com.mogo.tanlu.fragment;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -21,7 +19,6 @@ import com.mogo.map.location.IMogoLocationListener;
import com.mogo.map.location.MogoLocation;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.map.model.MogoPoi;
import com.mogo.map.search.geo.MogoPoiItem;
import com.mogo.map.search.poisearch.IMogoPoiSearchListener;
@@ -29,13 +26,12 @@ import com.mogo.map.search.poisearch.MogoPoiResult;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.service.module.IMogoModuleLifecycle;
import com.mogo.tanlu.R;
import com.mogo.tanlu.constant.TanluConstants;
import com.mogo.tanlu.video.SimpleCoverVideoPlayer;
import com.mogo.utils.TipToast;
import com.mogo.utils.logger.Logger;
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import static com.mogo.tanlu.video.VideoInitKt.initVideo;
/**
* @author lixiaopeng
@@ -52,105 +48,51 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
private static final String TAG = "TanluCardViewFragment";
private Button mAddMarker;
private Button mAddMarkers;
private Bitmap mMarkerIcon;
private Bitmap mClickedMarkerIcon;
private TextView mLocInfo;
private TextView mLoc;
private IMogoMarker mLastClickedMarker;
private TanluInfoWindowAdapter mDemoInfoWindowAdapter;
private MogoLocation mLocation;
private int position = -1;
private GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder();
private String videoUrl = "http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/CarPad/com.zhidao.roadcondition/ZD801B1942L02537/ZD801B1942L02537_20200103161355/PhotoFront_20200103_161351.JPG?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1578042652%3B1578049852%26q-key-time%3D1578042652%3B1578049852%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3Db9530357bc3d80fb13ec54dfaa9a7a1ee86180e2";
// private String videoUrl = "http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8";
SimpleCoverVideoPlayer simpleCoverVideoPlayer;
@Override
protected int getLayoutId() {
return R.layout.tanlu_card_view;
return R.layout.tanlu_item_main_media_recycler;
}
@Override
protected void initViews() {
initVideo();
position = getArguments().getInt("position");
simpleCoverVideoPlayer = findViewById(R.id.video_player_main);
//视频配置
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag(TAG)
.build(simpleCoverVideoPlayer);
// simpleCoverVideoPlayer.getStartButton().performClick();
simpleCoverVideoPlayer.getStartButton().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.d("liyz", "onClick ---------> ");
Intent intent = new Intent("fullscreen.video.play", Uri.parse("video://666"));
getActivity().startActivity(intent);
}
});
//图片显示
TanluServiceHandler.getPoiSearch().setPoiSearchListener(this);
mLocation = TanluServiceHandler.getLocationClient().getLastKnowLocation();
mLocInfo = findViewById(R.id.demo_module_id_loc_info);
mLoc = findViewById(R.id.demo_module_id_loc);
mLoc.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
TanluServiceHandler.getLocationClient().start(4_000L);
}
}
);
// mLocation = TanluServiceHandler.getLocationClient().getLastKnowLocation();
mDemoInfoWindowAdapter = new TanluInfoWindowAdapter(getContext(), TanluServiceHandler.getNavi(), TanluServiceHandler.getImageloader());
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_search_poi_location);
mClickedMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_search_choice_point);
mAddMarker = findViewById(R.id.demo_module_id_add_marker);
mAddMarker.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MogoMarkerOptions options = new MogoMarkerOptions()
.icon(mMarkerIcon)
.latitude(39.974525d)
.owner(TanluConstants.TAG)
.longitude(116.41733d);
IMogoMarker marker = TanluServiceHandler.getMarkerManager().addMarker(TanluConstants.TAG, options);
marker.setInfoWindowAdapter(mDemoInfoWindowAdapter);
marker.setOnMarkerClickListener(TanluCardViewFragment.this);
}
});
mAddMarkers = findViewById(R.id.demo_module_id_add_markers);
mAddMarkers.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ArrayList<MogoMarkerOptions> optionsList = new ArrayList<>();
for (int i = 0; i < 10; i++) {
MogoMarkerOptions options = new MogoMarkerOptions()
.owner(TanluConstants.TAG)
.latitude(39.974525d + new Random().nextDouble())
.longitude(116.41733d + new Random().nextDouble());
if (i % 2 == 0) {
options.icon(mMarkerIcon);
} else {
options.icon(mDemoInfoWindowAdapter.getMarkerView(options));
}
optionsList.add(options);
}
List<IMogoMarker> iMogoMarkers = TanluServiceHandler.getMarkerManager().addMarkers(TanluConstants.TAG, optionsList, true);
for (IMogoMarker iMogoMarker : iMogoMarkers) {
iMogoMarker.setInfoWindowAdapter(mDemoInfoWindowAdapter);
iMogoMarker.setOnMarkerClickListener(TanluCardViewFragment.this);
}
}
});
findViewById(R.id.demo_module_id_clear).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TanluServiceHandler.getMarkerManager().removeMarkers(TanluConstants.TAG);
}
});
findViewById(R.id.demo_module_id_current).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TanluServiceHandler.getMapUIController().moveToCenter(new MogoLatLng(mLocation.getLatitude(), mLocation.getLongitude()));
}
});
TanluServiceHandler.getLocationClient().addLocationListener(new IMogoLocationListener() {
@Override
public void onLocationChanged(MogoLocation location) {
mLocation = location;
// mLocation = location;
Logger.d(TAG, "demo模块定位定位间隔4s");
}
});
@@ -162,15 +104,15 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
getViewLifecycleOwner().getLifecycle().addObserver(mPresenter);
}
/**
* marker点击事件 TODO
* @param marker
* @return
*/
@Override
public boolean onMarkerClicked(IMogoMarker marker) {
// if ( mLastClickedMarker != null ) {
// mLastClickedMarker.setIcon( this.mMarkerIcon );
// }
// marker.setIcon( mClickedMarkerIcon );
// mLastClickedMarker = marker;
marker.getObject();
// marker.showInfoWindow();
return true;
}
@@ -229,31 +171,31 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
if (item == null) {
return;
}
if (mPoiMarker != null) {
mPoiMarker.destroy();
}
mPoiMarker = TanluServiceHandler.getMarkerManager().addMarker(TanluConstants.TAG, new MogoMarkerOptions()
.longitude(item.getPoint().lng)
.latitude(item.getPoint().lat)
.icon(mMarkerIcon));
if (mPoiMarker != null) {
mPoiMarker.setInfoWindowAdapter(mDemoInfoWindowAdapter);
mPoiMarker.setObject(item);
mPoiMarker.showInfoWindow();
}
// if (mPoiMarker != null) {
// mPoiMarker.destroy();
// }
// mPoiMarker = TanluServiceHandler.getMarkerManager().addMarker(TanluConstants.TAG, new MogoMarkerOptions()
// .longitude(item.getPoint().lng)
// .latitude(item.getPoint().lat)
// .icon(mMarkerIcon));
// if (mPoiMarker != null) {
// mPoiMarker.setInfoWindowAdapter(mDemoInfoWindowAdapter);
// mPoiMarker.setObject(item);
// mPoiMarker.showInfoWindow();
// }
}
@Override
public void onLocationChanged(MogoLocation location) {
mLocation = location;
Logger.i(TAG, "接受到的地图模块定位信息");
if (mLocInfo != null) {
if (location.getErrCode() == 0) {
mLocInfo.setText("当前位置:" + location.getAddress());
} else {
mLocInfo.setText(location.getErrInfo());
}
}
// mLocation = location;
// Logger.i(TAG, "接受到的地图模块定位信息");
// if (mLocInfo != null) {
// if (location.getErrCode() == 0) {
// mLocInfo.setText("当前位置:" + location.getAddress());
// } else {
// mLocInfo.setText(location.getErrInfo());
// }
// }
}
@Override

View File

@@ -0,0 +1,134 @@
package com.mogo.tanlu.video
import android.content.Context
import android.util.AttributeSet
import android.view.Surface
import android.view.View
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.mogo.tanlu.R
import com.shuyu.gsyvideoplayer.GSYVideoManager
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView
import com.shuyu.gsyvideoplayer.video.base.GSYVideoViewBridge
class SimpleCoverVideoPlayer : StandardGSYVideoPlayer {
private lateinit var coverImage: ImageView
private lateinit var start: ImageView
private lateinit var fullscreen: ImageView
constructor(context: Context?) : super(context)
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context?, fullFlag: Boolean?) : super(context, fullFlag)
override fun init(context: Context) {
super.init(context)
coverImage = findViewById(R.id.thumbImage)
start = findViewById(R.id.start)
fullscreen = findViewById(R.id.fullscreen)
if (mThumbImageViewLayout != null
&& (mCurrentState == -1 || mCurrentState == GSYVideoView.CURRENT_STATE_NORMAL || mCurrentState == GSYVideoView.CURRENT_STATE_ERROR)
) {
mThumbImageViewLayout.visibility = View.VISIBLE
}
}
override fun getLayoutId(): Int {
return R.layout.tanlu_item_video_cover
}
override fun getGSYVideoManager(): GSYVideoViewBridge {
GSYVideoManager.instance().initContext(context.applicationContext)
return GSYVideoManager.instance()
}
override fun setProgressAndTime(
progress: Int,
secProgress: Int,
currentTime: Int,
totalTime: Int
) {
super.setProgressAndTime(progress, secProgress, currentTime, totalTime)
if (progress != 0) {
mProgressBar.progress = progress
}
}
// fun loadCoverImage(url: String, mContext: Context) {
// Glide.with(mContext.applicationContext)
// .load(url)
// .error(R.color.color_303447)
// .into(coverImage)
// }
override fun updateStartImage() {
when (mCurrentState) {
GSYVideoView.CURRENT_STATE_PLAYING -> start.setImageResource(R.drawable.selector_bg_btn_pause)
GSYVideoView.CURRENT_STATE_ERROR -> start.setImageResource(R.mipmap.main_video_refresh_btn)
else -> start.setImageResource(R.drawable.selector_bg_btn_play)
}
}
fun setFullClickListener(listener: OnClickListener) {
fullscreen.setOnClickListener(listener)
}
override fun changeUiToCompleteShow() {
super.changeUiToCompleteShow()
setViewShowState(mBottomContainer, View.INVISIBLE)
}
override fun onAutoCompletion() {
super.onAutoCompletion()
mProgressBar.progress = 0
}
override fun showWifiDialog() {
//直接播放不显示WIFI对话框
startPlayLogic()
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
mProgressBar.progress = 0
mFullPauseBitmap = null
}
override fun onClick(v: View?) {
super.onClick(v)
}
override fun onPrepared() {
super.onPrepared()
}
override fun onCompletion() {
}
override fun onSurfaceUpdated(surface: Surface) {
super.onSurfaceUpdated(surface)
if (mThumbImageViewLayout != null && mThumbImageViewLayout.visibility == View.VISIBLE) {
mThumbImageViewLayout.visibility = View.INVISIBLE
}
}
override fun setViewShowState(view: View?, visibility: Int) {
if (view === mThumbImageViewLayout && visibility != View.VISIBLE) {
return
}
super.setViewShowState(view, visibility)
}
override fun onSurfaceAvailable(surface: Surface) {
super.onSurfaceAvailable(surface)
if (GSYVideoType.getRenderType() != GSYVideoType.TEXTURE) {
if (mThumbImageViewLayout != null && mThumbImageViewLayout.visibility == View.VISIBLE) {
mThumbImageViewLayout.visibility = View.INVISIBLE
}
}
}
}

View File

@@ -0,0 +1,22 @@
package com.mogo.tanlu.video
import com.shuyu.gsyvideoplayer.GSYVideoManager
import com.shuyu.gsyvideoplayer.cache.CacheFactory
import com.shuyu.gsyvideoplayer.cache.ProxyCacheManager
import com.shuyu.gsyvideoplayer.model.VideoOptionModel
import com.shuyu.gsyvideoplayer.player.IjkPlayerManager
import com.shuyu.gsyvideoplayer.player.PlayerFactory
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
import tv.danmaku.ijk.media.player.IjkMediaPlayer
fun initVideo() {
PlayerFactory.setPlayManager(IjkPlayerManager::class.java)
CacheFactory.setCacheManager(ProxyCacheManager::class.java)
var list = mutableListOf<VideoOptionModel>()
list.add(VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "enable-accurate-seek", 1))
list.add(VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "videotoolbox", 0))
GSYVideoManager.instance().optionModelList = list
GSYVideoType.enableMediaCodec()
GSYVideoType.enableMediaCodecTexture()
}

View File

@@ -83,10 +83,6 @@ class AutoZoomInImageView : ImageView {
private fun initInternalValues() {
mDrawable = drawable
if (mDrawable == null) {
throw IllegalArgumentException("please set the source of AutoZoomInImageView")
}
mDrawableW = mDrawable.intrinsicWidth
mDrawableH = mDrawable.intrinsicHeight
@@ -100,10 +96,6 @@ class AutoZoomInImageView : ImageView {
private fun initInternalValues(drawable: Drawable) {
mDrawable = drawable
if (mDrawable == null) {
throw IllegalArgumentException("please set the source of AutoZoomInImageView")
}
mDrawableW = mDrawable.intrinsicWidth
mDrawableH = mDrawable.intrinsicHeight

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/main_video_pause_btn_press" android:state_pressed="true" />
<item android:drawable="@mipmap/main_video_pause_btn_normal" android:state_pressed="false" />
<item android:drawable="@mipmap/main_video_pause_btn_normal" />
</selector>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/main_video_play_btn_press" android:state_pressed="true" />
<item android:drawable="@mipmap/main_video_play_btn_normal" android:state_pressed="false" />
<item android:drawable="@mipmap/main_video_play_btn_normal" />
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="6dp" />
<solid android:color="@color/color_A2A2A2"/>
</shape>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topLeftRadius="0mm"
android:topRightRadius="0mm"
android:bottomLeftRadius="6mm"
android:bottomRightRadius="6mm"/>
<corners android:topLeftRadius="0dp"
android:topRightRadius="0dp"
android:bottomLeftRadius="6dp"
android:bottomRightRadius="6dp"/>
<solid android:color="@color/color_222533"/>
</shape>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topLeftRadius="6mm"
android:topRightRadius="6mm"
android:bottomLeftRadius="0mm"
android:bottomRightRadius="0mm"/>
<corners android:topLeftRadius="6dp"
android:topRightRadius="6dp"
android:bottomLeftRadius="0dp"
android:bottomRightRadius="0dp"/>
<solid android:color="@color/color_222533"/>
</shape>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="4dp"/>
<solid android:color="@color/color_99191C25"/>
</shape>

View File

@@ -1,68 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="400mm"
android:layout_height="400mm"
android:layout_marginTop="30mm">
android:layout_width="400dp"
android:layout_height="400dp"
android:layout_marginTop="30dp">
<!--顶部view-->
<RelativeLayout
android:id="@+id/layout_top_view"
android:layout_width="match_parent"
android:layout_height="94mm"
android:layout_height="94dp"
android:background="@drawable/shape_bg_222533_6px_top">
<TextView
android:id="@+id/tv_information_media_content"
android:layout_width="match_parent"
android:layout_height="28mm"
android:layout_marginLeft="20mm"
android:layout_marginTop="22mm"
android:layout_marginRight="20mm"
android:layout_height="28dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="22dp"
android:layout_marginRight="20dp"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:text="@string/main_empty_location"
android:textColor="@color/white"
android:textSize="22mm" />
android:textSize="22dp" />
<TextView
android:id="@+id/tv_distance_video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_information_media_content"
android:layout_marginLeft="20mm"
android:layout_marginTop="3mm"
android:layout_marginBottom="18mm"
android:textSize="20mm" />
android:layout_marginLeft="20dp"
android:layout_marginTop="3dp"
android:layout_marginBottom="18dp"
android:textSize="20dp" />
</RelativeLayout>
<com.zhidao.roadcondition.video.SimpleCoverVideoPlayer
<!--播放器-->
<com.mogo.tanlu.video.SimpleCoverVideoPlayer
android:id="@+id/video_player_main"
android:layout_width="400mm"
android:layout_height="225mm"
android:layout_width="400dp"
android:layout_height="225dp"
android:layout_below="@+id/layout_top_view" />
<!--底部view-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="81mm"
android:layout_below="@+id/video_player_main"
android:background="@drawable/shape_bg_222533_6px_bottom">
android:layout_height="80dp"
android:background="@drawable/shape_bg_222533_6px_bottom"
android:layout_below="@+id/video_player_main">
<ImageView
android:id="@+id/username_image_video"
android:layout_width="40mm"
android:layout_height="40mm"
android:layout_width="40dp"
android:layout_height="40dp"
android:visibility="gone"
android:layout_centerVertical="true"
android:layout_marginLeft="20mm" />
android:layout_marginLeft="20dp"
android:src="@mipmap/ic_launcher" />
<TextView
android:id="@+id/tv_username_video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:layout_marginLeft="10dp"
android:visibility="gone"
android:layout_toRightOf="@+id/username_image_video"
android:text="你好小智"
android:textColor="@color/white"
android:textSize="18mm" />
android:textSize="18dp" />
<TextView
android:id="@+id/tv_information_media_time"
@@ -70,10 +77,40 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingLeft="15mm"
android:paddingRight="17mm"
android:paddingLeft="15dp"
android:paddingRight="17dp"
android:text="2019-10-10"
android:visibility="gone"
android:textColor="@color/color_9A9A9A"
android:textSize="16mm" />
android:textSize="16dp" />
<TextView
android:id="@+id/tv_previous_res"
android:layout_width="110dp"
android:layout_height="45dp"
android:layout_centerVertical="true"
android:gravity="center_vertical|center_horizontal"
android:layout_marginLeft="35dp"
android:text="上一个"
android:background="@drawable/shape_bg_222533"
android:textColor="@color/white"
android:textSize="18dp" />
<TextView
android:id="@+id/tv_next_res"
android:layout_width="110dp"
android:layout_height="45dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:gravity="center_vertical|center_horizontal"
android:layout_marginRight="35dp"
android:background="@drawable/shape_bg_222533"
android:text="下一个"
android:textColor="@color/white"
android:textSize="18dp" />
</RelativeLayout>
</RelativeLayout>

View File

@@ -1,80 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="400mm"
android:layout_height="400mm"
android:layout_marginTop="30mm">
android:layout_width="400dp"
android:layout_height="400dp"
android:layout_marginTop="30dp">
<TextView
android:id="@+id/tv_information_content"
android:layout_width="match_parent"
android:layout_height="28mm"
android:layout_marginLeft="20mm"
android:layout_marginTop="22mm"
android:layout_marginRight="5mm"
android:layout_height="28dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="22dp"
android:layout_marginRight="5dp"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:text="@string/main_empty_location"
android:textColor="@color/white"
android:textSize="22mm" />
android:textSize="22dp" />
<TextView
android:id="@+id/tv_distance_photo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_information_content"
android:layout_marginLeft="20mm"
android:layout_marginTop="3mm"
android:layout_marginBottom="14mm"
android:textSize="20mm" />
android:layout_marginLeft="20dp"
android:layout_marginTop="3dp"
android:layout_marginBottom="14dp"
android:textSize="20dp" />
<com.zhidao.roadcondition.view.AutoZoomInImageView
android:id="@+id/recycle_photo_imageView"
android:layout_width="400mm"
android:layout_height="225mm"
android:layout_width="400dp"
android:layout_height="225dp"
android:layout_below="@+id/tv_distance_photo" />
<ProgressBar
android:id="@+id/pb_loading"
android:layout_width="48mm"
android:layout_height="48mm"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_centerInParent="true"
android:indeterminateDrawable="@drawable/loading_bg"
android:visibility="gone" />
<Button
android:id="@+id/btn_enlarge"
android:layout_width="30mm"
android:layout_height="30mm"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_marginRight="14mm"
android:layout_marginBottom="95mm"
android:layout_marginRight="14dp"
android:layout_marginBottom="95dp"
android:background="@drawable/selector_bg_btn_enlarge" />
<!--bottom-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="81mm"
android:layout_height="81dp"
android:layout_below="@+id/recycle_photo_imageView">
<ImageView
android:id="@+id/username_image_photo"
android:layout_width="40mm"
android:layout_height="40mm"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_marginLeft="20mm" />
android:layout_marginLeft="20dp" />
<TextView
android:id="@+id/tv_username_photo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/username_image_photo"
android:textColor="@color/white"
android:textSize="18mm" />
android:textSize="18dp" />
<TextView
android:id="@+id/tv_information_time"
@@ -82,8 +82,8 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="20mm"
android:layout_marginRight="20dp"
android:textColor="@color/white"
android:textSize="18mm" />
android:textSize="18dp" />
</RelativeLayout>
</RelativeLayout>

View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/item_video_cover"
android:layout_width="match_parent"
android:layout_height="match_parent">
<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_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true">
<ImageView
android:id="@+id/thumbImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
</RelativeLayout>
<LinearLayout
android:id="@+id/layout_bottom"
android:layout_width="380dp"
android:layout_height="72dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="5dp"
android:background="@drawable/shape_bg_99191c25_4px"
android:gravity="center_vertical"
android:orientation="horizontal">
<SeekBar
android:id="@+id/progress"
android:layout_width="330dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@null"
android:max="100"
android:maxHeight="4dp"
android:minHeight="4dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:progressDrawable="@drawable/video_seek_progress"
android:thumb="@drawable/video_seek_thumb" />
<ImageView
android:id="@+id/fullscreen"
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="centerInside" />
</LinearLayout>
<ImageView
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" />
<ProgressBar
android:id="@+id/loading"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminateDrawable="@drawable/loading_bg"
android:visibility="invisible" />
</RelativeLayout>

View File

@@ -11,8 +11,22 @@
<color name="color_4d191C25">#4d191C25</color>
<color name="color_99191C25">#99191C25</color>
<color name="color_222533">#222533</color>
<color name="color_303447">#303447</color>
<color name="color_323131">#323131</color>
<color name="color_4B5369">#4B5369</color>
<color name="color_9A9A9A">#9A9A9A</color>
<color name="color_A2A2A2">#A2A2A2</color>
<color name="color_5a979797">#5a979797</color>
<color name="half_transparent_white">#80FFFFFF</color>
<color name="color_b3000000">#b3000000</color>
<color name="color_0DFFFFFF">#0DFFFFFF</color>
<color name="color_000000">#000000</color>
<color name="color_69718B">#69718B</color>
<color name="color_213142">#213142</color>
<color name="white_alpha20">#33FFFFFF</color>
<color name="color_B3000000">#B3000000</color>
<color name="color_3">#333333</color>
<color name="color_0091FF">#0091FF</color>
<color name="color_d9000000">#d9000000</color>
<color name="red_tips">#FF1B1B</color>
</resources>