Compare commits
2 Commits
9707314aee
...
cad4b58a46
| Author | SHA1 | Date |
|---|---|---|
|
|
cad4b58a46 | 3 weeks ago |
|
|
28b432159f | 3 weeks ago |
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="21" />
|
||||
<bytecodeTargetLevel target="17" />
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,48 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.mobile_pda'
|
||||
compileSdk 36
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.mobile_pda"
|
||||
minSdk 26
|
||||
targetSdk 36
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation libs.appcompat
|
||||
implementation libs.material
|
||||
implementation libs.activity
|
||||
implementation libs.constraintlayout
|
||||
|
||||
// Lifecycle components
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.7.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-livedata:2.7.0'
|
||||
|
||||
testImplementation libs.junit
|
||||
androidTestImplementation libs.ext.junit
|
||||
androidTestImplementation libs.espresso.core
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.mobile_pda"
|
||||
compileSdk {
|
||||
version = release(36)
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.mobile_pda"
|
||||
minSdk = 26
|
||||
targetSdk = 36
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.material)
|
||||
implementation(libs.activity)
|
||||
implementation(libs.constraintlayout)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.ext.junit)
|
||||
androidTestImplementation(libs.espresso.core)
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
package com.example.mobile_pda;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
// 顶部按钮组件 -->开始、暂停、主页图标
|
||||
private Button btnStartHeader, btnPauseHeader;
|
||||
private ImageButton btnHome;
|
||||
|
||||
// 表单输入组件 --> 资源、产品条码、工单等数据项
|
||||
private EditText etResource, etProductBarcode, etWorkOrder, etOpStep, etWorkNum, etProcess, etStatus, etWorkshop, etStartTime, etEndTime;
|
||||
|
||||
// SFC(生产控制) 区域按钮 --> 移除选项、移除全部
|
||||
private TextView btnRemoveSelected, btnRemoveAll;
|
||||
|
||||
// 底部操作区按钮 --> 互检、开始、刀具、辅料、异常、装配、自检、首检、完成
|
||||
private Button btnActionHujian, btnActionStart, btnActionTool, btnActionAux;
|
||||
private Button btnActionException, btnActionAssemble, btnActionSelfCheck, btnActionFirstCheck, btnActionFinish;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
// 启用全屏显示,适配系统栏(状态栏/导航栏)宽度占位
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
initViews();
|
||||
setupListeners();
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
// 顶部导航栏初始化
|
||||
btnStartHeader = findViewById(R.id.btn_start_header);
|
||||
btnPauseHeader = findViewById(R.id.btn_pause_header);
|
||||
btnHome = findViewById(R.id.btn_home);
|
||||
|
||||
// 核心表单区域初始化
|
||||
etResource = findViewById(R.id.et_resource);
|
||||
etProductBarcode = findViewById(R.id.et_product_barcode);
|
||||
etWorkOrder = findViewById(R.id.et_work_order);
|
||||
etOpStep = findViewById(R.id.et_op_step);
|
||||
etWorkNum = findViewById(R.id.et_work_num);
|
||||
etProcess = findViewById(R.id.et_process);
|
||||
etStatus = findViewById(R.id.et_status);
|
||||
etWorkshop = findViewById(R.id.et_workshop);
|
||||
etStartTime = findViewById(R.id.et_start_time);
|
||||
etEndTime = findViewById(R.id.et_end_time);
|
||||
|
||||
// SFC 列表区域初始化
|
||||
btnRemoveSelected = findViewById(R.id.btn_remove_selected);
|
||||
btnRemoveAll = findViewById(R.id.btn_remove_all);
|
||||
|
||||
// 底部快捷操作按钮初始化
|
||||
btnActionHujian = findViewById(R.id.btn_action_hujian);
|
||||
btnActionStart = findViewById(R.id.btn_action_start);
|
||||
btnActionTool = findViewById(R.id.btn_action_tool);
|
||||
btnActionAux = findViewById(R.id.btn_action_aux);
|
||||
btnActionException = findViewById(R.id.btn_action_exception);
|
||||
btnActionAssemble = findViewById(R.id.btn_action_assemble);
|
||||
btnActionSelfCheck = findViewById(R.id.btn_action_self_check);
|
||||
btnActionFirstCheck = findViewById(R.id.btn_action_first_check);
|
||||
btnActionFinish = findViewById(R.id.btn_action_finish);
|
||||
}
|
||||
|
||||
private void setupListeners() {
|
||||
btnActionStart.setOnClickListener(v -> Toast.makeText(this, "Start Clicked", Toast.LENGTH_SHORT).show());
|
||||
btnActionFinish.setOnClickListener(v -> Toast.makeText(this, "Finish Clicked", Toast.LENGTH_SHORT).show());
|
||||
}
|
||||
}
|
||||
@ -1,3 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Mobile_PDA</string>
|
||||
<string name="toast_start_clicked">开始被点击</string>
|
||||
<string name="toast_finish_clicked">完成被点击</string>
|
||||
</resources>
|
||||
@ -1,4 +1,4 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
alias(libs.plugins.android.application) apply false
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue