开机启动页面修改,搜索食材线上边距调整
This commit is contained in:
@@ -3,13 +3,13 @@ package com.shuwei.dish.match.utils
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.shuwei.dish.match.ui.HomeActivity
|
||||
import com.shuwei.dish.match.ui.InitActivity
|
||||
|
||||
class BootReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (Intent.ACTION_BOOT_COMPLETED == intent.action) {
|
||||
// 启动服务或Activity
|
||||
val launchIntent = Intent(context, HomeActivity::class.java)
|
||||
val launchIntent = Intent(context, InitActivity::class.java)
|
||||
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
context.startActivity(launchIntent)
|
||||
}
|
||||
|
||||
@@ -47,7 +47,11 @@ object WeightUtil {
|
||||
}
|
||||
|
||||
fun getWeight() {
|
||||
Weigher2.getWeight()
|
||||
try {
|
||||
Weigher2.getWeight()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
fun startContinuousRead() {
|
||||
@@ -64,7 +68,11 @@ object WeightUtil {
|
||||
}
|
||||
|
||||
fun tareTwo(address: Int) {
|
||||
Weigher2.tareTwo(address)
|
||||
try {
|
||||
Weigher2.tareTwo(address)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun runOnUiThread(action: () -> Unit) {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
android:layout_height="100dp"
|
||||
android:textColor="@color/black666"
|
||||
android:textSize="30sp"
|
||||
android:paddingHorizontal="5dp"
|
||||
android:gravity="center"
|
||||
android:layout_margin="15dp"
|
||||
tools:text="椒盐"
|
||||
|
||||
Reference in New Issue
Block a user