feat: 用户吧龄显示 & UI 优化
This commit is contained in:
parent
4a0bf0d41e
commit
f37366d931
|
|
@ -279,7 +279,7 @@
|
|||
android:label="@string/title_theme_settings"
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
<activity
|
||||
android:name=".activities.EditProfileActivity"
|
||||
android:name=".ui.editprofile.view.EditProfileActivity"
|
||||
android:configChanges="screenSize|screenLayout|orientation|smallestScreenSize|keyboardHidden"
|
||||
android:label="@string/title_activity_edit_profile"
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<litepal>
|
||||
<dbname value="tblite" />
|
||||
<version value="28" />
|
||||
<version value="29" />
|
||||
<list>
|
||||
<mapping class="com.huanchengfly.tieba.post.models.database.Account" />
|
||||
<mapping class="com.huanchengfly.tieba.post.models.database.Draft" />
|
||||
|
|
|
|||
|
|
@ -71,6 +71,9 @@ class UserActivity : BaseActivity() {
|
|||
@BindView(R.id.user_sex)
|
||||
lateinit var sexTv: TextView
|
||||
|
||||
@BindView(R.id.user_tb_age)
|
||||
lateinit var tbAgeTv: TextView
|
||||
|
||||
@BindView(R.id.user_center_action_btn)
|
||||
lateinit var actionBtn: TintMaterialButton
|
||||
|
||||
|
|
@ -86,6 +89,9 @@ class UserActivity : BaseActivity() {
|
|||
@BindView(R.id.user_center_header_mask)
|
||||
lateinit var headerMaskView: View
|
||||
|
||||
@BindView(R.id.user_info_chips)
|
||||
lateinit var infoChips: View
|
||||
|
||||
private var profileBean: ProfileBean? = null
|
||||
private var uid: String? = null
|
||||
private var tab = 0
|
||||
|
|
@ -117,8 +123,8 @@ class UserActivity : BaseActivity() {
|
|||
actionBtn.visibility = View.GONE
|
||||
if (!TextUtils.isEmpty(avatar)) {
|
||||
loadingView.visibility = View.GONE
|
||||
ImageUtil.load(avatarView, ImageUtil.LOAD_TYPE_AVATAR, avatar)
|
||||
ImageUtil.initImageView(avatarView, PhotoViewBean(avatar))
|
||||
ImageUtil.load(avatarView, ImageUtil.LOAD_TYPE_AVATAR, StringUtil.getAvatarUrl(avatar))
|
||||
ImageUtil.initImageView(avatarView, PhotoViewBean(StringUtil.getAvatarUrl(avatar)))
|
||||
}
|
||||
appbar.addOnOffsetChangedListener { appBarLayout: AppBarLayout, verticalOffset: Int ->
|
||||
val percent = abs(verticalOffset * 1.0f) / appBarLayout.totalScrollRange
|
||||
|
|
@ -202,6 +208,8 @@ class UserActivity : BaseActivity() {
|
|||
}
|
||||
sexTv.text =
|
||||
if (profileBean!!.user!!.sex == "1") "♂" else if (profileBean!!.user!!.sex == "2") "♀" else "?"
|
||||
tbAgeTv.text = getString(R.string.tb_age, profileBean!!.user!!.tbAge)
|
||||
infoChips.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@ data class Account(
|
|||
var fansNum: String? = null,
|
||||
var postNum: String? = null,
|
||||
var concernNum: String? = null,
|
||||
var tbAge: String? = null,
|
||||
var age: String? = null,
|
||||
var birthdayShowStatus: String? = null,
|
||||
var birthdayTime: String? = null,
|
||||
var constellation: String? = null,
|
||||
) : LitePalSupport() {
|
||||
internal constructor() : this("", "", "", "", "", "", "")
|
||||
|
||||
|
|
|
|||
|
|
@ -97,26 +97,11 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textSize="16sp"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
app:tint="@color/color_text_translucent_light"
|
||||
tools:text="USER" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_sex"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/bg_radius_50dp"
|
||||
android:backgroundTint="@color/user_center_action_btn_color"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingBottom="1dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
tools:text="♂" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintTextView
|
||||
|
|
@ -124,15 +109,15 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:textSize="12sp"
|
||||
app:tint="@color/color_text_secondary_translucent_light" />
|
||||
android:textSize="14sp"
|
||||
app:tint="@color/color_text_secondary_translucent_light"
|
||||
tools:text="介绍" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/user_center_stat"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="34dp"
|
||||
android:gravity="bottom"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
|
@ -175,6 +160,48 @@
|
|||
android:textStyle="bold"
|
||||
app:tint="@color/color_text_translucent_light" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/user_info_chips"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="34dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_sex"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/bg_radius_50dp"
|
||||
android:backgroundTint="@color/user_center_action_btn_color"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp"
|
||||
tools:text="♂" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_tb_age"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/bg_radius_50dp"
|
||||
android:backgroundTint="@color/user_center_action_btn_color"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp"
|
||||
tools:text="吧龄 10.7 年" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@
|
|||
<color name="icon_blue">#FF3373EE</color>
|
||||
<color name="icon_purple">#FF8E6DCA</color>
|
||||
<color name="black_trans">#50000000</color>
|
||||
<color name="user_center_action_btn_color">#50FFFFFF</color>
|
||||
<color name="user_center_action_btn_color">#40FFFFFF</color>
|
||||
<color name="user_center_header_mask">#90000000</color>
|
||||
<color name="default_color_on_accent">#FFFFFFFF</color>
|
||||
</resources>
|
||||
|
|
@ -4,6 +4,7 @@ android.useAndroidX=true
|
|||
kapt.verbose=true
|
||||
kotlin.code.style=official
|
||||
kotlin.parallel.tasks.in.project=true
|
||||
kotlin.incremental.useClasspathSnapshot=true
|
||||
org.gradle.caching=true
|
||||
org.gradle.configureondemand=true
|
||||
org.gradle.jvmargs=-Xmx2g -XX:+UseParallelGC -Dfile.encoding=UTF-8
|
||||
|
|
|
|||
Loading…
Reference in New Issue