@@ -2,68 +2,11 @@ package com.arkj.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,420 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_gradient"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 顶部栏 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:gravity="end">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btnMore"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/ic_more"
|
||||
android:background="@drawable/bg_menu_button"
|
||||
android:padding="8dp"
|
||||
android:contentDescription="更多"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btnScan"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/ic_scan"
|
||||
android:background="@drawable/bg_menu_button"
|
||||
android:padding="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:contentDescription="扫描"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 搜索栏 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/searchBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/bg_search"
|
||||
android:padding="12dp"
|
||||
android:layout_margin="16dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/ic_search"
|
||||
android:contentDescription="搜索"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/search_hint"
|
||||
android:textColor="#999999"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginStart="12dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 功能网格 - 第一行 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btnMemo"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@drawable/ic_memo"
|
||||
android:background="@drawable/bg_function_icon"
|
||||
android:padding="12dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/memo"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btnQRCode"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@drawable/ic_qrcode"
|
||||
android:background="@drawable/bg_function_icon"
|
||||
android:padding="12dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/qrcode"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btnWhoWorking"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@drawable/ic_star"
|
||||
android:background="@drawable/bg_function_icon"
|
||||
android:padding="12dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/who_working"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btnPVE"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@drawable/ic_pve"
|
||||
android:background="@drawable/bg_function_icon"
|
||||
android:padding="12dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pve"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 功能网格 - 第二行 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btnExpress"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@drawable/ic_express"
|
||||
android:background="@drawable/bg_function_icon"
|
||||
android:padding="12dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/express"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btnAnniversary"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@drawable/ic_anniversary"
|
||||
android:background="@drawable/bg_function_icon"
|
||||
android:padding="12dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/anniversary"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btnAccounting"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@drawable/ic_accounting"
|
||||
android:background="@drawable/bg_function_icon"
|
||||
android:padding="12dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/accounting"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btnMaterials"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@drawable/ic_materials"
|
||||
android:background="@drawable/bg_function_icon"
|
||||
android:padding="12dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/materials"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 消息提示 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/messageBanner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/bg_message"
|
||||
android:padding="12dp"
|
||||
android:layout_margin="16dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/ic_speaker"
|
||||
android:contentDescription="消息"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/message_hint"
|
||||
android:textColor="#666666"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginStart="12dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 博客卡片 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/blogCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_card"
|
||||
android:padding="16dp"
|
||||
android:layout_margin="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/blog_title"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/no_articles"
|
||||
android:textColor="#999999"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="8dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 占位空间,把底部导航推到底部 -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<!-- 底部导航 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/bottomNav"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:background="@android:color/white"
|
||||
android:elevation="8dp">
|
||||
|
||||
<!-- 首页 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/navHome"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@drawable/ic_home_active"
|
||||
android:contentDescription="首页"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/home"
|
||||
android:textColor="#FF4081"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 中间按钮 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/navCenter"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:src="@drawable/ic_center_button"
|
||||
android:contentDescription="快速操作"
|
||||
android:layout_marginTop="-16dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 我的 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/navProfile"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@drawable/ic_profile"
|
||||
android:contentDescription="我的"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/profile"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
android:text="ARKJ"
|
||||
android:textSize="32sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
Reference in New Issue
Block a user