commit 9707314aeeefd93c37bf2e555fb5b757a0e4f19c Author: Yangk Date: Fri Apr 10 09:03:55 2026 +0800 feat: init project diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/AndroidProjectSystem.xml b/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/deviceManager.xml b/.idea/deviceManager.xml new file mode 100644 index 0000000..91f9558 --- /dev/null +++ b/.idea/deviceManager.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..639c779 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/migrations.xml b/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..6de34e7 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,43 @@ + + + + + + + + Android + + + Android Lint: Compliance + + + Android Lint: Correctness + + + Android Lint: Performance + + + Android Lint: Productivity + + + Android Lint: Security + + + Android Lint: Usability + + + + + User defined + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..dcadb89 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,44 @@ +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) +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/example/mobile_pda/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/mobile_pda/ExampleInstrumentedTest.java new file mode 100644 index 0000000..9467ff8 --- /dev/null +++ b/app/src/androidTest/java/com/example/mobile_pda/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.mobile_pda; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.mobile_pda", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..67ad519 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/example/mobile_pda/MainActivity.java b/app/src/main/java/com/example/mobile_pda/MainActivity.java new file mode 100644 index 0000000..aae21e5 --- /dev/null +++ b/app/src/main/java/com/example/mobile_pda/MainActivity.java @@ -0,0 +1,78 @@ +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()); + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_btn.xml b/app/src/main/res/drawable/bg_btn.xml new file mode 100644 index 0000000..6f91d7d --- /dev/null +++ b/app/src/main/res/drawable/bg_btn.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/app/src/main/res/drawable/bg_input.xml b/app/src/main/res/drawable/bg_input.xml new file mode 100644 index 0000000..009c487 --- /dev/null +++ b/app/src/main/res/drawable/bg_input.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_home.xml b/app/src/main/res/drawable/ic_home.xml new file mode 100644 index 0000000..775d69d --- /dev/null +++ b/app/src/main/res/drawable/ic_home.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..f0a42da --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,257 @@ + + + + + + + + + +