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.getPreviewInfo
|
||||||
import com.huanchengfly.tieba.post.utils.QuickPreviewUtil.isForumUrl
|
import com.huanchengfly.tieba.post.utils.QuickPreviewUtil.isForumUrl
|
||||||
import com.huanchengfly.tieba.post.utils.QuickPreviewUtil.isThreadUrl
|
import com.huanchengfly.tieba.post.utils.QuickPreviewUtil.isThreadUrl
|
||||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout
|
|
||||||
import org.intellij.lang.annotations.RegExp
|
import org.intellij.lang.annotations.RegExp
|
||||||
import org.litepal.LitePal
|
import org.litepal.LitePal
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
@ -171,9 +170,7 @@ class BaseApplication : Application() {
|
||||||
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
|
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
|
||||||
override fun onActivityDestroyed(activity: Activity) {}
|
override fun onActivityDestroyed(activity: Activity) {}
|
||||||
})
|
})
|
||||||
CrashUtil.CrashHandler.getInstance().init(this)
|
//CrashUtil.CrashHandler.getInstance().init(this)
|
||||||
//CrashUtil.CrashHandler crashHandler = CrashUtil.CrashHandler.getInstance();
|
|
||||||
//crashHandler.init(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -322,9 +322,9 @@ class NewSearchActivity : BaseActivity(), TabLayout.OnTabSelectedListener {
|
||||||
position,
|
position,
|
||||||
itemCount,
|
itemCount,
|
||||||
positionOffset = 1,
|
positionOffset = 1,
|
||||||
|
colors = intArrayOf(R.color.default_color_card, R.color.default_color_divider),
|
||||||
radius = context.resources.getDimension(R.dimen.card_radius)
|
radius = context.resources.getDimension(R.dimen.card_radius)
|
||||||
)
|
)
|
||||||
viewHolder.itemView.backgroundTintList = ColorStateListUtils.createColorStateList(context, R.color.default_color_card)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getItemLayoutId(): Int {
|
override fun getItemLayoutId(): Int {
|
||||||
|
|
|
||||||
|
|
@ -4,21 +4,24 @@ import android.content.Context
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import com.alibaba.android.vlayout.layout.GridLayoutHelper
|
import com.alibaba.android.vlayout.layout.GridLayoutHelper
|
||||||
import com.huanchengfly.tieba.post.R
|
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.api.models.ForumRecommend
|
||||||
import com.huanchengfly.tieba.post.components.MyViewHolder
|
import com.huanchengfly.tieba.post.components.MyViewHolder
|
||||||
import com.huanchengfly.tieba.post.dpToPx
|
import com.huanchengfly.tieba.post.dpToPx
|
||||||
import com.huanchengfly.tieba.post.ui.theme.utils.ThemeUtils
|
import com.huanchengfly.tieba.post.ui.theme.utils.ColorStateListUtils
|
||||||
import com.huanchengfly.tieba.post.utils.ImageUtil
|
import com.huanchengfly.tieba.post.utils.*
|
||||||
import com.huanchengfly.tieba.post.utils.ThemeUtil
|
|
||||||
import com.huanchengfly.tieba.post.utils.getRadiusDrawable
|
|
||||||
|
|
||||||
class MainForumListAdapter(
|
class MainForumListAdapter(
|
||||||
context: Context,
|
context: Context,
|
||||||
span: Int = 1
|
span: Int = 1
|
||||||
) : BaseSingleTypeDelegateAdapter<ForumRecommend.LikeForum>(
|
) : BaseMultiTypeDelegateAdapter<ForumRecommend.LikeForum>(
|
||||||
context, GridLayoutHelper(span)
|
context, GridLayoutHelper(span)
|
||||||
) {
|
) {
|
||||||
|
companion object {
|
||||||
|
const val TYPE_LIST = 1
|
||||||
|
const val TYPE_GRID = 2
|
||||||
|
}
|
||||||
|
|
||||||
var spanCount = span
|
var spanCount = span
|
||||||
set(value) {
|
set(value) {
|
||||||
field = value
|
field = value
|
||||||
|
|
@ -26,51 +29,58 @@ class MainForumListAdapter(
|
||||||
notifyDataSetChanged()
|
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) {
|
override fun convert(viewHolder: MyViewHolder, item: ForumRecommend.LikeForum, position: Int, viewType: Int) {
|
||||||
viewHolder.itemView.setBackgroundColor(ThemeUtils.getColorByAttr(context, R.attr.colorCard))
|
|
||||||
val cardRadius = context.resources.getDimension(R.dimen.card_radius)
|
val cardRadius = context.resources.getDimension(R.dimen.card_radius)
|
||||||
when {
|
when {
|
||||||
//单列
|
//单列
|
||||||
spanCount == 1 -> {
|
spanCount == 1 -> {
|
||||||
|
viewHolder.itemView.background = wrapRipple(
|
||||||
|
Util.getColorByAttr(context, R.attr.colorControlHighlight, R.color.transparent),
|
||||||
if (position == getCount() - 1) {
|
if (position == getCount() - 1) {
|
||||||
viewHolder.itemView.background = getRadiusDrawable(bottomLeftPx = cardRadius, bottomRightPx = cardRadius)
|
getRadiusDrawable(bottomLeftPx = cardRadius, bottomRightPx = cardRadius)
|
||||||
} else {
|
} else {
|
||||||
viewHolder.itemView.background = getRadiusDrawable()
|
getRadiusDrawable()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
if (position % 2 == 1) {
|
||||||
|
viewHolder.itemView.backgroundTintList = ColorStateListUtils.createColorStateList(context, R.color.default_color_card)
|
||||||
|
} else {
|
||||||
|
viewHolder.itemView.backgroundTintList = ColorStateListUtils.createColorStateList(context, R.color.default_color_divider)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//双列左
|
//双列左
|
||||||
position % spanCount == 0 -> {
|
position % spanCount == 0 -> {
|
||||||
|
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) {
|
when (position) {
|
||||||
//最后一行,左
|
//最后一行,左
|
||||||
getCount() - 2 -> {
|
getCount() - 2 -> getRadiusDrawable(bottomLeftPx = cardRadius)
|
||||||
viewHolder.itemView.background = getRadiusDrawable(bottomLeftPx = cardRadius)
|
|
||||||
}
|
|
||||||
//最后一项
|
//最后一项
|
||||||
getCount() - 1 -> {
|
getCount() - 1 -> getRadiusDrawable(bottomLeftPx = cardRadius, bottomRightPx = cardRadius)
|
||||||
viewHolder.itemView.background = getRadiusDrawable(bottomLeftPx = cardRadius, bottomRightPx = cardRadius)
|
|
||||||
}
|
|
||||||
//其他
|
//其他
|
||||||
else -> {
|
else -> getRadiusDrawable()
|
||||||
viewHolder.itemView.background = getRadiusDrawable()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
//双列右
|
//双列右
|
||||||
else -> {
|
else -> {
|
||||||
|
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) {
|
if (position == getCount() - 1) {
|
||||||
viewHolder.itemView.background = getRadiusDrawable(bottomRightPx = cardRadius)
|
getRadiusDrawable(bottomRightPx = cardRadius)
|
||||||
} else {
|
} else {
|
||||||
viewHolder.itemView.background = getRadiusDrawable()
|
getRadiusDrawable()
|
||||||
}
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (spanCount > 1) {
|
if (spanCount > 1) {
|
||||||
viewHolder.setVisibility(R.id.forum_list_item_avatar, View.GONE)
|
|
||||||
ImageUtil.clear(viewHolder.getView(R.id.forum_list_item_avatar))
|
ImageUtil.clear(viewHolder.getView(R.id.forum_list_item_avatar))
|
||||||
} else {
|
} 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)
|
ImageUtil.load(viewHolder.getView(R.id.forum_list_item_avatar), ImageUtil.LOAD_TYPE_AVATAR, item.avatar)
|
||||||
}
|
}
|
||||||
ThemeUtil.setChipThemeByLevel(item.levelId,
|
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.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()
|
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,
|
position,
|
||||||
itemCount,
|
itemCount,
|
||||||
positionOffset = 1,
|
positionOffset = 1,
|
||||||
|
colors = intArrayOf(R.color.default_color_card, R.color.default_color_divider),
|
||||||
radius = context.resources.getDimension(R.dimen.card_radius)
|
radius = context.resources.getDimension(R.dimen.card_radius)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ class SearchUserAdapter(
|
||||||
position,
|
position,
|
||||||
itemCount,
|
itemCount,
|
||||||
positionOffset = 1,
|
positionOffset = 1,
|
||||||
|
colors = intArrayOf(R.color.default_color_card, R.color.default_color_divider),
|
||||||
radius = context.resources.getDimension(R.dimen.card_radius)
|
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.alibaba.android.vlayout.VirtualLayoutManager
|
||||||
import com.google.android.material.appbar.AppBarLayout
|
import com.google.android.material.appbar.AppBarLayout
|
||||||
import com.google.android.material.appbar.AppBarLayout.OnOffsetChangedListener
|
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.*
|
||||||
import com.huanchengfly.tieba.post.activities.ForumActivity
|
import com.huanchengfly.tieba.post.activities.ForumActivity
|
||||||
import com.huanchengfly.tieba.post.activities.NewSearchActivity
|
import com.huanchengfly.tieba.post.activities.NewSearchActivity
|
||||||
|
|
@ -58,7 +57,7 @@ class MainForumListFragment : BaseFragment(), Refreshable, Toolbar.OnMenuItemCli
|
||||||
lateinit var searchBarMotionLayout: MotionLayout
|
lateinit var searchBarMotionLayout: MotionLayout
|
||||||
|
|
||||||
@BindView(R.id.search_bar)
|
@BindView(R.id.search_bar)
|
||||||
lateinit var searchBar: TextInputLayout
|
lateinit var searchBar: View
|
||||||
|
|
||||||
@BindView(R.id.refresh_header)
|
@BindView(R.id.refresh_header)
|
||||||
lateinit var refreshLayoutHeader: MaterialHeader
|
lateinit var refreshLayoutHeader: MaterialHeader
|
||||||
|
|
@ -94,8 +93,12 @@ class MainForumListFragment : BaseFragment(), Refreshable, Toolbar.OnMenuItemCli
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
if (topForumListAdapter.spanCount != spanCount || mainForumListAdapter.spanCount != spanCount) {
|
||||||
topForumListAdapter.spanCount = spanCount
|
topForumListAdapter.spanCount = spanCount
|
||||||
mainForumListAdapter.spanCount = spanCount
|
mainForumListAdapter.spanCount = spanCount
|
||||||
|
mRecyclerView.recycledViewPool.clear()
|
||||||
|
reloadAdapters()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onAccountSwitch() {
|
override fun onAccountSwitch() {
|
||||||
|
|
@ -166,12 +169,9 @@ class MainForumListFragment : BaseFragment(), Refreshable, Toolbar.OnMenuItemCli
|
||||||
}
|
}
|
||||||
reloadAdapters()
|
reloadAdapters()
|
||||||
toolbar.setOnMenuItemClickListener(this)
|
toolbar.setOnMenuItemClickListener(this)
|
||||||
searchBar.editText?.setOnFocusChangeListener { v, hasFocus ->
|
searchBar.setOnClickListener {
|
||||||
if (hasFocus) {
|
|
||||||
v.clearFocus()
|
|
||||||
attachContext.goToActivity<NewSearchActivity>()
|
attachContext.goToActivity<NewSearchActivity>()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
btnOkSign.setOnClickListener {
|
btnOkSign.setOnClickListener {
|
||||||
TiebaUtil.startSign(attachContext)
|
TiebaUtil.startSign(attachContext)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import android.graphics.drawable.Drawable
|
||||||
import android.graphics.drawable.GradientDrawable
|
import android.graphics.drawable.GradientDrawable
|
||||||
import android.graphics.drawable.RippleDrawable
|
import android.graphics.drawable.RippleDrawable
|
||||||
import com.huanchengfly.tieba.post.R
|
import com.huanchengfly.tieba.post.R
|
||||||
|
import com.huanchengfly.tieba.post.ui.theme.utils.ColorStateListUtils
|
||||||
|
|
||||||
@JvmOverloads
|
@JvmOverloads
|
||||||
fun getItemBackgroundDrawable(
|
fun getItemBackgroundDrawable(
|
||||||
|
|
@ -15,12 +16,13 @@ fun getItemBackgroundDrawable(
|
||||||
itemCount: Int,
|
itemCount: Int,
|
||||||
positionOffset: Int = 0,
|
positionOffset: Int = 0,
|
||||||
radius: Float = 10f,
|
radius: Float = 10f,
|
||||||
|
colors: IntArray = intArrayOf(R.color.default_color_card),
|
||||||
ripple: Boolean = true
|
ripple: Boolean = true
|
||||||
): Drawable {
|
): Drawable {
|
||||||
val realPos = position + positionOffset
|
val realPos = position + positionOffset
|
||||||
val maxPos = itemCount - 1 + positionOffset
|
val maxPos = itemCount - 1 + positionOffset
|
||||||
val shape = GradientDrawable().apply {
|
val shape = GradientDrawable().apply {
|
||||||
color = ColorStateList.valueOf(Color.WHITE)
|
color = ColorStateListUtils.createColorStateList(context, colors[realPos % colors.size])
|
||||||
if (realPos == 0 && realPos == maxPos) {
|
if (realPos == 0 && realPos == maxPos) {
|
||||||
cornerRadius = radius
|
cornerRadius = radius
|
||||||
} else if (realPos == 0) {
|
} else if (realPos == 0) {
|
||||||
|
|
@ -44,8 +46,7 @@ fun getItemBackgroundDrawable(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return if (ripple) {
|
return if (ripple) {
|
||||||
val rippleColor = ColorStateList.valueOf(Util.getColorByAttr(context, R.attr.colorControlHighlight, R.color.transparent))
|
wrapRipple(Util.getColorByAttr(context, R.attr.colorControlHighlight, R.color.transparent), shape)
|
||||||
RippleDrawable(rippleColor, shape, shape)
|
|
||||||
} else {
|
} else {
|
||||||
shape
|
shape
|
||||||
}
|
}
|
||||||
|
|
@ -55,7 +56,8 @@ fun getRadiusDrawable(
|
||||||
topLeftPx: Float = 0f,
|
topLeftPx: Float = 0f,
|
||||||
topRightPx: Float = 0f,
|
topRightPx: Float = 0f,
|
||||||
bottomLeftPx: Float = 0f,
|
bottomLeftPx: Float = 0f,
|
||||||
bottomRightPx: Float = 0f
|
bottomRightPx: Float = 0f,
|
||||||
|
ripple: Boolean = false
|
||||||
): Drawable {
|
): Drawable {
|
||||||
return GradientDrawable().apply {
|
return GradientDrawable().apply {
|
||||||
color = ColorStateList.valueOf(Color.WHITE)
|
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"
|
android:layout_height="wrap_content"
|
||||||
app:layoutDescription="@xml/fragment_main_forum_list_scene">
|
app:layoutDescription="@xml/fragment_main_forum_list_scene">
|
||||||
|
|
||||||
<com.huanchengfly.tieba.post.widgets.theme.TintTextInputLayout
|
<com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
||||||
android:id="@+id/search_bar"
|
app:backgroundTint="@color/color_toolbar_bar"
|
||||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
|
tools:backgroundTint="@color/color_toolbar_bar"
|
||||||
android:layout_height="wrap_content"
|
android:padding="12dp"
|
||||||
|
android:background="@drawable/bg_radius_8dp_ripple"
|
||||||
android:layout_width="0dp"
|
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">
|
|
||||||
|
|
||||||
<com.huanchengfly.tieba.post.widgets.theme.TintTextInputEditText
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@null"
|
android:orientation="horizontal"
|
||||||
android:cursorVisible="false"
|
android:id="@+id/search_bar">
|
||||||
app:textColorHint="@color/color_on_toolbar_bar"
|
|
||||||
android:hint="@string/hint_search" />
|
<com.huanchengfly.tieba.post.widgets.theme.TintImageView
|
||||||
</com.huanchengfly.tieba.post.widgets.theme.TintTextInputLayout>
|
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:layout_gravity="center_vertical"
|
||||||
|
android:text="@string/hint_search" />
|
||||||
|
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
||||||
|
|
||||||
<com.huanchengfly.tieba.post.widgets.theme.TintImageView
|
<com.huanchengfly.tieba.post.widgets.theme.TintImageView
|
||||||
android:id="@+id/btn_oksign"
|
android:id="@+id/btn_oksign"
|
||||||
|
|
|
||||||
|
|
@ -162,21 +162,18 @@
|
||||||
|
|
||||||
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
||||||
|
|
||||||
<com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
<LinearLayout
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:layout_marginStart="@dimen/card_margin"
|
android:layout_marginStart="@dimen/card_margin"
|
||||||
android:layout_marginEnd="@dimen/card_margin"
|
android:layout_marginEnd="@dimen/card_margin"
|
||||||
android:layout_marginBottom="@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_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
||||||
android:id="@+id/my_info_collect"
|
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:paddingStart="24dp"
|
||||||
android:paddingEnd="24dp"
|
android:paddingEnd="24dp"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
|
|
@ -198,11 +195,12 @@
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="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:id="@+id/my_info_history"
|
||||||
android:background="?selectableItemBackground"
|
app:backgroundTint="@color/default_color_divider"
|
||||||
|
android:background="@drawable/bg_ripple"
|
||||||
android:paddingStart="24dp"
|
android:paddingStart="24dp"
|
||||||
android:paddingEnd="24dp"
|
android:paddingEnd="24dp"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
|
|
@ -224,11 +222,12 @@
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="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:id="@+id/my_info_theme"
|
||||||
android:background="?selectableItemBackground"
|
android:background="@drawable/bg_ripple"
|
||||||
|
app:backgroundTint="@color/default_color_card"
|
||||||
android:paddingStart="24dp"
|
android:paddingStart="24dp"
|
||||||
android:paddingEnd="24dp"
|
android:paddingEnd="24dp"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
|
|
@ -287,11 +286,12 @@
|
||||||
android:layout_toEndOf="@id/my_info_night_tv" />
|
android:layout_toEndOf="@id/my_info_night_tv" />
|
||||||
</RelativeLayout>
|
</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: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:paddingStart="24dp"
|
||||||
android:paddingEnd="24dp"
|
android:paddingEnd="24dp"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
|
|
@ -313,24 +313,21 @@
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="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
|
<LinearLayout
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:layout_marginStart="@dimen/card_margin"
|
android:layout_marginStart="@dimen/card_margin"
|
||||||
android:layout_marginEnd="@dimen/card_margin"
|
android:layout_marginEnd="@dimen/card_margin"
|
||||||
android:layout_marginBottom="@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_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
||||||
android:id="@+id/my_info_settings"
|
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:paddingStart="24dp"
|
||||||
android:paddingEnd="24dp"
|
android:paddingEnd="24dp"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
|
|
@ -352,11 +349,12 @@
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="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: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:paddingStart="24dp"
|
||||||
android:paddingEnd="24dp"
|
android:paddingEnd="24dp"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
|
|
@ -379,9 +377,9 @@
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
</LinearLayout>
|
|
||||||
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
</com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
</com.huanchengfly.tieba.post.widgets.theme.TintSwipeRefreshLayout>
|
</com.huanchengfly.tieba.post.widgets.theme.TintSwipeRefreshLayout>
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:foreground="?attr/selectableItemBackground"
|
|
||||||
app:backgroundTint="@color/default_color_card"
|
app:backgroundTint="@color/default_color_card"
|
||||||
android:paddingStart="@dimen/padding_start_default"
|
android:paddingStart="@dimen/padding_start_default"
|
||||||
android:paddingEnd="@dimen/padding_end_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"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<com.huanchengfly.tieba.post.widgets.theme.TintRelativeLayout
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
app:backgroundTint="@color/default_color_card"
|
app:backgroundTint="@color/default_color_card"
|
||||||
|
|
@ -24,4 +23,4 @@
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
tools:text="Title" />
|
tools:text="Title" />
|
||||||
</com.huanchengfly.tieba.post.widgets.theme.TintRelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<com.huanchengfly.tieba.post.widgets.theme.TintRelativeLayout
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
app:backgroundTint="@color/default_color_card"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="16dp">
|
android:padding="16dp">
|
||||||
|
|
@ -36,4 +34,4 @@
|
||||||
app:tint="@color/default_color_text_secondary"
|
app:tint="@color/default_color_text_secondary"
|
||||||
android:textSize="13sp"
|
android:textSize="13sp"
|
||||||
tools:text="Sub Title" />
|
tools:text="Sub Title" />
|
||||||
</com.huanchengfly.tieba.post.widgets.theme.TintRelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
app:backgroundTint="@color/default_color_card"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
|
@ -39,4 +37,4 @@
|
||||||
android:textSize="13sp"
|
android:textSize="13sp"
|
||||||
tools:text="Sub Title" />
|
tools:text="Sub Title" />
|
||||||
</LinearLayout>
|
</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_toolbar_item_active">#FF4477E0</color>
|
||||||
<color name="default_color_floor_card">#FFF0F3F5</color>
|
<color name="default_color_floor_card">#FFF0F3F5</color>
|
||||||
<color name="default_color_card">#FFFFFFFF</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_shadow">#FEE9E9E9</color>
|
||||||
<color name="default_color_toolbar_item_secondary">#FF545967</color>
|
<color name="default_color_toolbar_item_secondary">#FF545967</color>
|
||||||
<color name="default_color_swipe_refresh_view_background">#FFFFFFFF</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_grey_dark">#FF252525</color>
|
||||||
<color name="theme_color_swipe_refresh_view_background_amoled_dark">#FF1C1C1C</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_light">#10FFFFFF</color>
|
||||||
<color name="theme_color_divider_translucent_dark">#15000000</color>
|
<color name="theme_color_divider_translucent_dark">#15000000</color>
|
||||||
<color name="theme_color_divider_dark">#FF10171D</color>
|
<color name="theme_color_divider_dark">#FF10171D</color>
|
||||||
|
|
@ -164,7 +164,7 @@
|
||||||
|
|
||||||
<color name="red_accent">#FFC51100</color>
|
<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="colorSplashBg">#ffffff</color>
|
||||||
<color name="icon_blue">#FF3373EE</color>
|
<color name="icon_blue">#FF3373EE</color>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
<dimen name="text_size_hot_title">16sp</dimen>
|
<dimen name="text_size_hot_title">16sp</dimen>
|
||||||
<dimen name="text_size_hot_desc">14sp</dimen>
|
<dimen name="text_size_hot_desc">14sp</dimen>
|
||||||
<dimen name="text_size_refresh_tip">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="size_avatar">36dp</dimen>
|
||||||
<dimen name="default_small_pic_radius">8dp</dimen>
|
<dimen name="default_small_pic_radius">8dp</dimen>
|
||||||
<dimen name="padding_start_default">16dp</dimen>
|
<dimen name="padding_start_default">16dp</dimen>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue