头像显示 and 爵位内页 优化
This commit is contained in:
@@ -67,6 +67,8 @@ dependencies {
|
||||
implementation project(':moduletablayout')
|
||||
implementation libs.activity
|
||||
implementation libs.constraintlayout
|
||||
api 'androidx.activity:activity-compose:1.8.2'
|
||||
|
||||
testImplementation libs.junit
|
||||
androidTestImplementation libs.ext.junit
|
||||
androidTestImplementation libs.espresso.core
|
||||
|
||||
@@ -209,8 +209,21 @@ public class ImageUtils {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).load(path).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
Glide.with(mImageView).load(path).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
}
|
||||
|
||||
public static void loadHead(String path, ImageView mImageView) {
|
||||
if (mImageView == null) {
|
||||
return;
|
||||
}
|
||||
Context context = mImageView.getContext();
|
||||
if (context instanceof android.app.Activity) {
|
||||
android.app.Activity activity = (android.app.Activity) context;
|
||||
if (activity.isFinishing() || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && activity.isDestroyed())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).load(path).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
}
|
||||
|
||||
public static void loadHeadCC(String path, ImageView mImageView, LinearLayout.LayoutParams params) {
|
||||
|
||||
@@ -49,11 +49,10 @@ public class MeHeadView extends ConstraintLayout {
|
||||
public void setData(String headPicture, String framePicture, String nobilityImage) {
|
||||
Logger.e(headPicture, framePicture, nobilityImage);
|
||||
if (!TextUtils.isEmpty(headPicture)) {
|
||||
ImageUtils.loadHeadCC(headPicture, mRiv);
|
||||
ImageUtils.loadHead(headPicture, mRiv);
|
||||
}
|
||||
if (TextUtils.isEmpty(framePicture)) {
|
||||
mIvFrame.setVisibility(GONE);
|
||||
|
||||
} else {
|
||||
mIvFrame.setVisibility(VISIBLE);
|
||||
mIvFrame.setSource(framePicture, 1);
|
||||
@@ -73,7 +72,7 @@ public class MeHeadView extends ConstraintLayout {
|
||||
|
||||
if (nobilityImage!=null && !TextUtils.isEmpty(nobilityImage)){
|
||||
iv_frame_bg.setVisibility(VISIBLE);
|
||||
ImageUtils.loadHeadCC(nobilityImage, iv_frame_bg);
|
||||
ImageUtils.loadHead(nobilityImage, iv_frame_bg);
|
||||
}else {
|
||||
iv_frame_bg.setVisibility(GONE);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
||||
}
|
||||
|
||||
|
||||
parser.decodeFromAssets("ripple3695.svga", new SVGAParser.ParseCompletion() {
|
||||
parser.decodeFromAssets("mic.svga", new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(@Nullable SVGAVideoEntity videoItem) {
|
||||
if (videoItem != null) {
|
||||
|
||||
@@ -114,7 +114,7 @@ public class RoomSingWheatView extends LinearLayout {
|
||||
|
||||
if (isOn()) {
|
||||
//开启声浪
|
||||
mIvRipple.startLoopingSvga("ripple3695.svga");
|
||||
mIvRipple.startLoopingSvga("mic.svga");
|
||||
mIvRipple.setVisibility(VISIBLE);
|
||||
mTvName.setText(bean.getNickname());
|
||||
ImageUtils.loadHeadCC(bean.getAvatar(), mRiv);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"/>-->
|
||||
|
||||
<!-- 用户头像 -->
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
<com.xscm.moduleutil.utils.MeHeadView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
|
||||
@@ -1,80 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/riv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/me_avatar_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_percent="0.90154"
|
||||
android:src="@mipmap/default_avatar"
|
||||
app:riv_oval="true"/>
|
||||
<com.xscm.moduleutil.widget.CircularImage
|
||||
android:id="@+id/riv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/me_avatar_bg"
|
||||
android:src="@mipmap/default_avatar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_percent="0.8"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_sex"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:background="@mipmap/nan"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@id/riv"
|
||||
app:layout_constraintEnd_toEndOf="@id/riv"
|
||||
/>
|
||||
android:id="@+id/iv_sex"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:background="@mipmap/nan"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/riv"
|
||||
app:layout_constraintEnd_toEndOf="@id/riv"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.xscm.moduleutil.widget.AvatarFrameView
|
||||
android:id="@+id/iv_frame"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
android:id="@+id/iv_frame"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.58"
|
||||
/>
|
||||
android:id="@+id/guideline"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_frame_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="fitXY"
|
||||
tools:src="@mipmap/me_sj"
|
||||
app:layout_constraintTop_toTopOf="@+id/guideline"
|
||||
app:layout_constraintWidth_default="spread"
|
||||
app:layout_constraintHeight_default="spread"
|
||||
/>
|
||||
android:id="@+id/iv_frame_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintHeight_default="spread"
|
||||
app:layout_constraintTop_toTopOf="@+id/guideline"
|
||||
app:layout_constraintWidth_default="spread"
|
||||
tools:src="@mipmap/me_sj" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_online"
|
||||
android:layout_width="@dimen/dp_13"
|
||||
android:layout_height="@dimen/dp_13"
|
||||
android:src="@mipmap/me_online_icon"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/riv"
|
||||
app:layout_constraintEnd_toEndOf="@id/riv"
|
||||
app:layout_constraintHorizontal_bias="0.9"
|
||||
app:layout_constraintStart_toStartOf="@id/riv"
|
||||
app:layout_constraintTop_toTopOf="@id/riv"
|
||||
app:layout_constraintVertical_bias="0.9"/>
|
||||
android:id="@+id/iv_online"
|
||||
android:layout_width="@dimen/dp_13"
|
||||
android:layout_height="@dimen/dp_13"
|
||||
android:src="@mipmap/me_online_icon"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/riv"
|
||||
app:layout_constraintEnd_toEndOf="@id/riv"
|
||||
app:layout_constraintHorizontal_bias="0.9"
|
||||
app:layout_constraintStart_toStartOf="@id/riv"
|
||||
app:layout_constraintTop_toTopOf="@id/riv"
|
||||
app:layout_constraintVertical_bias="0.9" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -41,7 +41,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:loopCount="0"
|
||||
app:source="ripple3695.svga" />
|
||||
app:source="mic.svga" />
|
||||
|
||||
<!-- <com.xscm.moduleutil.widget.AvatarFrameView-->
|
||||
<!-- android:id="@+id/iv_ripple"-->
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
app:layout_constraintStart_toStartOf="@id/iv_frame"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_frame"
|
||||
app:loopCount="0"
|
||||
app:source="ripple3695.svga" />
|
||||
app:source="mic.svga" />
|
||||
|
||||
<!-- <com.xscm.moduleutil.widget.AvatarFrameView-->
|
||||
<!-- android:id="@+id/iv_ripple"-->
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
app:layout_constraintHeight_default="percent"
|
||||
app:layout_constraintHeight_percent="0.52"
|
||||
app:loopCount="0"
|
||||
app:source="ripple3695.svga" />
|
||||
app:source="mic.svga" />
|
||||
|
||||
|
||||
<!--离线状态 - 和头像框一样大,在标签下面-->
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_percent="0.8"
|
||||
app:loopCount="0"
|
||||
app:source="ripple3695.svga"
|
||||
app:source="mic.svga"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!-- <com.xscm.moduleutil.widget.AvatarFrameView-->
|
||||
|
||||
Reference in New Issue
Block a user