删除无用代码
This commit is contained in:
parent
a2a5fdb3b4
commit
e7cdff8188
@ -23,25 +23,7 @@ class ChatActivity : BaseActivity() {
|
||||
private val chatPageViewModel: ChatPageViewModel by lazy {
|
||||
ViewModelProvider(this)[ChatPageViewModel::class.java]
|
||||
}
|
||||
private val launcher =
|
||||
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
|
||||
if (it.resultCode == Activity.RESULT_OK) {
|
||||
// Use the uri to load the image
|
||||
// val uri = it.data?.data!!
|
||||
// Use the file path to set image or upload
|
||||
// val filePath= it.data?.getStringExtra(Const.BundleExtras.FILE_PATH)
|
||||
//...
|
||||
|
||||
// for Multiple picks
|
||||
// first item
|
||||
// val first = it.data?.data!!
|
||||
// other items
|
||||
// val clipData = it.data?.clipData
|
||||
// Multiple file paths list
|
||||
// val filePaths = result.data?.getStringArrayListExtra(Const.BundleExtras.FILE_PATH_LIST)
|
||||
//...
|
||||
}
|
||||
}
|
||||
private val filePicker = FilePicker.getInstance(this)
|
||||
override fun bindView() {
|
||||
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_chat);
|
||||
@ -175,11 +157,3 @@ class ChatActivity : BaseActivity() {
|
||||
// }
|
||||
// }
|
||||
//})
|
||||
|
||||
//FilePicker.Builder(this)
|
||||
// .setPopUpConfig()
|
||||
// .addPickDocumentFile()
|
||||
// .addImageCapture()
|
||||
// .addVideoCapture()
|
||||
// .addPickMedia()
|
||||
// .build()
|
@ -1,5 +1,6 @@
|
||||
package com.tenlionsoft.aimz_k.page.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
@ -136,6 +137,7 @@ class MainActivity : BaseActivity() {
|
||||
unregisterReceiver(mLocalReceiver)
|
||||
}
|
||||
|
||||
@SuppressLint("UnspecifiedRegisterReceiverFlag")
|
||||
private fun registerLocalReceiver() {
|
||||
mLocalReceiver = MainBroadcastReceiver()
|
||||
val filter = IntentFilter()
|
||||
|
@ -13,16 +13,14 @@ import com.tenlionsoft.aimz_k.R
|
||||
|
||||
object BindingUtils {
|
||||
|
||||
@BindingAdapter("app:setAdapter")
|
||||
@BindingAdapter("setAdapter")
|
||||
@JvmStatic
|
||||
fun bindAdapterToRecyclerView(recyclerView: RecyclerView, adapter: Adapter<*>) {
|
||||
// adapter.setHasStableIds(true)
|
||||
// recyclerView.setHasFixedSize(true)
|
||||
recyclerView.layoutManager = LinearLayoutManager(recyclerView.context)
|
||||
recyclerView.adapter = adapter
|
||||
}
|
||||
|
||||
@BindingAdapter("app:imageUrl")
|
||||
@BindingAdapter("imageUrl")
|
||||
@JvmStatic
|
||||
fun bindImgUrl(imageView: ImageView, url: String?) {
|
||||
if (url.isNullOrEmpty()) {
|
||||
|
@ -27,7 +27,7 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_msgs"
|
||||
android:layout_width="match_parent"
|
||||
app:setAdapter="@{msgViewModel.adapter}"
|
||||
setAdapter="@{msgViewModel.adapter}"
|
||||
android:layout_height="match_parent"
|
||||
tools:listitem="@layout/item_category" />
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
@ -28,11 +27,11 @@
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<ImageView
|
||||
imageUrl="@{item.avatar}"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="fitXY"
|
||||
app:imageUrl="@{item.avatar}"
|
||||
tools:src="@drawable/app_logo_small" />
|
||||
|
||||
<ImageView
|
||||
|
@ -65,5 +65,5 @@ dependencies {
|
||||
api(libs.jjwt)
|
||||
api(libs.emojipicker)
|
||||
api(libs.xxpermissions)
|
||||
api(libs.filepicker2)
|
||||
api(libs.filepicker)
|
||||
}
|
@ -2,6 +2,7 @@ package com.tenlionsoft.baselib.utils
|
||||
|
||||
import android.content.Context
|
||||
import android.util.DisplayMetrics
|
||||
import android.util.TypedValue
|
||||
import android.view.WindowManager
|
||||
|
||||
|
||||
@ -25,9 +26,12 @@ class DensityUtils {
|
||||
* @return value of px
|
||||
*/
|
||||
@JvmStatic
|
||||
fun sp2px(context: Context,spValue: Float): Int {
|
||||
val fontScale: Float =context.resources.displayMetrics.scaledDensity
|
||||
return (spValue * fontScale + 0.5f).toInt()
|
||||
fun sp2px(context: Context, spValue: Float): Int {
|
||||
return TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_SP,
|
||||
spValue,
|
||||
context.resources.displayMetrics
|
||||
).toInt()
|
||||
}
|
||||
|
||||
|
||||
@ -38,9 +42,9 @@ class DensityUtils {
|
||||
* @return value of sp
|
||||
*/
|
||||
@JvmStatic
|
||||
fun px2sp(context: Context,pxValue: Float): Int {
|
||||
val fontScale: Float = context.resources.displayMetrics.scaledDensity
|
||||
return (pxValue / fontScale + 0.5f).toInt()
|
||||
fun px2sp(context: Context, pxValue: Float): Int {
|
||||
val scaledDensity = context.resources.displayMetrics.scaledDensity
|
||||
return (pxValue / scaledDensity).toInt()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
|
@ -35,7 +35,7 @@ smartRefreshLayout = "2.1.0"
|
||||
jjwt = "3.10.3"
|
||||
emoji2Emojipicker = "1.0.0-alpha03"
|
||||
xxpermissions = "20.0"
|
||||
filepicker2="2.0.0"
|
||||
filepicker="2.0.0"
|
||||
|
||||
|
||||
[libraries]
|
||||
@ -84,7 +84,8 @@ refreshMaterial = { group = "io.github.scwang90", name = "refresh-header-materia
|
||||
jjwt = { group = "com.auth0", name = "java-jwt", version.ref = "jjwt" }
|
||||
emojipicker = { group = "androidx.emoji2", name = "emoji2-emojipicker", version.ref = "emoji2Emojipicker" }
|
||||
xxpermissions = { group = "com.github.getActivity", name = "XXPermissions", version.ref = "xxpermissions" }
|
||||
filepicker2={group="com.github.atwa",name="filepicker",version.ref="filepicker2"}
|
||||
filepicker={group="com.github.atwa",name="filepicker",version.ref="filepicker"}
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||||
|
Loading…
Reference in New Issue
Block a user