ソースを参照

1.gradle升级到7.0以上。
2.优化视频。

shihuiyun 2 年 前
コミット
074f1707ae
30 ファイル変更1051 行追加251 行削除
  1. 7 3
      app/build.gradle
  2. 20 1
      app/proguard-rules.pro
  3. 23 9
      app/src/main/AndroidManifest.xml
  4. 139 3
      app/src/main/java/com/hdl/xl/activity/AllCollectDetailsActivity.kt
  5. 3 2
      app/src/main/java/com/hdl/xl/activity/ArticleDetailActivity.kt
  6. 149 27
      app/src/main/java/com/hdl/xl/activity/CollectDetailsActivity.kt
  7. 132 10
      app/src/main/java/com/hdl/xl/activity/LotsDetailsActivity.kt
  8. 135 2
      app/src/main/java/com/hdl/xl/activity/SellDetailsActivity.kt
  9. 167 37
      app/src/main/java/com/hdl/xl/activity/TibetanDetailsActivity.kt
  10. 15 0
      app/src/main/java/com/hdl/xl/adapter/CalenTimeAdapter.kt
  11. 1 0
      app/src/main/java/com/hdl/xl/adapter/MsgAdapter.kt
  12. 1 0
      app/src/main/java/com/hdl/xl/base/MBActivity.kt
  13. 3 3
      app/src/main/java/com/hdl/xl/config/Config.kt
  14. 2 2
      app/src/main/java/com/hdl/xl/model/CalendarBean.kt
  15. BIN
      app/src/main/res/drawable-xxhdpi/ic_palyiv.webp
  16. BIN
      app/src/main/res/drawable-xxhdpi/tran_img.png
  17. 5 0
      app/src/main/res/drawable/fullscreento.xml
  18. 19 0
      app/src/main/res/layout/activity_all_collect_details.xml
  19. 45 39
      app/src/main/res/layout/activity_article_detail.xml
  20. 19 0
      app/src/main/res/layout/activity_collect_details.xml
  21. 18 0
      app/src/main/res/layout/activity_lots_details.xml
  22. 18 0
      app/src/main/res/layout/activity_sell_details.xml
  23. 110 94
      app/src/main/res/layout/activity_tibetan_details.xml
  24. 1 0
      app/src/main/res/layout/item_calend.xml
  25. 2 0
      app/src/main/res/values/strings.xml
  26. 7 5
      app/xiaomi/release/output-metadata.json
  27. 0 5
      base/src/main/java/com/ysnows/base/base/BActivity.kt
  28. 6 6
      build.gradle
  29. 1 1
      gradle/wrapper/gradle-wrapper.properties
  30. 3 2
      settings.gradle

+ 7 - 3
app/build.gradle

@@ -123,7 +123,8 @@ dependencies {
 
     implementation project(':base')
     implementation project(path: ':update')
-    implementation project(path: ':alipay')
+//    implementation project(path: ':alipay')
+
 
 
     // addComponent 'umeng'
@@ -168,8 +169,11 @@ dependencies {
     implementation 'com.alibaba:fastjson:1.2.62'
     implementation 'com.aliyun.dpa:oss-android-sdk:+'
     testImplementation 'junit:junit:4.+'
+//    //视频
+//    implementation 'com.github.JarvanMo:ExoVideoView:2.1.6'
 
-
-
+//    implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer:v8.3.4-release-jitpack'
+    implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:v8.3.4-release-jitpack'
+    implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-arm64:v8.3.4-release-jitpack'
 
 }

+ 20 - 1
app/proguard-rules.pro

@@ -455,4 +455,23 @@
 
 -dontwarn com.unionpay.**
 -keep class com.unionpay.** {*;}
-
+-keep class com.shuyu.gsyvideoplayer.video.** { *; }
+-dontwarn com.shuyu.gsyvideoplayer.video.**
+-keep class com.shuyu.gsyvideoplayer.video.base.** { *; }
+-dontwarn com.shuyu.gsyvideoplayer.video.base.**
+-keep class com.shuyu.gsyvideoplayer.utils.** { *; }
+-dontwarn com.shuyu.gsyvideoplayer.utils.**
+-keep class tv.danmaku.ijk.** { *; }
+-dontwarn tv.danmaku.ijk.**
+
+-keep class xyz.doikki.videoplayer.** { *; }
+-dontwarn xyz.doikki.videoplayer.**
+
+# IjkPlayer
+-keep class tv.danmaku.ijk.** { *; }
+-dontwarn tv.danmaku.ijk.**
+
+# ExoPlayer
+-keep class com.google.android.exoplayer2.** { *; }
+-dontwarn com.google.android.exoplayer2.**
+-keep class com.ywl5320.wlmedia.* {*;}

+ 23 - 9
app/src/main/AndroidManifest.xml

@@ -62,11 +62,11 @@
     </queries >
 
     <application
-        tools:replace="android:allowBackup"
+        tools:replace="android:allowBackup,android:label"
         android:name="com.hdl.xl.App"
         android:allowBackup="true"
         android:roundIcon="@mipmap/ic_launcher"
-        android:label="@string/app_name"
+        android:label="@string/app_name_to"
         android:supportsRtl="true"
         android:icon="@mipmap/ic_launcher"
         android:theme="@style/AppTheme.NoActionBar"
@@ -89,6 +89,7 @@
         <activity
             android:name="com.hdl.xl.activity.MainActivity"
             android:screenOrientation="portrait"
+            android:exported="true"
             android:windowSoftInputMode="adjustResize|adjustPan"
             android:theme="@style/FullScreenTheme" >
             <intent-filter >
@@ -107,7 +108,10 @@
 <!--        <activity android:name=".activity.LoginActivity" />-->
         <activity android:name="com.hdl.xl.activity.RegisterActivity" />
         <activity android:name="com.hdl.xl.activity.WebViewActivity" />
-        <activity android:name="com.hdl.xl.activity.SellDetailsActivity"/>
+        <activity android:name="com.hdl.xl.activity.SellDetailsActivity"
+            android:configChanges="orientation|screenSize|keyboardHidden"
+
+            />
         <activity android:name="com.hdl.xl.activity.TestMainActivity"/>
         <activity android:name="com.hdl.xl.activity.SettingActivity"/>
         <activity android:name="com.hdl.xl.activity.SpreadActivity"/>
@@ -125,7 +129,9 @@
         <activity android:name="com.hdl.xl.activity.WithdrawSuessActivity"/>
         <activity android:name="com.hdl.xl.activity.AuthenActivity"/>
         <activity android:name="com.hdl.xl.activity.MyCollectActivity"/>
-        <activity android:name="com.hdl.xl.activity.CollectDetailsActivity"/>
+        <activity android:name="com.hdl.xl.activity.CollectDetailsActivity"
+            android:configChanges="orientation|screenSize|keyboardHidden"
+            />
         <activity android:name="com.hdl.xl.activity.TrannsferActivity"/>
         <activity android:name="com.hdl.xl.activity.IntegralDetailsActivity"/>
         <activity android:name="com.hdl.xl.activity.SureOrderActivity"/>
@@ -133,7 +139,8 @@
         <activity android:name="com.hdl.xl.activity.MallOrderActivity"/>
         <activity android:name="com.hdl.xl.activity.AddressActivity"/>
         <activity android:name="com.hdl.xl.activity.AddAddressActivity"/>
-        <activity android:name="com.hdl.xl.activity.AllCollectDetailsActivity"/>
+        <activity android:name="com.hdl.xl.activity.AllCollectDetailsActivity"
+            />
         <activity android:name=".activity.SellOrderActivity"/>
         <activity android:name=".activity.GivenOrderActivity"/>
         <activity android:name=".activity.ComposeOrderActivity"/>
@@ -142,7 +149,10 @@
         <activity android:name=".activity.DrawActivity"/>
         <activity android:name=".activity.SecurityActivity"/>
         <activity android:name=".activity.UpCellActivity"/>
-        <activity android:name=".activity.LotsDetailsActivity"/>
+        <activity android:name=".activity.LotsDetailsActivity"
+            android:configChanges="orientation|screenSize|keyboardHidden"
+
+            />
         <activity android:name=".activity.RosterActivity"/>
         <activity android:name=".activity.PartakeActivity"/>
         <activity android:name=".activity.ComposeDetailsActivity"/>
@@ -169,7 +179,10 @@
             </intent-filter >
         </activity >
 
-        <activity android:name="com.hdl.xl.activity.MsgActivity" >
+        <activity android:name="com.hdl.xl.activity.MsgActivity"
+            android:exported="true"
+
+            >
             <intent-filter>
                 <action android:name="jpush.testAction" />
                 <category android:name="jpush.testCategory" />
@@ -199,8 +212,9 @@
         <activity android:name="com.hdl.xl.activity.ConsignmentOrderActivity"/>
         <activity android:name="com.hdl.xl.activity.CertificationActivity"/>
         <activity android:name="com.hdl.xl.activity.TibetanDetailsActivity"
-               android:hardwareAccelerated="false"
-            >
+            android:exported="true"
+            android:configChanges="orientation|screenSize|keyboardHidden"
+           >
             <intent-filter>
                 <action android:name="android.intent.action.VIEW"/>
                 <category android:name="android.intent.category.DEFAULT"/>

+ 139 - 3
app/src/main/java/com/hdl/xl/activity/AllCollectDetailsActivity.kt

@@ -1,12 +1,15 @@
 package com.hdl.xl.activity
 
 import android.app.Activity
+import android.content.res.Configuration
 import android.graphics.Color
 import android.os.Build
 import android.os.Bundle
 import android.text.TextUtils
+import android.util.Log
 import android.view.KeyEvent
 import android.view.View
+import android.widget.ImageView
 import androidx.lifecycle.lifecycleScope
 import coil.request.Disposable
 import com.githang.statusbar.StatusBarCompat
@@ -24,10 +27,17 @@ import com.hdl.xl.vmodel.AllCollectDetailsVModel
 import com.hwangjr.rxbus.RxBus
 import com.hwangjr.rxbus.annotation.Subscribe
 import com.hwangjr.rxbus.annotation.Tag
+import com.shuyu.gsyvideoplayer.GSYVideoManager
+import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
+import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
+import com.shuyu.gsyvideoplayer.utils.Debuger
+import com.shuyu.gsyvideoplayer.utils.OrientationUtils
+import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
 import com.ysnows.base.utils.B
 import com.ysnows.base.utils.UiSwitch
 import kotlinx.coroutines.launch
 import java.text.DecimalFormat
+import java.util.regex.Pattern
 
 /**
  * 全部的藏品详情
@@ -67,9 +77,24 @@ class AllCollectDetailsActivity : MBActivity<AllCollectDetailsVModel, ActivityAl
             }
             adapter?.addData(list)
 
-            //设置头 图片
 
-            GlideUtils.lImg(this, it.cover, 20, binding.imageView)
+            //判断是视频还是图片
+            if(null==it.pro_info.detail_img|| it.pro_info.detail_img == ""){
+                GlideUtils.lImg(this, it.cover, binding.imageView)
+            }else {
+                if (Pattern.compile(".*?(gif|jpeg|png|jpg|bmp)").matcher(it.pro_info.detail_img)
+                        .matches()
+                ) {
+                    //图片
+                    GlideUtils.lImg(this, it.pro_info.detail_img, binding.imageView)
+                } else {
+                    //视频
+                    initVideo(it.pro_info.detail_img,it.cover)
+
+                }
+            }
+
+//            GlideUtils.lImg(this, it.cover, 20, binding.imageView)
 
 
         }
@@ -91,10 +116,75 @@ class AllCollectDetailsActivity : MBActivity<AllCollectDetailsVModel, ActivityAl
 
 
 
+    var detailPlayer: StandardGSYVideoPlayer?=null
+    var orientationUtils: OrientationUtils?=null
+    var isPlay=false
+    var isPause=false
+    fun initVideo(videoUrl: String,cover:String) {
+
+        binding.imageView.visibility = View.GONE
+        binding.flVideo.visibility = View.VISIBLE
+
+        detailPlayer=binding.detailPlayer
+        //外部辅助的旋转,帮助全屏
+        orientationUtils = OrientationUtils(this, detailPlayer)
+        //初始化不打开外部的旋转
+        orientationUtils?.isEnable = false
+
+        val imageView = ImageView(this)
+        imageView.scaleType = ImageView.ScaleType.CENTER_CROP
+        GlideUtils.lImg(context(),cover,imageView)
+
+
+        val gsyVideoOption = GSYVideoOptionBuilder()
+        gsyVideoOption.setThumbImageView(imageView)
+            .setIsTouchWiget(true)
+            .setRotateViewAuto(false)
+            .setLockLand(false)
+            .setAutoFullWithSize(true)
+            .setShowFullAnimation(false)
+            .setNeedLockFull(true)
+            .setUrl(videoUrl)
+            .setCacheWithPlay(false)
+            .setVideoTitle("")
+            .setLooping(true)
+            .setVideoAllCallBack(object : GSYSampleCallBack() {
+                override fun onPrepared(url: String, vararg objects: Any) {
+                    super.onPrepared(url, *objects)
+                    //开始播放了才能旋转和全屏
+                    orientationUtils?.isEnable = true
+                    isPlay = true
+                }
+
+                override fun onQuitFullscreen(url: String, vararg objects: Any) {
+                    super.onQuitFullscreen(url, *objects)
+                    Debuger.printfError("***** onQuitFullscreen **** " + objects[0]) //title
+                    Debuger.printfError("***** onQuitFullscreen **** " + objects[1]) //当前非全屏player
+                    if (orientationUtils != null) {
+                        orientationUtils?.backToProtVideo()
+                    }
+                }
+            }).setLockClickListener { view, lock ->
+                if (orientationUtils != null) {
+                    //配合下方的onConfigurationChanged
+                    orientationUtils?.isEnable = !lock
+                }
+            }.build(detailPlayer)
+
+        detailPlayer?.fullscreenButton?.setOnClickListener(View.OnClickListener { //直接横屏
+            orientationUtils?.resolveByClick()
 
+            //第一个true是否需要隐藏actionbar,第二个true是否需要隐藏statusbar
+            detailPlayer?.startWindowFullscreen(this@AllCollectDetailsActivity, true, true)
+        })
 
 
-        override fun listeners() {
+    }
+
+
+
+
+    override fun listeners() {
             super.listeners()
             binding.butBuy.onClick {
 
@@ -135,6 +225,16 @@ class AllCollectDetailsActivity : MBActivity<AllCollectDetailsVModel, ActivityAl
                 if (null != disposable) {
                     disposable?.dispose()
                 }
+                if(null!=detailPlayer){
+
+                    if (orientationUtils != null) {
+                        orientationUtils?.backToProtVideo();
+                    }
+                    if (GSYVideoManager.backFromWindowFull(this)) {
+                        return false
+                    }
+
+                }
                 finishActivity()
                 return false
             } else {
@@ -149,6 +249,16 @@ class AllCollectDetailsActivity : MBActivity<AllCollectDetailsVModel, ActivityAl
             if (null != disposable) {
                 disposable?.dispose()
             }
+
+            if(null!=detailPlayer){
+                if (isPlay) {
+                    detailPlayer?.currentPlayer?.release();
+                }
+                if (orientationUtils != null)
+                    orientationUtils?.releaseListener();
+            }
+
+
         }
 
     @Subscribe(tags = [Tag(ConfigRx.CHOSE_PAY_TYPE)])
@@ -223,5 +333,31 @@ class AllCollectDetailsActivity : MBActivity<AllCollectDetailsVModel, ActivityAl
     }
 
 
+    override fun onResume() {
+        super.onResume()
+        if(null!=detailPlayer){
+            detailPlayer?.currentPlayer?.onVideoResume(false);
+            isPause = false
+
+        }
+    }
+
+
+    override fun onPause() {
+        super.onPause()
+        if(null!=detailPlayer){
+            detailPlayer?.currentPlayer?.onVideoPause()
+            isPause = true
+        }
+
+
+    }
+    override fun onConfigurationChanged(newConfig: Configuration) {
+        super.onConfigurationChanged(newConfig)
+        //如果旋转了就全屏
+        if (isPlay && !isPause) {
+            detailPlayer?.onConfigurationChanged(this, newConfig, orientationUtils, true, true)
+        }
+    }
 
 }

+ 3 - 2
app/src/main/java/com/hdl/xl/activity/ArticleDetailActivity.kt

@@ -44,8 +44,9 @@ class ArticleDetailActivity : MBActivity<ArticleDetailVModel, ActivityArticleDet
             vm.isShow.value = true
 
             titleBar()!!.setTitle("消息详情")
-            binding.tvContent.text = Html.fromHtml(item.content)
-
+//            binding.tvContent.text = Html.fromHtml(item.content)
+            binding.tvContent.visibility=View.GONE
+            inData(item.content)
 
             //设置已读消息
 

+ 149 - 27
app/src/main/java/com/hdl/xl/activity/CollectDetailsActivity.kt

@@ -1,17 +1,15 @@
 package com.hdl.xl.activity
 
 import android.Manifest
-import android.graphics.Color
-import android.os.Build
+import android.content.res.Configuration
 import android.os.Bundle
-import android.text.TextUtils
 import android.view.KeyEvent
 import android.view.View
+import android.widget.ImageView
 import androidx.lifecycle.lifecycleScope
 import coil.request.Disposable
 import com.eazypermissions.common.model.PermissionResult
 import com.eazypermissions.coroutinespermission.PermissionManager
-import com.githang.statusbar.StatusBarCompat
 import com.qmuiteam.qmui.kotlin.onClick
 import com.ysnows.base.utils.UiUtils
 import com.hdl.xl.R
@@ -27,8 +25,14 @@ import com.hdl.xl.utils.glide.GlideUtils
 import com.hdl.xl.vmodel.CollectDetailsVModel
 import com.hwangjr.rxbus.annotation.Subscribe
 import com.hwangjr.rxbus.annotation.Tag
+import com.shuyu.gsyvideoplayer.GSYVideoManager
+import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
+import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
+import com.shuyu.gsyvideoplayer.utils.Debuger
+import com.shuyu.gsyvideoplayer.utils.OrientationUtils
+import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
 import kotlinx.coroutines.launch
-import java.text.DecimalFormat
+import java.util.regex.Pattern
 
 /**
  * 自己的藏品详情
@@ -37,22 +41,22 @@ import java.text.DecimalFormat
 class CollectDetailsActivity : MBActivity<CollectDetailsVModel, ActivityCollectDetailsBinding>() {
 
     var disposable: Disposable? = null
-     var islide = true //是否滑动的时候标题改变
-     var screenHeightPixels = 0
+    var islide = true //是否滑动的时候标题改变
+    var screenHeightPixels = 0
     var adapter: ImagesAdapter? = null
 
 
     override fun init(savedInstanceState: Bundle?) {
         super.init(savedInstanceState)
 
-        titleBar()?.imgRight?.visibility=View.VISIBLE
+        titleBar()?.imgRight?.visibility = View.VISIBLE
         titleBar()?.imgRight?.setImageResource(R.drawable.ct_share)
         screenHeightPixels = UiUtils.getScreenHeightPixels()
         vm.ll = binding.ll
         adapter = ImagesAdapter()
         binding.recyclerView.adapter = adapter
         var id = intent?.extras?.getString("id")
-        vm.id.value=id
+        vm.id.value = id
         vm.getInfo()
         vm.getCertificate()
 
@@ -60,31 +64,46 @@ class CollectDetailsActivity : MBActivity<CollectDetailsVModel, ActivityCollectD
 
             //设置详情图片
             adapter?.clearList()
-            var ss=it.pro_info.describe.split("|")
-            var list=ArrayList<String>()
-            for(item in ss){
+            var ss = it.pro_info.describe.split("|")
+            var list = ArrayList<String>()
+            for (item in ss) {
                 list.add(item)
             }
             adapter?.addData(list)
             //设置头 图片
+            //判断是视频还是图片
+            if (null == it.pro_info.detail_img || it.pro_info.detail_img == "") {
+                GlideUtils.lImg(this, it.cover, binding.imageView)
+            } else {
+                if (Pattern.compile(".*?(gif|jpeg|png|jpg|bmp)").matcher(it.pro_info.detail_img)
+                        .matches()
+                ) {
+                    //图片
+                    GlideUtils.lImg(this, it.pro_info.detail_img, binding.imageView)
+                } else {
+                    //视频
+                    initVideo(it.pro_info.detail_img,it.cover)
 
-            GlideUtils.lImg(this, it.cover,  binding.imageView)
+                }
+            }
+
+//            GlideUtils.lImg(this, it.cover,  binding.imageView)
 
 
         }
 
-        vm.openData.observe(this){
+        vm.openData.observe(this) {
 
-            PopuOpenTipsUtils.show(context(),it,binding.ll,object : ChoiceData{
+            PopuOpenTipsUtils.show(context(), it, binding.ll, object : ChoiceData {
                 override fun onRestuse(type: String?) {
 
                 }
 
             })
         }
-        vm.openDataNo.observe(this){
+        vm.openDataNo.observe(this) {
 
-            PopuOpenNoUtils.show(context(),binding.ll)
+            PopuOpenNoUtils.show(context(), binding.ll)
 
         }
 
@@ -92,6 +111,71 @@ class CollectDetailsActivity : MBActivity<CollectDetailsVModel, ActivityCollectD
     }
 
 
+    var detailPlayer: StandardGSYVideoPlayer?=null
+    var orientationUtils: OrientationUtils?=null
+    var isPlay=false
+    var isPause=false
+    fun initVideo(videoUrl: String,cover:String) {
+
+        binding.imageView.visibility = View.GONE
+        binding.flVideo.visibility = View.VISIBLE
+
+        detailPlayer=binding.detailPlayer
+        //外部辅助的旋转,帮助全屏
+        orientationUtils = OrientationUtils(this, detailPlayer)
+        //初始化不打开外部的旋转
+        orientationUtils?.isEnable = false
+
+        val imageView = ImageView(this)
+        imageView.scaleType = ImageView.ScaleType.CENTER_CROP
+        GlideUtils.lImg(context(),cover,imageView)
+
+
+        val gsyVideoOption = GSYVideoOptionBuilder()
+        gsyVideoOption.setThumbImageView(imageView)
+            .setIsTouchWiget(true)
+            .setRotateViewAuto(false)
+            .setLockLand(false)
+            .setAutoFullWithSize(true)
+            .setShowFullAnimation(false)
+            .setNeedLockFull(true)
+            .setUrl(videoUrl)
+            .setCacheWithPlay(false)
+            .setVideoTitle("")
+            .setLooping(true)
+            .setVideoAllCallBack(object : GSYSampleCallBack() {
+                override fun onPrepared(url: String, vararg objects: Any) {
+                    super.onPrepared(url, *objects)
+                    //开始播放了才能旋转和全屏
+                    orientationUtils?.isEnable = true
+                    isPlay = true
+                }
+
+                override fun onQuitFullscreen(url: String, vararg objects: Any) {
+                    super.onQuitFullscreen(url, *objects)
+                    Debuger.printfError("***** onQuitFullscreen **** " + objects[0]) //title
+                    Debuger.printfError("***** onQuitFullscreen **** " + objects[1]) //当前非全屏player
+                    if (orientationUtils != null) {
+                        orientationUtils?.backToProtVideo()
+                    }
+                }
+            }).setLockClickListener { view, lock ->
+                if (orientationUtils != null) {
+                    //配合下方的onConfigurationChanged
+                    orientationUtils?.isEnable = !lock
+                }
+            }.build(detailPlayer)
+
+        detailPlayer?.fullscreenButton?.setOnClickListener(View.OnClickListener { //直接横屏
+            orientationUtils?.resolveByClick()
+
+            //第一个true是否需要隐藏actionbar,第二个true是否需要隐藏statusbar
+            detailPlayer?.startWindowFullscreen(this@CollectDetailsActivity, true, true)
+        })
+
+
+    }
+
 
 
 
@@ -103,10 +187,10 @@ class CollectDetailsActivity : MBActivity<CollectDetailsVModel, ActivityCollectD
 
             lifecycleScope.launch {
                 if (PermissionManager.requestPermissions(
-                                this@CollectDetailsActivity, 1000,
-                                Manifest.permission.WRITE_EXTERNAL_STORAGE,
-                                Manifest.permission.READ_EXTERNAL_STORAGE
-                        ) is PermissionResult.PermissionGranted
+                        this@CollectDetailsActivity, 1000,
+                        Manifest.permission.WRITE_EXTERNAL_STORAGE,
+                        Manifest.permission.READ_EXTERNAL_STORAGE
+                    ) is PermissionResult.PermissionGranted
                 ) {
                     vm.getUrl()
                 }
@@ -130,13 +214,9 @@ class CollectDetailsActivity : MBActivity<CollectDetailsVModel, ActivityCollectD
         }
 
 
-
-
     }
 
 
-
-
     override fun binding(): ActivityCollectDetailsBinding {
         return ActivityCollectDetailsBinding.inflate(layoutInflater)
     }
@@ -158,6 +238,16 @@ class CollectDetailsActivity : MBActivity<CollectDetailsVModel, ActivityCollectD
             if (null != disposable) {
                 disposable?.dispose()
             }
+            if(null!=detailPlayer){
+
+                if (orientationUtils != null) {
+                    orientationUtils?.backToProtVideo();
+                }
+                if (GSYVideoManager.backFromWindowFull(this)) {
+                    return false
+                }
+
+            }
             finishActivity()
             return false
         } else {
@@ -170,6 +260,14 @@ class CollectDetailsActivity : MBActivity<CollectDetailsVModel, ActivityCollectD
         if (null != disposable) {
             disposable?.dispose()
         }
+        if(null!=detailPlayer){
+            if (isPlay) {
+                detailPlayer?.currentPlayer?.release();
+            }
+            if (orientationUtils != null)
+                orientationUtils?.releaseListener();
+        }
+
     }
 
     @Subscribe(tags = [Tag(ConfigRx.PAY_SELL_CLOSE)])
@@ -181,7 +279,7 @@ class CollectDetailsActivity : MBActivity<CollectDetailsVModel, ActivityCollectD
     @Subscribe(tags = [Tag(ConfigRx.REFRESH_ZENG)])
     fun setRefreshList(type: String) {//转赠后关闭
 
-       finish()
+        finish()
 
     }
 
@@ -197,11 +295,35 @@ class CollectDetailsActivity : MBActivity<CollectDetailsVModel, ActivityCollectD
     @Subscribe(tags = [Tag(ConfigRx.REFRESH_ZHOU)])
     fun zhouRefresh(type: String) {
 
-        binding.tvTips.text="转售中"
+        binding.tvTips.text = "转售中"
         //刷新
         vm.getInfoTo()
     }
 
+    override fun onResume() {
+        super.onResume()
+        if(null!=detailPlayer){
+            detailPlayer?.currentPlayer?.onVideoResume(false);
+            isPause = false
 
+        }
+    }
+
+
+    override fun onPause() {
+        super.onPause()
+        if(null!=detailPlayer){
+            detailPlayer?.currentPlayer?.onVideoPause()
+            isPause = true
+        }
 
+    }
+
+    override fun onConfigurationChanged(newConfig: Configuration) {
+        super.onConfigurationChanged(newConfig)
+        //如果旋转了就全屏
+        if (isPlay && !isPause) {
+            detailPlayer?.onConfigurationChanged(this, newConfig, orientationUtils, true, true)
+        }
+    }
 }

+ 132 - 10
app/src/main/java/com/hdl/xl/activity/LotsDetailsActivity.kt

@@ -1,48 +1,48 @@
 package com.hdl.xl.activity
 
 import android.Manifest
+import android.content.res.Configuration
 import android.graphics.Color
 import android.graphics.LinearGradient
 import android.graphics.Shader
 import android.os.Bundle
 import android.os.Handler
 import android.os.Message
-import android.text.TextUtils
 import android.util.Log
 import android.view.KeyEvent
 import android.view.View
-import android.widget.Toast
+import android.widget.ImageView
 import androidx.lifecycle.lifecycleScope
 import coil.request.Disposable
 import com.eazypermissions.common.model.PermissionResult
 import com.eazypermissions.coroutinespermission.PermissionManager
-import com.hdl.xl.BuildConfig
 import com.hdl.xl.R
-import com.hdl.xl.adapter.GivenOrderAdapter
 import com.hdl.xl.adapter.ImagesAdapter
 import com.hdl.xl.base.MBActivity
 import com.hdl.xl.config.ConfigRx
 import com.hdl.xl.databinding.ActivityLotsDetailsBinding
-import com.hdl.xl.databinding.ActivityTibetanDetailsBinding
 import com.hdl.xl.model.User
 import com.hdl.xl.model.bean.PayTypeBen
-import com.hdl.xl.utils.AppUtils
-import com.hdl.xl.utils.MD5Utils
 import com.hdl.xl.utils.PopuPaySuesstils
 import com.hdl.xl.utils.glide.GlideUtils
 import com.hdl.xl.utils.net.NetEngine
 import com.hdl.xl.vmodel.LotsDetailsVModel
-import com.hdl.xl.vmodel.TibetanDetailsVModel
 import com.hwangjr.rxbus.annotation.Subscribe
 import com.hwangjr.rxbus.annotation.Tag
 import com.qmuiteam.qmui.kotlin.onClick
+import com.shuyu.gsyvideoplayer.GSYVideoManager
+import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
+import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
+import com.shuyu.gsyvideoplayer.utils.Debuger
+import com.shuyu.gsyvideoplayer.utils.OrientationUtils
+import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
 import com.ysnows.base.utils.B
 import com.ysnows.base.utils.UiSwitch
 import com.ysnows.base.utils.UiUtils
 import kotlinx.coroutines.launch
-import org.json.JSONObject
 import java.text.DecimalFormat
 import java.util.*
+import java.util.regex.Pattern
 
 
 /**
@@ -81,7 +81,21 @@ class LotsDetailsActivity : MBActivity<LotsDetailsVModel, ActivityLotsDetailsBin
             adapter?.addData(it.describe)
             //设置头 图片
 
-            GlideUtils.lImg(this, it.cover, binding.imageView)
+            //判断是视频还是图片
+            if (null == it.detail_img || it.detail_img == "") {
+                GlideUtils.lImg(this, it.cover, binding.imageView)
+            } else {
+                if (Pattern.compile(".*?(gif|jpeg|png|jpg|bmp)").matcher(it.detail_img).matches()) {
+                    //图片
+                    GlideUtils.lImg(this, it.detail_img, binding.imageView)
+                } else {
+                    //视频
+                    initVideo(it.detail_img,it.cover)
+
+                }
+            }
+
+//            GlideUtils.lImg(this, it.cover, binding.imageView)
         }
 
 
@@ -133,6 +147,71 @@ class LotsDetailsActivity : MBActivity<LotsDetailsVModel, ActivityLotsDetailsBin
         binding.tvGetGift?.invalidate()
 
     }
+    var detailPlayer: StandardGSYVideoPlayer?=null
+    var orientationUtils: OrientationUtils?=null
+    var isPlay=false
+    var isPause=false
+    fun initVideo(videoUrl: String,cover:String) {
+
+        binding.imageView.visibility = View.GONE
+        binding.flVideo.visibility = View.VISIBLE
+
+        detailPlayer=binding.detailPlayer
+        //外部辅助的旋转,帮助全屏
+        orientationUtils = OrientationUtils(this, detailPlayer)
+        //初始化不打开外部的旋转
+        orientationUtils?.isEnable = false
+
+        val imageView = ImageView(this)
+        imageView.scaleType = ImageView.ScaleType.CENTER_CROP
+        GlideUtils.lImg(context(),cover,imageView)
+
+
+        val gsyVideoOption = GSYVideoOptionBuilder()
+        gsyVideoOption.setThumbImageView(imageView)
+            .setIsTouchWiget(true)
+            .setRotateViewAuto(false)
+            .setLockLand(false)
+            .setAutoFullWithSize(true)
+            .setShowFullAnimation(false)
+            .setNeedLockFull(true)
+            .setUrl(videoUrl)
+            .setCacheWithPlay(false)
+            .setVideoTitle("")
+            .setLooping(true)
+            .setVideoAllCallBack(object : GSYSampleCallBack() {
+                override fun onPrepared(url: String, vararg objects: Any) {
+                    super.onPrepared(url, *objects)
+                    //开始播放了才能旋转和全屏
+                    orientationUtils?.isEnable = true
+                    isPlay = true
+                }
+
+                override fun onQuitFullscreen(url: String, vararg objects: Any) {
+                    super.onQuitFullscreen(url, *objects)
+                    Debuger.printfError("***** onQuitFullscreen **** " + objects[0]) //title
+                    Debuger.printfError("***** onQuitFullscreen **** " + objects[1]) //当前非全屏player
+                    if (orientationUtils != null) {
+                        orientationUtils?.backToProtVideo()
+                    }
+                }
+            }).setLockClickListener { view, lock ->
+                if (orientationUtils != null) {
+                    //配合下方的onConfigurationChanged
+                    orientationUtils?.isEnable = !lock
+                }
+            }.build(detailPlayer)
+
+        detailPlayer?.fullscreenButton?.setOnClickListener(View.OnClickListener { //直接横屏
+            orientationUtils?.resolveByClick()
+
+            //第一个true是否需要隐藏actionbar,第二个true是否需要隐藏statusbar
+            detailPlayer?.startWindowFullscreen(this@LotsDetailsActivity, true, true)
+        })
+
+
+    }
+
 
 
     override fun listeners() {
@@ -379,6 +458,16 @@ class LotsDetailsActivity : MBActivity<LotsDetailsVModel, ActivityLotsDetailsBin
             if (null != disposable) {
                 disposable?.dispose()
             }
+            if(null!=detailPlayer){
+
+                if (orientationUtils != null) {
+                    orientationUtils?.backToProtVideo();
+                }
+                if (GSYVideoManager.backFromWindowFull(this)) {
+                    return false
+                }
+
+            }
             finishActivity()
             return false
         } else {
@@ -392,8 +481,41 @@ class LotsDetailsActivity : MBActivity<LotsDetailsVModel, ActivityLotsDetailsBin
         if (null != disposable) {
             disposable?.dispose()
         }
+        if(null!=detailPlayer){
+            if (isPlay) {
+                detailPlayer?.currentPlayer?.release();
+            }
+            if (orientationUtils != null)
+                orientationUtils?.releaseListener();
+        }
+
+    }
+
+    override fun onResume() {
+        super.onResume()
+        if(null!=detailPlayer){
+            detailPlayer?.currentPlayer?.onVideoResume(false);
+            isPause = false
+
+        }
     }
 
 
+    override fun onPause() {
+        super.onPause()
+        if(null!=detailPlayer){
+            detailPlayer?.currentPlayer?.onVideoPause()
+            isPause = true
+        }
+
+
+    }
+    override fun onConfigurationChanged(newConfig: Configuration) {
+        super.onConfigurationChanged(newConfig)
+        //如果旋转了就全屏
+        if (isPlay && !isPause) {
+            detailPlayer?.onConfigurationChanged(this, newConfig, orientationUtils, true, true)
+        }
+    }
 
 }

+ 135 - 2
app/src/main/java/com/hdl/xl/activity/SellDetailsActivity.kt

@@ -1,11 +1,14 @@
 package com.hdl.xl.activity
 
+import android.content.res.Configuration
 import android.graphics.Color
 import android.os.Build
 import android.os.Bundle
 import android.text.TextUtils
+import android.util.Log
 import android.view.KeyEvent
 import android.view.View
+import android.widget.ImageView
 import coil.request.Disposable
 import com.githang.statusbar.StatusBarCompat
 import com.qmuiteam.qmui.kotlin.onClick
@@ -14,7 +17,6 @@ import com.hdl.xl.R
 import com.hdl.xl.adapter.ImagesAdapter
 import com.hdl.xl.base.MBActivity
 import com.hdl.xl.config.ConfigRx
-import com.hdl.xl.databinding.ActivityCollectDetailsBinding
 import com.hdl.xl.databinding.ActivitySellDetailsBinding
 import com.hdl.xl.inte.ChoiceData
 import com.hdl.xl.utils.PopuOpenNoUtils
@@ -24,7 +26,14 @@ import com.hdl.xl.vmodel.CollectDetailsVModel
 import com.hdl.xl.vmodel.SellDetailsVModel
 import com.hwangjr.rxbus.annotation.Subscribe
 import com.hwangjr.rxbus.annotation.Tag
+import com.shuyu.gsyvideoplayer.GSYVideoManager
+import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
+import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
+import com.shuyu.gsyvideoplayer.utils.Debuger
+import com.shuyu.gsyvideoplayer.utils.OrientationUtils
+import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
 import java.text.DecimalFormat
+import java.util.regex.Pattern
 
 /**
  * 转售中的藏品详情
@@ -67,7 +76,22 @@ class SellDetailsActivity : MBActivity<SellDetailsVModel, ActivitySellDetailsBin
             adapter?.addData(list)
             //设置头 图片
 
-            GlideUtils.lImg(this, it.cover,  binding.imageView)
+            if (null == it.pro_info.detail_img || it.pro_info.detail_img == "") {
+                GlideUtils.lImg(this, it.cover, binding.imageView)
+            } else {
+                if (Pattern.compile(".*?(gif|jpeg|png|jpg|bmp)").matcher(it.pro_info.detail_img)
+                        .matches()
+                ) {
+                    //图片
+                    GlideUtils.lImg(this, it.pro_info.detail_img, binding.imageView)
+                } else {
+                    //视频
+                    initVideo(it.pro_info.detail_img,it.cover)
+
+                }
+            }
+
+//            GlideUtils.lImg(this, it.cover,  binding.imageView)
 
 
 
@@ -94,6 +118,71 @@ class SellDetailsActivity : MBActivity<SellDetailsVModel, ActivitySellDetailsBin
 
 
 
+    var detailPlayer: StandardGSYVideoPlayer?=null
+    var orientationUtils: OrientationUtils?=null
+    var isPlay=false
+    var isPause=false
+    fun initVideo(videoUrl: String,cover:String) {
+
+        binding.imageView.visibility = View.GONE
+        binding.flVideo.visibility = View.VISIBLE
+
+        detailPlayer=binding.detailPlayer
+        //外部辅助的旋转,帮助全屏
+        orientationUtils = OrientationUtils(this, detailPlayer)
+        //初始化不打开外部的旋转
+        orientationUtils?.isEnable = false
+
+        val imageView = ImageView(this)
+        imageView.scaleType = ImageView.ScaleType.CENTER_CROP
+        GlideUtils.lImg(context(),cover,imageView)
+
+
+        val gsyVideoOption = GSYVideoOptionBuilder()
+        gsyVideoOption.setThumbImageView(imageView)
+            .setIsTouchWiget(true)
+            .setRotateViewAuto(false)
+            .setLockLand(false)
+            .setAutoFullWithSize(true)
+            .setShowFullAnimation(false)
+            .setNeedLockFull(true)
+            .setUrl(videoUrl)
+            .setCacheWithPlay(false)
+            .setVideoTitle("")
+            .setLooping(true)
+            .setVideoAllCallBack(object : GSYSampleCallBack() {
+                override fun onPrepared(url: String, vararg objects: Any) {
+                    super.onPrepared(url, *objects)
+                    //开始播放了才能旋转和全屏
+                    orientationUtils?.isEnable = true
+                    isPlay = true
+                }
+
+                override fun onQuitFullscreen(url: String, vararg objects: Any) {
+                    super.onQuitFullscreen(url, *objects)
+                    Debuger.printfError("***** onQuitFullscreen **** " + objects[0]) //title
+                    Debuger.printfError("***** onQuitFullscreen **** " + objects[1]) //当前非全屏player
+                    if (orientationUtils != null) {
+                        orientationUtils?.backToProtVideo()
+                    }
+                }
+            }).setLockClickListener { view, lock ->
+                if (orientationUtils != null) {
+                    //配合下方的onConfigurationChanged
+                    orientationUtils?.isEnable = !lock
+                }
+            }.build(detailPlayer)
+
+        detailPlayer?.fullscreenButton?.setOnClickListener(View.OnClickListener { //直接横屏
+            orientationUtils?.resolveByClick()
+
+            //第一个true是否需要隐藏actionbar,第二个true是否需要隐藏statusbar
+            detailPlayer?.startWindowFullscreen(this@SellDetailsActivity, true, true)
+        })
+
+
+    }
+
 
 
     override fun listeners() {
@@ -141,6 +230,16 @@ class SellDetailsActivity : MBActivity<SellDetailsVModel, ActivitySellDetailsBin
             if (null != disposable) {
                 disposable?.dispose()
             }
+            if(null!=detailPlayer){
+
+                if (orientationUtils != null) {
+                    orientationUtils?.backToProtVideo();
+                }
+                if (GSYVideoManager.backFromWindowFull(this)) {
+                    return false
+                }
+
+            }
             finishActivity()
             return false
         } else {
@@ -153,6 +252,40 @@ class SellDetailsActivity : MBActivity<SellDetailsVModel, ActivitySellDetailsBin
         if (null != disposable) {
             disposable?.dispose()
         }
+
+        if(null!=detailPlayer){
+            if (isPlay) {
+                detailPlayer?.currentPlayer?.release();
+            }
+            if (orientationUtils != null)
+                orientationUtils?.releaseListener();
+        }
+
+    }
+
+    override fun onResume() {
+        super.onResume()
+        if(null!=detailPlayer){
+            detailPlayer?.currentPlayer?.onVideoResume(false);
+            isPause = false
+
+        }
     }
 
+
+    override fun onPause() {
+        super.onPause()
+        if(null!=detailPlayer){
+            detailPlayer?.currentPlayer?.onVideoPause()
+            isPause = true
+        }
+
+    }
+    override fun onConfigurationChanged(newConfig: Configuration) {
+        super.onConfigurationChanged(newConfig)
+        //如果旋转了就全屏
+        if (isPlay && !isPause) {
+            detailPlayer?.onConfigurationChanged(this, newConfig, orientationUtils, true, true)
+        }
+    }
 }

+ 167 - 37
app/src/main/java/com/hdl/xl/activity/TibetanDetailsActivity.kt

@@ -1,29 +1,25 @@
 package com.hdl.xl.activity
 
 import android.Manifest
-import android.content.Intent
+import android.content.res.Configuration
 import android.os.Bundle
 import android.os.Handler
 import android.os.Message
-import android.text.TextUtils
 import android.util.Log
 import android.view.KeyEvent
 import android.view.View
-import android.widget.Toast
+import android.widget.ImageView
 import androidx.lifecycle.lifecycleScope
 import coil.request.Disposable
 import com.eazypermissions.common.model.PermissionResult
 import com.eazypermissions.coroutinespermission.PermissionManager
-import com.hdl.xl.BuildConfig
 import com.hdl.xl.R
 import com.hdl.xl.adapter.ImagesAdapter
 import com.hdl.xl.base.MBActivity
 import com.hdl.xl.config.ConfigRx
 import com.hdl.xl.databinding.ActivityTibetanDetailsBinding
-import com.hdl.xl.model.PayOrder
 import com.hdl.xl.model.User
 import com.hdl.xl.model.bean.PayTypeBen
-import com.hdl.xl.utils.MD5Utils
 import com.hdl.xl.utils.PopuPaySuesstils
 import com.hdl.xl.utils.glide.GlideUtils
 import com.hdl.xl.utils.net.NetEngine
@@ -31,13 +27,19 @@ import com.hdl.xl.vmodel.TibetanDetailsVModel
 import com.hwangjr.rxbus.annotation.Subscribe
 import com.hwangjr.rxbus.annotation.Tag
 import com.qmuiteam.qmui.kotlin.onClick
+import com.shuyu.gsyvideoplayer.GSYVideoManager
+import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
+import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
+import com.shuyu.gsyvideoplayer.utils.Debuger
+import com.shuyu.gsyvideoplayer.utils.OrientationUtils
+import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
 import com.ysnows.base.utils.B
 import com.ysnows.base.utils.UiSwitch
 import com.ysnows.base.utils.UiUtils
 import kotlinx.coroutines.launch
-import org.json.JSONObject
 import java.text.DecimalFormat
 import java.util.*
+import java.util.regex.Pattern
 
 
 /**
@@ -53,6 +55,7 @@ class TibetanDetailsActivity : MBActivity<TibetanDetailsVModel, ActivityTibetanD
 
     var adapter: ImagesAdapter? = null
 
+
     override fun init(savedInstanceState: Bundle?) {
         super.init(savedInstanceState)
 
@@ -91,17 +94,35 @@ class TibetanDetailsActivity : MBActivity<TibetanDetailsVModel, ActivityTibetanD
             //设置详情图片
             adapter?.clearList()
             adapter?.addData(it.describe)
-            //设置头 图片
-            GlideUtils.lImg(this, it.cover, binding.imageView)
+
+            //判断是视频还是图片
+
+            if (null == it.detail_img || it.detail_img == "") {
+                GlideUtils.lImg(this, it.cover, binding.imageView)
+            } else {
+                if (Pattern.compile(".*?(gif|jpeg|png|jpg|bmp)").matcher(it.detail_img).matches()) {
+                    //图片
+                    GlideUtils.lImg(this, it.detail_img, binding.imageView)
+                } else {
+
+                    //视频
+                    initVideo(it.detail_img,it.cover)
+
+
+                }
+            }
+
 
         }
 
         vm.bean.observe(this) {
 
-            UiSwitch.bundle(context(), WebViewActivity::class.java,
-                    B().putString("url", it.pay_url)
-                            .putString("type", "1")
-                            .ok())
+            UiSwitch.bundle(
+                context(), WebViewActivity::class.java,
+                B().putString("url", it.pay_url)
+                    .putString("type", "1")
+                    .ok()
+            )
 
 
         }
@@ -126,6 +147,76 @@ class TibetanDetailsActivity : MBActivity<TibetanDetailsVModel, ActivityTibetanD
     }
 
 
+
+    var detailPlayer: StandardGSYVideoPlayer?=null
+    var orientationUtils:OrientationUtils?=null
+    var isPlay=false
+    var isPause=false
+    fun initVideo(videoUrl: String,cover:String) {
+
+        binding.imageView.visibility = View.GONE
+        binding.flVideo.visibility = View.VISIBLE
+
+         detailPlayer=binding.detailPlayer
+        //外部辅助的旋转,帮助全屏
+         orientationUtils = OrientationUtils(this, detailPlayer)
+        //初始化不打开外部的旋转
+        orientationUtils?.isEnable = false
+
+        val imageView = ImageView(this)
+        imageView.scaleType = ImageView.ScaleType.CENTER_CROP
+        GlideUtils.lImg(context(),cover,imageView)
+
+
+        val gsyVideoOption = GSYVideoOptionBuilder()
+        gsyVideoOption.setThumbImageView(imageView)
+            .setIsTouchWiget(true)
+            .setRotateViewAuto(false)
+            .setLockLand(false)
+            .setAutoFullWithSize(true)
+            .setShowFullAnimation(false)
+            .setNeedLockFull(true)
+            .setUrl(videoUrl)
+            .setCacheWithPlay(false)
+            .setVideoTitle("")
+            .setLooping(true)
+            .setVideoAllCallBack(object : GSYSampleCallBack() {
+                override fun onPrepared(url: String, vararg objects: Any) {
+                    super.onPrepared(url, *objects)
+                    //开始播放了才能旋转和全屏
+                    orientationUtils?.isEnable = true
+                    isPlay = true
+                }
+
+                override fun onQuitFullscreen(url: String, vararg objects: Any) {
+                    super.onQuitFullscreen(url, *objects)
+                    Debuger.printfError("***** onQuitFullscreen **** " + objects[0]) //title
+                    Debuger.printfError("***** onQuitFullscreen **** " + objects[1]) //当前非全屏player
+                    if (orientationUtils != null) {
+                        orientationUtils?.backToProtVideo()
+                    }
+                }
+            }).setLockClickListener { view, lock ->
+                if (orientationUtils != null) {
+                    //配合下方的onConfigurationChanged
+                    orientationUtils?.isEnable = !lock
+                }
+            }.build(detailPlayer)
+
+        detailPlayer?.fullscreenButton?.setOnClickListener(View.OnClickListener { //直接横屏
+            orientationUtils?.resolveByClick()
+
+            //第一个true是否需要隐藏actionbar,第二个true是否需要隐藏statusbar
+            detailPlayer?.startWindowFullscreen(this@TibetanDetailsActivity, true, true)
+        })
+
+
+    }
+
+
+
+
+
     override fun listeners() {
         super.listeners()
 
@@ -151,10 +242,10 @@ class TibetanDetailsActivity : MBActivity<TibetanDetailsVModel, ActivityTibetanD
 
             lifecycleScope.launch {
                 if (PermissionManager.requestPermissions(
-                                this@TibetanDetailsActivity, 1000,
-                                Manifest.permission.WRITE_EXTERNAL_STORAGE,
-                                Manifest.permission.READ_EXTERNAL_STORAGE
-                        ) is PermissionResult.PermissionGranted
+                        this@TibetanDetailsActivity, 1000,
+                        Manifest.permission.WRITE_EXTERNAL_STORAGE,
+                        Manifest.permission.READ_EXTERNAL_STORAGE
+                    ) is PermissionResult.PermissionGranted
                 ) {
                     vm.getUrl()
                 }
@@ -162,20 +253,18 @@ class TibetanDetailsActivity : MBActivity<TibetanDetailsVModel, ActivityTibetanD
             }
 
 
-
-
         }
 
         binding.llSetTime.onClick {
 
             lifecycleScope.launch {
                 if (PermissionManager.requestPermissions(
-                                this@TibetanDetailsActivity, 1000,
-                                Manifest.permission.WRITE_CALENDAR,
-                                Manifest.permission.READ_CALENDAR
-                        ) is PermissionResult.PermissionGranted
+                        this@TibetanDetailsActivity, 1000,
+                        Manifest.permission.WRITE_CALENDAR,
+                        Manifest.permission.READ_CALENDAR
+                    ) is PermissionResult.PermissionGranted
                 ) {
-                   vm.toBuyTime()
+                    vm.toBuyTime()
                 }
 
             }
@@ -286,12 +375,12 @@ class TibetanDetailsActivity : MBActivity<TibetanDetailsVModel, ActivityTibetanD
 
                 val it = vm.repository().lreq {
                     NetEngine.service.setCreateOrder(
-                            "app", vm.data.value?.id, bean.num,
-                            "sd_rapid"
+                        "app", vm.data.value?.id, bean.num,
+                        "sd_rapid"
                     )
                 }
 
-                if(it.code==0){
+                if (it.code == 0) {
                     toast(it.msg)
                 }
 
@@ -313,12 +402,12 @@ class TibetanDetailsActivity : MBActivity<TibetanDetailsVModel, ActivityTibetanD
 
                 val it = vm.repository().lreq {
                     NetEngine.service.setCreateOrder(
-                            "app", vm.data.value?.id, bean.num,
-                            "wallet",
+                        "app", vm.data.value?.id, bean.num,
+                        "wallet",
                     )
                 }
 
-                if(it.code==0){
+                if (it.code == 0) {
                     toast(it.msg)
                 }
                 if (it.ok()) {
@@ -350,7 +439,7 @@ class TibetanDetailsActivity : MBActivity<TibetanDetailsVModel, ActivityTibetanD
 
     @Subscribe(tags = [Tag(ConfigRx.PAY_SD_SUESS)])
     fun setPaySdSuess(orderNo: String) {//杉德支付成功
-       //todo:
+        //todo:
         // vm.getMyOrder(orderNo)
 
         UiSwitch.single(context(), MyOrderActivity::class.java)
@@ -363,6 +452,16 @@ class TibetanDetailsActivity : MBActivity<TibetanDetailsVModel, ActivityTibetanD
             if (null != disposable) {
                 disposable?.dispose()
             }
+            if(null!=detailPlayer){
+
+                if (orientationUtils != null) {
+                    orientationUtils?.backToProtVideo();
+                }
+                if (GSYVideoManager.backFromWindowFull(this)) {
+                    return false
+                }
+
+            }
             finishActivity()
             return false
         } else {
@@ -371,21 +470,52 @@ class TibetanDetailsActivity : MBActivity<TibetanDetailsVModel, ActivityTibetanD
     }
 
 
+    override fun onResume() {
+        super.onResume()
+
+        if(null!=detailPlayer){
+            detailPlayer?.currentPlayer?.onVideoResume(false);
+            isPause = false
+
+        }
+    }
+
+
+    override fun onPause() {
+        super.onPause()
+
+        if(null!=detailPlayer){
+            detailPlayer?.currentPlayer?.onVideoPause()
+            isPause = true
+        }
+
+
+    }
+
+
     override fun onDestroy() {
         super.onDestroy()
         if (null != disposable) {
             disposable?.dispose()
         }
-    }
-
-
 
+        if(null!=detailPlayer){
+            if (isPlay) {
+                detailPlayer?.currentPlayer?.release();
+            }
+            if (orientationUtils != null)
+                orientationUtils?.releaseListener();
+        }
 
-    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
-        super.onActivityResult(requestCode, resultCode, data)
 
-        Log.i("-log-", "requestCode:$requestCode")
+    }
 
+    override fun onConfigurationChanged(newConfig: Configuration) {
+        super.onConfigurationChanged(newConfig)
+        //如果旋转了就全屏
+        if (isPlay && !isPause) {
+            detailPlayer?.onConfigurationChanged(this, newConfig, orientationUtils, true, true)
+        }
     }
 
 

+ 15 - 0
app/src/main/java/com/hdl/xl/adapter/CalenTimeAdapter.kt

@@ -15,6 +15,8 @@ import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
 import com.google.gson.Gson
 import com.hdl.xl.R
 import com.hdl.xl.activity.ArticleDetailActivity
+import com.hdl.xl.activity.LotsDetailsActivity
+import com.hdl.xl.activity.TibetanDetailsActivity
 import com.hdl.xl.databinding.ItemCalendBinding
 import com.hdl.xl.databinding.ItemMsgBinding
 import com.hdl.xl.databinding.ItemMyCalendBinding
@@ -27,6 +29,7 @@ import com.hdl.xl.vmodel.MyCalendarVModel
 import com.hdl.xl.vmodel.SellOrderVModel
 import com.qmuiteam.qmui.kotlin.onClick
 import com.ysnows.base.base.BAdapter
+import com.ysnows.base.utils.B
 import com.ysnows.base.utils.UiSwitch
 
 class CalenTimeAdapter(val vm: MyCalendarVModel,val index:Int) : BAdapter<CalendarBean.ListBean, BaseDataBindingHolder<ItemCalendBinding>>(R.layout.item_calend) {
@@ -54,6 +57,18 @@ class CalenTimeAdapter(val vm: MyCalendarVModel,val index:Int) : BAdapter<Calend
             }
 
         }
+        holder.dataBinding?.ll?.onClick {
+
+            if (item.issue_mode == 1) {
+                UiSwitch.bundle(context, TibetanDetailsActivity::class.java,
+                    B().putString("id", item.id)
+                        .ok())
+            } else {
+                UiSwitch.bundle(context, LotsDetailsActivity::class.java,
+                    B().putString("id", item.id)
+                        .ok())
+            }
+        }
 
     }
 }

+ 1 - 0
app/src/main/java/com/hdl/xl/adapter/MsgAdapter.kt

@@ -35,6 +35,7 @@ class MsgAdapter(var vm: MsgVModel) : BAdapter<MsgList, BaseDataBindingHolder<It
 
         if (item.is_read) {//已读
             holder.dataBinding?.tvTitle?.text = item.title
+            holder.dataBinding?.tvTitle?.setTextColor(Color.parseColor("#ffffff"))
         } else {
 
             var title = item.title + "·"

+ 1 - 0
app/src/main/java/com/hdl/xl/base/MBActivity.kt

@@ -91,4 +91,5 @@ abstract class MBActivity<VM : BViewModel<*>, B : ViewDataBinding> : BActivity<V
             im.hideSoftInputFromWindow(token, InputMethodManager.HIDE_NOT_ALWAYS)
         }
     }
+
 }

+ 3 - 3
app/src/main/java/com/hdl/xl/config/Config.kt

@@ -7,13 +7,13 @@ object  Config : IConfig {
     override fun baseUrl(): String {
 
        return "https://xlapi.xiangliannft.com/api/" //正式地址
-     //  return "https://xianglian-api.hdlkeji.com/api/"//测试地址
+      // return "https://xianglian-api.hdlkeji.com/api/"//测试地址
 
     }
 
     override fun searchUrl(): String? {//分享+支付回调的
-       //  return "https://xianglian-api.hdlkeji.com/"//测试地址
-       return "https://xlapi.xiangliannft.com/" //正式地址
+   //      return "https://xianglian-api.hdlkeji.com/"//测试地址
+      return "https://xlapi.xiangliannft.com/" //正式地址
     }
 
 

+ 2 - 2
app/src/main/java/com/hdl/xl/model/CalendarBean.kt

@@ -8,10 +8,10 @@ import com.ysnows.base.inter.IModel
 data  class CalendarBean(var date:String,var list:List<ListBean>):IModel {
 
     data class ListBean(var apply_st:String,var cover:String,var date:String,
-                        var id:String,var inventory:String,var is_remind:Boolean,var issue_mode:String,
+                        var id:String,var inventory:String,var is_remind:Boolean,var issue_mode:Int,
                         var label:String,var name:String,var now_inventory:String,
                         var price:String,var sell_time:String,var state:Int,
-                        var time:String
+                        var time:String,
 
                         ):IModel{
 

BIN
app/src/main/res/drawable-xxhdpi/ic_palyiv.webp


BIN
app/src/main/res/drawable-xxhdpi/tran_img.png


+ 5 - 0
app/src/main/res/drawable/fullscreento.xml

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

+ 19 - 0
app/src/main/res/layout/activity_all_collect_details.xml

@@ -67,6 +67,25 @@
                                 android:src="@drawable/bg_need_error"
                                 android:scaleType="centerCrop" />
 
+                            <!--视频-->
+                            <FrameLayout
+                                android:id="@+id/fl_video"
+                                android:layout_width="match_parent"
+                                android:layout_height="305dp"
+                                android:visibility="gone"
+                                android:layout_gravity="center"
+                                tools:visibility="visible">
+
+                                <com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
+                                    android:id="@+id/detail_player"
+                                    android:layout_width="match_parent"
+                                    android:layout_height="match_parent" />
+
+
+
+
+                            </FrameLayout>
+
 
                         </FrameLayout>
 

+ 45 - 39
app/src/main/res/layout/activity_article_detail.xml

@@ -16,52 +16,58 @@
         android:background="@color/c_bg"
         android:orientation="vertical">
 
-        <LinearLayout
+        <androidx.core.widget.NestedScrollView
+
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginTop="28dp"
-            android:layout_marginBottom="14dp"
-            android:orientation="vertical"
-            android:visibility="@{vm.isShow?View.VISIBLE:View.GONE}">
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginStart="27dp"
-                android:text="@{vm.msgGetInfo.title}"
-                android:textColor="@color/white"
-                android:textSize="16sp"
-                tools:text="功能上新:新增用户评价功能" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginStart="27dp"
-                android:layout_marginTop="9dp"
-                android:text="@{vm.msgGetInfo.create_at}"
-                android:textColor="@color/white"
-                android:textSize="11sp"
-                tools:text="2020-02-11 10:12:11" />
-
+            android:scrollbars="none">
 
-            <TextView
-                android:id="@+id/tv_content"
+            <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginStart="27dp"
-                android:layout_marginTop="26dp"
-                android:layout_marginEnd="45dp"
-                android:textColor="@color/white"
-                android:textSize="14sp"
-                tools:text="2020-02-11 10:12:11" />
-
-
-        </LinearLayout>
-
+                android:layout_marginTop="28dp"
+                android:layout_marginBottom="14dp"
+                android:orientation="vertical"
+                android:visibility="@{vm.isShow?View.VISIBLE:View.GONE}">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="27dp"
+                    android:text="@{vm.msgGetInfo.title}"
+                    android:textColor="@color/white"
+                    android:textSize="16sp"
+                    tools:text="功能上新:新增用户评价功能" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="27dp"
+                    android:layout_marginTop="9dp"
+                    android:text="@{vm.msgGetInfo.create_at}"
+                    android:textColor="@color/white"
+                    android:textSize="11sp"
+                    tools:text="2020-02-11 10:12:11" />
+
+
+                <TextView
+                    android:id="@+id/tv_content"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="27dp"
+                    android:layout_marginTop="26dp"
+                    android:layout_marginEnd="45dp"
+                    android:textColor="@color/white"
+                    android:textSize="14sp"
+                    tools:text="2020-02-11 10:12:11" />
+
+
+            </LinearLayout>
+        </androidx.core.widget.NestedScrollView>
 
         <androidx.core.widget.NestedScrollView
-            android:layout_width="match_parent"
             android:id="@+id/scroll"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:scrollbars="none">
 
@@ -75,8 +81,8 @@
                 android:textColor="@color/white"
                 android:textSize="14sp"
                 tools:text="2020-02-11 10:12:11" />
-        </androidx.core.widget.NestedScrollView>
 
+        </androidx.core.widget.NestedScrollView>
 
         <WebView
             android:id="@+id/web_content"

+ 19 - 0
app/src/main/res/layout/activity_collect_details.xml

@@ -68,6 +68,25 @@
                                 app:qmui_border_color="@color/translucent"
                                 app:qmui_corner_radius="20dp" />
 
+                            <!--视频-->
+                            <FrameLayout
+                                android:id="@+id/fl_video"
+                                android:layout_width="match_parent"
+                                android:layout_height="305dp"
+                                android:visibility="gone"
+                                android:layout_gravity="center"
+                                tools:visibility="visible">
+
+                                <com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
+                                    android:id="@+id/detail_player"
+                                    android:layout_width="match_parent"
+                                    android:layout_height="match_parent" />
+
+
+
+
+                            </FrameLayout>
+
 
                         </FrameLayout>
 

+ 18 - 0
app/src/main/res/layout/activity_lots_details.xml

@@ -71,6 +71,24 @@
                                 app:qmui_corner_radius="20dp"
                                 android:src="@drawable/bg_need_error" />
 
+                            <!--视频-->
+                            <FrameLayout
+                                android:id="@+id/fl_video"
+                                android:layout_width="match_parent"
+                                android:layout_height="305dp"
+                                android:visibility="gone"
+                                android:layout_gravity="center"
+                                tools:visibility="visible">
+
+                                <com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
+                                    android:id="@+id/detail_player"
+                                    android:layout_width="match_parent"
+                                    android:layout_height="match_parent" />
+
+
+                            </FrameLayout>
+
+
 
                             <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
                                 android:layout_width="100dp"

+ 18 - 0
app/src/main/res/layout/activity_sell_details.xml

@@ -68,6 +68,24 @@
                                 app:qmui_border_color="@color/translucent"
                                 app:qmui_corner_radius="20dp" />
 
+                            <!--视频-->
+                            <FrameLayout
+                                android:id="@+id/fl_video"
+                                android:layout_width="match_parent"
+                                android:layout_height="305dp"
+                                android:visibility="gone"
+                                android:layout_gravity="center"
+                                tools:visibility="visible">
+
+                                <com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
+                                    android:id="@+id/detail_player"
+                                    android:layout_width="match_parent"
+                                    android:layout_height="match_parent" />
+
+
+
+                            </FrameLayout>
+
 
                         </FrameLayout>
 

+ 110 - 94
app/src/main/res/layout/activity_tibetan_details.xml

@@ -57,15 +57,32 @@
                         android:layout_height="wrap_content">
 
 
-
                         <com.qmuiteam.qmui.widget.QMUIRadiusImageView
                             android:id="@+id/image_view"
                             android:layout_width="match_parent"
                             android:layout_height="305dp"
-                            app:qmui_border_color="@color/translucent"
-                            app:qmui_corner_radius="20dp"
+                            android:scaleType="centerCrop"
                             android:src="@drawable/bg_need_error"
-                            android:scaleType="centerCrop" />
+                            app:qmui_border_color="@color/translucent"
+                            app:qmui_corner_radius="20dp" />
+
+                        <!--视频-->
+                        <FrameLayout
+                            android:id="@+id/fl_video"
+                            android:layout_width="match_parent"
+                            android:layout_height="305dp"
+                            android:visibility="gone"
+                            android:layout_gravity="center"
+                            tools:visibility="visible">
+
+                            <com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
+                                android:id="@+id/detail_player"
+                                android:layout_width="match_parent"
+                                android:layout_height="match_parent" />
+
+
+
+                        </FrameLayout>
 
 
                     </FrameLayout>
@@ -105,9 +122,9 @@
                             android:layout_height="wrap_content"
                             android:layout_marginEnd="12dp"
                             android:background="@drawable/bg_kuang_blue"
+                            android:gravity="center"
                             android:hint="100份"
                             android:paddingStart="2dp"
-                            android:gravity="center"
                             android:paddingTop="2dp"
                             android:paddingEnd="2dp"
                             android:paddingBottom="2dp"
@@ -133,8 +150,8 @@
                             android:layout_height="wrap_content"
                             android:layout_marginEnd="12dp"
                             android:background="@drawable/bg_kuang_blue"
-                            android:hint="100份"
                             android:gravity="center"
+                            android:hint="100份"
                             android:paddingStart="2dp"
                             android:paddingTop="2dp"
                             android:paddingEnd="2dp"
@@ -160,11 +177,11 @@
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:background="@drawable/bg_kuang_blue"
+                            android:gravity="center"
                             android:hint="100份"
                             android:paddingStart="2dp"
                             android:paddingTop="2dp"
                             android:paddingEnd="2dp"
-                            android:gravity="center"
                             android:paddingBottom="2dp"
                             android:text="@{vm.data.buy_count+`份`}"
                             android:textColor="#54D7E9"
@@ -250,8 +267,7 @@
                         android:layout_height="wrap_content"
                         android:layout_marginTop="14dp"
                         android:gravity="center_vertical"
-                        android:orientation="horizontal"
-                       >
+                        android:orientation="horizontal">
 
                         <TextView
                             android:layout_width="wrap_content"
@@ -266,9 +282,9 @@
                             android:layout_marginStart="12dp"
                             android:layout_marginEnd="6dp"
                             android:layout_weight="1"
-                            android:singleLine="true"
                             android:ellipsize="end"
                             android:gravity="right"
+                            android:singleLine="true"
                             android:text="@{vm.link}"
                             android:textColor="@color/white"
                             android:textSize="13sp" />
@@ -330,9 +346,9 @@
 
                     <LinearLayout
                         android:layout_width="match_parent"
-                        android:orientation="vertical"
+                        android:layout_height="wrap_content"
                         android:layout_marginTop="14dp"
-                        android:layout_height="wrap_content">
+                        android:orientation="vertical">
 
 
                         <androidx.recyclerview.widget.RecyclerView
@@ -614,7 +630,7 @@
 
                 <View
                     android:layout_width="match_parent"
-                    android:layout_height="30dp"/>
+                    android:layout_height="30dp" />
 
             </LinearLayout>
 
@@ -633,9 +649,9 @@
             <TextView
                 android:layout_width="0dp"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="14dp"
-
                 android:layout_marginStart="16dp"
+
+                android:layout_marginTop="14dp"
                 android:layout_weight="1"
                 android:text="@{`¥`+vm.data.price}"
                 android:textColor="@color/white"
@@ -669,8 +685,8 @@
             <TextView
                 android:layout_width="0dp"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="14dp"
                 android:layout_marginStart="16dp"
+                android:layout_marginTop="14dp"
                 android:layout_weight="1"
                 android:text="@{`¥`+vm.data.price}"
                 android:textColor="@color/white"
@@ -695,107 +711,107 @@
 
         <LinearLayout
             android:layout_width="match_parent"
+            android:layout_height="wrap_content"
             android:orientation="vertical"
-            android:visibility="@{vm.data.state==2?View.VISIBLE:View.GONE}"
-            android:layout_height="wrap_content">
+            android:visibility="@{vm.data.state==2?View.VISIBLE:View.GONE}">
 
 
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="91dp"
-            android:layout_marginBottom="10dp"
-            android:visibility="@{vm.is_remind?View.GONE:View.VISIBLE}"
-
-            android:orientation="horizontal"
-            tools:visibility="visible">
-
-            <TextView
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="14dp"
-
-                android:layout_marginStart="16dp"
-                android:layout_weight="1"
-                android:text="@{`¥`+vm.data.price}"
-                android:textColor="@color/white"
-                android:textSize="30sp" />
-
             <LinearLayout
-                android:id="@+id/ll_set_time"
-                android:layout_width="180dp"
-                android:layout_height="40dp"
-                android:layout_marginTop="8dp"
-                android:layout_marginEnd="25dp"
-                android:background="@drawable/bg_logo_but"
-                android:gravity="center"
-                android:orientation="vertical">
+                android:layout_width="match_parent"
+                android:layout_height="91dp"
+                android:layout_marginBottom="10dp"
+                android:orientation="horizontal"
 
-                <TextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="设置购买提醒"
-                    android:textColor="#000000"
-                    android:textSize="16sp" />
+                android:visibility="@{vm.is_remind?View.GONE:View.VISIBLE}"
+                tools:visibility="visible">
 
                 <TextView
-                    android:layout_width="wrap_content"
+                    android:layout_width="0dp"
                     android:layout_height="wrap_content"
-                    android:text="@{vm.data.sell_time}"
-                    android:textColor="#000000"
-                    android:textSize="12sp" />
+                    android:layout_marginStart="16dp"
+
+                    android:layout_marginTop="14dp"
+                    android:layout_weight="1"
+                    android:text="@{`¥`+vm.data.price}"
+                    android:textColor="@color/white"
+                    android:textSize="30sp" />
+
+                <LinearLayout
+                    android:id="@+id/ll_set_time"
+                    android:layout_width="180dp"
+                    android:layout_height="40dp"
+                    android:layout_marginTop="8dp"
+                    android:layout_marginEnd="25dp"
+                    android:background="@drawable/bg_logo_but"
+                    android:gravity="center"
+                    android:orientation="vertical">
 
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="设置购买提醒"
+                        android:textColor="#000000"
+                        android:textSize="16sp" />
 
-            </LinearLayout>
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="@{vm.data.sell_time}"
+                        android:textColor="#000000"
+                        android:textSize="12sp" />
 
 
-        </LinearLayout>
+                </LinearLayout>
 
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="91dp"
-            android:layout_marginBottom="10dp"
-            android:orientation="horizontal"
-            android:visibility="@{vm.is_remind?View.VISIBLE:View.GONE}"
-            >
-            <TextView
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="14dp"
-                android:layout_marginStart="16dp"
-                android:layout_weight="1"
-                android:text="@{`¥`+vm.data.price}"
-                android:textColor="@color/white"
-                android:textSize="30sp" />
+
+            </LinearLayout>
 
             <LinearLayout
-                android:layout_width="180dp"
-                android:layout_height="40dp"
-                android:layout_marginTop="8dp"
-                android:layout_marginEnd="25dp"
-                android:onClick="@{v->vm.toBuyTime()}"
-                android:background="@drawable/bg_logo_but_on"
-                android:gravity="center"
-                android:orientation="vertical">
+                android:layout_width="match_parent"
+                android:layout_height="91dp"
+                android:layout_marginBottom="10dp"
+                android:orientation="horizontal"
+                android:visibility="@{vm.is_remind?View.VISIBLE:View.GONE}">
 
                 <TextView
-                    android:layout_width="wrap_content"
+                    android:layout_width="0dp"
                     android:layout_height="wrap_content"
-                    android:text="设置购买提醒"
-                    android:textColor="#DFDFDF"
-                    android:textSize="16sp" />
+                    android:layout_marginStart="16dp"
+                    android:layout_marginTop="14dp"
+                    android:layout_weight="1"
+                    android:text="@{`¥`+vm.data.price}"
+                    android:textColor="@color/white"
+                    android:textSize="30sp" />
+
+                <LinearLayout
+                    android:layout_width="180dp"
+                    android:layout_height="40dp"
+                    android:layout_marginTop="8dp"
+                    android:layout_marginEnd="25dp"
+                    android:background="@drawable/bg_logo_but_on"
+                    android:gravity="center"
+                    android:onClick="@{v->vm.toBuyTime()}"
+                    android:orientation="vertical">
 
-                <TextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="@{vm.data.sell_time}"
-                    android:textColor="#DFDFDF"
-                    android:textSize="12sp" />
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="设置购买提醒"
+                        android:textColor="#DFDFDF"
+                        android:textSize="16sp" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="@{vm.data.sell_time}"
+                        android:textColor="#DFDFDF"
+                        android:textSize="12sp" />
 
 
-            </LinearLayout>
+                </LinearLayout>
 
 
-        </LinearLayout>
+            </LinearLayout>
 
         </LinearLayout>
 

+ 1 - 0
app/src/main/res/layout/item_calend.xml

@@ -26,6 +26,7 @@
     </data>
 
     <LinearLayout
+        android:id="@+id/ll"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:orientation="vertical">

+ 2 - 0
app/src/main/res/values/strings.xml

@@ -1,5 +1,7 @@
 <resources >
     <string name="app_name" >象链</string >
+    <string name="app_name_to" >象链</string >
+
     <string name="abc_action_bar_home_description" >Navigate home</string >
     <string name="abc_action_bar_home_description_format" >%1$s, %2$s</string >
     <string name="abc_action_bar_home_subtitle_description_format" >%1$s, %2$s, %3$s</string >

+ 7 - 5
app/xiaomi/release/output-metadata.json

@@ -1,5 +1,5 @@
 {
-  "version": 2,
+  "version": 3,
   "artifactType": {
     "type": "APK",
     "kind": "Directory"
@@ -10,9 +10,11 @@
     {
       "type": "SINGLE",
       "filters": [],
-      "versionCode": 5,
-      "versionName": "1.0.4",
-      "outputFile": "xiaomi_1.0.4.apk"
+      "attributes": [],
+      "versionCode": 6,
+      "versionName": "1.0.5",
+      "outputFile": "xiaomi_1.0.5.apk"
     }
-  ]
+  ],
+  "elementType": "File"
 }

+ 0 - 5
base/src/main/java/com/ysnows/base/base/BActivity.kt

@@ -71,11 +71,6 @@ abstract class BActivity<VM : BViewModel<*>, B : ViewDataBinding> : RxAppCompatA
         } catch (e: Exception) {
         }
 
-//        if (intent.flags and Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT != 0) {
-//            finish()
-//            return
-//        }
-//        requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
 
 
         binding = binding()

+ 6 - 6
build.gradle

@@ -10,12 +10,12 @@ buildscript {
     ext.coroutines = '1.3.4'
 
     ext.application_id = "com.hdl.xl"
-    ext.application_version_code = 5
-    ext.application_version_name = "1.0.4"
+    ext.application_version_code = 6
+    ext.application_version_name = "1.0.5"
     ext.support_version = "29.0.2"
     ext.min_sdk_version = 23
-    ext.target_sdk_version = 30
-    ext.compile_sdk_version = 30
+    ext.target_sdk_version = 31
+    ext.compile_sdk_version = 31
 
     repositories {
         google()
@@ -28,7 +28,7 @@ buildscript {
     }
 
     dependencies {
-         classpath 'com.android.tools.build:gradle:4.2.1'
+        classpath 'com.android.tools.build:gradle:7.1.3'
         classpath 'com.billy.android:cc-register:1.1.2'
 
         // NOTE: Do not place your application dependencies here; they belong
@@ -45,7 +45,7 @@ allprojects {
         jcenter()
         mavenCentral() // add repository
         maven { url "https://jitpack.io" }
-
+        maven { url 'https://maven.google.com' }
 
     }
 }

+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip

+ 3 - 2
settings.gradle

@@ -2,8 +2,9 @@
 //include ':umeng'
 include ':update'
 //include ':gaode'
-include ':lookimg'
-include ':alipay'
+//include ':lookimg'
+//include ':alipay'
+
 
 include ':app',':base'