[Modify]声音签名页面修改
This commit is contained in:
@@ -12,7 +12,7 @@ import com.yizhuan.erban.databinding.ActivitySoundSignatureBinding
|
|||||||
class SoundSignatureActivity : BaseViewBindingActivity<ActivitySoundSignatureBinding>() {
|
class SoundSignatureActivity : BaseViewBindingActivity<ActivitySoundSignatureBinding>() {
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
initWhiteTitleBar(getString(R.string.label_user_sound_signature))
|
initWhiteTitleBar(getString(R.string.sound_signature))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun needSteepStateBar(): Boolean {
|
override fun needSteepStateBar(): Boolean {
|
||||||
|
BIN
app/src/main/res/drawable-xhdpi/ic_delete_sound.webp
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_delete_sound.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 616 B |
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
<gradient
|
<gradient
|
||||||
android:angle="90"
|
android:angle="90"
|
||||||
android:centerColor="#DBE3FC"
|
android:centerColor="#F2F1FF"
|
||||||
android:endColor="#F2F1FF"
|
android:endColor="#DBE3FC"
|
||||||
android:startColor="#FFFFFF"
|
android:startColor="#FFFFFF"
|
||||||
android:type="linear"
|
android:type="linear"
|
||||||
android:useLevel="true" />
|
android:useLevel="true" />
|
||||||
|
@@ -86,6 +86,7 @@
|
|||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/tvRsRecord"
|
||||||
android:text="@string/restart_record"
|
android:text="@string/restart_record"
|
||||||
android:textSize="@dimen/sp_12"
|
android:textSize="@dimen/sp_12"
|
||||||
android:textColor="@color/color_6D6B89"
|
android:textColor="@color/color_6D6B89"
|
||||||
@@ -119,7 +120,7 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/tvRecordTip"
|
android:id="@+id/tvRecordTip"
|
||||||
android:text="@string/hit_start_record"
|
android:text="@string/start_record"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_14"
|
||||||
android:textColor="@color/color_6D6B89"
|
android:textColor="@color/color_6D6B89"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -142,14 +143,67 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"/>
|
app:layout_constraintEnd_toEndOf="parent"/>
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/tvSaveSound"
|
||||||
android:text="@string/save_record"
|
android:text="@string/save_record"
|
||||||
android:textSize="@dimen/sp_12"
|
android:textSize="@dimen/sp_12"
|
||||||
android:textColor="@color/color_6D6B89"
|
android:textColor="@color/color_6D6B89"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_10"
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/frRestartBg"
|
app:layout_constraintTop_toBottomOf="@+id/ivSaveRecord"
|
||||||
app:layout_constraintStart_toStartOf="@+id/ivSaveRecord"
|
app:layout_constraintStart_toStartOf="@+id/ivSaveRecord"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/ivSaveRecord"/>
|
app:layout_constraintEnd_toEndOf="@+id/ivSaveRecord"/>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/frDeleteBg"
|
||||||
|
android:background="@drawable/bg_ffffff_r360"
|
||||||
|
android:layout_width="42dp"
|
||||||
|
android:layout_height="42dp"
|
||||||
|
android:elevation="1dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/ivSaveRecord"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/ivSaveRecord"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/ivSaveRecord"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/ivSaveRecord">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:layout_width="@dimen/dp_18"
|
||||||
|
android:layout_height="@dimen/dp_18"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/ic_delete_sound" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/tvDeleteSound"
|
||||||
|
android:text="@string/delete_sound"
|
||||||
|
android:textSize="@dimen/sp_12"
|
||||||
|
android:textColor="@color/color_6D6B89"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/frDeleteBg"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/frDeleteBg"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/frDeleteBg"/>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Group
|
||||||
|
android:id="@+id/groupRsRecord"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:constraint_referenced_ids="frRestartBg,tvRsRecord" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Group
|
||||||
|
android:id="@+id/groupSaveSound"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:constraint_referenced_ids="ivSaveRecord,tvSaveSound" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Group
|
||||||
|
android:id="@+id/groupDeleteSound"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:constraint_referenced_ids="frDeleteBg,tvDeleteSound" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -5031,9 +5031,15 @@
|
|||||||
<string name="successfully_unmasking">解除屏蔽成功</string>
|
<string name="successfully_unmasking">解除屏蔽成功</string>
|
||||||
<string name="sound_time">%ds/60s</string>
|
<string name="sound_time">%ds/60s</string>
|
||||||
<string name="good_voice_brings_more_attention">好的聲音能帶來更多關注哦~</string>
|
<string name="good_voice_brings_more_attention">好的聲音能帶來更多關注哦~</string>
|
||||||
<string name="hit_start_record">點擊開始錄制</string>
|
|
||||||
<string name="restart_record">重新錄制</string>
|
<string name="restart_record">重新錄制</string>
|
||||||
<string name="save_record">保存聲音</string>
|
<string name="save_record">保存聲音</string>
|
||||||
<string name="sound_signature">聲音簽名</string>
|
<string name="sound_signature">聲音簽名</string>
|
||||||
|
<string name="start_record">點擊開始錄制</string>
|
||||||
|
<string name="click_stop">點擊停止</string>
|
||||||
|
<string name="click_to_listen">點擊試聽</string>
|
||||||
|
<string name="click_to_stop_playing">點擊停止播放</string>
|
||||||
|
<string name="delete_sound">刪除聲音</string>
|
||||||
|
<string name="sure_to_delete_sound">確定要刪除這段聲音嗎?</string>
|
||||||
|
<string name="sound_audit_in_progress">聲音審核中,審核通過即可展示~</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
@@ -0,0 +1,165 @@
|
|||||||
|
package com.yizhuan.xchat_android_library.common.base;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
import androidx.annotation.CallSuper;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.lifecycle.DefaultLifecycleObserver;
|
||||||
|
import androidx.lifecycle.LifecycleOwner;
|
||||||
|
import androidx.viewbinding.ViewBinding;
|
||||||
|
|
||||||
|
import com.yizhuan.xchat_android_library.common.util.ActivityHelper;
|
||||||
|
import com.yizhuan.xchat_android_library.common.util.ViewBindingUtil;
|
||||||
|
|
||||||
|
public abstract class BaseLinearLayout<VB extends ViewBinding> extends LinearLayout implements DefaultLifecycleObserver {
|
||||||
|
private boolean mViewCreatedCalled = false;
|
||||||
|
@Nullable
|
||||||
|
private VB mViewBinding;
|
||||||
|
|
||||||
|
public BaseLinearLayout(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseLinearLayout(Context context, AttributeSet attrs) {
|
||||||
|
this(context, attrs, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseLinearLayout(Context context, AttributeSet attrs, int defStyle) {
|
||||||
|
this(context, attrs, defStyle, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseLinearLayout(Context context, AttributeSet attrs, int defStyle, int defStyleRes) {
|
||||||
|
super(context, attrs, defStyle, defStyleRes);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
mViewBinding = ViewBindingUtil.inflateWithView(this, LayoutInflater.from(getContext()), this);
|
||||||
|
BaseViewTag.registerLifecycle(this);
|
||||||
|
findView();
|
||||||
|
}
|
||||||
|
|
||||||
|
@CallSuper
|
||||||
|
@Override
|
||||||
|
protected void onAttachedToWindow() {
|
||||||
|
super.onAttachedToWindow();
|
||||||
|
if (!mViewCreatedCalled) {
|
||||||
|
onLazyLoad();
|
||||||
|
mViewCreatedCalled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重写该方法可实现懒加载数据,即当前控件第一次可见时才会执行一次,不同于在构造函数里面使用预加载机制直接加载数据的方式
|
||||||
|
*/
|
||||||
|
@CallSuper
|
||||||
|
protected void onLazyLoad() {
|
||||||
|
setView();
|
||||||
|
setListener();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final Activity getActivity() {
|
||||||
|
return ActivityHelper.getActivityFromView(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
protected final VB getBinding() {
|
||||||
|
return mViewBinding;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来自于Activity或Fragment的onCreate()方法被回调
|
||||||
|
*
|
||||||
|
* @param owner 生命周期提供者,一般是Activity或Fragment
|
||||||
|
*/
|
||||||
|
@CallSuper
|
||||||
|
@Override
|
||||||
|
public void onCreate(@NonNull LifecycleOwner owner) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来自于Activity或Fragment的onStart()方法被回调
|
||||||
|
*
|
||||||
|
* @param owner 生命周期提供者,一般是Activity或Fragment
|
||||||
|
*/
|
||||||
|
@CallSuper
|
||||||
|
@Override
|
||||||
|
public void onStart(@NonNull LifecycleOwner owner) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来自于Activity或Fragment的onResume()方法被回调
|
||||||
|
*
|
||||||
|
* @param owner 生命周期提供者,一般是Activity或Fragment
|
||||||
|
*/
|
||||||
|
@CallSuper
|
||||||
|
@Override
|
||||||
|
public void onResume(@NonNull LifecycleOwner owner) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来自于Activity或Fragment的onPause()方法被回调
|
||||||
|
*
|
||||||
|
* @param owner 生命周期提供者,一般是Activity或Fragment
|
||||||
|
*/
|
||||||
|
@CallSuper
|
||||||
|
@Override
|
||||||
|
public void onPause(@NonNull LifecycleOwner owner) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来自于Activity或Fragment的onStop()方法被回调
|
||||||
|
*
|
||||||
|
* @param owner 生命周期提供者,一般是Activity或Fragment
|
||||||
|
*/
|
||||||
|
@CallSuper
|
||||||
|
@Override
|
||||||
|
public void onStop(@NonNull LifecycleOwner owner) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来自于Activity或Fragment的onDestroy()方法被回调
|
||||||
|
*
|
||||||
|
* @param owner 生命周期提供者,一般是Activity或Fragment
|
||||||
|
*/
|
||||||
|
@CallSuper
|
||||||
|
@Override
|
||||||
|
public void onDestroy(@NonNull LifecycleOwner owner) {
|
||||||
|
BaseViewTag.unRegisterLifecycle(this, owner);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////以下是提供给子类复写的方法////////////////////////////////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 该方法是在构造函数里执行,可用于处理控件的初始化
|
||||||
|
*/
|
||||||
|
protected void findView() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 该方法是在onLazyLoad()方法里执行,可用于处理控件的加载数据
|
||||||
|
*/
|
||||||
|
protected void setView() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 该方法是在onLazyLoad()方法里执行,可用于处理控件的设置监听器
|
||||||
|
*/
|
||||||
|
protected void setListener() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user