优化
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12
.idea/caches/deviceStreaming.xml
generated
12
.idea/caches/deviceStreaming.xml
generated
@@ -75,6 +75,18 @@
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2400" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="OPPO" />
|
||||
<option name="codename" value="OP5759L1" />
|
||||
<option name="id" value="OP5759L1" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="OPPO" />
|
||||
<option name="name" value="A38" />
|
||||
<option name="screenDensity" value="320" />
|
||||
<option name="screenX" value="720" />
|
||||
<option name="screenY" value="1612" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="35" />
|
||||
<option name="brand" value="realme" />
|
||||
|
||||
7
.idea/deploymentTargetSelector.xml
generated
7
.idea/deploymentTargetSelector.xml
generated
@@ -4,6 +4,13 @@
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2026-08-05T02:01:17.427812300Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=D122222104A9" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />-->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />-->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />-->
|
||||
|
||||
@@ -305,12 +305,12 @@
|
||||
<!-- android:required="true" />-->
|
||||
|
||||
<!-- <!– 必要的蓝牙权限 –>-->
|
||||
<!-- <uses-permission android:name="android.permission.BLUETOOTH" />-->
|
||||
<!-- <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />-->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
|
||||
|
||||
<!-- <!– 从 Android 12 (API 31) 开始,需要新的蓝牙扫描/连接权限 –>-->
|
||||
<!-- <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />-->
|
||||
<!-- <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />-->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
<!-- <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />-->
|
||||
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ class CKApp : Application() {
|
||||
isUserLoggedIn = false
|
||||
PreferencesUtils.putString(this, Const.TOKEN, "")
|
||||
PreferencesUtils.putString(this, Const.USER_DATA, "")
|
||||
PreferencesUtils.putString(this, Const.PET_DATA, "")
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,11 @@ import pub.devrel.easypermissions.EasyPermissions.PermissionCallbacks
|
||||
class BlueToothActivity : CKBaseActivity() , PermissionCallbacks{
|
||||
|
||||
lateinit var activityBluetoothBinding: ActivityBluetoothBinding
|
||||
val permissions = listOf(Manifest.permission.BLUETOOTH,Manifest.permission.BLUETOOTH_ADMIN,Manifest.permission.BLUETOOTH_SCAN,Manifest.permission.BLUETOOTH_CONNECT)
|
||||
val permissions = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
listOf(Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT)
|
||||
} else {
|
||||
listOf(Manifest.permission.ACCESS_FINE_LOCATION)
|
||||
}
|
||||
|
||||
lateinit var blueBoothAdapter: BlueBoothAdapter
|
||||
var devices = mutableListOf<String>()
|
||||
@@ -185,7 +189,17 @@ class BlueToothActivity : CKBaseActivity() , PermissionCallbacks{
|
||||
requestCode: Int,
|
||||
perms: List<String?>
|
||||
) {
|
||||
val deniedPermissions = perms.filterNotNull().toTypedArray()
|
||||
val permanentlyDenied = deniedPermissions.any {
|
||||
!ActivityCompat.shouldShowRequestPermissionRationale(this, it)
|
||||
}
|
||||
if (permanentlyDenied) {
|
||||
super.onPermissionsDenied(requestCode, deniedPermissions, true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPermissionsGranted(requestCode: Int, permissions: Array<String>) {
|
||||
initData()
|
||||
}
|
||||
|
||||
class BlueBoothAdapter(var context: CKBaseActivity, var scanResults: List<String>) : RecyclerView.Adapter<BlueBoothAdapter.BlueBoothHolder>() {
|
||||
|
||||
@@ -143,7 +143,17 @@ class WifiListActivity : CKBaseActivity(), PermissionCallbacks {
|
||||
requestCode: Int,
|
||||
perms: List<String?>
|
||||
) {
|
||||
val deniedPermissions = perms.filterNotNull().toTypedArray()
|
||||
val permanentlyDenied = deniedPermissions.any {
|
||||
!ActivityCompat.shouldShowRequestPermissionRationale(this, it)
|
||||
}
|
||||
if (permanentlyDenied) {
|
||||
super.onPermissionsDenied(requestCode, deniedPermissions, true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPermissionsGranted(requestCode: Int, permissions: Array<String>) {
|
||||
initData()
|
||||
}
|
||||
|
||||
class WifiAdapter(var context: CKBaseActivity, var scanResults: List<ScanResult>) : RecyclerView.Adapter<WifiAdapter.WifiiewHoldr>() {
|
||||
|
||||
@@ -39,6 +39,8 @@ import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
|
||||
class BalanceActivity : CKLHBaseActionBarActivity() , View.OnClickListener{
|
||||
override val shouldRequestPermissionsOnCreate: Boolean = false
|
||||
|
||||
lateinit var binding: ActivityBalanceBinding
|
||||
var data = listOf<RecordModel>()
|
||||
lateinit var adapter: RecordAdapter
|
||||
@@ -116,9 +118,16 @@ class BalanceActivity : CKLHBaseActionBarActivity() , View.OnClickListener{
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
|
||||
getBalanceInfo()
|
||||
|
||||
getList()
|
||||
showProgeassDialog()
|
||||
var pendingRequests = 2
|
||||
val onRequestFinished = {
|
||||
pendingRequests--
|
||||
if (pendingRequests == 0) {
|
||||
hiddenProgeassDialog()
|
||||
}
|
||||
}
|
||||
getBalanceInfo(onRequestFinished)
|
||||
getList(onRequestFinished)
|
||||
}
|
||||
override fun getResult(data: DataCollection, resultCode: Int) {
|
||||
if (resultCode == 1001){
|
||||
@@ -127,22 +136,24 @@ class BalanceActivity : CKLHBaseActionBarActivity() , View.OnClickListener{
|
||||
getList()
|
||||
}
|
||||
}
|
||||
fun getBalanceInfo(){
|
||||
fun getBalanceInfo(onFinished: (() -> Unit)? = null){
|
||||
TTHttpClient.get(this,"余额", TTRequestParam(),object : ICallback{
|
||||
override fun onSuccess(data: String) {
|
||||
model = Gson().fromJson<BalanceModle>(data, BalanceModle::class.java)
|
||||
|
||||
binding.textBalance.text = model?.balance.toString()
|
||||
onFinished?.invoke()
|
||||
|
||||
}
|
||||
|
||||
override fun onFailed(code: String, msg: String) {
|
||||
onFinished?.invoke()
|
||||
toast(msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun getList(){
|
||||
fun getList(onFinished: (() -> Unit)? = null){
|
||||
TTHttpClient.get(this,"余额明细列表", TTRequestParam().apply { add(TTRequestData("type",type))
|
||||
add(TTRequestData("month",""))},object : ICallback{
|
||||
override fun onSuccess(data: String) {
|
||||
@@ -150,9 +161,11 @@ class BalanceActivity : CKLHBaseActionBarActivity() , View.OnClickListener{
|
||||
|
||||
adapter.data = this@BalanceActivity.data
|
||||
adapter.notifyDataSetChanged()
|
||||
onFinished?.invoke()
|
||||
}
|
||||
|
||||
override fun onFailed(code: String, msg: String) {
|
||||
onFinished?.invoke()
|
||||
toast(msg)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -60,7 +60,6 @@ import com.tt.kit.utils.TTLog
|
||||
import com.tt.kit.utils.TTUtils
|
||||
import java.io.File
|
||||
import java.util.UUID
|
||||
import kotlin.math.min
|
||||
|
||||
class CustomerActivity : CKBaseActivity() {
|
||||
|
||||
@@ -118,6 +117,10 @@ class CustomerActivity : CKBaseActivity() {
|
||||
binding.editMessage.setSingleLine(false)
|
||||
binding.editMessage.imeOptions = EditorInfo.IME_ACTION_NONE
|
||||
binding.editMessage.setRawInputType(android.text.InputType.TYPE_CLASS_TEXT or android.text.InputType.TYPE_TEXT_FLAG_MULTI_LINE)
|
||||
// setSingleLine(false) resets the XML maxLines value, so apply it last.
|
||||
binding.editMessage.maxLines = 4
|
||||
binding.editMessage.maxHeight = (70 * resources.displayMetrics.density).toInt()
|
||||
binding.editMessage.isVerticalScrollBarEnabled = true
|
||||
|
||||
binding.editMessage.setOnEditorActionListener(object : TextView.OnEditorActionListener {
|
||||
override fun onEditorAction(
|
||||
@@ -179,14 +182,6 @@ class CustomerActivity : CKBaseActivity() {
|
||||
) {
|
||||
if (p0?.toString()?.trim()?.isNotEmpty() == true) isSending = false
|
||||
updateSendControls()
|
||||
try {
|
||||
val lineCount: Int? = binding.editMessage.getLineCount()
|
||||
val lineHeight: Int = binding.editMessage.getLineHeight()
|
||||
val maxHeight: Int = lineCount!! * lineHeight
|
||||
binding.editMessage.setHeight(min(maxHeight, maxHeight))
|
||||
}catch (e : Exception){
|
||||
e.toString()
|
||||
}
|
||||
}
|
||||
})
|
||||
binding.btnMore.setOnClickListener {
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.ck.ckcollar.app.model.CustomerMessageModel
|
||||
import com.ck.ckcollar.app.model.UploadModel
|
||||
import com.ck.ckcollar.app.ui.base.CKBaseActivity
|
||||
import com.ck.ckcollar.app.utils.Const
|
||||
import com.ck.ckcollar.app.utils.LubanCompressUtil
|
||||
import com.ck.ckcollar.app.utils.networkone.ICallback
|
||||
import com.ck.ckcollar.app.utils.networkone.TTHttpClient
|
||||
import com.ck.ckcollar.app.utils.networkone.model.TTRequestData
|
||||
@@ -190,10 +191,7 @@ class MineCustomerActivity : CKBaseActivity() {
|
||||
} else {
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE
|
||||
}
|
||||
getPermissionRequst(
|
||||
permission,
|
||||
REQUEST_PHOTO_PERMISSION
|
||||
)
|
||||
getPermissionRequst(permission, REQUEST_PHOTO_PERMISSION)
|
||||
} else {
|
||||
toast(getString(R.string.only_one_photo))
|
||||
}
|
||||
@@ -452,17 +450,35 @@ class MineCustomerActivity : CKBaseActivity() {
|
||||
|
||||
if (requestCode == 55 && resultCode == RESULT_OK) {
|
||||
path = PreferencesUtils.getString(this@MineCustomerActivity, Const.IMAGE_PATH, "")!!
|
||||
|
||||
//addImage(path!!)
|
||||
uploadImage()
|
||||
compressAndUploadImage()
|
||||
} else if (requestCode == 56 && resultCode == RESULT_OK) {
|
||||
path = TTUtils.getImageUrl(this, data!!.getData());
|
||||
// addImage(path)
|
||||
uploadImage()
|
||||
compressAndUploadImage()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun compressAndUploadImage() {
|
||||
if (TextUtils.isEmpty(path)) return
|
||||
LubanCompressUtil.getCompressFile(
|
||||
this,
|
||||
File(path),
|
||||
object : LubanCompressUtil.CompressCallback {
|
||||
override fun success(file: File) {
|
||||
if (isFinishing || isDestroyed) return
|
||||
path = file.absolutePath
|
||||
uploadImage()
|
||||
}
|
||||
|
||||
override fun fail(failMsg: String) {
|
||||
if (isFinishing || isDestroyed) return
|
||||
path = ""
|
||||
toast(failMsg)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
|
||||
@@ -557,10 +573,11 @@ class MineCustomerActivity : CKBaseActivity() {
|
||||
holder.binding.textTo.visibility = View.GONE
|
||||
holder.binding.imageContentTo.visibility = View.VISIBLE
|
||||
|
||||
Glide.with(context)
|
||||
.load(ActionCode.BASE_URL + model.url)
|
||||
.placeholder(R.mipmap.image_default)
|
||||
.into(holder.binding.imageContentTo)
|
||||
ChatImageLoader.load(
|
||||
context,
|
||||
holder.binding.imageContentTo,
|
||||
ActionCode.BASE_URL + model.url
|
||||
)
|
||||
} else {
|
||||
holder.binding.textTo.visibility = View.VISIBLE
|
||||
holder.binding.imageContentTo.visibility = View.GONE
|
||||
|
||||
@@ -46,6 +46,7 @@ import com.ck.ckcollar.app.ui.base.CKBaseActivity
|
||||
import com.ck.ckcollar.app.ui.dialog.CKAlertDialog
|
||||
import com.ck.ckcollar.app.utils.CKUtils
|
||||
import com.ck.ckcollar.app.utils.Const
|
||||
import com.ck.ckcollar.app.utils.LubanCompressUtil
|
||||
import com.ck.ckcollar.app.utils.networkone.ICallback
|
||||
import com.ck.ckcollar.app.utils.networkone.TTHttpClient
|
||||
import com.ck.ckcollar.app.utils.networkone.model.TTRequestData
|
||||
@@ -228,10 +229,7 @@ class PeopleCustomerActivity : CKBaseActivity() {
|
||||
} else {
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE
|
||||
}
|
||||
getPermissionRequst(
|
||||
permission,
|
||||
REQUEST_PHOTO_PERMISSION
|
||||
)
|
||||
getPermissionRequst(permission, REQUEST_PHOTO_PERMISSION)
|
||||
} else {
|
||||
toast(getString(R.string.only_one_photo))
|
||||
}
|
||||
@@ -574,17 +572,35 @@ class PeopleCustomerActivity : CKBaseActivity() {
|
||||
|
||||
if (requestCode == 55 && resultCode == RESULT_OK) {
|
||||
path = PreferencesUtils.getString(this@PeopleCustomerActivity, Const.IMAGE_PATH, "")!!
|
||||
|
||||
//addImage(path!!)
|
||||
uploadImage()
|
||||
compressAndUploadImage()
|
||||
} else if (requestCode == 56 && resultCode == RESULT_OK) {
|
||||
path = TTUtils.getImageUrl(this, data!!.getData());
|
||||
//addImage(path)
|
||||
uploadImage()
|
||||
compressAndUploadImage()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun compressAndUploadImage() {
|
||||
if (TextUtils.isEmpty(path)) return
|
||||
LubanCompressUtil.getCompressFile(
|
||||
this,
|
||||
File(path),
|
||||
object : LubanCompressUtil.CompressCallback {
|
||||
override fun success(file: File) {
|
||||
if (isFinishing || isDestroyed) return
|
||||
path = file.absolutePath
|
||||
uploadImage()
|
||||
}
|
||||
|
||||
override fun fail(failMsg: String) {
|
||||
if (isFinishing || isDestroyed) return
|
||||
path = ""
|
||||
toast(failMsg)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
|
||||
@@ -695,10 +711,7 @@ class PeopleCustomerActivity : CKBaseActivity() {
|
||||
holder.binding.textTo.visibility = View.GONE
|
||||
holder.binding.imageContentTo.visibility = View.VISIBLE
|
||||
|
||||
Glide.with(context)
|
||||
.load( model.url)
|
||||
.placeholder(R.mipmap.image_default)
|
||||
.into(holder.binding.imageContentTo)
|
||||
ChatImageLoader.load(context, holder.binding.imageContentTo, model.url!!)
|
||||
|
||||
holder.binding.imageContentTo.setTag(model.url)
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ck.ckcollar.app.ui.act.customer
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
@@ -36,6 +37,7 @@ import com.ck.ckcollar.app.model.CustomerMessageModel
|
||||
import com.ck.ckcollar.app.model.UploadModel
|
||||
import com.ck.ckcollar.app.ui.base.CKBaseActivity
|
||||
import com.ck.ckcollar.app.utils.Const
|
||||
import com.ck.ckcollar.app.utils.LubanCompressUtil
|
||||
import com.ck.ckcollar.app.utils.networkone.ICallback
|
||||
import com.ck.ckcollar.app.utils.networkone.TTHttpClient
|
||||
import com.ck.ckcollar.app.utils.networkone.model.TTRequestData
|
||||
@@ -58,6 +60,8 @@ import java.util.concurrent.TimeUnit
|
||||
|
||||
class ShopCustomerActivity : CKBaseActivity() {
|
||||
|
||||
private val requestPhotoPermission = 1402
|
||||
|
||||
lateinit var binding: ActivityCustomerBinding
|
||||
lateinit var customerMessageAdapter: CustomerMessageAdapter
|
||||
var data = mutableListOf<CustomerMessageModel.MessageItemModel>()
|
||||
@@ -181,11 +185,12 @@ class ShopCustomerActivity : CKBaseActivity() {
|
||||
binding.conetnt2.setOnClickListener {
|
||||
if (TextUtils.isEmpty(path)) {
|
||||
//相册
|
||||
val i = Intent(
|
||||
Intent.ACTION_PICK,
|
||||
MediaStore.Images.Media.EXTERNAL_CONTENT_URI
|
||||
)
|
||||
startActivityForResult(i, 56)
|
||||
val permission = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
Manifest.permission.READ_MEDIA_IMAGES
|
||||
} else {
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE
|
||||
}
|
||||
getPermissionRequst(permission, requestPhotoPermission)
|
||||
} else {
|
||||
toast(getString(R.string.only_one_photo))
|
||||
}
|
||||
@@ -194,6 +199,22 @@ class ShopCustomerActivity : CKBaseActivity() {
|
||||
|
||||
}
|
||||
|
||||
override fun onPermissionsGranted(requestCode: Int, permissions: Array<String>) {
|
||||
if (requestCode == requestPhotoPermission) {
|
||||
openPhotoAlbum()
|
||||
}
|
||||
}
|
||||
|
||||
private fun openPhotoAlbum() {
|
||||
val intent = Intent(
|
||||
Intent.ACTION_PICK,
|
||||
MediaStore.Images.Media.EXTERNAL_CONTENT_URI
|
||||
).apply {
|
||||
setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*")
|
||||
}
|
||||
startActivityForResult(intent, 56)
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
|
||||
//getList()
|
||||
@@ -441,17 +462,35 @@ class ShopCustomerActivity : CKBaseActivity() {
|
||||
|
||||
if (requestCode == 55 && resultCode == RESULT_OK) {
|
||||
path = PreferencesUtils.getString(this@ShopCustomerActivity, Const.IMAGE_PATH, "")!!
|
||||
|
||||
//addImage(path!!)
|
||||
uploadImage()
|
||||
compressAndUploadImage()
|
||||
} else if (requestCode == 56 && resultCode == RESULT_OK) {
|
||||
path = TTUtils.getImageUrl(this, data!!.getData());
|
||||
//addImage(path)
|
||||
uploadImage()
|
||||
compressAndUploadImage()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun compressAndUploadImage() {
|
||||
if (TextUtils.isEmpty(path)) return
|
||||
LubanCompressUtil.getCompressFile(
|
||||
this,
|
||||
File(path),
|
||||
object : LubanCompressUtil.CompressCallback {
|
||||
override fun success(file: File) {
|
||||
if (isFinishing || isDestroyed) return
|
||||
path = file.absolutePath
|
||||
uploadImage()
|
||||
}
|
||||
|
||||
override fun fail(failMsg: String) {
|
||||
if (isFinishing || isDestroyed) return
|
||||
path = ""
|
||||
toast(failMsg)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
|
||||
@@ -541,10 +580,7 @@ class ShopCustomerActivity : CKBaseActivity() {
|
||||
holder.binding.textTo.visibility = View.GONE
|
||||
holder.binding.imageContentTo.visibility = View.VISIBLE
|
||||
|
||||
Glide.with(context)
|
||||
.load( model.url)
|
||||
.placeholder(R.mipmap.image_default)
|
||||
.into(holder.binding.imageContentTo)
|
||||
ChatImageLoader.load(context, holder.binding.imageContentTo, model.url!!)
|
||||
} else {
|
||||
holder.binding.textTo.visibility = View.VISIBLE
|
||||
holder.binding.imageContentTo.visibility = View.GONE
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ck.ckcollar.app.ui.act.home
|
||||
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
@@ -116,6 +117,22 @@ class MainActivity : CKLHBaseActivity(),View.OnClickListener {
|
||||
|
||||
mainBinding.viewPager.setPagingEnabled(false)
|
||||
|
||||
if (intent.getBooleanExtra(EXTRA_SHOW_HOME, false)) {
|
||||
showHomeTab()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
setIntent(intent)
|
||||
if (intent.getBooleanExtra(EXTRA_SHOW_HOME, false)) {
|
||||
showHomeTab()
|
||||
}
|
||||
}
|
||||
|
||||
private fun showHomeTab() {
|
||||
mainBinding.content1.performClick()
|
||||
}
|
||||
|
||||
fun resetItemIcon() {
|
||||
@@ -210,6 +227,7 @@ class MainActivity : CKLHBaseActivity(),View.OnClickListener {
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val EXTRA_SHOW_HOME = "extra_show_home"
|
||||
private const val EXIT_INTERVAL_MS = 2_000L
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ class HealthFragment: CKBaseFragment() {
|
||||
toActivity(CustomerActivity::class.java, DataCollection())
|
||||
}
|
||||
binding.contentCustomer.setOnClickListener {
|
||||
if (!requireLogin()) return@setOnClickListener
|
||||
checkCustomerStatus()
|
||||
}
|
||||
binding.refreshLayout.setEnableLoadMore(false)
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.Environment
|
||||
import android.provider.MediaStore
|
||||
import android.provider.Settings
|
||||
import android.text.TextUtils
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
@@ -22,6 +23,7 @@ import android.widget.PopupWindow
|
||||
import android.widget.TextView
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.content.FileProvider
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@@ -80,18 +82,30 @@ class HomeFragment : CKBaseFragment() {
|
||||
|
||||
private var pendingCameraAction: CameraAction? = null
|
||||
private var permissionTopDialog: AlertDialog? = null
|
||||
private val cameraSettingsLauncher = registerForActivityResult(
|
||||
ActivityResultContracts.StartActivityForResult()
|
||||
) {
|
||||
val action = pendingCameraAction
|
||||
pendingCameraAction = null
|
||||
if (checkCameraPermissions()) {
|
||||
performCameraAction(action)
|
||||
}
|
||||
}
|
||||
private val cameraPermissionLauncher = registerForActivityResult(
|
||||
ActivityResultContracts.RequestPermission()
|
||||
) { granted ->
|
||||
hideCameraPermissionTopDialog()
|
||||
val action = pendingCameraAction
|
||||
pendingCameraAction = null
|
||||
if (granted) {
|
||||
when (action) {
|
||||
CameraAction.SCAN -> startScan()
|
||||
CameraAction.TAKE_PHOTO -> takePhoto()
|
||||
null -> Unit
|
||||
}
|
||||
pendingCameraAction = null
|
||||
performCameraAction(action)
|
||||
} else if (!ActivityCompat.shouldShowRequestPermissionRationale(
|
||||
requireActivity(),
|
||||
Manifest.permission.CAMERA
|
||||
)) {
|
||||
showCameraSettingsDialog()
|
||||
} else {
|
||||
pendingCameraAction = null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,6 +117,8 @@ class HomeFragment : CKBaseFragment() {
|
||||
var dataModel: CollarTypeModel.TypeDataModel? = null
|
||||
var homeModel: HomeModel? = null
|
||||
var isFirstShow = false
|
||||
private var waitingForLoginResult = false
|
||||
private var loadedLoginToken: String? = null
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
@@ -128,7 +144,8 @@ class HomeFragment : CKBaseFragment() {
|
||||
|
||||
homeBinding.textName?.setOnClickListener {
|
||||
if (!requireLogin()) return@setOnClickListener
|
||||
getPetList()
|
||||
if (collarDatas.size <= 1) return@setOnClickListener
|
||||
showPetSelector()
|
||||
}
|
||||
//扫一扫
|
||||
homeBinding.btnScan?.setOnClickListener {
|
||||
@@ -206,6 +223,10 @@ class HomeFragment : CKBaseFragment() {
|
||||
}
|
||||
homeBinding.btnViewPostion?.setOnClickListener {
|
||||
if (!requireLogin()) return@setOnClickListener
|
||||
if(homeModel?.equipment?.collNum == null){
|
||||
toast("请为您的爱宠绑定项圈")
|
||||
return@setOnClickListener
|
||||
}
|
||||
getData(dataModel?.id.toString())
|
||||
|
||||
// toActivity(MapLocationActivity::class.java, DataCollection().apply {
|
||||
@@ -242,10 +263,18 @@ class HomeFragment : CKBaseFragment() {
|
||||
homeBinding.btnTraining?.setOnClickListener {
|
||||
toast(getString(R.string.waitting_open_area))
|
||||
}
|
||||
|
||||
LiveDataBus.get().with("FIRST", Int::class.java)
|
||||
.observe(viewLifecycleOwner, object : Observer<Int?> {
|
||||
override fun onChanged(result: Int?) {
|
||||
if (CKApp.app.isUserLoggedIn) getPetList2()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun requireLogin(): Boolean {
|
||||
if (CKApp.app.isUserLoggedIn) return true
|
||||
waitingForLoginResult = true
|
||||
toActivity(LoginActivity::class.java, DataCollection())
|
||||
return false
|
||||
}
|
||||
@@ -297,12 +326,12 @@ class HomeFragment : CKBaseFragment() {
|
||||
override fun initData() {
|
||||
|
||||
if (!CKApp.app.isUserLoggedIn) {
|
||||
setBannerData(listOf(BannarModel().apply {
|
||||
localImageRes = R.mipmap.index_banner1
|
||||
}))
|
||||
resetLoggedOutState()
|
||||
return
|
||||
}
|
||||
|
||||
loadedLoginToken = CKApp.app.token
|
||||
|
||||
var data = PreferencesUtils.getString(activity!!, Const.PET_DATA, "")
|
||||
|
||||
if (!TextUtils.isEmpty(data)) {
|
||||
@@ -322,18 +351,9 @@ class HomeFragment : CKBaseFragment() {
|
||||
}
|
||||
|
||||
|
||||
if (isFirstShow) {
|
||||
getPetList()
|
||||
}
|
||||
getPetList()
|
||||
|
||||
|
||||
LiveDataBus.get().with("FIRST", Int::class.java)
|
||||
.observe(viewLifecycleOwner, object : Observer<Int?> {
|
||||
override fun onChanged(result: Int?) {
|
||||
if (CKApp.app.isUserLoggedIn) getPetList2()
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
fun takePhoto() {
|
||||
@@ -380,6 +400,7 @@ class HomeFragment : CKBaseFragment() {
|
||||
add(TTRequestData("patId", id))
|
||||
}, object : ICallback {
|
||||
override fun onSuccess(data: String) {
|
||||
if (!CKApp.app.isUserLoggedIn) return
|
||||
homeModel = Gson().fromJson<HomeModel>(data, HomeModel::class.java)
|
||||
|
||||
setBannerData(homeModel?.banners.orEmpty())
|
||||
@@ -391,9 +412,9 @@ class HomeFragment : CKBaseFragment() {
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
TTHttpClient.get(activity as TTBaseActivity, "设备信息", TTRequestParam().apply { add(TTRequestData("patId",id)) },object : ICallback{
|
||||
override fun onSuccess(data: String) {
|
||||
if (!CKApp.app.isUserLoggedIn) return
|
||||
var model = Gson().fromJson<HomeModel.EquipmentModel>(data, HomeModel.EquipmentModel::class.java)
|
||||
|
||||
homeModel?.equipment = model
|
||||
@@ -487,6 +508,35 @@ class HomeFragment : CKBaseFragment() {
|
||||
})
|
||||
}
|
||||
|
||||
private fun performCameraAction(action: CameraAction?) {
|
||||
when (action) {
|
||||
CameraAction.SCAN -> startScan()
|
||||
CameraAction.TAKE_PHOTO -> takePhoto()
|
||||
null -> Unit
|
||||
}
|
||||
}
|
||||
|
||||
private fun showCameraSettingsDialog() {
|
||||
CKAlertDialog(
|
||||
requireActivity(),
|
||||
getString(R.string.settting_permissions),
|
||||
getString(R.string.camera_permission_settings_alert),
|
||||
object : CKAlertDialog.AlertClickListener {
|
||||
override fun onBack(isConfirm: Boolean) {
|
||||
if (isConfirm) {
|
||||
val intent = Intent(
|
||||
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
|
||||
Uri.parse("package:${requireContext().packageName}")
|
||||
)
|
||||
cameraSettingsLauncher.launch(intent)
|
||||
} else {
|
||||
pendingCameraAction = null
|
||||
}
|
||||
}
|
||||
}
|
||||
).show()
|
||||
}
|
||||
|
||||
private fun setBannerData(data: List<BannarModel>) {
|
||||
bannarData = data
|
||||
imageAdapter = ImageAdapter(activity!!, bannarData, object : OnItemClickListenner {
|
||||
@@ -634,43 +684,31 @@ class HomeFragment : CKBaseFragment() {
|
||||
override fun onSuccess(data: String) {
|
||||
|
||||
hiddenProgeassDialog()
|
||||
if (!CKApp.app.isUserLoggedIn) return
|
||||
var model = Gson().fromJson<CollarTypeModel>(data, CollarTypeModel::class.java)
|
||||
collarDatas = model.rows
|
||||
|
||||
if (!isFirstShow) {
|
||||
collarDatas = model.rows
|
||||
|
||||
homeBinding.btnRotate?.rotateDownward()
|
||||
CKCollarTypePopView(
|
||||
activity!!,
|
||||
homeBinding.textName!!,
|
||||
collarDatas,
|
||||
object : PopupWindow.OnDismissListener {
|
||||
override fun onDismiss() {
|
||||
homeBinding.btnRotate?.rotateUpwards()
|
||||
}
|
||||
}).show(object : CKCollarTypePopView.OnItemDataClickListenner {
|
||||
override fun onClick(
|
||||
pos: Int,
|
||||
model: CollarTypeModel.TypeDataModel
|
||||
) {
|
||||
dataModel = model
|
||||
homeBinding.textName?.setText(model.patName)
|
||||
|
||||
switchPet()
|
||||
dataModel?.let {
|
||||
PreferencesUtils.putString(
|
||||
activity!!,
|
||||
Const.PET_DATA,
|
||||
Gson().toJson(dataModel)
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (model.rows.isEmpty()) {
|
||||
isFirstShow = false
|
||||
if (model.rows.size > 0) {
|
||||
dataModel = model.rows.get(0)
|
||||
homeBinding.textName?.setText(dataModel?.patName)
|
||||
dataModel = null
|
||||
homeBinding.textName?.text = getString(R.string.choost_pet)
|
||||
PreferencesUtils.putString(activity!!, Const.PET_DATA, "")
|
||||
return
|
||||
}
|
||||
|
||||
if (isFirstShow) {
|
||||
isFirstShow = false
|
||||
dataModel = model.rows.first()
|
||||
homeBinding.textName?.text = dataModel?.patName
|
||||
switchPet()
|
||||
} else {
|
||||
val currentPet = model.rows.firstOrNull { it.id == dataModel?.id }
|
||||
if (currentPet != null) {
|
||||
dataModel = currentPet
|
||||
homeBinding.textName?.text = currentPet.patName
|
||||
} else if (model.rows.isNotEmpty()) {
|
||||
dataModel = model.rows.first()
|
||||
homeBinding.textName?.text = dataModel?.patName
|
||||
switchPet()
|
||||
}
|
||||
}
|
||||
@@ -684,6 +722,33 @@ class HomeFragment : CKBaseFragment() {
|
||||
})
|
||||
}
|
||||
|
||||
private fun showPetSelector() {
|
||||
homeBinding.btnRotate?.rotateDownward()
|
||||
CKCollarTypePopView(
|
||||
activity!!,
|
||||
homeBinding.textName!!,
|
||||
collarDatas,
|
||||
object : PopupWindow.OnDismissListener {
|
||||
override fun onDismiss() {
|
||||
homeBinding.btnRotate?.rotateUpwards()
|
||||
}
|
||||
}).show(object : CKCollarTypePopView.OnItemDataClickListenner {
|
||||
override fun onClick(
|
||||
pos: Int,
|
||||
model: CollarTypeModel.TypeDataModel
|
||||
) {
|
||||
dataModel = model
|
||||
homeBinding.textName?.text = model.patName
|
||||
switchPet()
|
||||
PreferencesUtils.putString(
|
||||
activity!!,
|
||||
Const.PET_DATA,
|
||||
Gson().toJson(dataModel)
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun getPetList2() {
|
||||
if (!CKApp.app.isUserLoggedIn) return
|
||||
@@ -699,6 +764,7 @@ class HomeFragment : CKBaseFragment() {
|
||||
override fun onSuccess(data: String) {
|
||||
|
||||
hiddenProgeassDialog()
|
||||
if (!CKApp.app.isUserLoggedIn) return
|
||||
var model = Gson().fromJson<CollarTypeModel>(data, CollarTypeModel::class.java)
|
||||
|
||||
if (model.rows.size == 1) {
|
||||
@@ -735,6 +801,10 @@ class HomeFragment : CKBaseFragment() {
|
||||
showProgeassDialog(getString(R.string.see))
|
||||
TTHttpClient.postFile(activity as TTBaseActivity, "上传照片s", param, object : ICallback {
|
||||
override fun onSuccess(data: String) {
|
||||
if (!CKApp.app.isUserLoggedIn) {
|
||||
hiddenProgeassDialog()
|
||||
return
|
||||
}
|
||||
var model = Gson().fromJson<UploadModel>(data, UploadModel::class.java)
|
||||
|
||||
//aiPhoto(ActionCode.BASE_URL + "/" + model.fileNames)
|
||||
@@ -756,6 +826,7 @@ class HomeFragment : CKBaseFragment() {
|
||||
}, object : ICallback {
|
||||
override fun onSuccess(data: String) {
|
||||
hiddenProgeassDialog()
|
||||
if (!CKApp.app.isUserLoggedIn) return
|
||||
|
||||
var model = Gson().fromJson<AIPhotoModel>(data, AIPhotoModel::class.java)
|
||||
if ("狗".equals(model.species) || "猫".equals(model.species)) {
|
||||
@@ -813,11 +884,54 @@ class HomeFragment : CKBaseFragment() {
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
homeBinding.banner.start();
|
||||
if (!CKApp.app.isUserLoggedIn) {
|
||||
waitingForLoginResult = false
|
||||
resetLoggedOutState()
|
||||
return
|
||||
}
|
||||
if (waitingForLoginResult) {
|
||||
waitingForLoginResult = false
|
||||
if (CKApp.app.isUserLoggedIn) {
|
||||
getPetList()
|
||||
}
|
||||
}
|
||||
dataModel?.let {
|
||||
getData(dataModel!!.id.toString())
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (CKApp.app.isUserLoggedIn && loadedLoginToken != CKApp.app.token) {
|
||||
initData()
|
||||
}
|
||||
}
|
||||
|
||||
private fun resetLoggedOutState() {
|
||||
loadedLoginToken = null
|
||||
collarDatas = emptyList()
|
||||
bannarData = emptyList()
|
||||
dataModel = null
|
||||
homeModel = null
|
||||
isFirstShow = false
|
||||
|
||||
homeBinding.textName?.text = getString(R.string.choost_pet)
|
||||
homeBinding.btnBound?.text = getString(R.string.unbound)
|
||||
homeBinding.textHealthPoints?.text = "--"
|
||||
homeBinding.points?.visibility = View.GONE
|
||||
homeBinding.textStep?.text = "-"
|
||||
homeBinding.textAddress?.text = getString(R.string.no_position)
|
||||
homeBinding.textDistance?.text = "-"
|
||||
homeBinding.textPowerValue?.text = "%"
|
||||
homeBinding.imagePower?.setImageResource(R.mipmap.image_power_0)
|
||||
homeBinding.contentPower?.visibility = View.GONE
|
||||
setNoDeviceUI()
|
||||
setBannerData(listOf(BannarModel().apply {
|
||||
localImageRes = R.mipmap.index_banner1
|
||||
}))
|
||||
homeBinding.refreshLayout?.finishRefresh()
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
homeBinding.banner.stop();
|
||||
|
||||
@@ -69,6 +69,7 @@ class MineFragment : CKBaseFragment() {
|
||||
}
|
||||
|
||||
binding.btnMessage.setOnClickListener {
|
||||
if (!requireLogin()) return@setOnClickListener
|
||||
toActivity(MessageCenterActivity::class.java, DataCollection())
|
||||
}
|
||||
|
||||
@@ -135,13 +136,14 @@ class MineFragment : CKBaseFragment() {
|
||||
override fun initData() {
|
||||
|
||||
if (!CKApp.app.isUserLoggedIn) {
|
||||
renderLoggedOutState()
|
||||
binding.textNick.text = getString(R.string.guest)
|
||||
binding.textPhone.text = ""
|
||||
binding.textPhone.visibility = View.GONE
|
||||
binding.textPhone.text = "用户未登录"
|
||||
binding.textPhone.visibility = View.VISIBLE
|
||||
binding.textBalance.text = "0"
|
||||
binding.textPoints.text = "0"
|
||||
binding.textCount.visibility = View.INVISIBLE
|
||||
binding.imageUser.setImageResource(R.mipmap.image_user_default)
|
||||
binding.imageUser.setImageResource(R.mipmap.icon_unlogin_defaul)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -152,7 +154,7 @@ class MineFragment : CKBaseFragment() {
|
||||
if (!TextUtils.isEmpty(CKApp.app.userInfo?.avatar)){
|
||||
Glide.with(this@MineFragment)
|
||||
.load( CKApp.app.userInfo?.avatar)
|
||||
.placeholder(R.mipmap.image_user_default)
|
||||
.placeholder(R.mipmap.icon_unlogin_defaul)
|
||||
.into(binding.imageUser)
|
||||
}
|
||||
|
||||
@@ -168,6 +170,7 @@ class MineFragment : CKBaseFragment() {
|
||||
}else{
|
||||
binding.btnOpen.setText(getString(R.string.open_member))
|
||||
binding.textMemberTitle.text = getString(R.string.pet_member)
|
||||
binding.textMemberDate.text = getString(R.string.pet_member_rewards)
|
||||
}
|
||||
|
||||
|
||||
@@ -180,9 +183,28 @@ class MineFragment : CKBaseFragment() {
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
getUserInfo()
|
||||
initData()
|
||||
if (CKApp.app.isUserLoggedIn) {
|
||||
getUserInfo()
|
||||
}
|
||||
}
|
||||
fun getUserInfo(){
|
||||
|
||||
private fun renderLoggedOutState() {
|
||||
binding.textNick.text = getString(R.string.guest)
|
||||
binding.textPhone.text = getString(R.string.user_not_logged_in)
|
||||
binding.textPhone.visibility = View.VISIBLE
|
||||
binding.textBalance.text = "0"
|
||||
binding.textPoints.text = "0"
|
||||
binding.textCount.text = "0"
|
||||
binding.textCount.visibility = View.INVISIBLE
|
||||
binding.btnOpen.text = getString(R.string.open_member)
|
||||
binding.textMemberTitle.text = getString(R.string.pet_member)
|
||||
binding.textMemberDate.text = getString(R.string.pet_member_rewards)
|
||||
Glide.with(this).clear(binding.imageUser)
|
||||
binding.imageUser.setImageResource(R.mipmap.icon_unlogin_defaul)
|
||||
}
|
||||
|
||||
private fun getUserInfo(){
|
||||
if (!CKApp.app.isUserLoggedIn) {
|
||||
binding.textCount.visibility = View.INVISIBLE
|
||||
return
|
||||
@@ -190,6 +212,7 @@ class MineFragment : CKBaseFragment() {
|
||||
|
||||
TTHttpClient.get(activity as TTBaseActivity,"个人资料", TTRequestParam(),object : ICallback{
|
||||
override fun onSuccess(data: String) {
|
||||
if (!CKApp.app.isUserLoggedIn) return
|
||||
CKApp.app.userInfo = Gson().fromJson<UserInfoModel>(data, UserInfoModel::class.java)
|
||||
PreferencesUtils.putString(activity!!, Const.USER_DATA,data)
|
||||
|
||||
@@ -206,6 +229,7 @@ class MineFragment : CKBaseFragment() {
|
||||
add(TTRequestData("accept","true"))
|
||||
},object : ICallback{
|
||||
override fun onSuccess(data: String) {
|
||||
if (!CKApp.app.isUserLoggedIn) return
|
||||
var model = Gson().fromJson<UnReadModel>(data, UnReadModel::class.java)
|
||||
|
||||
binding.textCount.text = model.unreadCount.toString()
|
||||
|
||||
@@ -135,10 +135,12 @@ class ShopFragment : CKBaseFragment() {
|
||||
}
|
||||
|
||||
binding.btnShopCar.setOnClickListener {
|
||||
if (!isUserLogin()) return@setOnClickListener
|
||||
toActivity(ShopCarActivity::class.java, DataCollection())
|
||||
}
|
||||
|
||||
binding.btnShopOrder.setOnClickListener {
|
||||
if (!isUserLogin()) return@setOnClickListener
|
||||
toActivity(MyOrderActivity::class.java, DataCollection().apply { add(Data("pos","0")) })
|
||||
}
|
||||
|
||||
@@ -155,7 +157,7 @@ class ShopFragment : CKBaseFragment() {
|
||||
getHot()
|
||||
page = 1
|
||||
getData()
|
||||
getBannar()
|
||||
// getBannar()
|
||||
}
|
||||
|
||||
override fun onLoadMore(refreshLayout: RefreshLayout) {
|
||||
|
||||
@@ -283,9 +283,12 @@ class LoginActivity : CKBaseActivity() {
|
||||
CKApp.app.userInfo = Gson().fromJson<UserInfoModel>(data, UserInfoModel::class.java)
|
||||
PreferencesUtils.putString(this@LoginActivity, Const.USER_DATA,data)
|
||||
|
||||
toActivity(MainActivity::class.java, DataCollection())
|
||||
|
||||
|
||||
startActivity(
|
||||
Intent(this@LoginActivity, MainActivity::class.java).apply {
|
||||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||
putExtra(MainActivity.EXTRA_SHOW_HOME, true)
|
||||
}
|
||||
)
|
||||
finish()
|
||||
}
|
||||
|
||||
|
||||
@@ -8,45 +8,42 @@ import android.widget.ImageButton
|
||||
import com.ck.ckcollar.app.CKApp
|
||||
import com.ck.ckcollar.app.R
|
||||
import com.ck.ckcollar.app.databinding.ActivityMemberBinding
|
||||
import com.ck.ckcollar.app.model.MemberModel
|
||||
import com.ck.ckcollar.app.model.MemberPriceModel
|
||||
import com.ck.ckcollar.app.model.PointsModel
|
||||
import com.ck.ckcollar.app.model.RecordModel
|
||||
import com.ck.ckcollar.app.model.UserInfoModel
|
||||
import com.ck.ckcollar.app.ui.base.CKBaseActivity
|
||||
import com.ck.ckcollar.app.utils.CKUtils
|
||||
import com.ck.ckcollar.app.utils.Const
|
||||
import com.ck.ckcollar.app.utils.MemberPriceCache
|
||||
import com.ck.ckcollar.app.utils.networkone.ICallback
|
||||
import com.ck.ckcollar.app.utils.networkone.TTHttpClient
|
||||
import com.ck.ckcollar.app.utils.networkone.model.TTRequestParam
|
||||
import com.cyclone.shadowsocks.utils.PreferencesUtils
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.gyf.immersionbar.ImmersionBar
|
||||
import com.tt.kit.base.TTBaseActivity
|
||||
import com.tt.kit.model.DataCollection
|
||||
|
||||
class MemberActivity : CKBaseActivity() {
|
||||
|
||||
override val useDarkStatusBarIcons: Boolean = false
|
||||
|
||||
lateinit var binding: ActivityMemberBinding
|
||||
private var priceRequestInFlight = false
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
binding = ActivityMemberBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
// ImmersionBar.with(this)
|
||||
// .statusBarDarkFont(true)
|
||||
// .init()
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
|
||||
setActionBarColor(resources.getColor(R.color.color_252132))
|
||||
setStatusBarColor2(resources.getColor(R.color.color_252132))
|
||||
|
||||
findViewById<ImageButton>(R.id.btnLeft).imageTintList = ColorStateList.valueOf(Color.WHITE)
|
||||
findViewById<ImageButton>(R.id.btnLeft).imageTintList =
|
||||
ColorStateList.valueOf(Color.WHITE)
|
||||
setTitleTextColor(resources.getColor(R.color.white))
|
||||
|
||||
setTitleText(getString(R.string.member))
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
|
||||
binding.btnOpen.setOnClickListener {
|
||||
toActivity(OpenMemberActivity::class.java, DataCollection())
|
||||
}
|
||||
@@ -56,8 +53,7 @@ class MemberActivity : CKBaseActivity() {
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
|
||||
|
||||
renderMemberInfo(CKApp.app.userInfo)
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
@@ -65,45 +61,78 @@ class MemberActivity : CKBaseActivity() {
|
||||
getMemberInfo()
|
||||
}
|
||||
|
||||
fun getInfo() {
|
||||
TTHttpClient.get(this, "会员套餐列表", TTRequestParam(), object : ICallback {
|
||||
override fun onSuccess(data: String) {
|
||||
var model = Gson().fromJson<List<MemberPriceModel>>(data, object : TypeToken<List<MemberPriceModel>>(){}.type)
|
||||
private fun loadMemberPrice() {
|
||||
val cachedPrice = MemberPriceCache.getPrice(this)
|
||||
if (cachedPrice != null) {
|
||||
showMemberPrice(cachedPrice)
|
||||
}
|
||||
|
||||
if (model.size > 0){
|
||||
binding.textMoney.text = model.get(0).actualPrice.toString()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onFailed(code: String, msg: String) {
|
||||
toast(msg)
|
||||
}
|
||||
})
|
||||
if (cachedPrice == null || MemberPriceCache.isExpired(this)) {
|
||||
getInfo(cachedPrice != null)
|
||||
}
|
||||
}
|
||||
|
||||
fun getMemberInfo(){
|
||||
TTHttpClient.get(this,"个人资料", TTRequestParam(),object : ICallback{
|
||||
private fun getInfo(hasCachedPrice: Boolean) {
|
||||
if (priceRequestInFlight) return
|
||||
priceRequestInFlight = true
|
||||
TTHttpClient.get(this, "会员套餐列表", TTRequestParam(), object : ICallback {
|
||||
override fun onSuccess(data: String) {
|
||||
var model = Gson().fromJson<UserInfoModel>(data, UserInfoModel::class.java)
|
||||
priceRequestInFlight = false
|
||||
val model = Gson().fromJson<List<MemberPriceModel>>(
|
||||
data,
|
||||
object : TypeToken<List<MemberPriceModel>>() {}.type
|
||||
)
|
||||
|
||||
|
||||
if (model.isMember == true){
|
||||
binding.textMemberDate.text = getString(R.string.deadline_date, CKUtils.dataToFormat(model.deadlineTime,
|
||||
CKUtils.YYYYMMDD_HHMMSS, CKUtils.YYYYMMDD))
|
||||
binding.conetnt1.visibility = View.GONE
|
||||
binding.conetnt2.visibility = View.VISIBLE
|
||||
}else{
|
||||
binding.conetnt1.visibility = View.VISIBLE
|
||||
binding.conetnt2.visibility = View.GONE
|
||||
|
||||
getInfo()
|
||||
if (model.isNotEmpty()) {
|
||||
val price = model.first().actualPrice
|
||||
MemberPriceCache.save(this@MemberActivity, price)
|
||||
showMemberPrice(price)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailed(code: String, msg: String) {
|
||||
priceRequestInFlight = false
|
||||
if (!hasCachedPrice) toast(msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun showMemberPrice(price: Double) {
|
||||
binding.textMoney.text = price.toString()
|
||||
binding.priceContent.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
private fun getMemberInfo() {
|
||||
TTHttpClient.get(this, "个人资料", TTRequestParam(), object : ICallback {
|
||||
override fun onSuccess(data: String) {
|
||||
val model = Gson().fromJson<UserInfoModel>(data, UserInfoModel::class.java)
|
||||
CKApp.app.userInfo = model
|
||||
PreferencesUtils.putString(this@MemberActivity, Const.USER_DATA, data)
|
||||
renderMemberInfo(model)
|
||||
}
|
||||
|
||||
override fun onFailed(code: String, msg: String) {
|
||||
toast(msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun renderMemberInfo(model: UserInfoModel?) {
|
||||
if (model?.isMember == true) {
|
||||
binding.textMemberDate.text = getString(
|
||||
R.string.deadline_date,
|
||||
CKUtils.dataToFormat(
|
||||
model.deadlineTime,
|
||||
CKUtils.YYYYMMDD_HHMMSS,
|
||||
CKUtils.YYYYMMDD
|
||||
)
|
||||
)
|
||||
binding.conetnt1.visibility = View.GONE
|
||||
binding.conetnt2.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.conetnt1.visibility = View.VISIBLE
|
||||
binding.conetnt2.visibility = View.GONE
|
||||
loadMemberPrice()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -188,14 +188,22 @@ class AddPetActivity : CKBaseActivity() {
|
||||
}
|
||||
|
||||
binding.tvAiRecognize.setOnClickListener {
|
||||
if (!checkCameraPermissions()) {
|
||||
getPermissionRequst(
|
||||
Manifest.permission.CAMERA,
|
||||
REQUEST_AI_CAMERA_PERMISSION
|
||||
)
|
||||
return@setOnClickListener
|
||||
}
|
||||
takePhoto2()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onPermissionsGranted(requestCode: Int, permissions: Array<String>) {
|
||||
if (requestCode == REQUEST_CAMERA_PERMISSION) {
|
||||
takePhoto()
|
||||
when (requestCode) {
|
||||
REQUEST_CAMERA_PERMISSION -> takePhoto()
|
||||
REQUEST_AI_CAMERA_PERMISSION -> takePhoto2()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -415,6 +423,7 @@ class AddPetActivity : CKBaseActivity() {
|
||||
|
||||
companion object {
|
||||
private const val REQUEST_CAMERA_PERMISSION = 1201
|
||||
private const val REQUEST_AI_CAMERA_PERMISSION = 1202
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ import com.google.gson.reflect.TypeToken
|
||||
import com.tt.kit.model.DataCollection
|
||||
|
||||
class ImageViewActivity : CKBaseActivity() {
|
||||
override val useDarkStatusBarIcons: Boolean = false
|
||||
|
||||
lateinit var binding: ActivityImageViewBinding
|
||||
var views = mutableListOf<View>()
|
||||
var data : List<String>? = null
|
||||
|
||||
@@ -33,6 +33,7 @@ import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
|
||||
class PointsActivity : CKLHBaseActionBarActivity() {
|
||||
override val shouldRequestPermissionsOnCreate: Boolean = false
|
||||
|
||||
lateinit var binding: ActivityPointsBinding
|
||||
var data = listOf<PointsModel.PointsRecordModel>()
|
||||
|
||||
@@ -168,7 +168,7 @@ class AddAddressActivity : CKBaseActivity() {
|
||||
add(TTRequestData("provinceName",provinceName))
|
||||
add(TTRequestData("cityName",cityName))
|
||||
add(TTRequestData("areaName",areaName))
|
||||
add(TTRequestData("detailAddress",binding.textDetailsAddress.text.toString()))
|
||||
add(TTRequestData("detailAddress",binding.textDetailsAddress.text.toString().trim()))
|
||||
add(TTRequestData("postalCode",""))
|
||||
add(TTRequestData("isDefault",check))
|
||||
add(TTRequestData("addressTag",tag))
|
||||
|
||||
@@ -195,12 +195,12 @@ class EditAddressActivity : CKBaseActivity() {
|
||||
}
|
||||
var param = TTRequestParam().apply {
|
||||
add(TTRequestData("id", model?.id.toString()))
|
||||
add(TTRequestData("receiverName", binding.textName.text.toString()))
|
||||
add(TTRequestData("receiverPhone", binding.textPhone.text.toString()))
|
||||
add(TTRequestData("receiverName", binding.textName.text.toString().trim()))
|
||||
add(TTRequestData("receiverPhone", binding.textPhone.text.toString().trim()))
|
||||
add(TTRequestData("provinceName", provinceName))
|
||||
add(TTRequestData("cityName", cityName))
|
||||
add(TTRequestData("areaName", areaName))
|
||||
add(TTRequestData("detailAddress", binding.textDetailsAddress.text.toString()))
|
||||
add(TTRequestData("detailAddress", binding.textDetailsAddress.text.toString().trim()))
|
||||
add(TTRequestData("postalCode", ""))
|
||||
add(TTRequestData("isDefault", check))
|
||||
add(TTRequestData("addressTag", tag))
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.ck.ckcollar.app.R
|
||||
import com.ck.ckcollar.app.databinding.ActivitySettingBinding
|
||||
import com.ck.ckcollar.app.ui.act.login.AgreementActivity
|
||||
import com.ck.ckcollar.app.ui.act.login.LoginActivity
|
||||
import com.ck.ckcollar.app.ui.act.home.MainActivity
|
||||
import com.ck.ckcollar.app.ui.base.CKBaseActivity
|
||||
import com.ck.ckcollar.app.ui.dialog.CKAlertDialog
|
||||
import com.tt.kit.model.Data
|
||||
@@ -77,7 +78,12 @@ class SettingActivity : CKBaseActivity(), View.OnClickListener {
|
||||
override fun onBack(isConfirm: Boolean) {
|
||||
if (isConfirm){
|
||||
CKApp.app.clearLoginState()
|
||||
toActivityNewTaskClear(LoginActivity::class.java, DataCollection())
|
||||
startActivity(
|
||||
Intent(this@SettingActivity, MainActivity::class.java).apply {
|
||||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||
putExtra(MainActivity.EXTRA_SHOW_HOME, true)
|
||||
}
|
||||
)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +91,10 @@ class ShopCarActivity : CKLHBaseActionBarActivity() {
|
||||
|
||||
|
||||
binding.checkbox.setOnClickListener {
|
||||
if (productDatas.isEmpty()) {
|
||||
toast(getString(R.string.shop_car_empty))
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
selectAll = !selectAll
|
||||
if (selectAll){
|
||||
@@ -154,6 +158,11 @@ class ShopCarActivity : CKLHBaseActionBarActivity() {
|
||||
|
||||
|
||||
override fun rightButton1OnClick() {
|
||||
if (productDatas.isEmpty()) {
|
||||
toast(getString(R.string.shop_car_empty))
|
||||
return
|
||||
}
|
||||
|
||||
isShowDelete = !isShowDelete
|
||||
|
||||
if (isShowDelete){
|
||||
@@ -296,14 +305,15 @@ class ShopCarActivity : CKLHBaseActionBarActivity() {
|
||||
}
|
||||
|
||||
fun sendSelectAll(select : String){
|
||||
|
||||
showProgeassDialog()
|
||||
TTHttpClient.putJson(this,"购物车全部选中", TTRequestParam().apply { add(TTRequestData("selected",select)) },object : ICallback{
|
||||
override fun onSuccess(data: String) {
|
||||
hiddenProgeassDialog()
|
||||
getData()
|
||||
}
|
||||
|
||||
override fun onFailed(code: String, msg: String) {
|
||||
|
||||
hiddenProgeassDialog()
|
||||
toast(msg)
|
||||
getData()
|
||||
}
|
||||
|
||||
@@ -2,10 +2,13 @@ package com.ck.ckcollar.app.ui.base
|
||||
|
||||
import android.Manifest
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.Intent
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.graphics.Color
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.util.TypedValue
|
||||
import android.view.View
|
||||
import android.view.Gravity
|
||||
@@ -21,6 +24,7 @@ import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.WindowInsetsControllerCompat
|
||||
import com.ck.ckcollar.app.CKApp
|
||||
import com.ck.ckcollar.app.R
|
||||
import com.ck.ckcollar.app.ui.dialog.CKAlertDialog
|
||||
@@ -32,9 +36,25 @@ import pub.devrel.easypermissions.EasyPermissions
|
||||
|
||||
open class CKBaseActivity : TTBaseActivity(){
|
||||
|
||||
protected open val useDarkStatusBarIcons: Boolean = true
|
||||
|
||||
private var permissionDialog: AlertDialog? = null
|
||||
private var pendingPermissionRequestCode: Int? = null
|
||||
private var pendingPermissions: Array<String> = emptyArray()
|
||||
private var settingsPermissionRequestCode: Int? = null
|
||||
private var settingsPermissions: Array<String> = emptyArray()
|
||||
private val permissionSettingsLauncher = registerForActivityResult(
|
||||
ActivityResultContracts.StartActivityForResult()
|
||||
) {
|
||||
val requestCode = settingsPermissionRequestCode
|
||||
val permissions = settingsPermissions
|
||||
settingsPermissionRequestCode = null
|
||||
settingsPermissions = emptyArray()
|
||||
|
||||
if (requestCode != null && hasRecordPermission(permissions)) {
|
||||
onPermissionsGranted(requestCode, permissions)
|
||||
}
|
||||
}
|
||||
private val permissionLauncher = registerForActivityResult(
|
||||
ActivityResultContracts.RequestMultiplePermissions()
|
||||
) { result ->
|
||||
@@ -48,7 +68,9 @@ open class CKBaseActivity : TTBaseActivity(){
|
||||
if (denied.isEmpty()) {
|
||||
onPermissionsGranted(requestCode, requestedPermissions)
|
||||
} else {
|
||||
val permanentlyDenied = denied.all { !ActivityCompat.shouldShowRequestPermissionRationale(this, it) }
|
||||
val permanentlyDenied = denied.any {
|
||||
!ActivityCompat.shouldShowRequestPermissionRationale(this, it)
|
||||
}
|
||||
onPermissionsDenied(requestCode, denied, permanentlyDenied)
|
||||
}
|
||||
}
|
||||
@@ -80,10 +102,15 @@ open class CKBaseActivity : TTBaseActivity(){
|
||||
|
||||
CKApp.app.activitys.add(this)
|
||||
setStatusBarColor(R.attr.actionBarBackground)
|
||||
setStatusBarTextDark(useDarkStatusBarIcons)
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun setStatusBarTextDark(isDark: Boolean = true) {
|
||||
WindowInsetsControllerCompat(window, window.decorView).isAppearanceLightStatusBars = isDark
|
||||
}
|
||||
|
||||
fun checkAppPermissions(){
|
||||
if (!checkPermissions()){
|
||||
requstPermissions()
|
||||
@@ -345,6 +372,27 @@ open class CKBaseActivity : TTBaseActivity(){
|
||||
permissions: Array<String>,
|
||||
permanentlyDenied: Boolean
|
||||
) {
|
||||
if (!permanentlyDenied) return
|
||||
|
||||
CKAlertDialog(
|
||||
this,
|
||||
getString(R.string.settting_permissions),
|
||||
getString(R.string.permission_settings_alert),
|
||||
object : CKAlertDialog.AlertClickListener {
|
||||
override fun onBack(isConfirm: Boolean) {
|
||||
if (isConfirm) {
|
||||
settingsPermissionRequestCode = requestCode
|
||||
settingsPermissions = permissions
|
||||
permissionSettingsLauncher.launch(
|
||||
Intent(
|
||||
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
|
||||
Uri.parse("package:$packageName")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
).show()
|
||||
}
|
||||
|
||||
fun requstPermissions(){
|
||||
@@ -366,6 +414,8 @@ open class CKBaseActivity : TTBaseActivity(){
|
||||
hidePermissionDialog()
|
||||
pendingPermissionRequestCode = null
|
||||
pendingPermissions = emptyArray()
|
||||
settingsPermissionRequestCode = null
|
||||
settingsPermissions = emptyArray()
|
||||
super.onDestroy()
|
||||
CKApp.app.activitys.remove(this)
|
||||
}
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
package com.ck.ckcollar.app.ui.base
|
||||
|
||||
import android.Manifest
|
||||
import com.ck.ckcollar.app.CKApp
|
||||
import com.ck.ckcollar.app.ui.act.login.LoginActivity
|
||||
import com.cyclone.shadowsocks.ui.frg.TTBaseFragment
|
||||
import com.tt.kit.model.DataCollection
|
||||
import pub.devrel.easypermissions.EasyPermissions
|
||||
|
||||
open class CKBaseFragment : TTBaseFragment() {
|
||||
|
||||
var perms_carmra = listOf<String>(Manifest.permission.CAMERA)
|
||||
|
||||
|
||||
fun isUserLogin(): Boolean {
|
||||
if (CKApp.app.isUserLoggedIn) return true
|
||||
toActivity(LoginActivity::class.java, DataCollection())
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
fun checkCameraPermissions() : Boolean{
|
||||
|
||||
@@ -28,7 +28,7 @@ import pub.devrel.easypermissions.EasyPermissions
|
||||
|
||||
open class CKLHBaseActionBarActivity : TTBaseActivity(){
|
||||
|
||||
protected open val shouldRequestPermissionsOnCreate: Boolean = true
|
||||
protected open val shouldRequestPermissionsOnCreate: Boolean = false
|
||||
|
||||
var perms_= listOf<String>(Manifest.permission.CAMERA, Manifest.permission.READ_MEDIA_IMAGES,Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
var perms_tiramisu = listOf<String>(Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||
|
||||
@@ -12,6 +12,8 @@ object Const {
|
||||
const val LOGIN_NAME = "login_name"
|
||||
const val LOGIN_PWD = "login_pwd"
|
||||
const val TOKEN = "token"
|
||||
const val MEMBER_PRICE = "member_price"
|
||||
const val MEMBER_PRICE_CACHE_TIME = "member_price_cache_time"
|
||||
const val WX_APP_ID = "wx7681e74df7d88ddc"
|
||||
|
||||
}
|
||||
@@ -35,8 +35,8 @@
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:id="@+id/textBalance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0.00"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="38sp"
|
||||
android:textStyle="bold"
|
||||
|
||||
@@ -78,19 +78,22 @@
|
||||
android:textColorHint="@color/textColor"
|
||||
android:hint="@string/please_input_message"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="5dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:layout_marginVertical="10dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:background="@drawable/bg_input_message"
|
||||
android:imeOptions="actionSend"
|
||||
android:inputType="text"
|
||||
android:maxHeight="70dp"
|
||||
android:maxLines="4"
|
||||
android:scrollbars="vertical"
|
||||
android:maxLength="100" />
|
||||
<com.ck.ckcollar.app.widget.CKImageView
|
||||
android:id="@+id/btnSmile"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@mipmap/image_smile"
|
||||
android:visibility="visible"/>
|
||||
android:visibility="gone"/>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKImageView
|
||||
android:id="@+id/btnMore"
|
||||
|
||||
@@ -33,16 +33,21 @@
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:id="@+id/priceContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="58dp"
|
||||
android:baselineAligned="true"
|
||||
android:baselineAlignedChildIndex="1"
|
||||
android:gravity="bottom"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="invisible">
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="¥"
|
||||
android:textColor="@color/color_7B4B12"
|
||||
android:textSize="22sp"></com.ck.ckcollar.app.widget.CKTextView>
|
||||
android:textSize="22sp"/>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:id="@+id/textMoney"
|
||||
@@ -51,14 +56,15 @@
|
||||
android:text=""
|
||||
android:textColor="@color/color_7B4B12"
|
||||
android:textSize="48sp"
|
||||
android:textStyle="bold"></com.ck.ckcollar.app.widget.CKTextView>
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:id="@+id/tv_month"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="/月"
|
||||
android:textColor="@color/color_7B4B12"
|
||||
android:textSize="22sp"></com.ck.ckcollar.app.widget.CKTextView>
|
||||
android:textSize="22sp"/>
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
|
||||
@@ -71,7 +77,7 @@
|
||||
android:gravity="center"
|
||||
android:text="@string/pet_member_open_now"
|
||||
android:textColor="@color/color_CACACA"
|
||||
android:textSize="16sp"></com.ck.ckcollar.app.widget.CKTextView>
|
||||
android:textSize="16sp"/>
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
@@ -93,7 +99,7 @@
|
||||
android:textColor="@color/color_7B4B12"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold"
|
||||
></com.ck.ckcollar.app.widget.CKTextView>
|
||||
/>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:id="@+id/textMemberDate"
|
||||
@@ -101,7 +107,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/deadline_date"
|
||||
android:textColor="@color/color_7B4B12"
|
||||
android:textSize="16sp"></com.ck.ckcollar.app.widget.CKTextView>
|
||||
android:textSize="16sp"/>
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
|
||||
@@ -260,9 +266,9 @@
|
||||
android:id="@+id/textNode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/color_CACACA"
|
||||
android:text=""
|
||||
android:text="商城商品享受折扣,开通会员赠送积分"
|
||||
android:layout_marginTop="20dp"
|
||||
></com.ck.ckcollar.app.widget.CKTextView>
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="38dp"
|
||||
android:text="0"
|
||||
></com.ck.ckcollar.app.widget.CKTextView>
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/refreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="match_parent">
|
||||
<com.scwang.smartrefresh.layout.header.ClassicsHeader
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"></com.scwang.smartrefresh.layout.header.ClassicsHeader>
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
android:id="@+id/textAmount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0.0"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="38sp"
|
||||
android:textStyle="bold"
|
||||
|
||||
@@ -9,6 +9,228 @@
|
||||
android:background="?attr/mainBackground"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/image_health_top"
|
||||
/>
|
||||
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_view_top_gray_radius_16"
|
||||
android:layout_marginTop="-10dp"
|
||||
android:paddingHorizontal="20dp"
|
||||
>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKFrameLayout
|
||||
android:id="@+id/contentCustomer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="96dp">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/bg_health_item1" />
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:id="@+id/customerTextContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="18dp"
|
||||
android:paddingRight="96dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:id="@+id/textDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/textColor"
|
||||
android:text="@string/pet_advisor2"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:id="@+id/textDate2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="@string/pet_advisor_time_default"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="12sp"
|
||||
app:autoSizeMaxTextSize="12sp"
|
||||
app:autoSizeMinTextSize="9sp"
|
||||
app:autoSizeStepGranularity="1sp"
|
||||
app:autoSizeTextType="uniform" />
|
||||
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/textColor"
|
||||
android:text="@string/pet_advisor_desc" />
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKImageView
|
||||
android:id="@+id/imageCustomerService"
|
||||
android:layout_width="75dp"
|
||||
android:layout_height="75dp"
|
||||
android:layout_gravity="top|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/image_health_kf"/>
|
||||
</com.ck.ckcollar.app.widget.CKFrameLayout>
|
||||
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
>
|
||||
<com.ck.ckcollar.app.widget.CKRelativeLayout
|
||||
android:id="@+id/btnAIText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/image_health_item_2"
|
||||
android:paddingLeft="16dp"
|
||||
>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="16sp"
|
||||
android:text="@string/ai_text_diagnosis"
|
||||
android:layout_marginTop="15dp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/textSecondColor"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/ai_text_diagnosis_tag"
|
||||
android:layout_marginTop="15dp"
|
||||
/>
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/image_health_wz"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
/>
|
||||
</com.ck.ckcollar.app.widget.CKRelativeLayout>
|
||||
<View
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="0dp"/>
|
||||
<com.ck.ckcollar.app.widget.CKRelativeLayout
|
||||
android:id="@+id/btnAIPhoto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/image_health_item_3"
|
||||
android:paddingLeft="15dp"
|
||||
>
|
||||
<com.ck.ckcollar.app.widget.CKImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/image_health_tp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
/>
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="16sp"
|
||||
android:text="@string/ai_photo_diagnosis"
|
||||
android:layout_marginTop="15dp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/textSecondColor"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/ai_photo_diagnosis_tag"
|
||||
android:layout_marginTop="15dp"
|
||||
/>
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
</com.ck.ckcollar.app.widget.CKRelativeLayout>
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/textColor"
|
||||
android:text="@string/pet_knowledge_popularization"
|
||||
android:layout_marginTop="30dp"
|
||||
/>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
/>
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/refreshLayout"
|
||||
@@ -19,228 +241,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<!--内容-->
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/image_health_top"
|
||||
/>
|
||||
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_view_top_gray_radius_16"
|
||||
android:layout_marginTop="-10dp"
|
||||
android:paddingHorizontal="20dp"
|
||||
>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKFrameLayout
|
||||
android:id="@+id/contentCustomer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="96dp"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/bg_health_item1" />
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:id="@+id/customerTextContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="18dp"
|
||||
android:paddingRight="96dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:id="@+id/textDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/textColor"
|
||||
android:text="@string/pet_advisor2"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:id="@+id/textDate2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="@string/pet_advisor_time_default"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="12sp"
|
||||
app:autoSizeMaxTextSize="12sp"
|
||||
app:autoSizeMinTextSize="9sp"
|
||||
app:autoSizeStepGranularity="1sp"
|
||||
app:autoSizeTextType="uniform" />
|
||||
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/textColor"
|
||||
android:text="@string/pet_advisor_desc" />
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKImageView
|
||||
android:id="@+id/imageCustomerService"
|
||||
android:layout_width="75dp"
|
||||
android:layout_height="75dp"
|
||||
android:layout_gravity="top|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/image_health_kf"/>
|
||||
</com.ck.ckcollar.app.widget.CKFrameLayout>
|
||||
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
>
|
||||
<com.ck.ckcollar.app.widget.CKRelativeLayout
|
||||
android:id="@+id/btnAIText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/image_health_item_2"
|
||||
android:paddingLeft="16dp"
|
||||
>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="16sp"
|
||||
android:text="@string/ai_text_diagnosis"
|
||||
android:layout_marginTop="15dp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/textSecondColor"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/ai_text_diagnosis_tag"
|
||||
android:layout_marginTop="15dp"
|
||||
/>
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/image_health_wz"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
/>
|
||||
</com.ck.ckcollar.app.widget.CKRelativeLayout>
|
||||
<View
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="0dp"/>
|
||||
<com.ck.ckcollar.app.widget.CKRelativeLayout
|
||||
android:id="@+id/btnAIPhoto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/image_health_item_3"
|
||||
android:paddingLeft="15dp"
|
||||
>
|
||||
<com.ck.ckcollar.app.widget.CKImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/image_health_tp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
/>
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="16sp"
|
||||
android:text="@string/ai_photo_diagnosis"
|
||||
android:layout_marginTop="15dp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/textSecondColor"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/ai_photo_diagnosis_tag"
|
||||
android:layout_marginTop="15dp"
|
||||
/>
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
</com.ck.ckcollar.app.widget.CKRelativeLayout>
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/textColor"
|
||||
android:text="@string/pet_knowledge_popularization"
|
||||
android:layout_marginTop="30dp"
|
||||
/>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
/>
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/refreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
@@ -16,6 +18,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
</com.scwang.smartrefresh.layout.header.ClassicsHeader>
|
||||
<!--内容-->
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
app:isCircle="true"
|
||||
android:src="@mipmap/image_user_default"
|
||||
android:src="@mipmap/icon_unlogin_defaul"
|
||||
></com.ck.ckcollar.app.widget.CKRoundImageView>
|
||||
<com.ck.ckcollar.app.widget.CKLinearLayout
|
||||
android:id="@+id/btnUserInfo"
|
||||
|
||||
@@ -53,20 +53,17 @@
|
||||
android:textSize="14sp"></com.ck.ckcollar.app.widget.CKTextView>
|
||||
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKImageView
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/imageContentFrom"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="100dp"
|
||||
|
||||
android:textColor="@color/textColor"
|
||||
android:background="@drawable/bg_message_from"
|
||||
android:paddingVertical="3dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginTop="3dp"
|
||||
android:maxWidth="200dp"
|
||||
android:maxHeight="200dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"
|
||||
></com.ck.ckcollar.app.widget.CKImageView>
|
||||
app:riv_corner_radius="8dp" />
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
|
||||
@@ -114,19 +111,17 @@
|
||||
android:textSize="14sp"></com.ck.ckcollar.app.widget.CKTextView>
|
||||
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKImageView
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/imageContentTo"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="100dp"
|
||||
android:textColor="@color/textColor"
|
||||
android:background="@drawable/bg_message_to"
|
||||
android:paddingVertical="3dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginTop="3dp"
|
||||
android:maxWidth="200dp"
|
||||
android:maxHeight="200dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"
|
||||
></com.ck.ckcollar.app.widget.CKImageView>
|
||||
app:riv_corner_radius="8dp" />
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
|
||||
<com.ck.ckcollar.app.widget.CKRoundImageView
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="14sp"
|
||||
android:textSize="12sp"
|
||||
android:text="宠物食品"
|
||||
></com.ck.ckcollar.app.widget.CKTextView>
|
||||
</com.ck.ckcollar.app.widget.CKLinearLayout>
|
||||
@@ -1,5 +1,6 @@
|
||||
<resources>
|
||||
<string name="guest">游客</string>
|
||||
<string name="user_not_logged_in">用户未登录</string>
|
||||
<string name="app_name">宠盾</string>
|
||||
|
||||
|
||||
@@ -56,6 +57,7 @@
|
||||
|
||||
<string name="settting_permissions">设置权限</string>
|
||||
<string name="settting_permissions_alert">使用宠物项圈,需要给予以下访问权限</string>
|
||||
<string name="permission_settings_alert">相关权限已被关闭,请前往系统设置开启权限</string>
|
||||
<string name="continue_str">继续</string>
|
||||
<string name="camera">相机</string>
|
||||
<string name="scan_bind_camera">用于扫码绑定设备</string>
|
||||
@@ -465,6 +467,7 @@
|
||||
|
||||
<string name="price_total">合计¥ %s</string>
|
||||
<string name="shop_car">购物车</string>
|
||||
<string name="shop_car_empty">购物车内暂无商品</string>
|
||||
|
||||
<string name="power_alert">设备电量:%s% 更新时间:%s</string>
|
||||
<string name="desc_text">规格:%s</string>
|
||||
@@ -588,6 +591,7 @@
|
||||
<string name="cancel_account_phone">注销%s绑定的账号</string>
|
||||
<string name="please_choose_data">请选择原因</string>
|
||||
<string name="camera_alert">宠盾需要您的授权,使用相机功能来进行扫码和拍照</string>
|
||||
<string name="camera_permission_settings_alert">相机权限已被关闭,请前往系统设置开启相机权限</string>
|
||||
<string name="photo_permission_alert">宠盾需要您的授权,访问相册以选择照片</string>
|
||||
<string name="press_again_to_exit">再按一次退出应用</string>
|
||||
<string name="input_question">请输入问题</string>
|
||||
|
||||
Reference in New Issue
Block a user