Merge branch 'feature/v1.0.0' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into feature/v1.0.0
This commit is contained in:
28
.idea/gradle.xml
generated
28
.idea/gradle.xml
generated
@@ -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>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,12 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.tanlu" />
|
||||
package="com.mogo.tanlu">
|
||||
|
||||
<application>
|
||||
<activity
|
||||
android:name=".video.FullMediaActivity"
|
||||
android:hardwareAccelerated="true">
|
||||
</activity>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.mogo.tanlu.constant
|
||||
|
||||
const val REQUESTCODE_MAINACTIVITY = 0
|
||||
const val REQUESTCODE_MEDIAACTIVITY = 1
|
||||
|
||||
//EXTRA_STATE
|
||||
const val AUTO_NAVI_START = 8 //开始导航
|
||||
const val AUTO_NAVI_END = 9 //结束导航
|
||||
@@ -9,4 +9,5 @@ package com.mogo.tanlu.constant;
|
||||
public class TanluConstants {
|
||||
|
||||
public static final String TAG = "/tanlu/ui";
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
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;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
@@ -21,21 +20,25 @@ 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;
|
||||
import com.mogo.map.search.poisearch.MogoPoiResult;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.imageloader.IMogoImageloader;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.tanlu.R;
|
||||
import com.mogo.tanlu.constant.TanluConstants;
|
||||
import com.mogo.tanlu.video.FullMediaActivity;
|
||||
import com.mogo.tanlu.video.SimpleCoverVideoPlayer;
|
||||
import com.mogo.tanlu.view.AutoZoomInImageView;
|
||||
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 +55,57 @@ 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;
|
||||
AutoZoomInImageView autoZoomInImageView;
|
||||
private IMogoImageloader mogoImageloader;
|
||||
|
||||
@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);
|
||||
autoZoomInImageView = findViewById(R.id.tanlu_photo_imageView);
|
||||
|
||||
//视频配置
|
||||
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);
|
||||
|
||||
FullMediaActivity.Companion.launch(getActivity(), videoUrl, "image");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//图片显示
|
||||
mogoImageloader = (IMogoImageloader) ARouter.getInstance().build( MogoServicePaths.PATH_UTILS_IMAGE_LOADER ).navigation();
|
||||
mogoImageloader.displayImage("https://oimagec4.ydstatic.com/image?id=-5397300958976572132&product=adpublish&w=520&h=347", autoZoomInImageView);
|
||||
|
||||
//当前定位信息
|
||||
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 +117,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 +184,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
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.mogo.tanlu.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 列表数据
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class Information implements Parcelable {
|
||||
private int type;
|
||||
private Double lon;
|
||||
private Double lat;
|
||||
private String addr;
|
||||
private Long generateTime;
|
||||
private String cityName;
|
||||
private ArrayList<Items> items;
|
||||
private int distance;
|
||||
private String nickName;
|
||||
private String headImgUrl;
|
||||
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(this.type);
|
||||
dest.writeValue(this.lon);
|
||||
dest.writeValue(this.lat);
|
||||
dest.writeString(this.addr);
|
||||
dest.writeValue(this.generateTime);
|
||||
dest.writeString(this.cityName);
|
||||
dest.writeTypedList(this.items);
|
||||
dest.writeInt(this.distance);
|
||||
dest.writeString(this.nickName);
|
||||
dest.writeString(this.headImgUrl);
|
||||
}
|
||||
|
||||
public Information() {
|
||||
}
|
||||
|
||||
protected Information(Parcel in) {
|
||||
this.type = in.readInt();
|
||||
this.lon = (Double) in.readValue(Double.class.getClassLoader());
|
||||
this.lat = (Double) in.readValue(Double.class.getClassLoader());
|
||||
this.addr = in.readString();
|
||||
this.generateTime = (Long) in.readValue(Long.class.getClassLoader());
|
||||
this.cityName = in.readString();
|
||||
this.items = in.createTypedArrayList(Items.CREATOR);
|
||||
this.distance = in.readInt();
|
||||
this.nickName = in.readString();
|
||||
this.headImgUrl = in.readString();
|
||||
}
|
||||
|
||||
public static final Creator<Information> CREATOR = new Creator<Information>() {
|
||||
@Override
|
||||
public Information createFromParcel(Parcel source) {
|
||||
return new Information(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Information[] newArray(int size) {
|
||||
return new Information[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.mogo.tanlu.model
|
||||
|
||||
import android.os.Parcel
|
||||
import android.os.Parcelable
|
||||
import com.amap.api.maps.model.LatLng
|
||||
|
||||
fun Informations.toLatLng(): LatLng {
|
||||
return LatLng(lat, lon)
|
||||
}
|
||||
|
||||
class Informations(
|
||||
var type: Int,
|
||||
var lon: Double,
|
||||
var lat: Double,
|
||||
var addr: String?,
|
||||
var generateTime: Long,
|
||||
var cityName: String?,
|
||||
// var items: ArrayList<Items>,
|
||||
var distance: Int,
|
||||
var nickName: String?,
|
||||
var headImgUrl: String?
|
||||
) :
|
||||
Parcelable {
|
||||
|
||||
var position = 0
|
||||
|
||||
constructor(parcel: Parcel) : this(
|
||||
parcel.readInt(),
|
||||
parcel.readDouble(),
|
||||
parcel.readDouble(),
|
||||
parcel.readString(),
|
||||
parcel.readLong(),
|
||||
parcel.readString(),
|
||||
// parcel.readArrayList(Items::class.java.classLoader) as ArrayList<Items>,
|
||||
parcel.readInt(),
|
||||
parcel.readString(),
|
||||
parcel.readString()
|
||||
)
|
||||
|
||||
override fun writeToParcel(parcel: Parcel, flags: Int) {
|
||||
parcel.writeInt(type)
|
||||
parcel.writeDouble(lon)
|
||||
parcel.writeDouble(lat)
|
||||
parcel.writeString(addr)
|
||||
parcel.writeLong(generateTime)
|
||||
parcel.writeString(cityName)
|
||||
// parcel.writeList(items)
|
||||
parcel.writeInt(distance)
|
||||
parcel.writeString(nickName)
|
||||
parcel.writeString(headImgUrl)
|
||||
}
|
||||
|
||||
override fun describeContents(): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
companion object CREATOR : Parcelable.Creator<Informations> {
|
||||
override fun createFromParcel(parcel: Parcel): Informations {
|
||||
return Informations(parcel)
|
||||
}
|
||||
|
||||
override fun newArray(size: Int): Array<Informations?> {
|
||||
return arrayOfNulls(size)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.mogo.tanlu.model
|
||||
|
||||
import android.os.Parcel
|
||||
import android.os.Parcelable
|
||||
|
||||
class Items(var url: String? = null, var thumbnail: String? = null) : Parcelable {
|
||||
constructor(parcel: Parcel) : this(
|
||||
parcel.readString(),
|
||||
parcel.readString()
|
||||
) {
|
||||
}
|
||||
|
||||
override fun writeToParcel(parcel: Parcel, flags: Int) {
|
||||
parcel.writeString(url)
|
||||
parcel.writeString(thumbnail)
|
||||
}
|
||||
|
||||
override fun describeContents(): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
companion object CREATOR : Parcelable.Creator<Items> {
|
||||
override fun createFromParcel(parcel: Parcel): Items {
|
||||
return Items(parcel)
|
||||
}
|
||||
|
||||
override fun newArray(size: Int): Array<Items?> {
|
||||
return arrayOfNulls(size)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.mogo.tanlu.model.global
|
||||
|
||||
import com.mogo.tanlu.model.Information
|
||||
import java.util.ArrayList
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-02
|
||||
*
|
||||
* 共享的情报列表,避免在点击大屏查看视频时intent序列化造成的开销
|
||||
*/
|
||||
object GlobalSharedInformation {
|
||||
|
||||
var informationList: ArrayList<Information>? = null
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.mogo.tanlu.util
|
||||
|
||||
|
||||
|
||||
const val SPACE_TIME = 1000
|
||||
var lastClickTime = 0L
|
||||
var viewId: Int = 0
|
||||
|
||||
fun isDoubleClick(view: Int): Boolean {
|
||||
val time = System.currentTimeMillis()
|
||||
val timeD = time - lastClickTime
|
||||
if (timeD < SPACE_TIME && viewId == view) {
|
||||
return true
|
||||
}
|
||||
lastClickTime = time
|
||||
viewId = view
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
fun isDoubleClickTime(view: Int,spaceTime:Int): Boolean {
|
||||
val time = System.currentTimeMillis()
|
||||
val timeD = time - lastClickTime
|
||||
if (timeD < spaceTime && viewId == view) {
|
||||
return true
|
||||
}
|
||||
lastClickTime = time
|
||||
viewId = view
|
||||
return false
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.mogo.tanlu.util
|
||||
|
||||
import android.os.Message
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.Group
|
||||
|
||||
class HideControl {
|
||||
|
||||
companion object {
|
||||
const val MSG_HIDE = 0x01
|
||||
}
|
||||
|
||||
private var mHideHandler: HideHandler = HideHandler()
|
||||
var view1: Group? = null
|
||||
var view2: Group? = null
|
||||
|
||||
val hideRunable = Runnable {
|
||||
mHideHandler.obtainMessage(MSG_HIDE).sendToTarget()
|
||||
}
|
||||
|
||||
private inner class HideHandler : android.os.Handler() {
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
when (msg.what) {
|
||||
MSG_HIDE -> {
|
||||
view1?.let {
|
||||
it.visibility = View.GONE
|
||||
}
|
||||
view2?.let {
|
||||
it.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun startHideTimer(view1: Group,view2: Group? = null) {
|
||||
this.view1 = view1
|
||||
this.view2 = view2
|
||||
mHideHandler.removeCallbacks(hideRunable)
|
||||
if (view1.visibility == View.GONE) {
|
||||
view1.visibility = View.VISIBLE
|
||||
}
|
||||
if (view2?.visibility == View.GONE) {
|
||||
view2.visibility = View.VISIBLE
|
||||
}
|
||||
mHideHandler.postDelayed(hideRunable, 3000)
|
||||
}
|
||||
|
||||
fun resetHideTimer() {
|
||||
if(view1 != null){
|
||||
view1!!.visibility = View.VISIBLE
|
||||
}
|
||||
if(view2 != null){
|
||||
view2!!.visibility = View.VISIBLE
|
||||
}
|
||||
mHideHandler.removeCallbacks(hideRunable)
|
||||
mHideHandler.postDelayed(hideRunable, 3000)
|
||||
}
|
||||
|
||||
fun endHideTime() {
|
||||
mHideHandler.removeCallbacks(hideRunable)
|
||||
if (view1 != null) {
|
||||
view1 = null
|
||||
}
|
||||
if (view2 != null) {
|
||||
view2 = null
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.mogo.tanlu.video
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.mogo.tanlu.R
|
||||
import com.mogo.tanlu.constant.REQUESTCODE_MAINACTIVITY
|
||||
import com.mogo.tanlu.model.Informations
|
||||
import com.mogo.tanlu.model.global.GlobalSharedInformation
|
||||
import com.mogo.tanlu.util.HideControl
|
||||
import com.mogo.tanlu.util.isDoubleClickTime
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import kotlinx.android.synthetic.main.tanlu_activity_media_full.*
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* 全屏显示适配
|
||||
*/
|
||||
|
||||
class FullMediaActivity : AppCompatActivity(), View.OnClickListener {
|
||||
companion object {
|
||||
const val PARAM_MEDIA_DATA = "PARAM_MEDIA_DATA"
|
||||
const val PARAM_MEDIA_POSITION_CALLBACK = "PARAM_MEDIA_POSITION_CALLBACK"
|
||||
const val TAG = "FullMediaActivity"
|
||||
|
||||
const val PARAM_VIDEO_URL = "param_video_url"
|
||||
const val PARAM_THUMB_URL = "param_thumb_url"
|
||||
|
||||
|
||||
// fun launch(context: Activity, strategyInfo: List<Informations>, position: Int) {
|
||||
// val intent = Intent(context, FullMediaActivity::class.java)
|
||||
// intent.putExtra(PARAM_MEDIA_POSITION, position)
|
||||
// // 使用全局静态对象代替,避免序列化开销
|
||||
// GlobalSharedInformation.informationList = strategyInfo as ArrayList<Informations>
|
||||
// context.startActivityForResult(intent, REQUESTCODE_MAINACTIVITY)
|
||||
// context.overridePendingTransition(0, 0)
|
||||
// }
|
||||
|
||||
fun launch(context: Activity, videoUrl: String, thumbnail: String) {
|
||||
val intent = Intent(context, FullMediaActivity::class.java)
|
||||
intent.putExtra(PARAM_VIDEO_URL, videoUrl)
|
||||
intent.putExtra(PARAM_THUMB_URL, thumbnail)
|
||||
context.startActivity(intent)
|
||||
context.overridePendingTransition(0, 0)
|
||||
}
|
||||
}
|
||||
|
||||
private var strategyInfo: ArrayList<Informations> = arrayListOf()
|
||||
private var currentImgPosition: Int = 0
|
||||
private var currentPosition: Int = 50
|
||||
private var control = HideControl()
|
||||
|
||||
private var gsyVideoOptionBuilder = GSYVideoOptionBuilder()
|
||||
private var videoUrl: String? = null
|
||||
private var thumbUrl: String? = null
|
||||
|
||||
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.tanlu_activity_media_full)
|
||||
handleIntent()
|
||||
setListener()
|
||||
}
|
||||
|
||||
private fun handleIntent() {
|
||||
var intent = intent
|
||||
|
||||
videoUrl = intent.getStringExtra(PARAM_VIDEO_URL)
|
||||
thumbUrl = intent.getStringExtra(PARAM_THUMB_URL)
|
||||
|
||||
Log.e("liyz", "videoUrl = $videoUrl --->thumbUrl = $thumbUrl")
|
||||
// currentPosition += strategyInfo.size * 10000
|
||||
// if (strategyInfo.size == 1) {
|
||||
// group_media_page_up.visibility = View.GONE
|
||||
// group_media_page_up.updatePreLayout(cl_media)
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
updateInformation()
|
||||
GSYVideoManager.onResume()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
GSYVideoManager.onPause()
|
||||
}
|
||||
|
||||
//需要监听完成事件
|
||||
private fun setListener() {
|
||||
iv_media_back.setOnClickListener(this)
|
||||
|
||||
//重置timer
|
||||
video_view.addSingleClickListener(object :
|
||||
MediaCoverVideoPlayer.SingleClickListener {
|
||||
override fun onClick() {
|
||||
control.resetHideTimer()
|
||||
}
|
||||
})
|
||||
|
||||
//视频播放完成
|
||||
video_view.onCompletionListener(object :
|
||||
MediaCoverVideoPlayer.CompletionListener {
|
||||
override fun onCompletion() {
|
||||
GSYVideoManager.releaseAllVideos()
|
||||
finish()
|
||||
}
|
||||
})
|
||||
|
||||
video_view.loadCoverImage(thumbUrl!!)
|
||||
//设置url,点击播放
|
||||
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(true)
|
||||
.setPlayTag(TAG).build(video_view)
|
||||
video_view.startButton.performClick()
|
||||
}
|
||||
|
||||
private fun updateInformation() {
|
||||
// tv_media_title_content.text = strategyInfo!![currentImgPosition].addr
|
||||
// tv_media_title_time.text = formatDate(strategyInfo!![currentImgPosition].generateTime)
|
||||
}
|
||||
|
||||
|
||||
override fun onClick(view: View) {
|
||||
view?.let {
|
||||
when (view) {
|
||||
iv_media_back -> {
|
||||
handleBack()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
GSYVideoManager.releaseAllVideos()
|
||||
overridePendingTransition(0, 0)
|
||||
}
|
||||
|
||||
private fun handleBack() {
|
||||
Log.d("liyz", "handleBack ------> finish ")
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
super.onBackPressed()
|
||||
handleBack()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.mogo.tanlu.video
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
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.video.StandardGSYVideoPlayer
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoViewBridge
|
||||
|
||||
|
||||
/**
|
||||
* 全屏播放
|
||||
*/
|
||||
class MediaCoverVideoPlayer : StandardGSYVideoPlayer {
|
||||
|
||||
private lateinit var coverImage: ImageView
|
||||
private lateinit var start: ImageView
|
||||
private lateinit var fullscreen: ImageView
|
||||
private lateinit var singleClickListener: SingleClickListener
|
||||
private lateinit var completionListener: CompletionListener
|
||||
|
||||
constructor(context: Context?) : super(context)
|
||||
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context?, fullFlag: Boolean?) : super(context, fullFlag)
|
||||
|
||||
interface SingleClickListener {
|
||||
fun onClick()
|
||||
}
|
||||
|
||||
interface CompletionListener {
|
||||
fun onCompletion()
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
fun addSingleClickListener(singleClickListener: SingleClickListener) {
|
||||
this.singleClickListener = singleClickListener
|
||||
}
|
||||
|
||||
fun onCompletionListener(completionListener: CompletionListener) {
|
||||
this.completionListener = completionListener
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.tanlu_item_video_cover_media
|
||||
}
|
||||
|
||||
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) {
|
||||
Glide.with(context)
|
||||
.load(url)
|
||||
.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 onClickUiToggle() {
|
||||
super.onClickUiToggle()
|
||||
singleClickListener.let {
|
||||
it.onClick()
|
||||
}
|
||||
}
|
||||
|
||||
override fun changeUiToCompleteShow() {
|
||||
super.changeUiToCompleteShow()
|
||||
setViewShowState(mBottomContainer, View.INVISIBLE)
|
||||
}
|
||||
|
||||
override fun onAutoCompletion() {
|
||||
super.onAutoCompletion()
|
||||
mProgressBar.progress = 0
|
||||
}
|
||||
|
||||
override fun showWifiDialog() {
|
||||
//直接播放,不显示WIFI对话框
|
||||
startPlayLogic()
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
super.onClick(v)
|
||||
v?.let {
|
||||
when (v) {
|
||||
start -> {
|
||||
|
||||
}
|
||||
else -> {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPrepared() {
|
||||
super.onPrepared()
|
||||
}
|
||||
|
||||
/**
|
||||
* 多次回调? TODO
|
||||
*/
|
||||
override fun onCompletion() {
|
||||
Log.d("liyz", "onCompletion --------->")
|
||||
// completionListener.let {
|
||||
// it.onCompletion()
|
||||
// }
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
mFullPauseBitmap?.let {
|
||||
if (!it.isRecycled) {
|
||||
it.recycle()
|
||||
}
|
||||
}
|
||||
mFullPauseBitmap = null
|
||||
Log.d("MediaCoverVideoPlayer", "recycle.")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
@@ -9,8 +9,9 @@ import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import com.mogo.service.imageloader.MogoImageView
|
||||
|
||||
class AutoZoomInImageView : ImageView {
|
||||
class AutoZoomInImageView : MogoImageView {
|
||||
|
||||
companion object {
|
||||
const val TAG = "AutoZoomInImageView"
|
||||
@@ -83,10 +84,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 +97,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
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/main_solid_left_page_up_press" android:state_pressed="true"/>
|
||||
<item android:drawable="@drawable/main_solid_left_page_up_normal" android:state_pressed="false"/>
|
||||
<item android:drawable="@drawable/main_solid_left_page_up_normal"/>
|
||||
</selector>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/main_solid_right_page_up_press" android:state_pressed="true"/>
|
||||
<item android:drawable="@drawable/main_solid_right_page_up_normal" android:state_pressed="false"/>
|
||||
<item android:drawable="@drawable/main_solid_right_page_up_normal"/>
|
||||
</selector>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/cl_media"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".video.FullMediaActivity">
|
||||
|
||||
<!--全屏播放器-->
|
||||
<com.mogo.tanlu.video.MediaCoverVideoPlayer
|
||||
android:id="@+id/video_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:longClickable="true" />
|
||||
|
||||
<!--顶部区域-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout_media"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="84dp"
|
||||
android:background="@color/color_323131"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_media_back"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="18dp"
|
||||
android:clickable="true"
|
||||
android:src="@drawable/public_arrow_back_iv"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_media_title_content"
|
||||
android:layout_width="560dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="18dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxWidth="560dp"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_media_title_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="19dp"
|
||||
android:layout_marginTop="58dp"
|
||||
android:layout_marginRight="50dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="17dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/group_media"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="constraintLayout_media" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,68 +1,88 @@
|
||||
<?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
|
||||
android:id="@+id/video_player_main"
|
||||
android:layout_width="400mm"
|
||||
android:layout_height="225mm"
|
||||
android:layout_below="@+id/layout_top_view" />
|
||||
<!--视频播放器和图片播放器-->
|
||||
<RelativeLayout
|
||||
android:id="@+id/media_layout"
|
||||
android:layout_below="@+id/layout_top_view"
|
||||
android:layout_width="400dp"
|
||||
android:layout_height="225dp">
|
||||
|
||||
<com.mogo.tanlu.video.SimpleCoverVideoPlayer
|
||||
android:id="@+id/video_player_main"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.mogo.tanlu.view.AutoZoomInImageView
|
||||
android:id="@+id/tanlu_photo_imageView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<!--底部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/media_layout">
|
||||
|
||||
<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 +90,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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -0,0 +1,85 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="72dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="@color/color_99191C25"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/progress"
|
||||
android:layout_width="match_parent"
|
||||
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:visibility="gone"
|
||||
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>
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user