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