删除个人资料-声音签名
This commit is contained in:
@@ -4,21 +4,15 @@ import android.Manifest
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Color
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.text.TextUtils
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.RecyclerView.OnItemTouchListener
|
||||
import com.fourmob.datetimepicker.date.DatePickerDialog
|
||||
import com.google.android.flexbox.AlignItems
|
||||
import com.google.android.flexbox.FlexDirection
|
||||
import com.hjq.toast.ToastUtils
|
||||
import com.netease.nim.uikit.StatusBarUtil
|
||||
import com.netease.nim.uikit.common.util.sys.TimeUtil
|
||||
@@ -29,20 +23,15 @@ import com.yalantis.ucrop.UCrop
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.UIHelper
|
||||
import com.chwl.app.application.App
|
||||
import com.chwl.app.audio.SoundSignatureActivity
|
||||
import com.chwl.app.base.BaseViewBindingActivity
|
||||
import com.chwl.app.common.util.BitmapUtil
|
||||
import com.chwl.library.common.util.Utils
|
||||
import com.chwl.app.databinding.ActivityUserInfoModifyBinding
|
||||
import com.chwl.app.ui.login.ModifyInfoActivity
|
||||
import com.chwl.app.ui.user.adapter.UserInfoLabelAdapter
|
||||
import com.chwl.app.ui.user.adapter.UserModifyLabelAdapter
|
||||
import com.chwl.app.ui.user.adapter.UserPhotoAdapter
|
||||
import com.chwl.app.ui.user.adapter.UserPhotoAdapter.ImageClickListener
|
||||
import com.chwl.app.ui.user.dialog.UserAreaDialog
|
||||
import com.chwl.app.ui.utils.ImageLoadUtils
|
||||
import com.chwl.app.ui.widget.dialog.CommonTipDialog
|
||||
import com.chwl.app.ui.widget.recyclerview.decoration.ColorDecoration
|
||||
import com.chwl.app.utils.RegexUtil
|
||||
import com.chwl.core.auth.AuthModel
|
||||
import com.chwl.core.file.FileModel
|
||||
@@ -54,7 +43,6 @@ import com.chwl.library.common.file.FileHelper
|
||||
import com.chwl.library.common.photo.PhotoProviderNew
|
||||
import com.chwl.library.common.util.PhotoCompressCallback
|
||||
import com.chwl.library.common.util.PhotoCompressUtil
|
||||
import com.chwl.library.common.widget.LinesFlexBoxLayoutManager
|
||||
import com.chwl.library.easypermisssion.EasyPermissions
|
||||
import com.chwl.library.utils.ResUtil
|
||||
import com.chwl.library.utils.TimeUtils
|
||||
@@ -144,17 +132,6 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
||||
} else {
|
||||
binding.rvPhotos.visibility = View.GONE
|
||||
}
|
||||
val hasSound = (userInfo.audioCard?.second ?: 0) > 0
|
||||
if (hasSound && ((userInfo.audioCard?.status ?: 0) == 1 || (userInfo.audioCard?.status
|
||||
?: 0) == 2)
|
||||
) {
|
||||
binding.tvSoundTip.visibility = View.GONE
|
||||
binding.llAudio.visibility = View.VISIBLE
|
||||
binding.tvAudio.text = userInfo.audioCard.second.toString()
|
||||
} else {
|
||||
binding.tvSoundTip.visibility = View.VISIBLE
|
||||
binding.llAudio.visibility = View.GONE
|
||||
}
|
||||
binding.tvArea.text = userInfo.region
|
||||
}
|
||||
}
|
||||
@@ -164,7 +141,6 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
||||
binding.tvBirth.setOnClickListener(this)
|
||||
binding.tvNick.setOnClickListener(this)
|
||||
binding.layoutPhotos.setOnClickListener(this)
|
||||
binding.llAudioRecord.setOnClickListener(this)
|
||||
binding.llDesc.setOnClickListener(this)
|
||||
binding.layoutArea.setOnClickListener(this)
|
||||
val mLayoutManager = LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, true)
|
||||
@@ -276,19 +252,6 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
||||
Method.DESC,
|
||||
ModifyInfoActivity.CONTENT_MODIFY
|
||||
)
|
||||
R.id.ll_audio_record -> checkPermission(
|
||||
{
|
||||
// 点击跳转到声音签名页面
|
||||
UIHelper.showSoundAct(
|
||||
this@UserInfoModifyActivity,
|
||||
Method.AUDIO,
|
||||
ResUtil.getString(R.string.ui_user_userinfomodifyactivity_07),
|
||||
mUserInfo?.audioCard
|
||||
)
|
||||
isAvatar = false
|
||||
}, R.string.ask_again,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
)
|
||||
R.id.layout_photos -> UserModifyPhotosActivity.startForResult(
|
||||
this@UserInfoModifyActivity,
|
||||
userId,
|
||||
@@ -457,29 +420,6 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
|
||||
.subscribe(userInfoUpdateObserver)
|
||||
}
|
||||
}
|
||||
Method.AUDIO -> {// 刷新声音资源
|
||||
data?.let {
|
||||
// 获取数据并刷新显示
|
||||
val audioFileUrl = it.getStringExtra(SoundSignatureActivity.AUDIO_FILE)
|
||||
val audioDuration = it.getIntExtra(SoundSignatureActivity.AUDIO_DURA, 0)
|
||||
if (TextUtils.isEmpty(audioFileUrl)) {
|
||||
val soundBean = mUserInfo?.audioCard
|
||||
soundBean?.audioUrl = ""
|
||||
soundBean?.second = 0
|
||||
soundBean?.status = 0
|
||||
binding.tvSoundTip.visibility = View.VISIBLE
|
||||
binding.llAudio.visibility = View.GONE
|
||||
} else {
|
||||
val soundBean = mUserInfo?.audioCard
|
||||
soundBean?.audioUrl = audioFileUrl
|
||||
soundBean?.second = audioDuration
|
||||
soundBean?.status = 1
|
||||
binding.tvSoundTip.visibility = View.GONE
|
||||
binding.llAudio.visibility = View.VISIBLE
|
||||
binding.tvAudio.text = audioDuration.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
Method.PHOTO -> {
|
||||
data?.let {
|
||||
val isChanged =
|
||||
|
@@ -243,89 +243,6 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:background="@color/line_353548" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_audio_record"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_user_sound_signature"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="18dp"
|
||||
android:layout_marginBottom="18dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|end"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSoundTip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:hint="@string/label_record_your_own_voice"
|
||||
android:textColor="@color/color_6D6B89"
|
||||
android:textColorHint="@color/color_6D6B89" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llAudio"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:background="@drawable/user_info_bg_audio"
|
||||
android:gravity="center_vertical|end"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:drawableStart="@drawable/user_info_ic_audio_palying"
|
||||
android:id="@+id/tvAudio"
|
||||
android:drawablePadding="5dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="60" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="''"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_sound_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/arrow_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
|
Reference in New Issue
Block a user