Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f59b83443 |
@@ -2,11 +2,71 @@ package com.arkj.app;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
public class MainActivity extends Activity {
|
public class MainActivity extends Activity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,12 +3,344 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:gravity="center">
|
android:background="@drawable/bg_gradient">
|
||||||
|
|
||||||
<TextView
|
<!-- 顶部搜索栏 -->
|
||||||
android:layout_width="wrap_content"
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="ARKJ"
|
android:orientation="horizontal"
|
||||||
android:textSize="32sp"/>
|
android:padding="16dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:src="@drawable/ic_speaker"
|
||||||
|
android:layout_marginEnd="12dp"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:background="@drawable/bg_search"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:src="@drawable/ic_search"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/search_hint"
|
||||||
|
android:textColor="#999"
|
||||||
|
android:layout_marginStart="8dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:src="@drawable/ic_scan"
|
||||||
|
android:layout_marginStart="12dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 功能网格 -->
|
||||||
|
<GridLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:rowCount="3"
|
||||||
|
android:columnCount="3"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<!-- 备忘录 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btnMemo"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_columnWeight="1"
|
||||||
|
android:layout_rowWeight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/bg_function_icon"
|
||||||
|
android:layout_margin="8dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:src="@drawable/ic_memo"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/memo"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:layout_marginTop="4dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 二维码 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btnQRCode"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_columnWeight="1"
|
||||||
|
android:layout_rowWeight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/bg_function_icon"
|
||||||
|
android:layout_margin="8dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:src="@drawable/ic_qrcode"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/qrcode"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:layout_marginTop="4dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 谁在干活 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btnWhoWorking"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_columnWeight="1"
|
||||||
|
android:layout_rowWeight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/bg_function_icon"
|
||||||
|
android:layout_margin="8dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:src="@drawable/ic_star"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/who_working"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:layout_marginTop="4dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- PVE -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btnPVE"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_columnWeight="1"
|
||||||
|
android:layout_rowWeight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/bg_function_icon"
|
||||||
|
android:layout_margin="8dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:src="@drawable/ic_pve"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/pve"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:layout_marginTop="4dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 快递 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btnExpress"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_columnWeight="1"
|
||||||
|
android:layout_rowWeight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/bg_function_icon"
|
||||||
|
android:layout_margin="8dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:src="@drawable/ic_express"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/express"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:layout_marginTop="4dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 纪念日 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btnAnniversary"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_columnWeight="1"
|
||||||
|
android:layout_rowWeight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/bg_function_icon"
|
||||||
|
android:layout_margin="8dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:src="@drawable/ic_anniversary"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/anniversary"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:layout_marginTop="4dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 记账 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btnAccounting"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_columnWeight="1"
|
||||||
|
android:layout_rowWeight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/bg_function_icon"
|
||||||
|
android:layout_margin="8dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:src="@drawable/ic_accounting"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/accounting"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:layout_marginTop="4dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 资料 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btnMaterials"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_columnWeight="1"
|
||||||
|
android:layout_rowWeight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/bg_function_icon"
|
||||||
|
android:layout_margin="8dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:src="@drawable/ic_materials"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/materials"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:layout_marginTop="4dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 更多 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btnMore"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_columnWeight="1"
|
||||||
|
android:layout_rowWeight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/bg_function_icon"
|
||||||
|
android:layout_margin="8dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:src="@drawable/ic_more"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="更多"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:layout_marginTop="4dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</GridLayout>
|
||||||
|
|
||||||
|
<!-- 底部导航 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:background="@drawable/bg_menu_button">
|
||||||
|
|
||||||
|
<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"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/home"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:layout_marginTop="2dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/navCenter"
|
||||||
|
android:layout_width="64dp"
|
||||||
|
android:layout_height="64dp"
|
||||||
|
android:src="@drawable/ic_center_button"
|
||||||
|
android:layout_marginHorizontal="16dp"/>
|
||||||
|
|
||||||
|
<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"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/profile"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:layout_marginTop="2dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
Reference in New Issue
Block a user