diff --git a/app/src/main/java/com/arkj/app/MainActivity.java b/app/src/main/java/com/arkj/app/MainActivity.java index 6729a66..946414d 100644 --- a/app/src/main/java/com/arkj/app/MainActivity.java +++ b/app/src/main/java/com/arkj/app/MainActivity.java @@ -2,11 +2,71 @@ package com.arkj.app; import android.app.Activity; import android.os.Bundle; +import android.view.View; +import android.widget.Toast; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + + // 设置功能按钮点击事件 + setupFunctionButtons(); + + // 设置底部导航点击事件 + setupBottomNavigation(); } -} + + private void setupFunctionButtons() { + // 备忘录 + findViewById(R.id.btnMemo).setOnClickListener(v -> + Toast.makeText(this, "打开备忘录", Toast.LENGTH_SHORT).show()); + + // 二维码 + findViewById(R.id.btnQRCode).setOnClickListener(v -> + Toast.makeText(this, "打开二维码扫描", Toast.LENGTH_SHORT).show()); + + // 谁在干活 + findViewById(R.id.btnWhoWorking).setOnClickListener(v -> + Toast.makeText(this, "查看谁在干活", Toast.LENGTH_SHORT).show()); + + // PVE + findViewById(R.id.btnPVE).setOnClickListener(v -> + Toast.makeText(this, "打开 PVE", Toast.LENGTH_SHORT).show()); + + // 快递 + findViewById(R.id.btnExpress).setOnClickListener(v -> + Toast.makeText(this, "查看快递", Toast.LENGTH_SHORT).show()); + + // 纪念日 + findViewById(R.id.btnAnniversary).setOnClickListener(v -> + Toast.makeText(this, "查看纪念日", Toast.LENGTH_SHORT).show()); + + // 记账 + findViewById(R.id.btnAccounting).setOnClickListener(v -> + Toast.makeText(this, "打开记账", Toast.LENGTH_SHORT).show()); + + // 资料 + findViewById(R.id.btnMaterials).setOnClickListener(v -> + Toast.makeText(this, "查看资料", Toast.LENGTH_SHORT).show()); + + // 更多 + findViewById(R.id.btnMore).setOnClickListener(v -> + Toast.makeText(this, "更多功能", Toast.LENGTH_SHORT).show()); + } + + private void setupBottomNavigation() { + // 首页 + findViewById(R.id.navHome).setOnClickListener(v -> + Toast.makeText(this, "已在首页", Toast.LENGTH_SHORT).show()); + + // 中间按钮 + findViewById(R.id.navCenter).setOnClickListener(v -> + Toast.makeText(this, "快速操作", Toast.LENGTH_SHORT).show()); + + // 我的 + findViewById(R.id.navProfile).setOnClickListener(v -> + Toast.makeText(this, "打开个人中心", Toast.LENGTH_SHORT).show()); + } +} \ 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 index e248bc7..97d03ef 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -3,12 +3,344 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - android:gravity="center"> + android:background="@drawable/bg_gradient"> - + + android:orientation="horizontal" + android:padding="16dp" + android:gravity="center_vertical"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file