refactor: 移除无用代码
This commit is contained in:
parent
c5c9cd9751
commit
3c219a3bdc
|
|
@ -43,7 +43,7 @@ import com.huanchengfly.tieba.post.api.retrofit.exception.getErrorMessage
|
||||||
import com.huanchengfly.tieba.post.components.FillVirtualLayoutManager
|
import com.huanchengfly.tieba.post.components.FillVirtualLayoutManager
|
||||||
import com.huanchengfly.tieba.post.components.dialogs.EditTextDialog
|
import com.huanchengfly.tieba.post.components.dialogs.EditTextDialog
|
||||||
import com.huanchengfly.tieba.post.fragments.threadmenu.IThreadMenuFragment
|
import com.huanchengfly.tieba.post.fragments.threadmenu.IThreadMenuFragment
|
||||||
import com.huanchengfly.tieba.post.fragments.threadmenu.MIUIThreadMenuFragment
|
import com.huanchengfly.tieba.post.fragments.threadmenu.ThreadMenuFragment
|
||||||
import com.huanchengfly.tieba.post.goToActivity
|
import com.huanchengfly.tieba.post.goToActivity
|
||||||
import com.huanchengfly.tieba.post.models.ReplyInfoBean
|
import com.huanchengfly.tieba.post.models.ReplyInfoBean
|
||||||
import com.huanchengfly.tieba.post.models.ThreadHistoryInfoBean
|
import com.huanchengfly.tieba.post.models.ThreadHistoryInfoBean
|
||||||
|
|
@ -745,7 +745,7 @@ class ThreadActivity : BaseActivity(), View.OnClickListener, IThreadMenuFragment
|
||||||
}
|
}
|
||||||
R.id.toolbar -> recyclerView.scrollToPosition(0)
|
R.id.toolbar -> recyclerView.scrollToPosition(0)
|
||||||
R.id.thread_bottom_bar_more_btn -> {
|
R.id.thread_bottom_bar_more_btn -> {
|
||||||
MIUIThreadMenuFragment(
|
ThreadMenuFragment(
|
||||||
seeLz,
|
seeLz,
|
||||||
collect,
|
collect,
|
||||||
replyAdapter.isPureRead,
|
replyAdapter.isPureRead,
|
||||||
|
|
|
||||||
|
|
@ -1,214 +0,0 @@
|
||||||
package com.huanchengfly.tieba.post.fragments.threadmenu
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import android.view.View
|
|
||||||
import butterknife.BindView
|
|
||||||
import butterknife.OnClick
|
|
||||||
import com.google.android.material.button.MaterialButton
|
|
||||||
import com.huanchengfly.tieba.post.R
|
|
||||||
import com.huanchengfly.tieba.post.dpToPx
|
|
||||||
import com.huanchengfly.tieba.post.dpToPxFloat
|
|
||||||
import com.huanchengfly.tieba.post.ui.common.animation.addMaskAnimation
|
|
||||||
import com.huanchengfly.tieba.post.ui.common.animation.addZoomAnimation
|
|
||||||
import com.huanchengfly.tieba.post.ui.common.animation.buildPressAnimator
|
|
||||||
import com.huanchengfly.tieba.post.widgets.theme.TintImageView
|
|
||||||
import com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
|
||||||
import com.huanchengfly.tieba.post.widgets.theme.TintTextView
|
|
||||||
|
|
||||||
class MIUIThreadMenuFragment(
|
|
||||||
seeLz: Boolean,
|
|
||||||
collect: Boolean,
|
|
||||||
pureRead: Boolean,
|
|
||||||
sort: Boolean,
|
|
||||||
canDelete: Boolean
|
|
||||||
) : IThreadMenuFragment(seeLz, collect, pureRead, sort, canDelete) {
|
|
||||||
@BindView(R.id.thread_menu_see_lz)
|
|
||||||
lateinit var seeLzItem: TintLinearLayout
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_see_lz_icon)
|
|
||||||
lateinit var seeLzIcon: TintImageView
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_see_lz_text)
|
|
||||||
lateinit var seeLzText: TintTextView
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_see_lz_status)
|
|
||||||
lateinit var seeLzStatus: TintTextView
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_collect)
|
|
||||||
lateinit var collectItem: TintLinearLayout
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_collect_icon)
|
|
||||||
lateinit var collectIcon: TintImageView
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_collect_text)
|
|
||||||
lateinit var collectText: TintTextView
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_collect_status)
|
|
||||||
lateinit var collectStatus: TintTextView
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_pure_read)
|
|
||||||
lateinit var pureReadItem: TintLinearLayout
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_pure_read_icon)
|
|
||||||
lateinit var pureReadIcon: TintImageView
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_pure_read_text)
|
|
||||||
lateinit var pureReadText: TintTextView
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_pure_read_status)
|
|
||||||
lateinit var pureReadStatus: TintTextView
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_sort)
|
|
||||||
lateinit var sortItem: TintLinearLayout
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_sort_icon)
|
|
||||||
lateinit var sortIcon: TintImageView
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_sort_text)
|
|
||||||
lateinit var sortText: TintTextView
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_sort_status)
|
|
||||||
lateinit var sortStatus: TintTextView
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_delete)
|
|
||||||
lateinit var deleteMenuItem: View
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu)
|
|
||||||
lateinit var menuView: View
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_jump_page)
|
|
||||||
lateinit var jumpPageItem: View
|
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_close)
|
|
||||||
lateinit var closeBtn: MaterialButton
|
|
||||||
|
|
||||||
override fun initView() {
|
|
||||||
if (seeLz) {
|
|
||||||
seeLzItem.setBackgroundTintResId(R.color.default_color_accent)
|
|
||||||
seeLzIcon.setTintListResId(R.color.default_color_card)
|
|
||||||
seeLzText.tintResId = R.color.default_color_card
|
|
||||||
seeLzStatus.tintResId = R.color.default_color_card
|
|
||||||
seeLzStatus.setText(R.string.title_on)
|
|
||||||
seeLzStatus.alpha = .75f
|
|
||||||
} else {
|
|
||||||
seeLzItem.setBackgroundTintResId(R.color.default_color_card)
|
|
||||||
seeLzIcon.setTintListResId(R.color.default_color_accent)
|
|
||||||
seeLzText.tintResId = R.color.default_color_text
|
|
||||||
seeLzStatus.tintResId = R.color.default_color_text_secondary
|
|
||||||
seeLzStatus.setText(R.string.title_off)
|
|
||||||
seeLzStatus.alpha = 1f
|
|
||||||
}
|
|
||||||
if (collect) {
|
|
||||||
collectItem.setBackgroundTintResId(R.color.default_color_accent)
|
|
||||||
collectIcon.setTintListResId(R.color.default_color_card)
|
|
||||||
collectText.tintResId = R.color.default_color_card
|
|
||||||
collectStatus.tintResId = R.color.default_color_card
|
|
||||||
collectStatus.setText(R.string.title_collected)
|
|
||||||
collectStatus.alpha = .75f
|
|
||||||
} else {
|
|
||||||
collectItem.setBackgroundTintResId(R.color.default_color_card)
|
|
||||||
collectIcon.setTintListResId(R.color.default_color_accent)
|
|
||||||
collectText.tintResId = R.color.default_color_text
|
|
||||||
collectStatus.tintResId = R.color.default_color_text_secondary
|
|
||||||
collectStatus.setText(R.string.title_uncollected)
|
|
||||||
collectStatus.alpha = 1f
|
|
||||||
}
|
|
||||||
if (pureRead) {
|
|
||||||
pureReadItem.setBackgroundTintResId(R.color.default_color_accent)
|
|
||||||
pureReadIcon.setTintListResId(R.color.default_color_card)
|
|
||||||
pureReadText.tintResId = R.color.default_color_card
|
|
||||||
pureReadStatus.tintResId = R.color.default_color_card
|
|
||||||
pureReadStatus.setText(R.string.title_on)
|
|
||||||
pureReadStatus.alpha = .75f
|
|
||||||
} else {
|
|
||||||
pureReadItem.setBackgroundTintResId(R.color.default_color_card)
|
|
||||||
pureReadIcon.setTintListResId(R.color.default_color_accent)
|
|
||||||
pureReadText.tintResId = R.color.default_color_text
|
|
||||||
pureReadStatus.tintResId = R.color.default_color_text_secondary
|
|
||||||
pureReadStatus.setText(R.string.title_off)
|
|
||||||
pureReadStatus.alpha = 1f
|
|
||||||
}
|
|
||||||
if (sort) {
|
|
||||||
sortItem.setBackgroundTintResId(R.color.default_color_accent)
|
|
||||||
sortIcon.setTintListResId(R.color.default_color_card)
|
|
||||||
sortText.tintResId = R.color.default_color_card
|
|
||||||
sortStatus.tintResId = R.color.default_color_card
|
|
||||||
sortStatus.setText(R.string.title_on)
|
|
||||||
sortStatus.alpha = .75f
|
|
||||||
} else {
|
|
||||||
sortItem.setBackgroundTintResId(R.color.default_color_card)
|
|
||||||
sortIcon.setTintListResId(R.color.default_color_accent)
|
|
||||||
sortText.tintResId = R.color.default_color_text
|
|
||||||
sortStatus.tintResId = R.color.default_color_text_secondary
|
|
||||||
sortStatus.setText(R.string.title_off)
|
|
||||||
sortStatus.alpha = 1f
|
|
||||||
}
|
|
||||||
listOf(
|
|
||||||
seeLzItem,
|
|
||||||
collectItem,
|
|
||||||
pureReadItem,
|
|
||||||
sortItem
|
|
||||||
).forEach {
|
|
||||||
buildPressAnimator(it) {
|
|
||||||
addZoomAnimation(0.1f)
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
||||||
addMaskAnimation(maskRadius = 10f.dpToPxFloat())
|
|
||||||
}
|
|
||||||
}.init()
|
|
||||||
}
|
|
||||||
deleteMenuItem.visibility = if (canDelete) {
|
|
||||||
View.VISIBLE
|
|
||||||
} else {
|
|
||||||
View.GONE
|
|
||||||
}
|
|
||||||
menuView.post {
|
|
||||||
mBehavior.setPeekHeight(
|
|
||||||
((4 + 8 * 2 + 16 * 3 + 8).dpToPx() + seeLzItem.height * 2 + jumpPageItem.height * 2.5f).toInt(),
|
|
||||||
false
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_thread_menu_miui_style
|
|
||||||
|
|
||||||
@OnClick(
|
|
||||||
R.id.thread_menu_see_lz,
|
|
||||||
R.id.thread_menu_collect,
|
|
||||||
R.id.thread_menu_pure_read,
|
|
||||||
R.id.thread_menu_sort,
|
|
||||||
R.id.thread_menu_report,
|
|
||||||
R.id.thread_menu_jump_page,
|
|
||||||
R.id.thread_menu_copy_link,
|
|
||||||
R.id.thread_menu_share,
|
|
||||||
R.id.thread_menu_close
|
|
||||||
)
|
|
||||||
override fun onClick(v: View) {
|
|
||||||
when (v.id) {
|
|
||||||
R.id.thread_menu_see_lz, R.id.thread_menu_see_lz_icon -> {
|
|
||||||
onActionsListener?.onToggleSeeLz(!seeLz)
|
|
||||||
}
|
|
||||||
R.id.thread_menu_collect, R.id.thread_menu_collect_icon -> {
|
|
||||||
onActionsListener?.onToggleCollect(!collect)
|
|
||||||
}
|
|
||||||
R.id.thread_menu_pure_read, R.id.thread_menu_pure_read_icon -> {
|
|
||||||
onActionsListener?.onTogglePureRead(!pureRead)
|
|
||||||
}
|
|
||||||
R.id.thread_menu_sort, R.id.thread_menu_sort_icon -> {
|
|
||||||
onActionsListener?.onToggleSort(!sort)
|
|
||||||
}
|
|
||||||
R.id.thread_menu_report -> {
|
|
||||||
onActionsListener?.onReport()
|
|
||||||
}
|
|
||||||
R.id.thread_menu_jump_page -> {
|
|
||||||
onActionsListener?.onJumpPage()
|
|
||||||
}
|
|
||||||
R.id.thread_menu_copy_link -> {
|
|
||||||
onActionsListener?.onCopyLink()
|
|
||||||
}
|
|
||||||
R.id.thread_menu_share -> {
|
|
||||||
onActionsListener?.onShare()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,12 +1,18 @@
|
||||||
package com.huanchengfly.tieba.post.fragments.threadmenu
|
package com.huanchengfly.tieba.post.fragments.threadmenu
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import butterknife.BindView
|
import butterknife.BindView
|
||||||
import butterknife.OnClick
|
import butterknife.OnClick
|
||||||
|
import com.google.android.material.button.MaterialButton
|
||||||
import com.huanchengfly.tieba.post.R
|
import com.huanchengfly.tieba.post.R
|
||||||
|
import com.huanchengfly.tieba.post.dpToPx
|
||||||
|
import com.huanchengfly.tieba.post.dpToPxFloat
|
||||||
|
import com.huanchengfly.tieba.post.ui.common.animation.addMaskAnimation
|
||||||
import com.huanchengfly.tieba.post.ui.common.animation.addZoomAnimation
|
import com.huanchengfly.tieba.post.ui.common.animation.addZoomAnimation
|
||||||
import com.huanchengfly.tieba.post.ui.common.animation.buildPressAnimator
|
import com.huanchengfly.tieba.post.ui.common.animation.buildPressAnimator
|
||||||
import com.huanchengfly.tieba.post.widgets.theme.TintImageView
|
import com.huanchengfly.tieba.post.widgets.theme.TintImageView
|
||||||
|
import com.huanchengfly.tieba.post.widgets.theme.TintLinearLayout
|
||||||
import com.huanchengfly.tieba.post.widgets.theme.TintTextView
|
import com.huanchengfly.tieba.post.widgets.theme.TintTextView
|
||||||
|
|
||||||
class ThreadMenuFragment(
|
class ThreadMenuFragment(
|
||||||
|
|
@ -14,80 +20,140 @@ class ThreadMenuFragment(
|
||||||
collect: Boolean,
|
collect: Boolean,
|
||||||
pureRead: Boolean,
|
pureRead: Boolean,
|
||||||
sort: Boolean,
|
sort: Boolean,
|
||||||
canDelete: Boolean = false
|
canDelete: Boolean
|
||||||
) : IThreadMenuFragment(seeLz, collect, pureRead, sort, canDelete) {
|
) : IThreadMenuFragment(seeLz, collect, pureRead, sort, canDelete) {
|
||||||
|
@BindView(R.id.thread_menu_see_lz)
|
||||||
|
lateinit var seeLzItem: TintLinearLayout
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_see_lz_icon)
|
@BindView(R.id.thread_menu_see_lz_icon)
|
||||||
lateinit var seeLzIcon: TintImageView
|
lateinit var seeLzIcon: TintImageView
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_see_lz_text)
|
@BindView(R.id.thread_menu_see_lz_text)
|
||||||
lateinit var seeLzText: TintTextView
|
lateinit var seeLzText: TintTextView
|
||||||
|
|
||||||
|
@BindView(R.id.thread_menu_see_lz_status)
|
||||||
|
lateinit var seeLzStatus: TintTextView
|
||||||
|
|
||||||
|
@BindView(R.id.thread_menu_collect)
|
||||||
|
lateinit var collectItem: TintLinearLayout
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_collect_icon)
|
@BindView(R.id.thread_menu_collect_icon)
|
||||||
lateinit var collectIcon: TintImageView
|
lateinit var collectIcon: TintImageView
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_collect_text)
|
@BindView(R.id.thread_menu_collect_text)
|
||||||
lateinit var collectText: TintTextView
|
lateinit var collectText: TintTextView
|
||||||
|
|
||||||
|
@BindView(R.id.thread_menu_collect_status)
|
||||||
|
lateinit var collectStatus: TintTextView
|
||||||
|
|
||||||
|
@BindView(R.id.thread_menu_pure_read)
|
||||||
|
lateinit var pureReadItem: TintLinearLayout
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_pure_read_icon)
|
@BindView(R.id.thread_menu_pure_read_icon)
|
||||||
lateinit var pureReadIcon: TintImageView
|
lateinit var pureReadIcon: TintImageView
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_pure_read_text)
|
@BindView(R.id.thread_menu_pure_read_text)
|
||||||
lateinit var pureReadText: TintTextView
|
lateinit var pureReadText: TintTextView
|
||||||
|
|
||||||
|
@BindView(R.id.thread_menu_pure_read_status)
|
||||||
|
lateinit var pureReadStatus: TintTextView
|
||||||
|
|
||||||
|
@BindView(R.id.thread_menu_sort)
|
||||||
|
lateinit var sortItem: TintLinearLayout
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_sort_icon)
|
@BindView(R.id.thread_menu_sort_icon)
|
||||||
lateinit var sortIcon: TintImageView
|
lateinit var sortIcon: TintImageView
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_sort_text)
|
@BindView(R.id.thread_menu_sort_text)
|
||||||
lateinit var sortText: TintTextView
|
lateinit var sortText: TintTextView
|
||||||
|
|
||||||
|
@BindView(R.id.thread_menu_sort_status)
|
||||||
|
lateinit var sortStatus: TintTextView
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_delete)
|
@BindView(R.id.thread_menu_delete)
|
||||||
lateinit var deleteMenuItem: View
|
lateinit var deleteMenuItem: View
|
||||||
|
|
||||||
|
@BindView(R.id.thread_menu)
|
||||||
|
lateinit var menuView: View
|
||||||
|
|
||||||
|
@BindView(R.id.thread_menu_jump_page)
|
||||||
|
lateinit var jumpPageItem: View
|
||||||
|
|
||||||
|
@BindView(R.id.thread_menu_close)
|
||||||
|
lateinit var closeBtn: MaterialButton
|
||||||
|
|
||||||
override fun initView() {
|
override fun initView() {
|
||||||
if (seeLz) {
|
if (seeLz) {
|
||||||
|
seeLzItem.setBackgroundTintResId(R.color.default_color_accent)
|
||||||
seeLzIcon.setTintListResId(R.color.default_color_card)
|
seeLzIcon.setTintListResId(R.color.default_color_card)
|
||||||
seeLzIcon.setBackgroundTintResId(R.color.default_color_accent)
|
seeLzText.tintResId = R.color.default_color_card
|
||||||
seeLzText.setText(R.string.title_see_lz_on)
|
seeLzStatus.tintResId = R.color.default_color_card
|
||||||
|
seeLzStatus.setText(R.string.title_on)
|
||||||
|
seeLzStatus.alpha = .75f
|
||||||
} else {
|
} else {
|
||||||
seeLzIcon.setTintListResId(R.color.default_color_text_secondary)
|
seeLzItem.setBackgroundTintResId(R.color.default_color_card)
|
||||||
seeLzIcon.setBackgroundTintResId(R.color.default_color_card)
|
seeLzIcon.setTintListResId(R.color.default_color_accent)
|
||||||
seeLzText.setText(R.string.title_see_lz)
|
seeLzText.tintResId = R.color.default_color_text
|
||||||
|
seeLzStatus.tintResId = R.color.default_color_text_secondary
|
||||||
|
seeLzStatus.setText(R.string.title_off)
|
||||||
|
seeLzStatus.alpha = 1f
|
||||||
}
|
}
|
||||||
if (collect) {
|
if (collect) {
|
||||||
|
collectItem.setBackgroundTintResId(R.color.default_color_accent)
|
||||||
collectIcon.setTintListResId(R.color.default_color_card)
|
collectIcon.setTintListResId(R.color.default_color_card)
|
||||||
collectIcon.setBackgroundTintResId(R.color.default_color_accent)
|
collectText.tintResId = R.color.default_color_card
|
||||||
collectText.setText(R.string.title_collect_on)
|
collectStatus.tintResId = R.color.default_color_card
|
||||||
|
collectStatus.setText(R.string.title_collected)
|
||||||
|
collectStatus.alpha = .75f
|
||||||
} else {
|
} else {
|
||||||
collectIcon.setTintListResId(R.color.default_color_text_secondary)
|
collectItem.setBackgroundTintResId(R.color.default_color_card)
|
||||||
collectIcon.setBackgroundTintResId(R.color.default_color_card)
|
collectIcon.setTintListResId(R.color.default_color_accent)
|
||||||
collectText.setText(R.string.title_collect)
|
collectText.tintResId = R.color.default_color_text
|
||||||
|
collectStatus.tintResId = R.color.default_color_text_secondary
|
||||||
|
collectStatus.setText(R.string.title_uncollected)
|
||||||
|
collectStatus.alpha = 1f
|
||||||
}
|
}
|
||||||
if (pureRead) {
|
if (pureRead) {
|
||||||
|
pureReadItem.setBackgroundTintResId(R.color.default_color_accent)
|
||||||
pureReadIcon.setTintListResId(R.color.default_color_card)
|
pureReadIcon.setTintListResId(R.color.default_color_card)
|
||||||
pureReadIcon.setBackgroundTintResId(R.color.default_color_accent)
|
pureReadText.tintResId = R.color.default_color_card
|
||||||
pureReadText.setText(R.string.title_pure_read_on)
|
pureReadStatus.tintResId = R.color.default_color_card
|
||||||
|
pureReadStatus.setText(R.string.title_on)
|
||||||
|
pureReadStatus.alpha = .75f
|
||||||
} else {
|
} else {
|
||||||
pureReadIcon.setTintListResId(R.color.default_color_text_secondary)
|
pureReadItem.setBackgroundTintResId(R.color.default_color_card)
|
||||||
pureReadIcon.setBackgroundTintResId(R.color.default_color_card)
|
pureReadIcon.setTintListResId(R.color.default_color_accent)
|
||||||
pureReadText.setText(R.string.title_pure_read)
|
pureReadText.tintResId = R.color.default_color_text
|
||||||
|
pureReadStatus.tintResId = R.color.default_color_text_secondary
|
||||||
|
pureReadStatus.setText(R.string.title_off)
|
||||||
|
pureReadStatus.alpha = 1f
|
||||||
}
|
}
|
||||||
if (sort) {
|
if (sort) {
|
||||||
|
sortItem.setBackgroundTintResId(R.color.default_color_accent)
|
||||||
sortIcon.setTintListResId(R.color.default_color_card)
|
sortIcon.setTintListResId(R.color.default_color_card)
|
||||||
sortIcon.setBackgroundTintResId(R.color.default_color_accent)
|
sortText.tintResId = R.color.default_color_card
|
||||||
sortText.setText(R.string.title_sort_on)
|
sortStatus.tintResId = R.color.default_color_card
|
||||||
|
sortStatus.setText(R.string.title_on)
|
||||||
|
sortStatus.alpha = .75f
|
||||||
} else {
|
} else {
|
||||||
sortIcon.setTintListResId(R.color.default_color_text_secondary)
|
sortItem.setBackgroundTintResId(R.color.default_color_card)
|
||||||
sortIcon.setBackgroundTintResId(R.color.default_color_card)
|
sortIcon.setTintListResId(R.color.default_color_accent)
|
||||||
sortText.setText(R.string.title_sort)
|
sortText.tintResId = R.color.default_color_text
|
||||||
|
sortStatus.tintResId = R.color.default_color_text_secondary
|
||||||
|
sortStatus.setText(R.string.title_off)
|
||||||
|
sortStatus.alpha = 1f
|
||||||
}
|
}
|
||||||
listOf(
|
listOf(
|
||||||
seeLzIcon,
|
seeLzItem,
|
||||||
collectIcon,
|
collectItem,
|
||||||
pureReadIcon,
|
pureReadItem,
|
||||||
sortIcon
|
sortItem
|
||||||
).forEach {
|
).forEach {
|
||||||
buildPressAnimator(it) {
|
buildPressAnimator(it) {
|
||||||
addZoomAnimation()
|
addZoomAnimation(0.1f)
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
addMaskAnimation(maskRadius = 10f.dpToPxFloat())
|
||||||
|
}
|
||||||
}.init()
|
}.init()
|
||||||
}
|
}
|
||||||
deleteMenuItem.visibility = if (canDelete) {
|
deleteMenuItem.visibility = if (canDelete) {
|
||||||
|
|
@ -95,19 +161,21 @@ class ThreadMenuFragment(
|
||||||
} else {
|
} else {
|
||||||
View.GONE
|
View.GONE
|
||||||
}
|
}
|
||||||
|
menuView.post {
|
||||||
|
mBehavior.setPeekHeight(
|
||||||
|
((4 + 8 * 2 + 16 * 3 + 8).dpToPx() + seeLzItem.height * 2 + jumpPageItem.height * 2.5f).toInt(),
|
||||||
|
false
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_thread_menu
|
override fun getLayoutId(): Int = R.layout.fragment_thread_menu_miui_style
|
||||||
|
|
||||||
@OnClick(
|
@OnClick(
|
||||||
R.id.thread_menu_see_lz,
|
R.id.thread_menu_see_lz,
|
||||||
R.id.thread_menu_collect,
|
R.id.thread_menu_collect,
|
||||||
R.id.thread_menu_pure_read,
|
R.id.thread_menu_pure_read,
|
||||||
R.id.thread_menu_sort,
|
R.id.thread_menu_sort,
|
||||||
R.id.thread_menu_see_lz_icon,
|
|
||||||
R.id.thread_menu_collect_icon,
|
|
||||||
R.id.thread_menu_pure_read_icon,
|
|
||||||
R.id.thread_menu_sort_icon,
|
|
||||||
R.id.thread_menu_report,
|
R.id.thread_menu_report,
|
||||||
R.id.thread_menu_jump_page,
|
R.id.thread_menu_jump_page,
|
||||||
R.id.thread_menu_copy_link,
|
R.id.thread_menu_copy_link,
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
|
android:baselineAligned="false"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
@ -187,7 +188,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:text="关注"
|
android:text="@string/title_stat_concerns_num"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
app:tint="@color/color_text_secondary_translucent_light" />
|
app:tint="@color/color_text_secondary_translucent_light" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -213,7 +214,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:text="贴子"
|
android:text="@string/title_stat_threads_num"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
app:tint="@color/color_text_secondary_translucent_light" />
|
app:tint="@color/color_text_secondary_translucent_light" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -239,7 +240,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:text="回贴"
|
android:text="@string/title_stat_posts_num"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
app:tint="@color/color_text_secondary_translucent_light" />
|
app:tint="@color/color_text_secondary_translucent_light" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -547,4 +547,7 @@
|
||||||
<string name="title_posts_num">贴子</string>
|
<string name="title_posts_num">贴子</string>
|
||||||
<string name="title_oksign_use_official_oksign">使用官方一键签到</string>
|
<string name="title_oksign_use_official_oksign">使用官方一键签到</string>
|
||||||
<string name="summary_oksign_use_official_oksign">(实验性特性)先使用官方一键签到减少需签到吧数量,以加快签到速度</string>
|
<string name="summary_oksign_use_official_oksign">(实验性特性)先使用官方一键签到减少需签到吧数量,以加快签到速度</string>
|
||||||
|
<string name="title_stat_threads_num">贴子</string>
|
||||||
|
<string name="title_stat_posts_num">回贴</string>
|
||||||
|
<string name="title_stat_concerns_num">关注</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue