Quellcode durchsuchen

add poc2.0显示版本号

lihao1 vor 3 Jahren
Ursprung
Commit
8087b8578e

+ 6 - 0
demo/src/main/java/com/sybotan/android/demo/activities/PocActivity.kt

@@ -7,6 +7,7 @@ import android.content.SharedPreferences
 import android.content.pm.PackageManager
 import android.os.Bundle
 import android.widget.Button
+import android.widget.TextView
 import androidx.constraintlayout.widget.ConstraintLayout
 import androidx.core.app.ActivityCompat
 import androidx.lifecycle.lifecycleScope
@@ -46,6 +47,8 @@ class PocActivity : BaseActivity(), DIAware {
 
     private lateinit var frontBtn: Button
 
+    private lateinit var version: TextView
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         setContentView(R.layout.activity_poc)
@@ -53,6 +56,7 @@ class PocActivity : BaseActivity(), DIAware {
         downloadBtn = findViewById(R.id.downloadBtn)
         uploadBtn = findViewById(R.id.uploadBtn)
         frontBtn = findViewById(R.id.frontBtn)
+        version = findViewById(R.id.version)
 
         downloadBtn.setOnClickListener {
             mVm.downloadBuilding(sp) {
@@ -107,6 +111,8 @@ class PocActivity : BaseActivity(), DIAware {
             startActivity<SceneActivity>()
         }
 
+        version.setText("版本号:${CommonUtils.getVersionName(this)}")
+
 //        mVm.requestBuilding(
 //            AdmRequest(
 //                userId = "bdtp",

+ 11 - 0
demo/src/main/res/layout/activity_poc.xml

@@ -116,6 +116,17 @@
         app:layout_constraintStart_toStartOf="@+id/downloadBtn"
         app:layout_constraintTop_toBottomOf="@+id/downloadBtn" />
 
+    <TextView
+        android:id="@+id/version"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="16dp"
+        android:text=""
+        android:textSize="12sp"
+        app:layout_constraintEnd_toEndOf="@+id/uploadBtn"
+        app:layout_constraintStart_toStartOf="@+id/uploadBtn"
+        app:layout_constraintTop_toBottomOf="@+id/uploadBtn" />
+
     <Button
         android:id="@+id/frontBtn"
         android:layout_width="wrap_content"

+ 2 - 2
gradle.properties

@@ -17,14 +17,14 @@ SAGA_SERVICE_VERSION=1.4.140
 MAVEN_REPO_RELEASE_URL=http\://dev.dp.sagacloud.cn\:8082/repository/maven-releases/
 EVENTBUS_VERSION=3.1.1
 EASYPERMISSIONS_VERSION=1.2.0
-SAGA_ANDROID_VERSION=1.2.49
+SAGA_ANDROID_VERSION=0.2.0
 JUNIT_VERSION=5.3.1
 KOTLIN_VERSION=1.5.31
 SAGA_GROUP=cn.sagacloud
 SYBOTAN_KOTLIN_VERSION=1.2.42
 android.useAndroidX=true
 LICENSE_NAME=The Apache Software License, Version 2.0
-SAGA_CODE=8
+SAGA_CODE=9
 MAVEN_REPO_SNAPSHOT_URL=http\://dev.dp.sagacloud.cn\:8082/repository/maven-snapshots/
 NEXUS_USERNAME=saga
 DEVELOPER_ID=Andy.Sybotan