修复 首页"优质陪伴"tab UI 问题
This commit is contained in:
@@ -172,4 +172,9 @@ public class ViewAdapter {
|
||||
public static void setBirthday(GenderAgeTextView v, long birthday) {
|
||||
v.setBirthDay(birthday);
|
||||
}
|
||||
|
||||
@BindingAdapter(value = {"gender"}, requireAll = false)
|
||||
public static void setGender(GenderAgeTextView v, int gender) {
|
||||
v.setGender(gender);
|
||||
}
|
||||
}
|
||||
|
@@ -21,14 +21,14 @@ import com.yizhuan.erban.ui.user.activity.UserInfoActivity
|
||||
import com.yizhuan.erban.ui.user.adapter.UserInfoLabelAdapter
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.erban.ui.utils.loadAvatar
|
||||
import com.yizhuan.erban.view.GenderAgeTextView
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo.SoundBean
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils
|
||||
import com.yizhuan.xchat_android_core.utils.StarUtils
|
||||
import com.yizhuan.xchat_android_core.utils.ifNullOrEmpty
|
||||
import com.yizhuan.xchat_android_library.common.widget.LinesFlexBoxLayoutManager
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils
|
||||
import java.util.*
|
||||
import java.util.Date
|
||||
|
||||
class RoomNewFriendsAdapter :
|
||||
BaseQuickAdapter<UserInfo, BaseViewHolder>(R.layout.item_room_new_friends) {
|
||||
@@ -36,27 +36,21 @@ class RoomNewFriendsAdapter :
|
||||
override fun convert(helper: BaseViewHolder, item: UserInfo) {
|
||||
helper.getView<ImageView>(R.id.iv_avatar).loadAvatar(item.avatar)
|
||||
helper.setText(R.id.tv_desc, item.userDesc.ifNullOrEmpty { "我是个默认签名" })
|
||||
.setText(
|
||||
R.id.tv_age,
|
||||
((CurrentTimeUtils.getCurrentTime() - item.birth) / 1000 / 60 / 60 / 24 / 365).toString()
|
||||
)
|
||||
|
||||
val tvGenderAge = helper.getView<GenderAgeTextView>(R.id.tv_gender_age)
|
||||
tvGenderAge.setBirthDay(item.birth)
|
||||
tvGenderAge.setGender(item.gender)
|
||||
|
||||
//设置星座
|
||||
val star = StarUtils.getConstellation(Date(item.birth))
|
||||
helper.setImageResource(R.id.iv_constellation, star)
|
||||
helper.setBackgroundRes(
|
||||
R.id.ll_gender_age,
|
||||
if (item.gender == 1) R.drawable.shape_65d3f7_corner else R.drawable.shape_ff9cce_corner
|
||||
)
|
||||
helper.setImageResource(
|
||||
R.id.iv_gender,
|
||||
if (item.gender == 1) R.drawable.ic_home_man else R.drawable.ic_home_woman
|
||||
)
|
||||
val star = StarUtils.getConstellationString(Date(item.birth))
|
||||
helper.setText(R.id.tv_constellation, star)
|
||||
|
||||
val tvTalk = helper.getView<TextView>(R.id.tv_talk)
|
||||
val viewOnline = helper.getView<View>(R.id.view_online)
|
||||
val groupParty = helper.getView<Group>(R.id.group_party)
|
||||
|
||||
viewOnline.isVisible = item.inOnline
|
||||
if(item.inMic){
|
||||
if (item.inMic) {
|
||||
groupParty.visibility = View.VISIBLE
|
||||
} else {
|
||||
groupParty.visibility = View.INVISIBLE
|
||||
@@ -112,7 +106,7 @@ class RoomNewFriendsAdapter :
|
||||
}
|
||||
|
||||
val mLabelRecyclerView = helper.getView<RecyclerView>(R.id.mLabelRecyclerView)
|
||||
if(!ListUtils.isListEmpty(item.labels)){
|
||||
if (!ListUtils.isListEmpty(item.labels)) {
|
||||
mLabelRecyclerView.visibility = View.VISIBLE
|
||||
val userInfoLabelAdapter = UserInfoLabelAdapter()
|
||||
|
||||
|
@@ -307,6 +307,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
UserInfoUiMgr.get().setValue(userInfo);
|
||||
mBinding.tvDesc.setText(userInfo.getUserDesc() != null ? userInfo.getUserDesc() : getResources().getString(R.string.msg_no_user_desc));
|
||||
|
||||
mBinding.tvGenderAge.setGender(userInfo.getGender());
|
||||
mBinding.tvGenderAge.setBirthDay(userInfo.getBirth());
|
||||
|
||||
mBinding.tvFansCount.setText(String.valueOf(userInfo.getFansNum()));
|
||||
|
@@ -14,8 +14,6 @@ class UserInfoLabelAdapter :
|
||||
BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_user_info_label) {
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: String) {
|
||||
val tvLabel = helper.getView<AppCompatTextView>(R.id.tv_user_tag)
|
||||
tvLabel.isSelected = helper.layoutPosition <3
|
||||
helper.setText(R.id.tv_user_tag, item)
|
||||
}
|
||||
|
||||
|
@@ -3,37 +3,46 @@ package com.yizhuan.erban.view
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import android.view.Gravity
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.yizhuan.erban.R
|
||||
import java.util.Calendar
|
||||
import java.util.Date
|
||||
|
||||
class GenderAgeTextView : AppCompatTextView {
|
||||
class GenderAgeTextView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyle: Int = 0
|
||||
) : AppCompatTextView(context, attrs, defStyle) {
|
||||
|
||||
constructor(context: Context) : this(context, null)
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : this(context, attrs, 0)
|
||||
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
) {
|
||||
init(context, attrs)
|
||||
}
|
||||
|
||||
fun init(context: Context, attrs: AttributeSet?) {
|
||||
init {
|
||||
val array =
|
||||
context.obtainStyledAttributes(attrs, R.styleable.GenderAgeTextView)
|
||||
val gender = array.getInt(R.styleable.GenderAgeTextView_gender, 0)
|
||||
array.recycle()
|
||||
|
||||
setTextColor(Color.WHITE)
|
||||
textSize = 12f
|
||||
|
||||
minWidth = resources.getDimensionPixelOffset(R.dimen.dp_26)
|
||||
gravity = Gravity.CENTER_VERTICAL
|
||||
setPadding(
|
||||
resources.getDimensionPixelOffset(R.dimen.dp_4),
|
||||
0,
|
||||
resources.getDimensionPixelOffset(R.dimen.dp_4),
|
||||
0
|
||||
)
|
||||
compoundDrawablePadding = resources.getDimensionPixelOffset(R.dimen.dp_2)
|
||||
|
||||
setGender(gender)
|
||||
setBirthDay(System.currentTimeMillis())
|
||||
}
|
||||
|
||||
fun setBirthDay(ts: Long) {
|
||||
text = getAgeByBirthday(Date(ts)).toString()
|
||||
}
|
||||
|
||||
fun setGender(gender: Int) {
|
||||
setCompoundDrawablesRelativeWithIntrinsicBounds(
|
||||
if (gender == GENDER_MALE) R.drawable.ic_gender_male_t else R.drawable.ic_gender_female_t,
|
||||
0,
|
||||
@@ -46,20 +55,6 @@ class GenderAgeTextView : AppCompatTextView {
|
||||
if (gender == GENDER_MALE) R.drawable.bg_gender_male else R.drawable.bg_gender_female
|
||||
)
|
||||
background = drawable
|
||||
|
||||
setPadding(
|
||||
resources.getDimensionPixelOffset(R.dimen.dp_4),
|
||||
0,
|
||||
resources.getDimensionPixelOffset(R.dimen.dp_4),
|
||||
0
|
||||
)
|
||||
compoundDrawablePadding = resources.getDimensionPixelOffset(R.dimen.dp_2)
|
||||
|
||||
setBirthDay(System.currentTimeMillis())
|
||||
}
|
||||
|
||||
fun setBirthDay(ts: Long) {
|
||||
text = getAgeByBirthday(Date(ts)).toString()
|
||||
}
|
||||
|
||||
private fun getAgeByBirthday(birthday: Date): Int {
|
||||
@@ -87,9 +82,9 @@ class GenderAgeTextView : AppCompatTextView {
|
||||
return age
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
const val GENDER_MALE = 0
|
||||
const val GENDER_FEMALE = 1
|
||||
const val GENDER_UNKNOWN = 0
|
||||
const val GENDER_MALE = 1
|
||||
const val GENDER_FEMALE = 2
|
||||
}
|
||||
}
|
@@ -1,5 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="100dp" />
|
||||
<solid android:color="#339168FA" />
|
||||
|
||||
<solid android:color="@color/color_339168FA" />
|
||||
|
||||
<corners android:radius="@dimen/dp_16" />
|
||||
|
||||
</shape>
|
@@ -184,6 +184,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/tv_nick"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_nick" />
|
||||
|
@@ -67,26 +67,26 @@
|
||||
android:id="@+id/iv_audit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_avatar_auditing_me"
|
||||
android:visibility="@{userInfo.isReview()?View.VISIBLE:View.GONE}"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_user_head"
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_user_head"
|
||||
app:layout_constraintRight_toRightOf="@id/iv_user_head" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:text="@string/in_audit"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:textColor="@color/white"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/in_audit"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:visibility="@{userInfo.isReview()?View.VISIBLE:View.GONE}"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_audit"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_audit"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_audit"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_audit"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_audit"/>
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_audit"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_audit" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/layout_user_info"
|
||||
@@ -141,10 +141,10 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_copy"
|
||||
android:src="@drawable/ic_user_info_copy"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:src="@drawable/ic_user_info_copy" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -154,7 +154,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:birthday="@{userInfo.birth}"
|
||||
app:gender="@{userInfo.gender}"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ll_id"
|
||||
app:layout_constraintStart_toEndOf="@id/ll_id"
|
||||
app:layout_constraintTop_toTopOf="@id/ll_id" />
|
||||
@@ -192,8 +194,8 @@
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="visible"
|
||||
tools:src="@mipmap/ic_user_level" />
|
||||
|
||||
@@ -201,8 +203,8 @@
|
||||
android:id="@+id/iv_user_charm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="visible"
|
||||
tools:src="@drawable/ic_user_charm_level" />
|
||||
|
||||
@@ -212,14 +214,14 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/tag_101"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@drawable/tag_101"
|
||||
android:gravity="center"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
tools:ignore="SmallSp" />
|
||||
tools:ignore="SmallSp"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -562,9 +564,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/me_my_room"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_my_room_right"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_room_right"
|
||||
@@ -574,10 +576,10 @@
|
||||
android:textColor="@color/color_1F1A4E"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_my_room"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_my_room"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_my_room"/>
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_my_room"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_my_room" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_room"
|
||||
@@ -588,9 +590,9 @@
|
||||
android:textColor="@color/color_1F1A4E"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_my_room"/>
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_my_room" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -614,9 +616,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/me_gain_recording"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_earn_right"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_earn_right"
|
||||
@@ -626,10 +628,10 @@
|
||||
android:textColor="@color/color_1F1A4E"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_earn"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_earn"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_earn"/>
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_earn"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_earn" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_earn"
|
||||
@@ -640,9 +642,9 @@
|
||||
android:textColor="@color/color_1F1A4E"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_earn"/>
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_earn" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -650,12 +652,12 @@
|
||||
android:id="@+id/ll_clean_diamonds"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_18"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_18"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
|
@@ -80,43 +80,24 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:maxEms="8"
|
||||
android:textColor="@color/color_1F1B4F"
|
||||
android:textSize="14sp"
|
||||
android:lines="1"
|
||||
android:ellipsize="end"
|
||||
android:maxEms="8"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_avatar"
|
||||
app:layout_constraintTop_toTopOf="@id/view_bg"
|
||||
tools:text="余生点唱歌曲京东卡数据接口的萨拉卡死" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_gender_age"
|
||||
<com.yizhuan.erban.view.GenderAgeTextView
|
||||
android:id="@+id/tv_gender_age"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_marginStart="4dp"
|
||||
android:background="@drawable/shape_ff9cce_corner"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_nickname"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_nickname"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_nickname">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_gender"
|
||||
android:layout_width="@dimen/dp_8"
|
||||
android:layout_height="@dimen/dp_8"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:src="@drawable/ic_home_woman" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_age"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="1dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10"
|
||||
tools:text="22" />
|
||||
|
||||
</LinearLayout>
|
||||
app:layout_constraintTop_toTopOf="@id/tv_nickname" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
@@ -126,7 +107,7 @@
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_nickname"
|
||||
app:layout_constraintStart_toEndOf="@id/ll_gender_age"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_gender_age"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_nickname"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
@@ -143,14 +124,17 @@
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_constellation"
|
||||
android:layout_width="46dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
<TextView
|
||||
android:id="@+id/tv_constellation"
|
||||
android:layout_width="@dimen/dp_46"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:background="@drawable/bg_constellation"
|
||||
android:gravity="center"
|
||||
android:src="@drawable/ic_constellation_aquarius"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_avatar"
|
||||
android:textColor="@color/color_9168FA"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_nickname"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_nickname"
|
||||
tools:text="巨蟹座" />
|
||||
|
||||
@@ -158,13 +142,14 @@
|
||||
android:id="@+id/mLabelRecyclerView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_24"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_constellation"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_talk"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_constellation"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_nickname" />
|
||||
app:layout_constraintStart_toEndOf="@id/tv_constellation"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_constellation" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_desc"
|
||||
@@ -185,7 +170,7 @@
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_talk"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_avatar"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_constellation" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_constellation" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llAudio"
|
||||
@@ -200,7 +185,7 @@
|
||||
android:paddingEnd="@dimen/dp_12"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_avatar"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_constellation"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_constellation"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
|
@@ -414,8 +414,9 @@
|
||||
|
||||
<declare-styleable name="GenderAgeTextView">
|
||||
<attr name="gender" format="enum">
|
||||
<enum name="male" value="0" />
|
||||
<enum name="female" value="1" />
|
||||
<enum name="unknown" value="0" />
|
||||
<enum name="male" value="1" />
|
||||
<enum name="female" value="2" />
|
||||
</attr>
|
||||
</declare-styleable>
|
||||
|
||||
|
@@ -624,6 +624,7 @@
|
||||
<color name="color_13E2F5">#13E2F5</color>
|
||||
<color name="color_CC66FF">#CC66FF</color>
|
||||
<color name="color_9168FA">#9168FA</color>
|
||||
<color name="color_339168FA">#339168FA</color>
|
||||
<color name="color_0D344D">#0D344D</color>
|
||||
<color name="color_75FBE2">#75FBE2</color>
|
||||
<color name="color_A8041D">#A8041D</color>
|
||||
|
@@ -66,6 +66,24 @@ public class StarUtils {
|
||||
return constellationImgArr[11];
|
||||
}
|
||||
|
||||
public static String getConstellationString(Date date) {
|
||||
if (date == null) {
|
||||
return constellationArr[0];
|
||||
}
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
int month = cal.get(Calendar.MONTH);
|
||||
int day = cal.get(Calendar.DAY_OF_MONTH);
|
||||
if (day < constellationEdgeDay[month]) {
|
||||
month = month - 1;
|
||||
}
|
||||
if (month >= 0) {
|
||||
return constellationArr[month];
|
||||
}
|
||||
// default to return 魔羯
|
||||
return constellationArr[11];
|
||||
}
|
||||
|
||||
public static String getElapseTimeForShowNOS(int milliseconds) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int seconds = milliseconds / 1000;
|
||||
|
Reference in New Issue
Block a user