pref: 优化贴菜单默认弹出高度
This commit is contained in:
parent
ba8bc166c2
commit
cac11a7831
|
|
@ -6,6 +6,7 @@ import butterknife.BindView
|
||||||
import butterknife.OnClick
|
import butterknife.OnClick
|
||||||
import com.google.android.material.button.MaterialButton
|
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.dpToPxFloat
|
||||||
import com.huanchengfly.tieba.post.ui.animation.addMaskAnimation
|
import com.huanchengfly.tieba.post.ui.animation.addMaskAnimation
|
||||||
import com.huanchengfly.tieba.post.ui.animation.addZoomAnimation
|
import com.huanchengfly.tieba.post.ui.animation.addZoomAnimation
|
||||||
|
|
@ -75,6 +76,9 @@ class MIUIThreadMenuFragment(
|
||||||
@BindView(R.id.thread_menu)
|
@BindView(R.id.thread_menu)
|
||||||
lateinit var menuView: View
|
lateinit var menuView: View
|
||||||
|
|
||||||
|
@BindView(R.id.thread_menu_jump_page)
|
||||||
|
lateinit var jumpPageItem: View
|
||||||
|
|
||||||
@BindView(R.id.thread_menu_close)
|
@BindView(R.id.thread_menu_close)
|
||||||
lateinit var closeBtn: MaterialButton
|
lateinit var closeBtn: MaterialButton
|
||||||
|
|
||||||
|
|
@ -158,7 +162,7 @@ class MIUIThreadMenuFragment(
|
||||||
View.GONE
|
View.GONE
|
||||||
}
|
}
|
||||||
menuView.post {
|
menuView.post {
|
||||||
mBehavior.setPeekHeight(menuView.height + closeBtn.height, false)
|
mBehavior.setPeekHeight(((4 + 8 * 2 + 16 * 3 + 8).dpToPx() + seeLzItem.height * 2 + jumpPageItem.height * 2.5f).toInt(), false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -206,35 +206,6 @@
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/thread_menu_report"
|
|
||||||
android:background="?selectableItemBackground"
|
|
||||||
android:paddingStart="16dp"
|
|
||||||
android:paddingEnd="16dp"
|
|
||||||
android:paddingTop="12dp"
|
|
||||||
android:paddingBottom="12dp"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<com.huanchengfly.tieba.post.widgets.theme.TintImageView
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
app:srcCompat="@drawable/ic_round_verified_user"
|
|
||||||
app:tint="@color/default_color_text_secondary"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="24dp" />
|
|
||||||
|
|
||||||
<com.huanchengfly.tieba.post.widgets.theme.TintTextView
|
|
||||||
android:text="@string/title_report"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
app:tint="@color/default_color_text_secondary"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/thread_menu_jump_page"
|
android:id="@+id/thread_menu_jump_page"
|
||||||
android:background="?selectableItemBackground"
|
android:background="?selectableItemBackground"
|
||||||
|
|
@ -264,6 +235,36 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/thread_menu_share"
|
||||||
|
android:background="?selectableItemBackground"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:paddingBottom="12dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.huanchengfly.tieba.post.widgets.theme.TintImageView
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
app:srcCompat="@drawable/ic_round_share_white"
|
||||||
|
app:tint="@color/default_color_text_secondary"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp" />
|
||||||
|
|
||||||
|
<com.huanchengfly.tieba.post.widgets.theme.TintTextView
|
||||||
|
android:text="@string/title_share"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:tint="@color/default_color_text_secondary"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/thread_menu_copy_link"
|
android:id="@+id/thread_menu_copy_link"
|
||||||
android:background="?selectableItemBackground"
|
android:background="?selectableItemBackground"
|
||||||
|
|
@ -294,7 +295,7 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/thread_menu_share"
|
android:id="@+id/thread_menu_report"
|
||||||
android:background="?selectableItemBackground"
|
android:background="?selectableItemBackground"
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:paddingEnd="16dp"
|
android:paddingEnd="16dp"
|
||||||
|
|
@ -306,14 +307,14 @@
|
||||||
|
|
||||||
<com.huanchengfly.tieba.post.widgets.theme.TintImageView
|
<com.huanchengfly.tieba.post.widgets.theme.TintImageView
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
app:srcCompat="@drawable/ic_round_share_white"
|
app:srcCompat="@drawable/ic_round_verified_user"
|
||||||
app:tint="@color/default_color_text_secondary"
|
app:tint="@color/default_color_text_secondary"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="24dp" />
|
android:layout_height="24dp" />
|
||||||
|
|
||||||
<com.huanchengfly.tieba.post.widgets.theme.TintTextView
|
<com.huanchengfly.tieba.post.widgets.theme.TintTextView
|
||||||
android:text="@string/title_share"
|
android:text="@string/title_report"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:tint="@color/default_color_text_secondary"
|
app:tint="@color/default_color_text_secondary"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue