Commit 896ef78c authored by 小费同学阿's avatar 小费同学阿 💬

环渤海-页面交互优化

parent 4fd1ece5
......@@ -9,12 +9,8 @@
<option name="autoReloadType" value="NONE" />
</component>
<component name="ChangeListManager">
<list default="true" id="1610d094-2fe0-4efc-9eff-ac55fbf06aaf" name="Changes" comment="环渤海-我的页面创建">
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/merchanthbh/ui/Home/HomeFragment.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/merchanthbh/ui/mine/MineFragment.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/src/main/res/layout/fragment_home.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/src/main/res/layout/fragment_mine.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/src/main/res/menu/bottom_nav_menu.xml" afterDir="false" />
<list default="true" id="1610d094-2fe0-4efc-9eff-ac55fbf06aaf" name="Changes" comment="环渤海-页面交互优化">
<change afterPath="$PROJECT_DIR$/app/src/main/res/drawable/selector_menu_wode.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/8.0/executionHistory/executionHistory.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/8.0/executionHistory/executionHistory.bin" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/8.0/executionHistory/executionHistory.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/8.0/executionHistory/executionHistory.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.gradle/8.0/fileHashes/fileHashes.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/8.0/fileHashes/fileHashes.bin" afterDir="false" />
......@@ -25,8 +21,13 @@
<change beforePath="$PROJECT_DIR$/.gradle/file-system.probe" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/file-system.probe" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/merchanthbh/ui/Home/HomeActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/merchanthbh/ui/Home/HomeActivity.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/activity_home.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/activity_home.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/activity_mine.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/activity_mine.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/merchanthbh/ui/Home/HomeViewModel.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/merchanthbh/ui/mine/MineViewModel.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/merchanthbh/ui/mine/MineViewModel.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/drawable/arrow_right.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/drawable/selector_menu_home.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/fragment_home.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/fragment_home.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/fragment_mine.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/fragment_mine.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/menu/bottom_nav_menu.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/menu/bottom_nav_menu.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/local.properties" beforeDir="false" afterPath="$PROJECT_DIR$/local.properties" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
......@@ -34,6 +35,9 @@
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CodeInsightWorkspaceSettings">
<option name="optimizeImportsOnTheFly" value="true" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[C:\Users\11194\.android\avd\Pixel_6_Pro_API_34.avd]" />
<component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$">
......@@ -61,8 +65,8 @@
<option name="RECENT_TEMPLATES">
<list>
<option value="Kotlin Class" />
<option value="resourceFile" />
<option value="Class" />
<option value="resourceFile" />
</list>
</option>
</component>
......@@ -99,8 +103,8 @@
"cidr.known.project.marker": "true",
"dart.analysis.tool.window.visible": "false",
"last_directory_selection": "C:/AndroidStudioProjects/hbhandroid/app/src/main/res/mipmap-hdpi",
"last_opened_file_path": "C:/AndroidStudioProjects/hbhandroid/app/src/main/res/layout",
"project.structure.last.edited": "Dependencies",
"last_opened_file_path": "C:/AndroidStudioProjects/hbhandroid/app/src/main/res/mipmap-hdpi",
"project.structure.last.edited": "SDK Location",
"project.structure.proportion": "0.17",
"project.structure.side.proportion": "0.2",
"settings.editor.selected.configurable": "preferences.pluginManager",
......@@ -118,10 +122,10 @@
<recent name="com.example.merchanthbh.ui.Home" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="C:\AndroidStudioProjects\hbhandroid\app\src\main\res\mipmap-hdpi" />
<recent name="C:\AndroidStudioProjects\hbhandroid\app\src\main\res\layout" />
<recent name="C:\AndroidStudioProjects\hbhandroid\app\src\main\res" />
<recent name="C:\AndroidStudioProjects\hbhandroid\app\src\main\res\drawable" />
<recent name="C:\AndroidStudioProjects\hbhandroid\app\src\main\res\mipmap-hdpi" />
<recent name="C:\AndroidStudioProjects\hbhandroid\app\src\main\res\mipmap\home" />
</key>
<key name="MoveFile.RECENT_KEYS">
......@@ -214,7 +218,14 @@
<option name="project" value="LOCAL" />
<updated>1688715086532</updated>
</task>
<option name="localTasksCounter" value="2" />
<task id="LOCAL-00002" summary="环渤海-页面交互">
<created>1688722135494</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1688722135494</updated>
</task>
<option name="localTasksCounter" value="3" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
......@@ -230,7 +241,9 @@
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="环渤海-我的页面创建" />
<option name="LAST_COMMIT_MESSAGE" value="环渤海-我的页面创建" />
<MESSAGE value="环渤海-页面交互" />
<MESSAGE value="环渤海-页面交互优化" />
<option name="LAST_COMMIT_MESSAGE" value="环渤海-页面交互优化" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
......
package com.example.merchanthbh.ui.Home;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import com.example.merchanthbh.R;
import com.example.merchanthbh.ui.mine.MineFragment;
import com.google.android.material.bottomnavigation.BottomNavigationView;
public class HomeActivity extends AppCompatActivity {
private HomeFragment homeFragment;
private BottomNavigationView bottomNavigationView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
// 初始化底部导航栏
bottomNavigationView = findViewById(R.id.bottom_navigation_view);
BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_navigation_view);
bottomNavigationView.setOnNavigationItemSelectedListener(navItemSelectedListener);
// 显示默认的 Fragment
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new HomeFragment()).commit();
}
private BottomNavigationView.OnNavigationItemSelectedListener navItemSelectedListener = item -> {
private final BottomNavigationView.OnNavigationItemSelectedListener navItemSelectedListener = item -> {
Fragment selectedFragment = null;
// 根据选项 ID 创建相应的 Fragmen
// 根据选项 ID 创建相应的 Fragment
if (item.getItemId()==R.id.menu_home)
{ selectedFragment = new HomeFragment();}
else if (item.getItemId()==R.id.menu_mine) {
if (item.getItemId() == R.id.menu_home) {
selectedFragment = new HomeFragment();
} else if (item.getItemId() == R.id.menu_mine) {
selectedFragment = new MineFragment();
}
/* switch (item.getItemId()) {
case R.id.menu_home:
selectedFragment = new HomeFragment();
break;
case R.id.menu_mine:
selectedFragment = new MineFragment();
break;
default:
}*/
// 替换当前显示的 Fragment
// 确保选择项不能为空
assert selectedFragment != null;
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, selectedFragment).commit();
return true;
};
}
}
package com.example.merchanthbh.ui.Home;
import android.app.Application;
import androidx.annotation.NonNull;
import com.example.merchanthbh.http.data.LoginModel;
import me.goldze.mvvmhabit.base.BaseViewModel;
public class HomeViewModel extends BaseViewModel<LoginModel> {
public HomeViewModel(@NonNull Application application, LoginModel model) {
super(application, model);
}
}
......@@ -4,13 +4,13 @@ import android.app.Application;
import androidx.annotation.NonNull;
import com.example.merchanthbh.http.data.LoginModel;
import com.example.merchanthbh.http.data.LoginRespons;
import me.goldze.mvvmhabit.base.BaseViewModel;
public class MineViewModel extends BaseViewModel<LoginModel> {
public MineViewModel(@NonNull Application application, LoginModel model) {
public class MineViewModel extends BaseViewModel<LoginRespons> {
public MineViewModel(@NonNull Application application, LoginRespons model) {
super(application, model);
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/tab_icon_home_selected" android:state_checked="true" />
<item android:drawable="@mipmap/tab_icon_home_default" android:state_checked="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/tab_icon_wode_selected" android:state_checked="true" />
<item android:drawable="@mipmap/tab_icon_wode_default" android:state_checked="false" />
</selector>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -2,14 +2,15 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_home"
android:icon="@mipmap/tab_icon_home_selected"
android:title="首页" />
android:icon="@drawable/selector_menu_home"
android:title="@string/navigation_home" />
<item
android:id="@+id/menu_huanbohai"
android:icon="@mipmap/tab_icon_huanbohai_default"
android:title="环渤海" />
android:icon="@drawable/selector_menu_home"
android:title="@string/navigation_sea" />
<item
android:id="@+id/menu_mine"
android:icon="@mipmap/tab_icon_wode_default"
android:title="我的" />
android:icon="@drawable/selector_menu_wode"
android:title="@string/navigation_mine" />
</menu>
\ No newline at end of file
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="app_name">HBHFurniture</string>
<string name="title_activity_exactivity">EXActivity</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
......@@ -7,6 +7,71 @@
<string name="nav_header_subtitle">android.studio@android.com</string>
<string name="nav_header_desc">Navigation header</string>
<string name="action_settings">Settings</string>
<!--navigationBar底部菜单-->
<!--首页-->
<string name="navigation_home">首页</string>
<!--环渤海-->
<string name="navigation_sea">环渤海</string>
<!--我的-->
<string name="navigation_mine">我的</string>
<!--首页模块-->
<!--首页模块 今日成交(元)-->
<string name="today_deal">今日成交(元)</string>
<!--首页模块 今日成交数量-->
<string name="today_deal_number">27587.68</string>
<!--首页模块 今日订单-->
<string name="today_order">今日订单</string>
<!--首页模块 今日订单数量-->
<string name="today_order_number">795个</string>
<!--首页模块 今日下单用户-->
<string name="today_customer">今日下单用户</string>
<!--首页模块 今日下单用户数量-->
<string name="today_customer_number">795位</string>
<!--首页模块 电费余额-->
<string name="electricity_balance">电费余额</string>
<!--首页模块 电费余额数量-->
<string name="electricity_balance_num">795.00元</string>
<!--首页模块 店铺信息-->
<string name="store_information">店铺信息</string>
<!--首页模块 店铺积分-->
<string name="store_points">店铺积分</string>
<!--首页模块 店员管理-->
<string name="clerk_management">店员管理</string>
<!--首页模块 添加商品-->
<string name="goods_add">添加商品</string>
<!--首页模块 商品管理-->
<string name="goods_management">商品管理</string>
<!--首页模块 创建订单-->
<string name="order_add">创建订单</string>
<!--首页模块 订单管理-->
<string name="order_management">订单管理</string>
<!--首页模块 诉求反馈-->
<string name="appeal_feedback">诉求反馈</string>
<!--首页模块 转发统计-->
<string name="forwarding_statistics">转发统计</string>
<!--首页模块 人才招聘-->
<string name="talent_recruitment">人才招聘</string>
<!--我的模块-->
<!--我的模块 用户姓名-->
<string name="user_nickname">王小丫</string>
<!--我的模块 用户职位-->
<string name="user_position">店长</string>
<!--我的模块 创建日期-->
<string name="user_createdate" tools:ignore="TypographyDashes">创建日期:2022–12-12</string>
<!--我的模块 菜单列表-->
<!--修改密码-->
<string name="change_password">修改密码</string>
<!--更换手机号-->
<string name="change_phone">更换手机号</string>
<!--隐私协议-->
<string name="privary_agreement">隐私协议</string>
<!--清除缓存-->
<string name="clear_cache">清除缓存</string>
<!--检查更新-->
<string name="check_update">检查更新</string>
<!--退出登录-->
<string name="log_out">退出登录</string>
<string name="menu_home">Home</string>
<string name="menu_gallery">Gallery</string>
......
## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file should *NOT* be checked into Version Control Systems,
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=D\:\\workSoft\\SDK
\ No newline at end of file
#Fri Jul 07 18:50:30 CST 2023
sdk.dir=C\:\\AndroidSDK
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment