pref: 增加列表背景色交错效果
This commit is contained in:
parent
a18d2bce7b
commit
2df6c3fa3b
|
|
@ -27,7 +27,6 @@ import com.huanchengfly.tieba.post.utils.QuickPreviewUtil.getForumName
|
|||
import com.huanchengfly.tieba.post.utils.QuickPreviewUtil.getPreviewInfo
|
||||
import com.huanchengfly.tieba.post.utils.QuickPreviewUtil.isForumUrl
|
||||
import com.huanchengfly.tieba.post.utils.QuickPreviewUtil.isThreadUrl
|
||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
import org.intellij.lang.annotations.RegExp
|
||||
import org.litepal.LitePal
|
||||
import java.util.*
|
||||
|
|
@ -171,9 +170,7 @@ class BaseApplication : Application() {
|
|||
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
|
||||
override fun onActivityDestroyed(activity: Activity) {}
|
||||
})
|
||||
CrashUtil.CrashHandler.getInstance().init(this)
|
||||
//CrashUtil.CrashHandler crashHandler = CrashUtil.CrashHandler.getInstance();
|
||||
//crashHandler.init(this);
|
||||
//CrashUtil.CrashHandler.getInstance().init(this)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -322,9 +322,9 @@ class NewSearchActivity : BaseActivity(), TabLayout.OnTabSelectedListener {
|
|||
position,
|
||||
itemCount,
|
||||
positionOffset = 1,
|
||||
colors = intArrayOf(R.color.default_color_card, R.color.default_color_divider),
|
||||
radius = context.resources.getDimension(R.dimen.card_radius)
|
||||
)
|
||||
viewHolder.itemView.backgroundTintList = ColorStateListUtils.createColorStateList(context, R.color.default_color_card)
|
||||
}
|
||||
|
||||
override fun getItemLayoutId(): Int {
|
||||
|
|
|
|||
|
|
@ -4,21 +4,24 @@ import android.content.Context
|
|||
import android.view.View
|
||||
import com.alibaba.android.vlayout.layout.GridLayoutHelper
|
||||
import com.huanchengfly.tieba.post.R
|
||||
import com.huanchengfly.tieba.post.adapters.base.BaseSingleTypeDelegateAdapter
|
||||
import com.huanchengfly.tieba.post.adapters.base.BaseMultiTypeDelegateAdapter
|
||||
import com.huanchengfly.tieba.post.api.models.ForumRecommend
|
||||
import com.huanchengfly.tieba.post.components.MyViewHolder
|
||||
import com.huanchengfly.tieba.post.dpToPx
|
||||
import com.huanchengfly.tieba.post.ui.theme.utils.ThemeUtils
|
||||
import com.huanchengfly.tieba.post.utils.ImageUtil
|
||||
import com.huanchengfly.tieba.post.utils.ThemeUtil
|
||||
import com.huanchengfly.tieba.post.utils.getRadiusDrawable
|
||||
import com.huanchengfly.tieba.post.ui.theme.utils.ColorStateListUtils
|
||||
import com.huanchengfly.tieba.post.utils.*
|
||||
|
||||
class MainForumListAdapter(
|
||||
context: Context,
|
||||
span: Int = 1
|
||||
) : BaseSingleTypeDelegateAdapter<ForumRecommend.LikeForum>(
|
||||
) : BaseMultiTypeDelegateAdapter<ForumRecommend.LikeForum>(
|
||||
context, GridLayoutHelper(span)
|
||||
) {
|
||||
companion object {
|
||||
const val TYPE_LIST = 1
|
||||
const val TYPE_GRID = 2
|
||||
}
|
||||
|
||||
var spanCount = span
|
||||
set(value) {
|
||||
field = value
|
||||
|
|
@ -26,51 +29,58 @@ class MainForumListAdapter(
|
|||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun getItemLayoutId(): Int = R.layout.item_forum_list
|
||||
override fun getItemLayoutId(itemType: Int): Int = if (itemType == TYPE_LIST) R.layout.item_forum_list_single else R.layout.item_forum_list
|
||||
|
||||
override fun convert(viewHolder: MyViewHolder, item: ForumRecommend.LikeForum, position: Int) {
|
||||
viewHolder.itemView.setBackgroundColor(ThemeUtils.getColorByAttr(context, R.attr.colorCard))
|
||||
override fun convert(viewHolder: MyViewHolder, item: ForumRecommend.LikeForum, position: Int, viewType: Int) {
|
||||
val cardRadius = context.resources.getDimension(R.dimen.card_radius)
|
||||
when {
|
||||
//单列
|
||||
spanCount == 1 -> {
|
||||
if (position == getCount() - 1) {
|
||||
viewHolder.itemView.background = getRadiusDrawable(bottomLeftPx = cardRadius, bottomRightPx = cardRadius)
|
||||
viewHolder.itemView.background = wrapRipple(
|
||||
Util.getColorByAttr(context, R.attr.colorControlHighlight, R.color.transparent),
|
||||
if (position == getCount() - 1) {
|
||||
getRadiusDrawable(bottomLeftPx = cardRadius, bottomRightPx = cardRadius)
|
||||
} else {
|
||||
getRadiusDrawable()
|
||||
}
|
||||
)
|
||||
if (position % 2 == 1) {
|
||||
viewHolder.itemView.backgroundTintList = ColorStateListUtils.createColorStateList(context, R.color.default_color_card)
|
||||
} else {
|
||||
viewHolder.itemView.background = getRadiusDrawable()
|
||||
viewHolder.itemView.backgroundTintList = ColorStateListUtils.createColorStateList(context, R.color.default_color_divider)
|
||||
}
|
||||
}
|
||||
//双列左
|
||||
position % spanCount == 0 -> {
|
||||
when (position) {
|
||||
//最后一行,左
|
||||
getCount() - 2 -> {
|
||||
viewHolder.itemView.background = getRadiusDrawable(bottomLeftPx = cardRadius)
|
||||
}
|
||||
//最后一项
|
||||
getCount() - 1 -> {
|
||||
viewHolder.itemView.background = getRadiusDrawable(bottomLeftPx = cardRadius, bottomRightPx = cardRadius)
|
||||
}
|
||||
//其他
|
||||
else -> {
|
||||
viewHolder.itemView.background = getRadiusDrawable()
|
||||
}
|
||||
}
|
||||
viewHolder.itemView.backgroundTintList = ColorStateListUtils.createColorStateList(context, R.color.default_color_card)
|
||||
viewHolder.itemView.background = wrapRipple(
|
||||
Util.getColorByAttr(context, R.attr.colorControlHighlight, R.color.transparent),
|
||||
when (position) {
|
||||
//最后一行,左
|
||||
getCount() - 2 -> getRadiusDrawable(bottomLeftPx = cardRadius)
|
||||
//最后一项
|
||||
getCount() - 1 -> getRadiusDrawable(bottomLeftPx = cardRadius, bottomRightPx = cardRadius)
|
||||
//其他
|
||||
else -> getRadiusDrawable()
|
||||
}
|
||||
)
|
||||
}
|
||||
//双列右
|
||||
else -> {
|
||||
if (position == getCount() - 1) {
|
||||
viewHolder.itemView.background = getRadiusDrawable(bottomRightPx = cardRadius)
|
||||
} else {
|
||||
viewHolder.itemView.background = getRadiusDrawable()
|
||||
}
|
||||
viewHolder.itemView.backgroundTintList = ColorStateListUtils.createColorStateList(context, R.color.default_color_card)
|
||||
viewHolder.itemView.background = wrapRipple(
|
||||
Util.getColorByAttr(context, R.attr.colorControlHighlight, R.color.transparent),
|
||||
if (position == getCount() - 1) {
|
||||
getRadiusDrawable(bottomRightPx = cardRadius)
|
||||
} else {
|
||||
getRadiusDrawable()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
if (spanCount > 1) {
|
||||
viewHolder.setVisibility(R.id.forum_list_item_avatar, View.GONE)
|
||||
ImageUtil.clear(viewHolder.getView(R.id.forum_list_item_avatar))
|
||||
} else {
|
||||
viewHolder.setVisibility(R.id.forum_list_item_avatar, View.VISIBLE)
|
||||
ImageUtil.load(viewHolder.getView(R.id.forum_list_item_avatar), ImageUtil.LOAD_TYPE_AVATAR, item.avatar)
|
||||
}
|
||||
ThemeUtil.setChipThemeByLevel(item.levelId,
|
||||
|
|
@ -82,4 +92,8 @@ class MainForumListAdapter(
|
|||
viewHolder.setVisibility(R.id.forum_list_item_sign_status, if ("1" == item.isSign) View.VISIBLE else View.GONE)
|
||||
viewHolder.getView<View>(R.id.forum_list_item_status).minimumWidth = (if ("1" == item.isSign) 50 else 32).dpToPx()
|
||||
}
|
||||
|
||||
override fun getViewType(position: Int, item: ForumRecommend.LikeForum): Int {
|
||||
return if (spanCount == 1) TYPE_LIST else TYPE_GRID
|
||||
}
|
||||
}
|
||||
|
|
@ -23,6 +23,7 @@ class SearchForumAdapter(context: Context?) : BaseMultiTypeDelegateAdapter<Searc
|
|||
position,
|
||||
itemCount,
|
||||
positionOffset = 1,
|
||||
colors = intArrayOf(R.color.default_color_card, R.color.default_color_divider),
|
||||
radius = context.resources.getDimension(R.dimen.card_radius)
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ class SearchUserAdapter(
|
|||
position,
|
||||
itemCount,
|
||||
positionOffset = 1,
|
||||
colors = intArrayOf(R.color.default_color_card, R.color.default_color_divider),
|
||||
radius = context.resources.getDimension(R.dimen.card_radius)
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import com.alibaba.android.vlayout.DelegateAdapter
|
|||
import com.alibaba.android.vlayout.VirtualLayoutManager
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.google.android.material.appbar.AppBarLayout.OnOffsetChangedListener
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
import com.huanchengfly.tieba.post.*
|
||||
import com.huanchengfly.tieba.post.activities.ForumActivity
|
||||
import com.huanchengfly.tieba.post.activities.NewSearchActivity
|
||||
|
|
@ -58,7 +57,7 @@ class MainForumListFragment : BaseFragment(), Refreshable, Toolbar.OnMenuItemCli
|
|||
lateinit var searchBarMotionLayout: MotionLayout
|
||||
|
||||
@BindView(R.id.search_bar)
|
||||
lateinit var searchBar: TextInputLayout
|
||||
lateinit var searchBar: View
|
||||
|
||||
@BindView(R.id.refresh_header)
|
||||
lateinit var refreshLayoutHeader: MaterialHeader
|
||||
|
|
@ -94,8 +93,12 @@ class MainForumListFragment : BaseFragment(), Refreshable, Toolbar.OnMenuItemCli
|
|||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
topForumListAdapter.spanCount = spanCount
|
||||
mainForumListAdapter.spanCount = spanCount
|
||||
if (topForumListAdapter.spanCount != spanCount || mainForumListAdapter.spanCount != spanCount) {
|
||||
topForumListAdapter.spanCount = spanCount
|
||||
mainForumListAdapter.spanCount = spanCount
|
||||
mRecyclerView.recycledViewPool.clear()
|
||||
reloadAdapters()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAccountSwitch() {
|
||||
|
|
@ -166,11 +169,8 @@ class MainForumListFragment : BaseFragment(), Refreshable, Toolbar.OnMenuItemCli
|
|||
}
|
||||
reloadAdapters()
|
||||
toolbar.setOnMenuItemClickListener(this)
|
||||
searchBar.editText?.setOnFocusChangeListener { v, hasFocus ->
|
||||
if (hasFocus) {
|
||||
v.clearFocus()
|
||||
attachContext.goToActivity<NewSearchActivity>()
|
||||
}
|
||||
searchBar.setOnClickListener {
|
||||
attachContext.goToActivity<NewSearchActivity>()
|
||||
}
|
||||
btnOkSign.setOnClickListener {
|
||||
TiebaUtil.startSign(attachContext)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import android.graphics.drawable.Drawable
|
|||
import android.graphics.drawable.GradientDrawable
|
||||
import android.graphics.drawable.RippleDrawable
|
||||
import com.huanchengfly.tieba.post.R
|
||||
import com.huanchengfly.tieba.post.ui.theme.utils.ColorStateListUtils
|
||||
|
||||
@JvmOverloads
|
||||
fun getItemBackgroundDrawable(
|
||||
|
|
@ -15,12 +16,13 @@ fun getItemBackgroundDrawable(
|
|||
itemCount: Int,
|
||||
positionOffset: Int = 0,
|
||||
radius: Float = 10f,
|
||||
colors: IntArray = intArrayOf(R.color.default_color_card),
|
||||
ripple: Boolean = true
|
||||
): Drawable {
|
||||
val realPos = position + positionOffset
|
||||
val maxPos = itemCount - 1 + positionOffset
|
||||
val shape = GradientDrawable().apply {
|
||||
color = ColorStateList.valueOf(Color.WHITE)
|
||||
color = ColorStateListUtils.createColorStateList(context, colors[realPos % colors.size])
|
||||
if (realPos == 0 && realPos == maxPos) {
|
||||
cornerRadius = radius
|
||||
} else if (realPos == 0) {
|
||||
|
|
@ -44,8 +46,7 @@ fun getItemBackgroundDrawable(
|
|||
}
|
||||
}
|
||||
return if (ripple) {
|
||||
val rippleColor = ColorStateList.valueOf(Util.getColorByAttr(context, R.attr.colorControlHighlight, R.color.transparent))
|
||||
RippleDrawable(rippleColor, shape, shape)
|
||||
wrapRipple(Util.getColorByAttr(context, R.attr.colorControlHighlight, R.color.transparent), shape)
|
||||
} else {
|
||||
shape
|
||||
}
|
||||
|
|
@ -55,7 +56,8 @@ fun getRadiusDrawable(
|
|||
topLeftPx: Float = 0f,
|
||||
topRightPx: Float = 0f,
|
||||
bottomLeftPx: Float = 0f,
|
||||
bottomRightPx: Float = 0f
|
||||
bottomRightPx: Float = 0f,
|
||||
ripple: Boolean = false
|
||||
): Drawable {
|
||||
return GradientDrawable().apply {
|
||||
color = ColorStateList.valueOf(Color.WHITE)
|
||||
|
|
@ -67,3 +69,7 @@ fun getRadiusDrawable(
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun wrapRipple(rippleColor: Int, drawable: Drawable): Drawable {
|
||||
return RippleDrawable(ColorStateList.valueOf(rippleColor), drawable, drawable)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?colorControlHighlight">
|
||||
<item android:drawable="@drawable/bg_bottom_radius_10dp" />
|
||||
</ripple>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners
|
||||
android:topLeftRadius="10dp"
|
||||
android:topRightRadius="10dp" />
|
||||
<solid android:color="@color/white" />
|
||||
</shape>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?colorControlHighlight">
|
||||
<item android:drawable="@drawable/bg_top_radius_10dp" />
|
||||
</ripple>
|
||||
|
|
@ -38,33 +38,33 @@
|
|||
android:layout_height="wrap_content"
|
||||
app:layoutDescription="@xml/fragment_main_forum_list_scene">
|
||||
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintTextInputLayout
|
||||
android:id="@+id/search_bar"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
|
||||
android:layout_height="wrap_content"
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
||||
app:backgroundTint="@color/color_toolbar_bar"
|
||||
tools:backgroundTint="@color/color_toolbar_bar"
|
||||
android:padding="12dp"
|
||||
android:background="@drawable/bg_radius_8dp_ripple"
|
||||
android:layout_width="0dp"
|
||||
app:boxBackgroundColor="@color/color_toolbar_bar"
|
||||
app:boxCollapsedPaddingTop="0dp"
|
||||
app:boxCornerRadiusBottomEnd="8dp"
|
||||
app:boxCornerRadiusBottomStart="8dp"
|
||||
app:boxCornerRadiusTopEnd="8dp"
|
||||
app:boxCornerRadiusTopStart="8dp"
|
||||
app:boxStrokeWidth="0dp"
|
||||
app:boxStrokeWidthFocused="0dp"
|
||||
app:hintEnabled="false"
|
||||
app:hintTextColor="@color/default_color_primary"
|
||||
app:placeholderTextColor="@color/default_color_primary"
|
||||
app:startIconTint="@color/color_on_toolbar_bar"
|
||||
app:startIconDrawable="@drawable/ic_search">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/search_bar">
|
||||
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintTextInputEditText
|
||||
android:layout_width="match_parent"
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
app:srcCompat="@drawable/ic_search"
|
||||
tools:tint="@color/color_on_toolbar_bar"
|
||||
app:tint="@color/color_on_toolbar_bar" />
|
||||
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintTextView
|
||||
android:layout_marginStart="16dp"
|
||||
android:textSize="16sp"
|
||||
tools:textColor="@color/color_on_toolbar_bar"
|
||||
app:tint="@color/color_on_toolbar_bar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:cursorVisible="false"
|
||||
app:textColorHint="@color/color_on_toolbar_bar"
|
||||
android:hint="@string/hint_search" />
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintTextInputLayout>
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/hint_search" />
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
||||
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintImageView
|
||||
android:id="@+id/btn_oksign"
|
||||
|
|
|
|||
|
|
@ -162,21 +162,18 @@
|
|||
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
||||
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
<LinearLayout
|
||||
android:layout_marginStart="@dimen/card_margin"
|
||||
android:layout_marginEnd="@dimen/card_margin"
|
||||
android:layout_marginBottom="@dimen/card_margin"
|
||||
android:background="@drawable/bg_radius_10dp"
|
||||
app:backgroundTint="@color/default_color_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
||||
android:id="@+id/my_info_collect"
|
||||
android:background="?selectableItemBackground"
|
||||
android:background="@drawable/bg_top_radius_10dp_ripple"
|
||||
app:backgroundTint="@color/default_color_card"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:paddingTop="16dp"
|
||||
|
|
@ -198,11 +195,12 @@
|
|||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
||||
android:id="@+id/my_info_history"
|
||||
android:background="?selectableItemBackground"
|
||||
app:backgroundTint="@color/default_color_divider"
|
||||
android:background="@drawable/bg_ripple"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:paddingTop="16dp"
|
||||
|
|
@ -224,11 +222,12 @@
|
|||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
||||
android:id="@+id/my_info_theme"
|
||||
android:background="?selectableItemBackground"
|
||||
android:background="@drawable/bg_ripple"
|
||||
app:backgroundTint="@color/default_color_card"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:paddingTop="16dp"
|
||||
|
|
@ -287,11 +286,12 @@
|
|||
android:layout_toEndOf="@id/my_info_night_tv" />
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
||||
android:id="@+id/my_info_service_center"
|
||||
android:background="?selectableItemBackground"
|
||||
android:background="@drawable/bg_bottom_radius_10dp_ripple"
|
||||
app:backgroundTint="@color/default_color_divider"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:paddingTop="16dp"
|
||||
|
|
@ -313,24 +313,21 @@
|
|||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
<LinearLayout
|
||||
android:layout_marginStart="@dimen/card_margin"
|
||||
android:layout_marginEnd="@dimen/card_margin"
|
||||
android:layout_marginBottom="@dimen/card_margin"
|
||||
android:background="@drawable/bg_radius_10dp"
|
||||
app:backgroundTint="@color/default_color_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
||||
android:id="@+id/my_info_settings"
|
||||
android:background="?selectableItemBackground"
|
||||
android:background="@drawable/bg_top_radius_10dp_ripple"
|
||||
app:backgroundTint="@color/default_color_card"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:paddingTop="16dp"
|
||||
|
|
@ -352,11 +349,12 @@
|
|||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
||||
android:id="@+id/my_info_about"
|
||||
android:background="?selectableItemBackground"
|
||||
app:backgroundTint="@color/default_color_divider"
|
||||
android:background="@drawable/bg_bottom_radius_10dp_ripple"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:paddingTop="16dp"
|
||||
|
|
@ -379,8 +377,8 @@
|
|||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintSwipeRefreshLayout>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:foreground="?attr/selectableItemBackground"
|
||||
app:backgroundTint="@color/default_color_card"
|
||||
android:paddingStart="@dimen/padding_start_default"
|
||||
android:paddingEnd="@dimen/padding_end_default"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,77 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
app:backgroundTint="@color/default_color_card"
|
||||
android:paddingStart="@dimen/padding_start_default"
|
||||
android:paddingEnd="@dimen/padding_end_default"
|
||||
android:padding="12dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:id="@+id/forum_list_item_avatar"
|
||||
android:layout_width="@dimen/size_forum_list_avatar"
|
||||
android:layout_height="@dimen/size_forum_list_avatar" />
|
||||
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintTextView
|
||||
android:layout_toEndOf="@id/forum_list_item_avatar"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:id="@+id/forum_list_item_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_toStartOf="@id/forum_list_item_status"
|
||||
android:ellipsize="end"
|
||||
android:gravity="start|center_vertical"
|
||||
android:maxLines="1"
|
||||
android:textSize="16sp"
|
||||
app:tint="@color/default_color_text"
|
||||
tools:text="Title" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/forum_list_item_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@drawable/bg_radius_50dp"
|
||||
android:backgroundTint="#FFFF9800"
|
||||
android:minWidth="54dp"
|
||||
android:padding="3dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/forum_list_item_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10dp"
|
||||
android:textStyle="bold"
|
||||
tools:text="13"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/forum_list_item_sign_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_toEndOf="@id/forum_list_item_level"
|
||||
android:text="@string/tip_signed"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10dp"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="SpUsage" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintRelativeLayout>
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintRelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout 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"
|
||||
app:backgroundTint="@color/default_color_card"
|
||||
|
|
@ -24,4 +23,4 @@
|
|||
android:textSize="16sp"
|
||||
android:layout_centerVertical="true"
|
||||
tools:text="Title" />
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintRelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintRelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
app:backgroundTint="@color/default_color_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp">
|
||||
|
|
@ -36,4 +34,4 @@
|
|||
app:tint="@color/default_color_text_secondary"
|
||||
android:textSize="13sp"
|
||||
tools:text="Sub Title" />
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintRelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.huanchengfly.tieba.post.widgets.theme.TintRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:padding="16dp"
|
||||
app:backgroundTint="@color/default_color_card"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ImageView
|
||||
|
|
@ -39,4 +37,4 @@
|
|||
android:textSize="13sp"
|
||||
tools:text="Sub Title" />
|
||||
</LinearLayout>
|
||||
</com.huanchengfly.tieba.post.widgets.theme.TintRelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
@ -58,7 +58,7 @@
|
|||
<color name="default_color_toolbar_item_active">#FF4477E0</color>
|
||||
<color name="default_color_floor_card">#FFF0F3F5</color>
|
||||
<color name="default_color_card">#FFFFFFFF</color>
|
||||
<color name="default_color_divider">#FFF0F3F5</color>
|
||||
<color name="default_color_divider">#FFF7FBFE</color>
|
||||
<color name="default_color_shadow">#FEE9E9E9</color>
|
||||
<color name="default_color_toolbar_item_secondary">#FF545967</color>
|
||||
<color name="default_color_swipe_refresh_view_background">#FFFFFFFF</color>
|
||||
|
|
@ -152,7 +152,7 @@
|
|||
<color name="theme_color_swipe_refresh_view_background_grey_dark">#FF252525</color>
|
||||
<color name="theme_color_swipe_refresh_view_background_amoled_dark">#FF1C1C1C</color>
|
||||
|
||||
<color name="theme_color_divider_light">@color/color_divider</color>
|
||||
<color name="theme_color_divider_light">#FFF7FBFE</color>
|
||||
<color name="theme_color_divider_translucent_light">#10FFFFFF</color>
|
||||
<color name="theme_color_divider_translucent_dark">#15000000</color>
|
||||
<color name="theme_color_divider_dark">#FF10171D</color>
|
||||
|
|
@ -164,7 +164,7 @@
|
|||
|
||||
<color name="red_accent">#FFC51100</color>
|
||||
|
||||
<color name="color_divider">#FFF0F3F5</color>
|
||||
<color name="color_divider">#FFF7FBFE</color>
|
||||
|
||||
<color name="colorSplashBg">#ffffff</color>
|
||||
<color name="icon_blue">#FF3373EE</color>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<dimen name="text_size_hot_title">16sp</dimen>
|
||||
<dimen name="text_size_hot_desc">14sp</dimen>
|
||||
<dimen name="text_size_refresh_tip">14sp</dimen>
|
||||
<dimen name="size_forum_list_avatar">36dp</dimen>
|
||||
<dimen name="size_forum_list_avatar">42dp</dimen>
|
||||
<dimen name="size_avatar">36dp</dimen>
|
||||
<dimen name="default_small_pic_radius">8dp</dimen>
|
||||
<dimen name="padding_start_default">16dp</dimen>
|
||||
|
|
|
|||
Loading…
Reference in New Issue