fix(ui): 修复界面文本显示和布局问题
- 将"餐品模式"统一修改为"菜品模式" - 优化列表项布局结构,使用ConstraintLayout替代LinearLayout - 调整间距属性,将marginTop改为layout_marginVertical - 重新设置文本和图标的位置约束关系 - 添加多点击检测器用于快速跳转到主页面的临时功能
This commit is contained in:
@@ -94,7 +94,7 @@ class SingleFragmentActivity : BaseActivity() {
|
|||||||
*/
|
*/
|
||||||
private fun getTitleForPage(pageType: PageType): String = when (pageType) {
|
private fun getTitleForPage(pageType: PageType): String = when (pageType) {
|
||||||
PageType.FOOD_COLLECT -> "食材采集"
|
PageType.FOOD_COLLECT -> "食材采集"
|
||||||
PageType.COOK_MODE -> "餐品模式"
|
PageType.COOK_MODE -> "菜品模式"
|
||||||
PageType.SEASONING_CONFIG -> "调料区设置"
|
PageType.SEASONING_CONFIG -> "调料区设置"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import com.shuwei.dish.match.base.BaseFragment
|
|||||||
import com.shuwei.dish.match.databinding.FragmentDeviceConfigBinding
|
import com.shuwei.dish.match.databinding.FragmentDeviceConfigBinding
|
||||||
import com.shuwei.dish.match.ui.SamplingModeActivity
|
import com.shuwei.dish.match.ui.SamplingModeActivity
|
||||||
import com.shuwei.dish.match.ui.CookingModeActivity
|
import com.shuwei.dish.match.ui.CookingModeActivity
|
||||||
|
import com.shuwei.dish.match.ui.HomeActivity
|
||||||
|
import com.shuwei.dish.match.utils.MultiClickDetector
|
||||||
import com.shuwei.dish.match.utils.SpTool
|
import com.shuwei.dish.match.utils.SpTool
|
||||||
import com.shuwei.dish.match.utils.ext.appendText
|
import com.shuwei.dish.match.utils.ext.appendText
|
||||||
import com.shuwei.dish.match.utils.ext.buildSpannableString
|
import com.shuwei.dish.match.utils.ext.buildSpannableString
|
||||||
@@ -110,7 +112,13 @@ class DeviceConfigFragment : BaseFragment<FragmentDeviceConfigBinding>() {
|
|||||||
}
|
}
|
||||||
activity?.finish()
|
activity?.finish()
|
||||||
}
|
}
|
||||||
|
// TODO: 临时测试----------------------
|
||||||
|
detector.setOnMultiClickListener(binding.tvSetting) {
|
||||||
|
activity?.startActivity<HomeActivity>()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val detector = MultiClickDetector(targetCount = 3, intervalMs = 500)
|
||||||
//
|
//
|
||||||
// /**
|
// /**
|
||||||
// * 添加称重监听
|
// * 添加称重监听
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="餐品模式"
|
android:text="菜品模式"
|
||||||
android:textSize="32sp"
|
android:textSize="32sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:layout_marginStart="32dp"
|
android:layout_marginStart="32dp"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
android:id="@+id/tvLockRemind"
|
android:id="@+id/tvLockRemind"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="30dp"
|
android:layout_marginVertical="15dp"
|
||||||
android:text="@string/lock_remind"
|
android:text="@string/lock_remind"
|
||||||
android:textColor="@color/lock_remind"
|
android:textColor="@color/lock_remind"
|
||||||
android:textSize="26sp"
|
android:textSize="26sp"
|
||||||
@@ -22,14 +22,14 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="180dp"
|
android:layout_height="180dp"
|
||||||
android:layout_marginStart="60dp"
|
android:layout_marginStart="60dp"
|
||||||
android:layout_marginTop="30dp"
|
android:layout_marginVertical="15dp"
|
||||||
android:layout_marginEnd="60dp"
|
android:layout_marginEnd="60dp"
|
||||||
app:cardBackgroundColor="@color/white"
|
app:cardBackgroundColor="@color/white"
|
||||||
app:cardCornerRadius="30dp"
|
app:cardCornerRadius="30dp"
|
||||||
app:cardElevation="0dp"
|
app:cardElevation="0dp"
|
||||||
app:rippleColor="#B0BEC5">
|
app:rippleColor="#B0BEC5">
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
@@ -46,44 +46,48 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:ignore="ContentDescription" />
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="40dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="start|center_vertical"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvModeName"
|
android:id="@+id/tvModeName"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
tools:text="@string/mode_cook"
|
tools:text="@string/mode_cook"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/ivModeIcon"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/tvModeDesc"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/ivRightIcon"
|
||||||
|
android:layout_marginStart="40dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
android:textColor="@color/mode_name"
|
android:textColor="@color/mode_name"
|
||||||
android:textSize="36sp"
|
android:textSize="36sp"
|
||||||
|
app:layout_constraintVertical_chainStyle="packed"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvModeDesc"
|
android:id="@+id/tvModeDesc"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="16dp"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/tvModeName"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/tvModeName"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tvModeName"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
tools:text="@string/cook_mode_desc"
|
tools:text="@string/cook_mode_desc"
|
||||||
android:textColor="@color/mode_desc"
|
android:textColor="@color/mode_desc"
|
||||||
android:textSize="26sp" />
|
android:textSize="26sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ivRightIcon"
|
android:id="@+id/ivRightIcon"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginEnd="40dp"
|
android:layout_marginEnd="40dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:src="@drawable/ic_arrow_right"
|
android:src="@drawable/ic_arrow_right"
|
||||||
tools:ignore="ContentDescription" />
|
tools:ignore="ContentDescription" />
|
||||||
</LinearLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
Reference in New Issue
Block a user