Browse Source

摄像头详情

zhanghongrui 1 week ago
parent
commit
5c68737cad
32 changed files with 565 additions and 279 deletions
  1. 1 0
      OneBottomNavigationBar/build.gradle
  2. 147 169
      OneBottomNavigationBar/src/main/java/cn/onestravel/one/navigation/androidx/OneBottomNavigationBarX.kt
  3. 1 1
      app/build.gradle
  4. 20 0
      app/debug/output-metadata.json
  5. BIN
      app/debug/taishiganzhi_debug_v1.0.0_20250714.apk
  6. BIN
      app/debug/taishiganzhi_debug_v1.0.0_20250714.zip
  7. 20 0
      app/release/output-metadata.json
  8. BIN
      app/release/taishiganzhi_release_v1.0.0_20250714.apk
  9. BIN
      app/release/taishiganzhi_release_v1.0.0_20250714.zip
  10. 8 5
      app/src/main/AndroidManifest.xml
  11. 22 0
      app/src/main/assets/supermap.crt
  12. 84 14
      app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/ExoPlayerActivity.java
  13. 8 4
      app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/GuidePageActivity.java
  14. 13 7
      app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/MonitoringCenterActivity.java
  15. 9 25
      app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/CameraAdapter.java
  16. 10 4
      app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/MyAdapter.java
  17. 34 3
      app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/AllCameraBean.java
  18. 13 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/ExoPlayerBean.java
  19. 15 15
      app/src/main/java/com/sjkj/appthreefloor_tsgz/fragment/MainFragment.java
  20. 21 3
      app/src/main/java/com/sjkj/appthreefloor_tsgz/login/ConfigActivity.java
  21. 2 3
      app/src/main/java/com/sjkj/appthreefloor_tsgz/login/LoginActivity.java
  22. 50 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/net/GetPlayerUrlRequest.java
  23. 6 0
      app/src/main/java/com/sjkj/appthreefloor_tsgz/net/RetrofitService.java
  24. BIN
      app/src/main/res/drawable-xxhdpi/icon_back2.png
  25. 4 2
      app/src/main/res/layout/activity_camera_list.xml
  26. 19 6
      app/src/main/res/layout/activity_config.xml
  27. 10 0
      app/src/main/res/layout/activity_guidepage.xml
  28. 13 6
      app/src/main/res/layout/item_camera_list_layout.xml
  29. 31 2
      app/src/main/res/layout/player_activity.xml
  30. 2 4
      app/src/main/res/menu/navigation_menu.xml
  31. 0 1
      app/src/main/res/values/styles.xml
  32. 2 5
      base-lib/src/main/java/com/sjkj/base_lib/utils/AppTools.java

+ 1 - 0
OneBottomNavigationBar/build.gradle

@@ -20,6 +20,7 @@ android {
     }
     lintOptions {
         abortOnError false
+        checkReleaseBuilds false
     }
 
 }

+ 147 - 169
OneBottomNavigationBar/src/main/java/cn/onestravel/one/navigation/androidx/OneBottomNavigationBarX.kt

@@ -151,19 +151,11 @@ class OneBottomNavigationBar : View {
         init(context, attrs, 0)
     }
 
-    constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
-        context,
-        attrs,
-        defStyleAttr
-    ) {
+    constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
         init(context, attrs, defStyleAttr)
     }
 
 
-    public fun getList(): MutableList<Item> {
-        return itemList;
-    }
-
     /**
      * 设置选中的监听事件
      *
@@ -229,19 +221,11 @@ class OneBottomNavigationBar : View {
      * 绑定 ViewPager 使用,ViewPager 使用的 Fragment 数量需要与 Tab 数量一致,否则会出现 Fragment 显示与 tab 选中状态不对应的情况
      * @param viewPager
      */
-    fun attachViewPager(
-        fragmentManager: FragmentManager,
-        viewPager: ViewPager,
-        fragments: List<Fragment>
-    ) {
+    fun attachViewPager(fragmentManager: FragmentManager, viewPager: ViewPager, fragments: List<Fragment>) {
         this.mViewPager = viewPager
         if (this.mViewPager != null) {
             mViewPager?.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
-                override fun onPageScrolled(
-                    position: Int,
-                    positionOffset: Float,
-                    positionOffsetPixels: Int
-                ) {
+                override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
                 }
 
                 override fun onPageSelected(position: Int) {
@@ -458,7 +442,7 @@ class OneBottomNavigationBar : View {
                     params.topMargin = 0 - floatingUp
                 }
                 is RelativeLayout.LayoutParams -> {
-                    params.topMargin = 0 - floatingUp * 2
+                    params.topMargin = 0 - floatingUp
                 }
                 is FrameLayout.LayoutParams -> {
                     params.topMargin = 0 - floatingUp
@@ -482,41 +466,20 @@ class OneBottomNavigationBar : View {
     private fun init(context: Context, attrs: AttributeSet?, defStyleAttr: Int) {
         if (attrs != null) {
             val ta = context.obtainStyledAttributes(attrs, R.styleable.One_StyleBottomLayout)
-            itemIconTintRes =
-                ta.getColorStateList(R.styleable.One_StyleBottomLayout_oneItemIconTint)
-            itemColorStateList =
-                ta.getColorStateList(R.styleable.One_StyleBottomLayout_oneItemTextColor)
+            itemIconTintRes = ta.getColorStateList(R.styleable.One_StyleBottomLayout_oneItemIconTint)
+            itemColorStateList = ta.getColorStateList(R.styleable.One_StyleBottomLayout_oneItemTextColor)
             if (itemColorStateList == null) {
-                itemColorStateList = ResourcesCompat.getColorStateList(
-                    resources,
-                    R.drawable.default_blue_tab_tint,
-                    null
-                )
+                itemColorStateList = ResourcesCompat.getColorStateList(resources, R.drawable.default_blue_tab_tint, null)
             }
-            topLineColor = ta.getColor(
-                R.styleable.One_StyleBottomLayout_oneItemTopLineColor,
-                Color.TRANSPARENT
-            )
-            floatingEnable =
-                ta.getBoolean(R.styleable.One_StyleBottomLayout_oneFloatingEnable, false)
-            floatingUp =
-                ta.getDimension(R.styleable.One_StyleBottomLayout_oneFloatingUp, 20f).toInt()
-            titleSize = ta.getDimension(
-                R.styleable.One_StyleBottomLayout_oneItemTextSize,
-                DensityUtils.spToPx(resources, 12f).toFloat()
-            ).toInt()
-            textTop = ta.getDimension(
-                R.styleable.One_StyleBottomLayout_oneItemTextTopMargin,
-                DensityUtils.dpToPx(resources, 3f).toFloat()
-            ).toInt()
-            itemIconWidth =
-                ta.getDimension(R.styleable.One_StyleBottomLayout_oneItemIconWidth, 0f).toInt()
-            itemIconHeight =
-                ta.getDimension(R.styleable.One_StyleBottomLayout_oneItemIconHeight, 0f).toInt()
-            itemPadding =
-                ta.getDimension(R.styleable.One_StyleBottomLayout_oneItemPadding, 0f).toInt()
-            itemFloatingPadding =
-                ta.getDimension(R.styleable.One_StyleBottomLayout_oneFloatingPadding, 0f).toInt()
+            topLineColor = ta.getColor(R.styleable.One_StyleBottomLayout_oneItemTopLineColor, Color.TRANSPARENT)
+            floatingEnable = ta.getBoolean(R.styleable.One_StyleBottomLayout_oneFloatingEnable, false)
+            floatingUp = ta.getDimension(R.styleable.One_StyleBottomLayout_oneFloatingUp, 20f).toInt()
+            titleSize = ta.getDimension(R.styleable.One_StyleBottomLayout_oneItemTextSize, DensityUtils.spToPx(resources, 12f).toFloat()).toInt()
+            textTop = ta.getDimension(R.styleable.One_StyleBottomLayout_oneItemTextTopMargin, DensityUtils.dpToPx(resources, 3f).toFloat()).toInt()
+            itemIconWidth = ta.getDimension(R.styleable.One_StyleBottomLayout_oneItemIconWidth, 0f).toInt()
+            itemIconHeight = ta.getDimension(R.styleable.One_StyleBottomLayout_oneItemIconHeight, 0f).toInt()
+            itemPadding = ta.getDimension(R.styleable.One_StyleBottomLayout_oneItemPadding, 0f).toInt()
+            itemFloatingPadding = ta.getDimension(R.styleable.One_StyleBottomLayout_oneFloatingPadding, 0f).toInt()
             val xmlRes = ta.getResourceId(R.styleable.One_StyleBottomLayout_oneMenu, 0)
             parseXml(xmlRes)
         }
@@ -532,17 +495,13 @@ class OneBottomNavigationBar : View {
         }
         bgDrawable = if (background != null && background is ColorDrawable) {
             background
-
         } else if (background is StateListDrawable) {
             background
         } else if (background is GradientDrawable) {
             background
-
         } else {
-            // ColorDrawable(Color.BLACK)
-            resources.getDrawable(R.drawable.rounded_corners)
+            ColorDrawable(Color.WHITE)
         }
-        //
         for (item in itemList) {
             item.titleSize = titleSize
             item.iconWidth = itemIconWidth
@@ -573,7 +532,7 @@ class OneBottomNavigationBar : View {
                 when (event) {
                     XmlPullParser.START_DOCUMENT -> {
                         if (BuildConfig.DEBUG) {
-                            //Log.e(TAG, "xml解析开始")
+                            Log.e(TAG, "xml解析开始")
                         }
                     }
                     XmlPullParser.START_TAG ->
@@ -583,51 +542,28 @@ class OneBottomNavigationBar : View {
                             val item = Item()
                             for (i in 0 until xmlParser.attributeCount) {
                                 //两种方法获取属性值
-//                                                                Log.e(TAG, "第" + (i + 1) + "个属性:" + xmlParser.getAttributeName(i)
-//                                                                        + ": " + xmlParser.getAttributeValue(i));
+                                //                                Log.e(TAG, "第" + (i + 1) + "个属性:" + xmlParser.getAttributeName(i)
+                                //                                        + ": " + xmlParser.getAttributeValue(i));
                                 if ("id".equals(xmlParser.getAttributeName(i), ignoreCase = true)) {
                                     item.id = xmlParser.getAttributeResourceValue(i, 0)
-                                } else if ("icon".equals(
-                                        xmlParser.getAttributeName(i),
-                                        ignoreCase = true
-                                    )
-                                ) {
+                                } else if ("icon".equals(xmlParser.getAttributeName(i), ignoreCase = true)) {
                                     val drawableId = xmlParser.getAttributeResourceValue(i, 0)
-                                    val drawable =
-                                        ResourcesCompat.getDrawable(resources, drawableId, null)
+                                    val drawable = ResourcesCompat.getDrawable(resources, drawableId, null)
                                     item.drawable = drawable!!.constantState!!.newDrawable()
                                     var stateListDrawable = StateListDrawable()
                                     if (drawable is StateListDrawable) {
                                         stateListDrawable = drawable
-                                        stateListDrawable.state =
-                                            intArrayOf(android.R.attr.state_checked)
+                                        stateListDrawable.state = intArrayOf(android.R.attr.state_checked)
                                         stateListDrawable.mutate()
                                     } else {
-                                        val selectedDrawable =
-                                            tintListDrawable(drawable, itemIconTintRes)
-                                        selectedDrawable.state =
-                                            intArrayOf(android.R.attr.state_checked)
-                                        stateListDrawable.addState(
-                                            intArrayOf(android.R.attr.state_checked),
-                                            selectedDrawable.current
-                                        )
-                                        stateListDrawable.addState(
-                                            intArrayOf(android.R.attr.state_selected),
-                                            selectedDrawable.current
-                                        )
-                                        stateListDrawable.addState(
-                                            intArrayOf(android.R.attr.state_pressed),
-                                            selectedDrawable.current
-                                        )
-                                        stateListDrawable.addState(
-                                            intArrayOf(android.R.attr.state_focused),
-                                            selectedDrawable.current
-                                        )
+                                        val selectedDrawable = tintListDrawable(drawable, itemIconTintRes)
+                                        selectedDrawable.state = intArrayOf(android.R.attr.state_checked)
+                                        stateListDrawable.addState(intArrayOf(android.R.attr.state_checked), selectedDrawable.current)
+                                        stateListDrawable.addState(intArrayOf(android.R.attr.state_selected), selectedDrawable.current)
+                                        stateListDrawable.addState(intArrayOf(android.R.attr.state_pressed), selectedDrawable.current)
+                                        stateListDrawable.addState(intArrayOf(android.R.attr.state_focused), selectedDrawable.current)
                                         selectedDrawable.state = intArrayOf()
-                                        stateListDrawable.addState(
-                                            intArrayOf(),
-                                            selectedDrawable.current
-                                        )
+                                        stateListDrawable.addState(intArrayOf(), selectedDrawable.current)
                                     }
                                     item.icon = stateListDrawable
                                 } else if ("title" == xmlParser.getAttributeName(i)) {
@@ -656,7 +592,7 @@ class OneBottomNavigationBar : View {
                     }
                     XmlPullParser.END_TAG -> {
                         if (BuildConfig.DEBUG) {
-                           // Log.e(TAG, "xml解析结束")
+                            Log.e(TAG, "xml解析结束")
                         }
                     }
                     else -> {
@@ -697,18 +633,16 @@ class OneBottomNavigationBar : View {
         val specMode = MeasureSpec.getMode(heightMeasureSpec)
         mWidth = MeasureSpec.getSize(widthMeasureSpec)
         mItemWidth = (mWidth - paddingLeft - paddingRight) / itemList.size
-        topPadding = topPadding
+        topPadding = paddingTop
         bottomPadding = paddingBottom
         setTextPaint(titleSize, Color.BLACK)
-        val textHeight = getTextHeight("事件", mTextPaint)
+        val textHeight = getTextHeight("首页", mTextPaint)
         mHeight = if (specMode == View.MeasureSpec.AT_MOST) {
-
             itemIconHeight = if (itemIconHeight < 50) itemIconHeight else 50
             topPadding + bottomPadding + itemIconHeight + textHeight + textTop + itemPadding * 2
         } else {
             val height = MeasureSpec.getSize(heightMeasureSpec)
-            this.itemIconHeight =
-                height - topPadding - bottomPadding - textHeight - textTop - itemPadding * 2
+            this.itemIconHeight = height - topPadding - bottomPadding - textHeight - textTop - itemPadding * 2
             height
         }
         this.itemIconWidth = this.itemIconHeight
@@ -727,13 +661,7 @@ class OneBottomNavigationBar : View {
     override fun onDraw(canvas: Canvas) {
         super.onDraw(canvas)
         var floatingUpInt = getFloatingUpHeight()
-//        canvas.drawLine(
-//            0f,
-//            floatingUpInt.toFloat(),
-//            mWidth.toFloat(),
-//            floatingUpInt.toFloat(),
-//            linePaint!!
-//        )
+        canvas.drawLine(0f, floatingUpInt.toFloat(), mWidth.toFloat(), floatingUpInt.toFloat(), linePaint!!)
         //画背景
         drawFloating(canvas)
 
@@ -777,12 +705,7 @@ class OneBottomNavigationBar : View {
                     linePaint!!.style = Paint.Style.STROKE
                     canvas.drawCircle(x.toFloat(), y.toFloat(), r, linePaint!!)
                     paint.style = Paint.Style.FILL
-                    canvas.drawCircle(
-                        x.toFloat(),
-                        y.toFloat(),
-                        r - linePaint!!.strokeWidth / 2,
-                        paint
-                    )
+                    canvas.drawCircle(x.toFloat(), y.toFloat(), r - linePaint!!.strokeWidth / 2, paint)
                 }
             }
         }
@@ -817,22 +740,11 @@ class OneBottomNavigationBar : View {
         }
         var rect = getItemRect(item, position)
         if (!TextUtils.isEmpty(item.title)) {
-            var color = if (item.isChecked) itemColorStateList!!.getColorForState(
-                intArrayOf(android.R.attr.state_checked),
-                itemColorStateList!!.defaultColor
-            ) else itemColorStateList!!.defaultColor
+            var color = if (item.isChecked) itemColorStateList!!.getColorForState(intArrayOf(android.R.attr.state_checked), itemColorStateList!!.defaultColor) else itemColorStateList!!.defaultColor
             if (!item.isCheckable) {
-                color = itemColorStateList!!.getColorForState(
-                    intArrayOf(android.R.attr.state_checked),
-                    itemColorStateList!!.defaultColor
-                )
+                color = itemColorStateList!!.getColorForState(intArrayOf(android.R.attr.state_checked), itemColorStateList!!.defaultColor)
             }
-            setTextPaint(
-                if (item.titleSize == 0) DensityUtils.dpToPx(
-                    resources,
-                    14f
-                ) else item.titleSize, color
-            )
+            setTextPaint(if (item.titleSize == 0) DensityUtils.dpToPx(resources, 14f) else item.titleSize, color)
             val textHeight = getTextHeight(item.title, mTextPaint)
             val textX = (rect.left + rect.right) / 2
             val textY = rect.bottom - textHeight / 4
@@ -844,9 +756,74 @@ class OneBottomNavigationBar : View {
                 it.draw(canvas)
             }
         }
-//        if (item.msgCount != 0) {
-//            drawItemMsgCount(item, position, canvas)
-//        }
+        if (item.msgCount != 0) {
+            drawItemMsgCount(item, position, canvas)
+        }
+    }
+
+    /**
+     * 画出消息数
+     */
+    private fun drawItemMsgCount(item: Item, position: Int, canvas: Canvas) {
+        val msgCountRect = getMsgCountRect(item, position)
+        var x = (msgCountRect.left + msgCountRect.right) / 2
+        var y = (msgCountRect.top + msgCountRect.bottom) / 2
+        var r = (msgCountRect.bottom - msgCountRect.top) / 2
+
+        if (item.msgCount > 0) {
+            var countStr = when {
+                item.msgCount > 99 -> {
+                    setTextPaint(DensityUtils.dpToPx(resources, 7f), Color.WHITE)
+                    "99+"
+                }
+                item.msgCount < 10 -> {
+                    setTextPaint(DensityUtils.dpToPx(resources, 9f), Color.WHITE)
+                    item.msgCount.toString()
+                }
+                else -> {
+                    setTextPaint(DensityUtils.dpToPx(resources, 8f), Color.WHITE)
+                    item.msgCount.toString()
+                }
+            }
+            val paint = createPaint(Color.RED, Paint.Style.FILL, 0f)
+            canvas.drawCircle(x.toFloat(), y.toFloat(), r.toFloat(), paint)
+            canvas.drawText(countStr, x.toFloat(), (y + (r - DEFAULT_MSG_COUNT_TEXT_PADDING) / 2).toFloat(), mTextPaint)
+            paint.style = Paint.Style.STROKE
+            paint.color = Color.WHITE
+            paint.strokeWidth = DensityUtils.dpToPx(resources, 1f).toFloat()
+            canvas.drawCircle(x.toFloat(), y.toFloat(), r.toFloat(), paint)
+        } else {
+            val paint = createPaint(Color.RED, Paint.Style.FILL, 0f)
+            canvas.drawCircle(x.toFloat(), y.toFloat(), r.toFloat(), paint)
+            paint.style = Paint.Style.STROKE
+            paint.color = Color.WHITE
+            paint.strokeWidth = DensityUtils.dpToPx(resources, 1f).toFloat()
+            canvas.drawCircle(x.toFloat(), y.toFloat(), r.toFloat(), paint)
+        }
+    }
+
+    private fun getMsgCountRect(item: Item, position: Int): Rect {
+        val r = if (item.msgCount > 0) {
+            setTextPaint(DensityUtils.dpToPx(resources, 7f), Color.WHITE)
+            getTextWidth("99+", mTextPaint!!) / 2 + DEFAULT_MSG_COUNT_TEXT_PADDING
+        } else {
+            7
+        }
+        val rect = getIconRect(item, position)
+        var x = (rect.left + rect.right) / 2
+        var y = (rect.top + rect.bottom) / 2
+        var r2 = y - rect.top
+        val offset = sqrt(r2 * r2 * 1.0 / 2)
+        val msgRect = Rect()
+        msgRect.left = (x + offset - r).toInt()
+        msgRect.top = (y - offset - r).toInt()
+        if (item.msgCount > 0) {
+            msgRect.left += r / 3
+            msgRect.top += r / 3
+        }
+        msgRect.right = msgRect.left + 2 * r
+        msgRect.bottom = msgRect.top + 2 * r
+        return msgRect
     }
 
 
@@ -888,16 +865,13 @@ class OneBottomNavigationBar : View {
         val floating = getFloatingUpHeight()
         var iconSize = itemIconWidth.coerceAtMost(itemIconHeight)
         setTextPaint(titleSize, Color.BLACK)
-        val textHeight = getTextHeight("事件", mTextPaint!!)
+        val textHeight = getTextHeight("首页", mTextPaint!!)
         if (TextUtils.isEmpty(item.title)) {
             iconSize += (textTop + textHeight)
         }
         to.top = rect.top
         if (floatingEnable && item.isFloating) {
-            iconSize += floating * 3 / 3
-        } else {
-            iconSize = 65
-            to.top = 85
+            iconSize += floating * 3 / 4
         }
         iconSize += (itemPadding - item.padding) * 2//高度修复
         to.left = (rect.left + rect.right - iconSize) / 2
@@ -1022,33 +996,17 @@ class OneBottomNavigationBar : View {
                         //图片文字内容高度
                         val height = mItemHeight - topPadding - bottomPadding
                         if (!TextUtils.isEmpty(item.title)) {
-                            val color = if (item.isChecked) itemColorStateList!!.getColorForState(
-                                intArrayOf(android.R.attr.state_checked),
-                                itemColorStateList!!.defaultColor
-                            ) else itemColorStateList!!.defaultColor
-                            setTextPaint(
-                                if (item.titleSize == 0) DensityUtils.dpToPx(
-                                    resources,
-                                    14f
-                                ) else item.titleSize, color
-                            )
+                            val color = if (item.isChecked) itemColorStateList!!.getColorForState(intArrayOf(android.R.attr.state_checked), itemColorStateList!!.defaultColor) else itemColorStateList!!.defaultColor
+                            setTextPaint(if (item.titleSize == 0) DensityUtils.dpToPx(resources, 14f) else item.titleSize, color)
                             val textHeight = getTextHeight(item.title, mTextPaint!!)
                             val textY = startTop + height - textHeight / 4//上边距+图片文字内容高度
                             val w = textY - textHeight / 2 - topPadding
                             //                        width = height = height - textHeight - textTop;
                         }
-                        val centerX =
-                            paddingLeft + i * mItemWidth + (mItemWidth - width) / 2 + width / 2
+                        val centerX = paddingLeft + i * mItemWidth + (mItemWidth - width) / 2 + width / 2
                         val centerY = mItemHeight / 2
                         val r = mItemHeight / 2
-                        if (y >= getFloatingUpHeight() || item.isFloating && isInCircle(
-                                centerX,
-                                centerY,
-                                r,
-                                x.toInt(),
-                                y.toInt()
-                            )
-                        ) {
+                        if (y >= getFloatingUpHeight() || item.isFloating && isInCircle(centerX, centerY, r, x.toInt(), y.toInt())) {
                             setSelected(i)
                         }
                     }
@@ -1070,21 +1028,13 @@ class OneBottomNavigationBar : View {
      * @param touchY   触摸位置的 Y 坐标
      * @return
      */
-    private fun isInCircle(
-        vCenterX: Int,
-        vCenterY: Int,
-        r: Int,
-        touchX: Int,
-        touchY: Int
-    ): Boolean {
+    private fun isInCircle(vCenterX: Int, vCenterY: Int, r: Int, touchX: Int, touchY: Int): Boolean {
         //点击位置x坐标与圆心的x坐标的距离
         val distanceX = Math.abs(vCenterX - touchX)
         //点击位置y坐标与圆心的y坐标的距离
         val distanceY = Math.abs(vCenterY - touchY)
         //点击位置与圆心的直线距离
-        val distanceZ =
-            Math.sqrt(Math.pow(distanceX.toDouble(), 2.0) + Math.pow(distanceY.toDouble(), 2.0))
-                .toInt()
+        val distanceZ = Math.sqrt(Math.pow(distanceX.toDouble(), 2.0) + Math.pow(distanceY.toDouble(), 2.0)).toInt()
 
         //如果点击位置与圆心的距离大于圆的半径,证明点击位置没有在圆内
         return distanceZ <= r
@@ -1110,6 +1060,37 @@ class OneBottomNavigationBar : View {
     }
 
 
+    internal fun drawable2Bitmap(drawable: Drawable?): Bitmap {
+        if (drawable is BitmapDrawable) {
+            return drawable.bitmap
+        } else if (drawable is NinePatchDrawable) {
+            val bitmap = Bitmap
+                .createBitmap(
+                    drawable.intrinsicWidth,
+                    drawable.intrinsicHeight,
+                    if (drawable.opacity != PixelFormat.OPAQUE)
+                        Bitmap.Config.ARGB_8888
+                    else
+                        Bitmap.Config.RGB_565)
+            val canvas = Canvas(bitmap)
+            drawable.setBounds(0, 0, drawable.intrinsicWidth,
+                drawable.intrinsicHeight)
+            drawable.draw(canvas)
+            return bitmap
+        } else {
+            val bitmap: Bitmap
+            if (drawable!!.intrinsicWidth <= 0 || drawable.intrinsicHeight <= 0) {
+                bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888) // Single color bitmap will be created of 1x1 pixel
+            } else {
+                bitmap = Bitmap.createBitmap(drawable.intrinsicWidth, drawable.intrinsicHeight, Bitmap.Config.ARGB_8888)
+            }
+            val canvas = Canvas(bitmap)
+            drawable.setBounds(0, 0, canvas.width, canvas.height)
+            drawable.draw(canvas)
+            return bitmap
+        }
+    }
+
     /**
      * 改变Fragment
      *
@@ -1164,10 +1145,7 @@ class OneBottomNavigationBar : View {
     }
 
 
-    private class ViewpagerAdapter(
-        fragmentManager: FragmentManager,
-        val fragments: List<Fragment>
-    ) : FragmentPagerAdapter(fragmentManager) {
+    private class ViewpagerAdapter(fragmentManager: FragmentManager, val fragments: List<Fragment>) : FragmentPagerAdapter(fragmentManager) {
         override fun getCount(): Int {
             return fragments.size
         }

+ 1 - 1
app/build.gradle

@@ -37,7 +37,7 @@ android {
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
             android.applicationVariants.all { variant ->
                 variant.outputs.all {
-                    outputFileName = "yitihua_sp_taishiganzhi_${buildType.name}_v${defaultConfig.versionName}_${buildTime()}.apk"
+                    outputFileName = "taishiganzhi_${buildType.name}_v${defaultConfig.versionName}_${buildTime()}.apk"
                 }
             }
         }

+ 20 - 0
app/debug/output-metadata.json

@@ -0,0 +1,20 @@
+{
+  "version": 3,
+  "artifactType": {
+    "type": "APK",
+    "kind": "Directory"
+  },
+  "applicationId": "com.sjkj.appthreefloor_tsgz",
+  "variantName": "debug",
+  "elements": [
+    {
+      "type": "SINGLE",
+      "filters": [],
+      "attributes": [],
+      "versionCode": 10000,
+      "versionName": "1.0.0",
+      "outputFile": "taishiganzhi_debug_v1.0.0_20250714.apk"
+    }
+  ],
+  "elementType": "File"
+}

BIN
app/debug/taishiganzhi_debug_v1.0.0_20250714.apk


BIN
app/debug/taishiganzhi_debug_v1.0.0_20250714.zip


+ 20 - 0
app/release/output-metadata.json

@@ -0,0 +1,20 @@
+{
+  "version": 3,
+  "artifactType": {
+    "type": "APK",
+    "kind": "Directory"
+  },
+  "applicationId": "com.sjkj.appthreefloor_tsgz",
+  "variantName": "release",
+  "elements": [
+    {
+      "type": "SINGLE",
+      "filters": [],
+      "attributes": [],
+      "versionCode": 10000,
+      "versionName": "1.0.0",
+      "outputFile": "taishiganzhi_release_v1.0.0_20250714.apk"
+    }
+  ],
+  "elementType": "File"
+}

BIN
app/release/taishiganzhi_release_v1.0.0_20250714.apk


BIN
app/release/taishiganzhi_release_v1.0.0_20250714.zip


+ 8 - 5
app/src/main/AndroidManifest.xml

@@ -75,6 +75,7 @@
             android:name="com.sjkj.appthreefloor_tsgz.activity.SplashActivity"
             android:noHistory="true"
             android:exported="true"
+            android:screenOrientation="portrait"
             android:theme="@style/SplashTheme">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -113,6 +114,7 @@
         <activity
             android:name="com.sjkj.appthreefloor_tsgz.login.LoginActivity"
             android:exported="false"
+            android:screenOrientation="portrait"
             android:label="@string/title_activity_login"
             android:theme="@style/AppTheme.NoActionBar" />
 
@@ -128,6 +130,7 @@
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sjkj.appthreefloor_tsgz.activity.GuidePageActivity"
+            android:theme="@style/AppTheme.NoActionBar"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sjkj.appthreefloor_tsgz.activity.MonitoringCenterActivity"
@@ -135,7 +138,7 @@
         <activity
             android:name="com.sjkj.appthreefloor_tsgz.activity.WaterCraneResourcesActivity"
             android:exported='false'
-            android:screenOrientation="fullSensor" />
+            android:screenOrientation="portrait" />
         <activity
             android:name="com.sjkj.appthreefloor_tsgz.activity.PermissionListActivity"
             android:screenOrientation="portrait" />
@@ -147,8 +150,7 @@
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sjkj.appthreefloor_tsgz.weight.photoview.PhotoViewActivity"
-            android:screenOrientation="portrait"
-             />
+            android:screenOrientation="portrait" />
         <activity
             android:name="com.sjkj.appthreefloor_tsgz.activity.MyVideoPlayerActivity"
             android:screenOrientation="portrait" />
@@ -156,12 +158,13 @@
             android:name="com.sjkj.appthreefloor_tsgz.activity.ResourceDetailsActivity"
             android:screenOrientation="portrait" />
         <activity
+            android:screenOrientation="landscape"
             android:name="com.sjkj.appthreefloor_tsgz.activity.ExoPlayerActivity"
             android:configChanges="orientation|screenSize|keyboardHidden"
-            android:theme="@style/AppNoTitleTheme"
-            android:screenOrientation="unspecified" />
+            android:theme="@style/AppNoTitleTheme" />
         <activity
             android:name="com.amap.api.navi.AmapRouteActivity"
+            android:screenOrientation="portrait"
             android:configChanges="orientation|keyboardHidden|screenSize|navigation"
             android:theme="@android:style/Theme.NoTitleBar" />
     </application>

+ 22 - 0
app/src/main/assets/supermap.crt

@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDmzCCAoOgAwIBAgIUG1pLSlAAo+YBDezQmQQgL/2owuYwDQYJKoZIhvcNAQEL
+BQAwZzELMAkGA1UEBhMCQ04xETAPBgNVBAgMCFpoZUppYW5nMREwDwYDVQQHDAhI
+YW5nWmhvdTEMMAoGA1UECgwDQklDMQswCQYDVQQLDAJHTjEXMBUGA1UEAwwOQklD
+LUdOLVJPT1QtVjEwHhcNMjUwNzE0MDY1MDQwWhcNMjcxMDE2MDY1MDQwWjBxMQsw
+CQYDVQQGEwJDTjERMA8GA1UECAwIWmhlSmlhbmcxETAPBgNVBAcMCEhhbmdaaG91
+MRgwFgYDVQQKDA9jbHVzdGVyX21hbmFnZXIxCzAJBgNVBAsMAkdYMRUwEwYDVQQD
+DAwxOTIuMTY4LjAuMzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCt
+yJkdc9wOIg9imQzECea2zOg1OkyPIMQXR5MBpJNt86Gw1FGH0fYdNVymJZleFkEB
+iIOBAS6V1X3V31buU76AW9/1lhpuWNuZEovcuB5K429I+AQDqkS7aJG4JRvkcDgA
+dSjIdCrtIk9ZmNwMqCGpmy9qa677Uu9SwNt92wSKx3lf624gOvsXCICAB0M5v2aE
+7uE+ilz2Oqqa1DoIY0+1HDarBAv31BBYwmd90jQ1dctfEa0BHMX0/QKGSn1soWZG
+t2uEgTmmovymhKWXptEvDDe4QOpdXQnU2dnprXGjh3cNQQzYDgKgerL12hLZX8zz
+I23oQ0WwO14raiZouxc5AgMBAAGjNTAzMDEGA1UdEQQqMCiHBCSJMEKCDDM2LjEz
+Ny40OC42NocEwKgAIIIMMTkyLjE2OC4wLjMyMA0GCSqGSIb3DQEBCwUAA4IBAQB+
+EDALWT6HMu8GyA6Hgc33T9GzPaq0E42KvzPWKJIgDVtEdvDE/o4X2fv9DkfMUH9T
+3HJjLAUZtZLg9IMOPaGw0O/p6t4CZRzNFkNVAEQiUwlKxPsjmk7UDpEd8N2vBrEs
+0phL1/9MBUA9Lhfn7+/SkUp2Il4oVZXxx6Xj+9IXchshwzBGfTl2SxFarIWVZeok
+KHJ1+AM2SyknY+mWyUd7hqfytKc1G3hXhyzxMuH8BnovHohwm0/77flzxmpKofze
+37241CvUC6m0xcMIndBW+PbOLcgBnli4kvo+lkveEkfWrux2DfGccu+Mu5aj/K0i
+Olxt8HzsMNC5hfHlLkJ7
+-----END CERTIFICATE-----

+ 84 - 14
app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/ExoPlayerActivity.java

@@ -1,20 +1,29 @@
 package com.sjkj.appthreefloor_tsgz.activity;
 
 import android.content.pm.ActivityInfo;
-import android.graphics.drawable.Drawable;
 import android.net.Uri;
+import android.text.TextUtils;
 import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
 
-import androidx.core.content.ContextCompat;
 import androidx.lifecycle.ViewModelProvider;
 
 import com.google.android.exoplayer2.ExoPlayer;
 import com.google.android.exoplayer2.MediaItem;
+import com.google.android.exoplayer2.Player;
 import com.google.android.exoplayer2.SimpleExoPlayer;
+import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
 import com.gyf.immersionbar.ImmersionBar;
 import com.sjkj.appthreefloor_tsgz.R;
 import com.sjkj.appthreefloor_tsgz.activity.viewModel.PlayViewModel;
+import com.sjkj.appthreefloor_tsgz.app.App;
+import com.sjkj.appthreefloor_tsgz.bean.ExoPlayerBean;
 import com.sjkj.appthreefloor_tsgz.databinding.PlayerActivityBinding;
+import com.sjkj.appthreefloor_tsgz.net.GetPlayerUrlRequest;
+import com.sjkj.base_lib.entity.Params;
+import com.sjkj.base_lib.net.domain.interactor.ProcessErrorSubscriber;
+import com.sjkj.base_lib.utils.ToastUtils;
 import com.sjkj.base_lib.view.BaseActivity;
 
 public class ExoPlayerActivity extends BaseActivity {
@@ -23,6 +32,8 @@ public class ExoPlayerActivity extends BaseActivity {
     private ExoPlayer player;
     private boolean isFullScreen;
     private int currentOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
+    private GetPlayerUrlRequest getPlayerUrlRequest = new GetPlayerUrlRequest(App.getInstance());
+
 
     @Override
     public void initBinding() {
@@ -33,21 +44,34 @@ public class ExoPlayerActivity extends BaseActivity {
     }
 
     @Override
+    public void initListener() {
+        super.initListener();
+        binding.back.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
+    }
+
+    @Override
     public void initView() {
         super.initView();
-        getTitleView().setText("监控画面");
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
+        // getTitleView().setText("视频预览");
         ImmersionBar.with(ExoPlayerActivity.this)
                 .statusBarDarkFont(true, 0.2f)
                 .statusBarColor(R.color.white)
+                .titleBar(binding.toolbar)
                 .init();
-        getTitleView().setTextColor(getResources().getColor(R.color.black));
-        int drawableLeft = R.drawable.icon_back; // 替换为你的drawable资源ID
-        Drawable drawable = ContextCompat.getDrawable(ExoPlayerActivity.this, drawableLeft);
-        if (drawable != null) {
-            getBackView().setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, null, null, null); // 使用Relative版本以支持RTL布局方向
-        }
-        getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.color.white));
-        initializePlayer();
+        binding.toolbar.setTitle("dddd");
+//        getTitleView().setTextColor(getResources().getColor(R.color.black));
+//        int drawableLeft = R.drawable.icon_back; // 替换为你的drawable资源ID
+//        Drawable drawable = ContextCompat.getDrawable(ExoPlayerActivity.this, drawableLeft);
+//        if (drawable != null) {
+//            getBackView().setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, null, null, null); // 使用Relative版本以支持RTL布局方向
+//        }
+//        getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.color.white));
 
         binding.fullscreenButton.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -58,18 +82,64 @@ public class ExoPlayerActivity extends BaseActivity {
     }
 
 
-    private void initializePlayer() {
-        player = new SimpleExoPlayer.Builder(this).build();
+    private void initializePlayer(String url) {
 
+        binding.loading.setVisibility(View.VISIBLE);
+        player = new SimpleExoPlayer.Builder(this).build();
+        binding.playerView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FILL);
         binding.playerView.setUseController(false); // 设置为不使用控制器
         binding.playerView.setPlayer(player);
 
         // 准备M3U8流的MediaItem
-        MediaItem mediaItem = MediaItem.fromUri(Uri.parse("http://192.168.100.111:83/openUrl/vsigHDVVtaob9265a8f852343ddae9da/live.m3u8"));
+        MediaItem mediaItem = MediaItem.fromUri(Uri.parse(url));
         player.setMediaItem(mediaItem);
         player.prepare();
         player.play();
         toggleFullScreen();
+
+        player.addListener(new Player.Listener() {
+            @Override
+            public void onPositionDiscontinuity(int reason) {
+            }
+
+            @Override
+            public void onPlaybackStateChanged(int playbackState) {
+                if (playbackState == Player.STATE_READY) {
+                    // 播放器准备好可以播放
+                    binding.loading.setVisibility(View.GONE);
+                }
+            }
+
+            @Override
+            public void onPlayWhenReadyChanged(boolean playWhenReady, int reason) {
+                // 播放状态变化时
+            }
+        });
+    }
+
+    @Override
+    public void loadData() {
+        super.loadData();
+        Params params = new Params();
+        params.put("cameraIndexCode", getIntent().getStringExtra("id"));
+        getPlayerUrlRequest.setParams(params);
+        getPlayerUrlRequest.execute(new ProcessErrorSubscriber<ExoPlayerBean>() {
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+                if (!TextUtils.isEmpty(e.getMessage())) {
+                    ToastUtils.show(e.getMessage());
+                }
+            }
+
+            @Override
+            public void onNext(ExoPlayerBean bean) {
+                super.onNext(bean);
+                if (bean != null) {
+                    initializePlayer(bean.getUrl());
+                }
+            }
+        });
     }
 
     private void toggleFullScreen() {

+ 8 - 4
app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/GuidePageActivity.java

@@ -1,9 +1,11 @@
 package com.sjkj.appthreefloor_tsgz.activity;
 
 import android.content.Intent;
+import android.os.Build;
 import android.view.View;
 import android.widget.ImageView;
 
+import androidx.annotation.RequiresApi;
 import androidx.lifecycle.ViewModelProvider;
 import androidx.viewpager.widget.ViewPager;
 
@@ -37,12 +39,14 @@ public class GuidePageActivity extends BaseActivity {
         return R.layout.activity_guidepage;
     }
 
+    @RequiresApi(api = Build.VERSION_CODES.R)
     @Override
     public void initView() {
         super.initView();
-        ImmersionBar.with(this).init();
-        getTitleLayoutView().setVisibility(View.GONE);
-        getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.color.transparent_click));
+        ImmersionBar.with(this)
+                .statusBarDarkFont(true, 0.2f) // 深色字体适配状态栏字体颜色自动切换功能,0.2f表示0.2透明度,可根据实际情况调整透明度值。
+                .navigationBarDarkIcon(true) // 深色图标适配导航栏图标颜色自动切换功能。
+                .init(); // 初始化沉浸式状态栏。
         binding.startBtn.setVisibility(View.GONE);
         mImageViewList = new ArrayList<>();
         for (int i = 0; i < mImageIds.length; i++) {
@@ -96,7 +100,7 @@ public class GuidePageActivity extends BaseActivity {
                 } else {
                     binding.ivRed1.setVisibility(View.VISIBLE);
                     binding.ivRed2.setVisibility(View.GONE);
-                     binding.startBtn.setVisibility(View.GONE);
+                    binding.startBtn.setVisibility(View.GONE);
                 }
             }
 

+ 13 - 7
app/src/main/java/com/sjkj/appthreefloor_tsgz/activity/MonitoringCenterActivity.java

@@ -4,7 +4,6 @@ import android.content.Intent;
 import android.graphics.drawable.Drawable;
 import android.os.Build;
 import android.text.TextUtils;
-import android.util.Log;
 import android.view.View;
 
 import androidx.annotation.RequiresApi;
@@ -33,15 +32,12 @@ import com.sjkj.appthreefloor_tsgz.net.CameraAllListRequest;
 import com.sjkj.appthreefloor_tsgz.net.CameraTypeListRequest;
 import com.sjkj.appthreefloor_tsgz.net.GetDictTypeRequest;
 import com.sjkj.base_lib.adapter.BaseRecAdapter;
-import com.sjkj.base_lib.camera.dh.bean.CameraBean;
-import com.sjkj.base_lib.camera.dh.view.DHCameraDetailsActivity;
 import com.sjkj.base_lib.camera.dh.vm.CameraViewModel;
-import com.sjkj.base_lib.divider.DividerItem;
 import com.sjkj.base_lib.entity.Params;
 import com.sjkj.base_lib.net.domain.interactor.ProcessErrorSubscriber;
-import com.sjkj.base_lib.utils.AppTools;
 import com.sjkj.base_lib.utils.ToastUtils;
 import com.sjkj.base_lib.view.BaseActivity;
+import com.sjkj.base_lib.weight.LoadingDialog;
 
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -145,7 +141,7 @@ public class MonitoringCenterActivity extends BaseActivity {
         LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
         linearLayoutManager.setOrientation(RecyclerView.VERTICAL);
         binding.mainRecyclerView.setLayoutManager(linearLayoutManager);
-        binding.mainRecyclerView.addItemDecoration(new DividerItem(this));
+        //binding.mainRecyclerView.addItemDecoration(new DividerItem(this));
 
         adapter = new CameraAdapter(this);
         binding.mainRecyclerView.setAdapter(adapter);
@@ -191,7 +187,11 @@ public class MonitoringCenterActivity extends BaseActivity {
         adapter.setItemClick(new BaseRecAdapter.OnItemClick<AllCameraBean.Rows>() {
             @Override
             public void onItemClick(AllCameraBean.Rows bean, int position) {
-                startActivity(new Intent(MonitoringCenterActivity.this, ExoPlayerActivity.class));
+                if (!TextUtils.isEmpty(bean.getChannelCode())) {
+                    startActivity(new Intent(MonitoringCenterActivity.this, ExoPlayerActivity.class).putExtra("id", bean.getChannelCode()));
+                } else {
+                    ToastUtils.show("无视频源");
+                }
 //                if (AppTools.getCameraType() == AppTools.CAMERA_TYPE_NONE) {
 //
 //                } else if (AppTools.getCameraType() == AppTools.CAMERA_TYPE_DH) {
@@ -293,6 +293,7 @@ public class MonitoringCenterActivity extends BaseActivity {
     private void requestListRefresh() {
 
 
+        showLoadingDialog();
         currentPage = 1;
         Params params = new Params();
         params.put("cameraName", viewModel.keyword.get());
@@ -304,6 +305,7 @@ public class MonitoringCenterActivity extends BaseActivity {
             @Override
             public void onError(Throwable e) {
                 super.onError(e);
+                hideLoadingDialog(LoadingDialog.LOADING_FAILED);
                 finishRefreshOrLoadMore(binding.smartRefreshLayout);
             }
 
@@ -312,6 +314,7 @@ public class MonitoringCenterActivity extends BaseActivity {
             public void onNext(AllCameraBean beanList) {
                 super.onNext(beanList);
                 list.clear();
+                hideLoadingDialog(LoadingDialog.LOADING_SUCCESS);
                 if (beanList != null && beanList.getRows().size() > 0) {
 
                     list.addAll(beanList.getRows());
@@ -347,6 +350,7 @@ public class MonitoringCenterActivity extends BaseActivity {
     }
 
     private void requestListLoadMore() {
+        showLoadingDialog();
         Params params = new Params();
         params.put("cameraName", viewModel.keyword.get());
         params.put("pageSize", 10);
@@ -357,12 +361,14 @@ public class MonitoringCenterActivity extends BaseActivity {
             @Override
             public void onError(Throwable e) {
                 super.onError(e);
+                hideLoadingDialog(LoadingDialog.LOADING_FAILED);
                 finishRefreshOrLoadMore(binding.smartRefreshLayout);
             }
 
             @Override
             public void onNext(AllCameraBean beanList) {
                 super.onNext(beanList);
+                hideLoadingDialog(LoadingDialog.LOADING_SUCCESS);
                 if (beanList != null && beanList.getRows().size() > 0) {
                     currentPage = currentPage + 1;
                     list.addAll(beanList.getRows());

+ 9 - 25
app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/CameraAdapter.java

@@ -2,9 +2,7 @@ package com.sjkj.appthreefloor_tsgz.adapter;
 
 
 import android.content.Context;
-import android.graphics.Color;
-import android.util.TypedValue;
-import android.widget.TextView;
+import android.view.View;
 
 import androidx.recyclerview.widget.LinearLayoutManager;
 
@@ -13,7 +11,6 @@ import com.sjkj.appthreefloor_tsgz.bean.AllCameraBean;
 import com.sjkj.appthreefloor_tsgz.databinding.ItemCameraListLayoutBinding;
 import com.sjkj.base_lib.adapter.BaseRecAdapter;
 
-import java.util.ArrayList;
 import java.util.List;
 
 public class CameraAdapter extends BaseRecAdapter<AllCameraBean.Rows, ItemCameraListLayoutBinding> {
@@ -35,29 +32,16 @@ public class CameraAdapter extends BaseRecAdapter<AllCameraBean.Rows, ItemCamera
     protected void onBindItem(ItemCameraListLayoutBinding binding, AllCameraBean.Rows listBean, int position) {
         binding.setBean(listBean);
         binding.executePendingBindings();
-        List<String> list=new ArrayList();
-        list.add("林业");
-        list.add("林业");
-        list.add("林业");
-        list.add("林业");
-        list.add("林业");
-        list.add("林业");
-        list.add("林业");
-        list.add("林业");
-        list.add("林业");
-        list.add("林业");
+
         binding.recyclerView.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false));
-        MyAdapter adapter = new MyAdapter(list); // items是你的数据源
+        MyAdapter adapter = new MyAdapter();
         binding.recyclerView.setAdapter(adapter);
+        if (listBean.getTags() != null && listBean.getTags().size() > 0) {
+            binding.llTitle.setVisibility(View.VISIBLE);
+        } else {
+            binding.llTitle.setVisibility(View.GONE);
+        }
+        adapter.refreshList(listBean.getTags());
 
-//        for (String text : textArray) {
-//            TextView textView = new TextView(context);
-//            textView.setText(text);
-//            textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16); // 设置文本大小
-//            textView.setTextColor(Color.BLACK); // 设置文本颜色
-//            // 可选:设置TextView的padding或margin等
-//            textView.setPadding(10, 0, 10, 0); // 设置左右padding为10dp,上下为0dp
-//            binding.llTitle.addView(textView); // 将TextView添加到LinearLayout中
-//        }
     }
 }

+ 10 - 4
app/src/main/java/com/sjkj/appthreefloor_tsgz/adapter/MyAdapter.java

@@ -8,14 +8,17 @@ import android.widget.TextView;
 import androidx.recyclerview.widget.RecyclerView;
 
 import com.sjkj.appthreefloor_tsgz.R;
+import com.sjkj.appthreefloor_tsgz.bean.AllCameraBean;
 
 import java.util.List;
 
 public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> {
-    private List<String> items;
+    private List<AllCameraBean.Rows.TAGS> items;
 
-    public MyAdapter(List<String> items) {
-        this.items = items;
+
+    public void refreshList(List<AllCameraBean.Rows.TAGS> list) {
+        this.items = list;
+        notifyDataSetChanged();
     }
 
     @Override
@@ -26,7 +29,10 @@ public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> {
 
     @Override
     public void onBindViewHolder(ViewHolder holder, int position) {
-        holder.textView.setText(items.get(position));
+        if (items != null && items.size() > 0) {
+            holder.textView.setText(items.get(position).getTagName());
+        }
+
     }
 
     @Override

+ 34 - 3
app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/AllCameraBean.java

@@ -27,9 +27,19 @@ public class AllCameraBean {
         private String cameraRadius;
         private String cameraType;
         private String id;
+
+        public String getChannelCode() {
+            return channelCode;
+        }
+
+        public void setChannelCode(String channelCode) {
+            this.channelCode = channelCode;
+        }
+
+        private String channelCode;
         private String latitude;
         private String longitude;
-        private List<String> tags;
+        private List<TAGS> tags;
         public void setAddress(String address) {
             this.address = address;
         }
@@ -86,12 +96,33 @@ public class AllCameraBean {
             return longitude;
         }
 
-        public void setTags(List<String> tags) {
+        public void setTags(List<TAGS> tags) {
             this.tags = tags;
         }
-        public List<String> getTags() {
+
+        public List<TAGS> getTags() {
             return tags;
         }
 
+        public class TAGS {
+            private String id;
+            private String tagName;
+
+            public String getId() {
+                return id;
+            }
+
+            public void setId(String id) {
+                this.id = id;
+            }
+
+            public String getTagName() {
+                return tagName;
+            }
+
+            public void setTagName(String tagName) {
+                this.tagName = tagName;
+            }
+        }
     }
 }

+ 13 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/bean/ExoPlayerBean.java

@@ -0,0 +1,13 @@
+package com.sjkj.appthreefloor_tsgz.bean;
+
+public class ExoPlayerBean {
+    private String url;
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+}

+ 15 - 15
app/src/main/java/com/sjkj/appthreefloor_tsgz/fragment/MainFragment.java

@@ -77,20 +77,20 @@ public class MainFragment extends BaseFragment {
             @Override
             public void onClick(View view) {
 
-                LocationUtils.getInstance().startLocation(true, new LocationUtils.OnLocationListener() {
-                    @Override
-                    public void onLocationChanged(double lat, double lng, String address, int code) {
-
-
-                        if (CommonUtils.checkLongitudeLatitude(lng + "", lat + "")) {
-                            // hideLoadingDialog(LoadingDialog.LOADING_SUCCESS);
-                            startActivity(new Intent(getActivity(), WaterCraneResourcesActivity.class).putExtra("Longitude", lng).putExtra("Latitude", lat));
-                        } else {
-                            ToastUtils.show("定位失败,请检查定位权限或者稍后重试");
-                        }
-
-                    }
-                });
+//                LocationUtils.getInstance().startLocation(true, new LocationUtils.OnLocationListener() {
+//                    @Override
+//                    public void onLocationChanged(double lat, double lng, String address, int code) {
+//
+//
+//                        if (CommonUtils.checkLongitudeLatitude(lng + "", lat + "")) {
+//                            // hideLoadingDialog(LoadingDialog.LOADING_SUCCESS);
+//                            startActivity(new Intent(getActivity(), WaterCraneResourcesActivity.class).putExtra("Longitude", lng).putExtra("Latitude", lat));
+//                        } else {
+//                            ToastUtils.show("定位失败,请检查定位权限或者稍后重试");
+//                        }
+//
+//                    }
+//                });
             }
         });
         //取水口
@@ -98,7 +98,7 @@ public class MainFragment extends BaseFragment {
             @Override
             public void onClick(View view) {
 
-                startActivity(new Intent(getActivity(), MyVideoPlayerActivity.class).putExtra("videoUrl", "https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8"));
+                //startActivity(new Intent(getActivity(), MyVideoPlayerActivity.class).putExtra("videoUrl", "https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8"));
             }
         });
         //水源

+ 21 - 3
app/src/main/java/com/sjkj/appthreefloor_tsgz/login/ConfigActivity.java

@@ -1,19 +1,23 @@
 package com.sjkj.appthreefloor_tsgz.login;
 
-import android.content.Intent;
+import android.graphics.drawable.Drawable;
 import android.text.TextUtils;
 import android.view.View;
 import android.widget.EditText;
 import android.widget.TextView;
 
+import androidx.appcompat.widget.Toolbar;
+import androidx.core.content.ContextCompat;
+
+import com.gyf.immersionbar.ImmersionBar;
 import com.sjkj.appthreefloor_tsgz.R;
 import com.sjkj.base_lib.utils.AppTools;
 import com.sjkj.base_lib.utils.ToastUtils;
 import com.sjkj.base_lib.view.BaseActivity;
 
 public class ConfigActivity extends BaseActivity {
-//    private MMKV mmkv = MMKV.defaultMMKV();
-
+    //    private MMKV mmkv = MMKV.defaultMMKV();
+    Toolbar toolbar;
     @Override
     protected int initLayout() {
         return R.layout.activity_config;
@@ -21,6 +25,20 @@ public class ConfigActivity extends BaseActivity {
 
     @Override
     public void initView() {
+        toolbar = findViewById(R.id.toolbar);
+        ImmersionBar.with(ConfigActivity.this)
+                .statusBarDarkFont(true, 0.2f)
+                .statusBarColor(R.color.white)
+                .titleBar(toolbar)
+                .init();
+        getTitleView().setTextColor(getResources().getColor(R.color.black));
+        int drawableLeft = R.drawable.icon_back; // 替换为你的drawable资源ID
+        Drawable drawable = ContextCompat.getDrawable(ConfigActivity.this, drawableLeft);
+        if (drawable != null) {
+            getBackView().setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, null, null, null); // 使用Relative版本以支持RTL布局方向
+        }
+        getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.color.white));
+
         getTitleView().setText("配置");
         EditText ipDomainEt = findViewById(R.id.ip_domain_tv);
         EditText ipWebEt = findViewById(R.id.ip_web_tv);

+ 2 - 3
app/src/main/java/com/sjkj/appthreefloor_tsgz/login/LoginActivity.java

@@ -3,6 +3,7 @@ package com.sjkj.appthreefloor_tsgz.login;
 import android.content.Intent;
 import android.os.Handler;
 import android.text.TextUtils;
+import android.util.Log;
 import android.view.View;
 import android.view.ViewGroup;
 
@@ -13,12 +14,9 @@ import com.sjkj.appthreefloor_tsgz.BuildConfig;
 import com.sjkj.appthreefloor_tsgz.R;
 import com.sjkj.appthreefloor_tsgz.activity.MainActivity;
 import com.sjkj.appthreefloor_tsgz.app.App;
-import com.sjkj.appthreefloor_tsgz.bean.LogInRsaBean;
 import com.sjkj.appthreefloor_tsgz.databinding.ActivityLoginBinding;
-import com.sjkj.appthreefloor_tsgz.net.LoginGetKeyRequest;
 import com.sjkj.appthreefloor_tsgz.net.LoginRequest;
 import com.sjkj.appthreefloor_tsgz.utils.LongClickUtils;
-import com.sjkj.appthreefloor_tsgz.utils.RSAUtils;
 import com.sjkj.base_lib.app.AppManager;
 import com.sjkj.base_lib.entity.Params;
 import com.sjkj.base_lib.net.domain.interactor.ProcessErrorSubscriber;
@@ -174,6 +172,7 @@ public class LoginActivity extends BaseLoginActivity {
                 if (!TextUtils.isEmpty(e.getMessage()) && e.getMessage().contains("connect")) {
                     ToastUtils.show("连接服务器失败,检查网络连接。");
                 } else {
+                    Log.d("zhr1111", e.getMessage());
                     ToastUtils.show(e.getMessage() + "");
                 }
             }

+ 50 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/net/GetPlayerUrlRequest.java

@@ -0,0 +1,50 @@
+package com.sjkj.appthreefloor_tsgz.net;
+
+import android.content.Context;
+
+import com.sjkj.appthreefloor_tsgz.bean.ExoPlayerBean;
+import com.sjkj.base_lib.entity.Params;
+import com.sjkj.base_lib.entity.ResponseBean;
+import com.sjkj.base_lib.net.RetrofitFactory;
+import com.sjkj.base_lib.net.data.exception.BusinessException;
+import com.sjkj.base_lib.net.domain.interactor.UseCase;
+import com.sjkj.base_lib.utils.AppTools;
+
+import rx.Observable;
+import rx.functions.Func1;
+
+/**
+ * 获取视频流
+ */
+public class GetPlayerUrlRequest extends UseCase {
+    private Context context;
+    private RetrofitService service;
+
+    private Params params;
+
+    public Params getParams() {
+        return params;
+    }
+
+    public void setParams(Params params) {
+        this.params = params;
+    }
+
+    public GetPlayerUrlRequest(Context context) {
+        this.context = context;
+        service = RetrofitFactory.getRetrofit(AppTools.getBaseUrl()).create(RetrofitService.class);
+    }
+
+    @Override
+    protected Observable buildUseCaseObservable() {
+        return service.gethikPreviewURLs(params).flatMap(new Func1<ResponseBean<ExoPlayerBean>, Observable<ExoPlayerBean>>() {
+            @Override
+            public Observable<ExoPlayerBean> call(ResponseBean<ExoPlayerBean> responseBean) {
+                if (!"0".equals(responseBean.getCode())) {
+                    return Observable.error(new BusinessException(responseBean.getMsg()));
+                }
+                return Observable.just(responseBean.getData());
+            }
+        });
+    }
+}

+ 6 - 0
app/src/main/java/com/sjkj/appthreefloor_tsgz/net/RetrofitService.java

@@ -10,6 +10,7 @@ import com.sjkj.appthreefloor_tsgz.bean.DailyBean;
 import com.sjkj.appthreefloor_tsgz.bean.EventCenterListBean;
 import com.sjkj.appthreefloor_tsgz.bean.EventDetailsBean;
 import com.sjkj.appthreefloor_tsgz.bean.EventMessageDetailsBean;
+import com.sjkj.appthreefloor_tsgz.bean.ExoPlayerBean;
 import com.sjkj.appthreefloor_tsgz.bean.FileBean;
 import com.sjkj.appthreefloor_tsgz.bean.LogInRsaBean;
 import com.sjkj.appthreefloor_tsgz.bean.NoticeListBean;
@@ -124,4 +125,9 @@ public interface RetrofitService {
     //获取摄像头类型字典项
     @GET("app/dictList")
     Observable<ResponseBean<List<CameraTypeBean>>> GetdictType(@QueryMap Map<String, Object> params);
+
+    //获取视频流
+    @POST("app/hikPreviewURLs")
+    Observable<ResponseBean<ExoPlayerBean>> gethikPreviewURLs(@QueryMap Map<String, Object> params);
+
 }

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


+ 4 - 2
app/src/main/res/layout/activity_camera_list.xml

@@ -43,8 +43,10 @@
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:orientation="horizontal"
-                    android:padding="12dp"
-                    android:visibility="gone">
+                    android:layout_marginTop="10dp"
+                    android:layout_marginRight="15dp"
+                    android:layout_marginLeft="15dp"
+                    android:visibility="visible">
 
                     <EditText
                         android:id="@+id/input_et"

+ 19 - 6
app/src/main/res/layout/activity_config.xml

@@ -2,13 +2,25 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:background="#ECEDF4"
     android:orientation="vertical">
 
+    <androidx.appcompat.widget.Toolbar
+        android:id="@+id/toolbar"
+        android:layout_width="match_parent"
+        android:layout_height="?actionBarSize"
+        android:fitsSystemWindows="true"
+        android:gravity="center_horizontal">
+
+
+    </androidx.appcompat.widget.Toolbar>
+
     <LinearLayout
+        android:layout_marginLeft="15dp"
+        android:layout_marginRight="15dp"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:orientation="vertical"
-        android:padding="30dp">
+        android:orientation="vertical">
 
         <TextView
             android:layout_width="wrap_content"
@@ -22,8 +34,9 @@
         <EditText
             android:id="@+id/ip_domain_tv"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:background="@null"
+            android:layout_height="44dp"
+            android:background="@drawable/shape_common_corners_10dp"
+            android:paddingLeft="15dp"
             android:hint="http://xx.xx.xx.xx:xxxx/"
             android:inputType="textNoSuggestions"
             android:lines="1"
@@ -101,9 +114,9 @@
         <Button
             android:id="@+id/save_tv"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
+            android:layout_height="44dp"
             android:layout_marginTop="100dp"
-            android:background="@drawable/shape_login_btn_solid_black"
+            android:background="@drawable/shape_fillet_bg_blue"
             android:text="保存"
             android:textColor="@color/color_white" />
     </LinearLayout>

+ 10 - 0
app/src/main/res/layout/activity_guidepage.xml

@@ -18,7 +18,17 @@
             android:layout_width="match_parent"
             android:layout_height="match_parent" />
 
+        <androidx.appcompat.widget.Toolbar
+            android:id="@+id/toolbar"
+            android:layout_width="match_parent"
+            android:layout_height="?actionBarSize"
+            android:fitsSystemWindows="true"
+            android:gravity="center_horizontal">
+
+
+        </androidx.appcompat.widget.Toolbar>
         <TextView
+            android:layout_below="@+id/toolbar"
             android:id="@+id/tvSkip"
             style="@style/GuidePage.SkipStyle" />
 

+ 13 - 6
app/src/main/res/layout/item_camera_list_layout.xml

@@ -25,10 +25,11 @@
             android:orientation="horizontal">
 
             <LinearLayout
+                android:layout_height="80dp"
                 android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
+                android:layout_gravity="center_vertical"
+                android:layout_marginTop="8dp"
                 android:layout_marginLeft="10dp"
-                android:layout_marginTop="10dp"
                 android:background="@drawable/shape_corners"
                 android:padding="10dp">
 
@@ -49,8 +50,10 @@
                 android:orientation="vertical">
 
                 <TextView
+                    android:layout_height="0dp"
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:gravity="center_vertical"
                     android:layout_marginLeft="10dp"
                     android:ellipsize="end"
                     android:singleLine="true"
@@ -60,7 +63,10 @@
 
                 <LinearLayout
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
+                    android:layout_height="0dp"
+                    android:layout_gravity="center_vertical"
+                    android:layout_weight="1"
+                    android:gravity="center_vertical"
                     android:layout_marginLeft="10dp"
                     android:layout_marginTop="7dp"
                     android:orientation="horizontal">
@@ -116,12 +122,14 @@
                 <LinearLayout
                     android:id="@+id/ll_title"
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
+                    android:layout_height="0dp"
+                    android:layout_weight="1"
                     android:layout_marginLeft="10dp"
                     android:layout_marginTop="7dp"
                     android:orientation="horizontal">
 
                     <androidx.recyclerview.widget.RecyclerView
+
                         android:id="@+id/recyclerView"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content">
@@ -154,7 +162,6 @@
                 android:layout_height="wrap_content"
                 android:layout_alignParentLeft="true"
                 android:layout_centerVertical="true"
-                android:layout_toLeftOf="@+id/iv_next"
                 android:background="@drawable/rounded_30eeeff4"
                 android:orientation="horizontal"
                 android:padding="3dp">

+ 31 - 2
app/src/main/res/layout/player_activity.xml

@@ -8,9 +8,19 @@
             type="com.sjkj.appthreefloor_tsgz.activity.viewModel.PlayViewModel" />
     </data>
 
-    <RelativeLayout
+    <FrameLayout
+        android:orientation="vertical"
         android:layout_width="match_parent"
         android:layout_height="match_parent">
+        <androidx.appcompat.widget.Toolbar
+            android:visibility="gone"
+            android:id="@+id/toolbar"
+            android:layout_width="match_parent"
+            android:layout_height="?actionBarSize"
+            android:fitsSystemWindows="true"
+            android:gravity="center_horizontal">
+        </androidx.appcompat.widget.Toolbar>
+
 
         <RelativeLayout
             android:layout_width="match_parent"
@@ -20,6 +30,17 @@
                 android:id="@+id/player_view"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent" />
+            <!-- 加载中的圆环 -->
+            <ProgressBar
+                android:id="@+id/loading"
+                style="?android:attr/progressBarStyleLarge"
+                android:layout_width="48dp"
+                android:layout_height="48dp"
+                android:layout_centerHorizontal="true"
+                android:layout_centerVertical="true"
+                android:visibility="visible">
+
+            </ProgressBar>
 
             <Button
                 android:id="@+id/fullscreen_button"
@@ -30,5 +51,13 @@
                 android:text="全屏"
                 android:visibility="gone" />
         </RelativeLayout>
-    </RelativeLayout>
+        <ImageView
+            android:id="@+id/back"
+            android:layout_width="48dp"
+            android:layout_height="25dp"
+            android:layout_marginLeft="10dp"
+            android:layout_marginTop="10dp"
+            android:layout_centerVertical="true"
+            android:src="@drawable/icon_back2" />
+    </FrameLayout>
 </layout>

+ 2 - 4
app/src/main/res/menu/navigation_menu.xml

@@ -1,12 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto">
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
 
     <item
         android:id="@+id/tab1"
         android:icon="@drawable/bar_event"
-        android:title="事件"
-        app:floating="true"></item>
+        android:title="事件"></item>
     <item
         android:id="@+id/tab2"
         android:icon="@drawable/bar_home"

+ 0 - 1
app/src/main/res/values/styles.xml

@@ -226,7 +226,6 @@
         <item name="android:paddingRight">@dimen/gp_skip_paddingRight</item>
         <item name="android:paddingBottom">@dimen/gp_skip_paddingBottom</item>
         <item name="android:layout_marginLeft">@dimen/gp_skip_marginLeft</item>
-        <item name="android:layout_marginTop">@dimen/gp_skip_marginTop</item>
         <item name="android:layout_marginRight">@dimen/gp_skip_margiRight</item>
         <item name="android:layout_marginBottom">@dimen/gp_skip_marginBottom</item>
         <item name="android:textAppearance">@style/GuidePage.SkipTextAppearance</item>

+ 2 - 5
base-lib/src/main/java/com/sjkj/base_lib/utils/AppTools.java

@@ -12,9 +12,6 @@ import android.view.KeyEvent;
 
 import androidx.appcompat.app.AlertDialog;
 
-import com.hjq.permissions.OnPermissionCallback;
-import com.hjq.permissions.Permission;
-import com.hjq.permissions.XXPermissions;
 import com.orhanobut.logger.AndroidLogAdapter;
 import com.orhanobut.logger.Logger;
 import com.sjkj.base_lib.R;
@@ -479,12 +476,12 @@ public class AppTools {
 
     public static String getBaseUrl() {
       // return mmkv.decodeString("baseUrl", "http://192.168.4.82:8080/api/");
-        return mmkv.decodeString("baseUrl", "http://192.168.4.26:8080/api/");
+        return mmkv.decodeString("baseUrl", "http://36.137.48.33:5520/api/");
     }
 
     public static String getImageBaseUrl() {
         // return mmkv.decodeString("baseUrl", "http://192.168.4.82:8080/api/");
-        return mmkv.decodeString("ImagebaseUrl", "http://192.168.4.26");
+        return mmkv.decodeString("ImagebaseUrl", "http://36.137.48.33:5520");
     }
 //    public static final String GATEWAY_URL = "sooka-mobile";
 //    public static final String GATEWAY_URL_SYSTEM = "system";