添加个人头像完成

This commit is contained in:
tongchenfei
2020-06-08 17:48:29 +08:00
parent b8617ed402
commit 34ef0c4bae
6 changed files with 24 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.module.extensions.userinfo.UserInfo;
import com.mogo.utils.glide.GlideApp;
import com.mogo.utils.logger.Logger;
/**
@@ -35,6 +36,8 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
private View mMsgContainer;
private TextView mMsgCounter;
private ImageView mUserHeadImg;
@Override
protected int getLayoutId() {
return R.layout.module_ext_layout_extensions;
@@ -47,6 +50,8 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
mWeatherIcon = findViewById( R.id.module_ext_id_weather_icon );
mWeatherTemp = findViewById( R.id.module_ext_id_weather_temp );
mUserHeadImg = findViewById(R.id.ivUserHeadImg);
mMsgContainer = findViewById( R.id.module_ext_id_msg );
mMsgContainer.setOnClickListener( view -> {
ARouter.getInstance().build( "/push/ui/message" ).navigation( getContext() );
@@ -100,5 +105,6 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
@Override
public void renderUserInfo(UserInfo userInfo) {
Logger.d(TAG, "renderUserInfo: " + userInfo);
GlideApp.with(getContext()).load(userInfo.getHeadImgurl()).circleCrop().into(mUserHeadImg);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -41,8 +41,9 @@
android:layout_marginRight="@dimen/module_ext_msg_marginRight"
android:background="@drawable/module_ext_drawable_msg_container_bkg"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/ivUserHeadImg"
app:layout_constraintRight_toLeftOf="@+id/ivUserHeadImg"
app:layout_constraintTop_toTopOf="@+id/ivUserHeadImg"
tools:visibility="visible">
<ImageView
@@ -66,5 +67,14 @@
tools:text="···" />
</FrameLayout>
<ImageView
android:id="@+id/ivUserHeadImg"
android:layout_width="@dimen/module_ext_height"
android:layout_height="@dimen/module_ext_height"
android:layout_marginEnd="@dimen/dp_16"
android:src="@drawable/model_ext_default_user_head"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -73,6 +73,9 @@
<dimen name="module_ext_msg_counter_height">30px</dimen>
<dimen name="module_ext_msg_counter_textSize">20px</dimen>
<dimen name="module_ext_user_img_width">103px</dimen>
<dimen name="module_ext_user_img_height">103px</dimen>
<!-- module_map_layout_navi_info_panel.xml-->
<dimen name="module_ext_navi_info_panel_width">1058px</dimen>
<dimen name="module_ext_navi_info_panel_height">210px</dimen>

View File

@@ -76,6 +76,9 @@
<dimen name="module_ext_msg_counter_height">15px</dimen>
<dimen name="module_ext_msg_counter_textSize">11.73px</dimen>
<dimen name="module_ext_user_img_width">56px</dimen>
<dimen name="module_ext_user_img_height">56px</dimen>
<!-- module_map_layout_navi_info_panel.xml-->
<dimen name="module_ext_navi_info_panel_width">544px</dimen>
<dimen name="module_ext_navi_info_panel_height">117px</dimen>