diff --git a/modules/mogo-module-tanlu/src/main/AndroidManifest.xml b/modules/mogo-module-tanlu/src/main/AndroidManifest.xml
index 0c407d146c..c910375626 100644
--- a/modules/mogo-module-tanlu/src/main/AndroidManifest.xml
+++ b/modules/mogo-module-tanlu/src/main/AndroidManifest.xml
@@ -1,2 +1,12 @@
+ package="com.mogo.tanlu">
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/constant/Const.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/constant/Const.kt
new file mode 100644
index 0000000000..7dc93f919b
--- /dev/null
+++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/constant/Const.kt
@@ -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 //结束导航
diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/constant/TanluConstants.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/constant/TanluConstants.java
index 85da40785d..a58ccebf23 100644
--- a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/constant/TanluConstants.java
+++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/constant/TanluConstants.java
@@ -9,4 +9,5 @@ package com.mogo.tanlu.constant;
public class TanluConstants {
public static final String TAG = "/tanlu/ui";
+
}
diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/fragment/TanluCardViewFragment.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/fragment/TanluCardViewFragment.java
index 4500d03a0e..9bdd396d56 100644
--- a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/fragment/TanluCardViewFragment.java
+++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/fragment/TanluCardViewFragment.java
@@ -10,6 +10,7 @@ import android.view.View;
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;
@@ -24,9 +25,15 @@ 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.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;
@@ -52,10 +59,11 @@ public class TanluCardViewFragment extends MvpFragment>
private TanluInfoWindowAdapter mDemoInfoWindowAdapter;
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";
+// 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() {
@@ -67,6 +75,7 @@ public class TanluCardViewFragment extends MvpFragment>
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)
@@ -76,15 +85,19 @@ public class TanluCardViewFragment extends MvpFragment>
@Override
public void onClick(View view) {
Log.d("liyz", "onClick ---------> ");
- Intent intent = new Intent("fullscreen.video.play", Uri.parse("video://666"));
- getActivity().startActivity(intent);
+// 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();
mDemoInfoWindowAdapter = new TanluInfoWindowAdapter(getContext(), TanluServiceHandler.getNavi(), TanluServiceHandler.getImageloader());
diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/model/Information.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/model/Information.java
new file mode 100644
index 0000000000..a65ca8b47f
--- /dev/null
+++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/model/Information.java
@@ -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;
+ 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 CREATOR = new Creator() {
+ @Override
+ public Information createFromParcel(Parcel source) {
+ return new Information(source);
+ }
+
+ @Override
+ public Information[] newArray(int size) {
+ return new Information[size];
+ }
+ };
+}
diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/model/Informations.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/model/Informations.kt
new file mode 100644
index 0000000000..6793083965
--- /dev/null
+++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/model/Informations.kt
@@ -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,
+ 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,
+ 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 {
+ override fun createFromParcel(parcel: Parcel): Informations {
+ return Informations(parcel)
+ }
+
+ override fun newArray(size: Int): Array {
+ return arrayOfNulls(size)
+ }
+ }
+
+}
diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/model/Items.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/model/Items.kt
new file mode 100644
index 0000000000..d7f75dc33e
--- /dev/null
+++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/model/Items.kt
@@ -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 {
+ override fun createFromParcel(parcel: Parcel): Items {
+ return Items(parcel)
+ }
+
+ override fun newArray(size: Int): Array {
+ return arrayOfNulls(size)
+ }
+ }
+
+
+}
\ No newline at end of file
diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/model/global/GlobalSharedInformation.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/model/global/GlobalSharedInformation.kt
new file mode 100644
index 0000000000..31fe2a771b
--- /dev/null
+++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/model/global/GlobalSharedInformation.kt
@@ -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? = null
+}
\ No newline at end of file
diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/util/DoubleCheckUtil.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/util/DoubleCheckUtil.kt
new file mode 100644
index 0000000000..b0582d8da9
--- /dev/null
+++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/util/DoubleCheckUtil.kt
@@ -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
+}
\ No newline at end of file
diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/util/HideControl.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/util/HideControl.kt
new file mode 100644
index 0000000000..0307d5c53e
--- /dev/null
+++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/util/HideControl.kt
@@ -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
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/video/FullMediaActivity.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/video/FullMediaActivity.kt
new file mode 100644
index 0000000000..6881256481
--- /dev/null
+++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/video/FullMediaActivity.kt
@@ -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, position: Int) {
+// val intent = Intent(context, FullMediaActivity::class.java)
+// intent.putExtra(PARAM_MEDIA_POSITION, position)
+// // 使用全局静态对象代替,避免序列化开销
+// GlobalSharedInformation.informationList = strategyInfo as ArrayList
+// 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 = 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()
+ }
+}
diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/video/MediaCoverVideoPlayer.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/video/MediaCoverVideoPlayer.kt
new file mode 100644
index 0000000000..c71fc8d361
--- /dev/null
+++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/video/MediaCoverVideoPlayer.kt
@@ -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.")
+ }
+
+}
\ No newline at end of file
diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/view/AutoZoomInImageView.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/view/AutoZoomInImageView.kt
index 9a4d59eaf4..391727aa8d 100644
--- a/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/view/AutoZoomInImageView.kt
+++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/tanlu/view/AutoZoomInImageView.kt
@@ -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"
diff --git a/modules/mogo-module-tanlu/src/main/res/drawable/selector_bg_solid_left_page_up.xml b/modules/mogo-module-tanlu/src/main/res/drawable/selector_bg_solid_left_page_up.xml
new file mode 100644
index 0000000000..5448ebf742
--- /dev/null
+++ b/modules/mogo-module-tanlu/src/main/res/drawable/selector_bg_solid_left_page_up.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-tanlu/src/main/res/drawable/selector_bg_solid_right_page_up.xml b/modules/mogo-module-tanlu/src/main/res/drawable/selector_bg_solid_right_page_up.xml
new file mode 100644
index 0000000000..a3879591d8
--- /dev/null
+++ b/modules/mogo-module-tanlu/src/main/res/drawable/selector_bg_solid_right_page_up.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-tanlu/src/main/res/layout/tanlu_activity_media_full.xml b/modules/mogo-module-tanlu/src/main/res/layout/tanlu_activity_media_full.xml
new file mode 100644
index 0000000000..1a92d9b201
--- /dev/null
+++ b/modules/mogo-module-tanlu/src/main/res/layout/tanlu_activity_media_full.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-tanlu/src/main/res/layout/tanlu_item_main_media_recycler.xml b/modules/mogo-module-tanlu/src/main/res/layout/tanlu_item_main_media_recycler.xml
index e2e24bc657..ccbb8d827b 100644
--- a/modules/mogo-module-tanlu/src/main/res/layout/tanlu_item_main_media_recycler.xml
+++ b/modules/mogo-module-tanlu/src/main/res/layout/tanlu_item_main_media_recycler.xml
@@ -36,19 +36,32 @@
android:textSize="20dp" />
-
-
+
+ android:layout_height="225dp">
+
+
+
+
+
+
+ android:layout_below="@+id/media_layout">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+