Browse Source

首页分类菜谱

桌面小炒机
liup 7 months ago
parent
commit
47bd6e9c1d
23 changed files with 287 additions and 163 deletions
  1. +26
    -2
      app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/BottomNavigationNewActivity.java
  2. +2
    -2
      app/src/main/java/com/bonait/bnframework/ViewModel/FragmentViewModel/Home4Fragment.java
  3. +2
    -25
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  4. +2
    -2
      app/src/main/java/com/bonait/bnframework/common/utils/DisplayManager.java
  5. +12
    -1
      app/src/main/java/com/bonait/bnframework/ui/activity/EditClassifyActivity.java
  6. +5
    -2
      app/src/main/java/com/bonait/bnframework/ui/adapter/ClassifyAdapter.java
  7. +3
    -1
      app/src/main/java/com/bonait/bnframework/ui/adapter/CloudGoodsAdapter.java
  8. +4
    -2
      app/src/main/java/com/bonait/bnframework/ui/adapter/LocalGoodsAdapter.java
  9. +9
    -9
      app/src/main/java/com/bonait/bnframework/ui/fragment/CloudGoodsFragment.java
  10. +12
    -0
      app/src/main/java/com/bonait/bnframework/ui/fragment/HomeFoodsFragment.java
  11. +12
    -3
      app/src/main/java/com/bonait/bnframework/ui/fragment/LocalGoodsFragment.java
  12. +6
    -0
      app/src/main/res/anim/slide_left_in.xml
  13. +6
    -0
      app/src/main/res/anim/slide_left_out.xml
  14. +20
    -0
      app/src/main/res/anim/slide_right_in.xml
  15. +20
    -0
      app/src/main/res/anim/slide_right_out.xml
  16. +2
    -2
      app/src/main/res/layout/dialog/layout/dialog_add_classify.xml
  17. +38
    -33
      app/src/main/res/layout/fragment_cloud_goods.xml
  18. +10
    -5
      app/src/main/res/layout/fragment_home_foods.xml
  19. +57
    -47
      app/src/main/res/layout/fragment_local_goods.xml
  20. +6
    -8
      app/src/main/res/layout/item/layout/item_classify.xml
  21. +7
    -7
      app/src/main/res/layout/item/layout/item_cloud_goods.xml
  22. +17
    -12
      app/src/main/res/layout/item/layout/item_local_goods.xml
  23. +9
    -0
      app/src/main/res/values/styles.xml

+ 26
- 2
app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/BottomNavigationNewActivity.java View File

@@ -1,12 +1,14 @@
package com.bonait.bnframework.ViewModel.ActivityViewModel;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.viewpager.widget.ViewPager;

import com.apkfuns.logutils.LogUtils;
@@ -34,6 +36,7 @@ import com.bonait.bnframework.common.utils.NetworkUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.common.view.BottomNavigationBar;
import com.bonait.bnframework.manager.ActivityLifecycleManager;
import com.bonait.bnframework.ui.activity.EditClassifyActivity;
import com.bonait.bnframework.ui.fragment.HomeFoodsFragment;
import com.lzy.okgo.OkGo;
import com.qmuiteam.qmui.widget.QMUIViewPager;
@@ -45,7 +48,7 @@ import butterknife.ButterKnife;
import butterknife.OnClick;

public class BottomNavigationNewActivity extends BaseActivity {
private static final String TAG= "BottomNavigationNewActivity ==>";
//region 变量
@BindView(R.id.navigation)
BottomNavigationBar bottomNavigationView;
@@ -65,6 +68,7 @@ public class BottomNavigationNewActivity extends BaseActivity {

//region 界面私立
public Activity activity;
private HomeFoodsFragment homeFoodsFragment;

@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -123,8 +127,9 @@ public class BottomNavigationNewActivity extends BaseActivity {
* viewPager里添加fragment
*/
private void initFragment() {
homeFoodsFragment = new HomeFoodsFragment();
FragmentAdapter fragmentAdapter = new FragmentAdapter(getSupportFragmentManager());
fragmentAdapter.addFragment(new HomeFoodsFragment());
fragmentAdapter.addFragment(homeFoodsFragment);
// fragmentAdapter.addFragment(new HomeFragmentPR());
fragmentAdapter.addFragment(new Home4Fragment());
// fragmentAdapter.addFragment(new HomeFragmentSBKZ());
@@ -632,4 +637,23 @@ public class BottomNavigationNewActivity extends BaseActivity {
}
}
//endregion


public static final int REQUEST_CLASSIFY_ACTIVITY = 1000;
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
LogUtils.d(TAG+" onActivityResult requestCode="+requestCode+" resultCode="+resultCode+" data="+data);
if (requestCode == REQUEST_CLASSIFY_ACTIVITY&& resultCode==RESULT_OK) {
if(homeFoodsFragment!=null){
homeFoodsFragment.updateLocalData();
}
}
}

public void jumpClassifyActivity(){
Intent intent = new Intent(BottomNavigationNewActivity.this, EditClassifyActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivityForResult(intent,REQUEST_CLASSIFY_ACTIVITY);
}
}

+ 2
- 2
app/src/main/java/com/bonait/bnframework/ViewModel/FragmentViewModel/Home4Fragment.java View File

@@ -14,6 +14,7 @@ import androidx.appcompat.app.AppCompatActivity;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.R;
import com.bonait.bnframework.ViewModel.ActivityViewModel.BottomNavigationNewActivity;
import com.bonait.bnframework.ViewModel.ActivityViewModel.DishTestActivity;
import com.bonait.bnframework.ViewModel.ActivityViewModel.LoginActivity;
import com.bonait.bnframework.ViewModel.CustomView.XComDialog;
@@ -24,7 +25,6 @@ import com.bonait.bnframework.common.message.MessageManager;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.manager.ActivityLifecycleManager;
import com.bonait.bnframework.ui.activity.EditClassifyActivity;
import com.bonait.bnframework.ui.activity.SetSeasoningActivity;
import com.orhanobut.logger.Logger;

@@ -72,7 +72,7 @@ public class Home4Fragment extends BaseFragment {
switch (view.getId()) {
case R.id.kaishipengren:
// MessageManager.getInstance().sendMessage(MessageName.SelectZY, 0);
OpenActivity(EditClassifyActivity.class);
((BottomNavigationNewActivity)getActivity()).jumpClassifyActivity();
break;
case R.id.shebeikongzhi:
MessageManager.getInstance().sendMessage(MessageName.SelectZY, 2);


+ 2
- 25
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java View File

@@ -14,16 +14,14 @@ import com.bonait.bnframework.HBL.Interface.IRun;
import com.bonait.bnframework.HBL.Interface.IRunT;
import com.bonait.bnframework.HBL.Thread.IThread;
import com.bonait.bnframework.HBL.Thread.ThreadManager;
import com.bonait.bnframework.Service.AnalogConvert;
import com.bonait.bnframework.Service.ModbusHelper;
import com.bonait.bnframework.ViewModel.CustomView.MyStatus;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE;
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS;
import com.bonait.bnframework.common.db.mode.BPA_SILOS;
import com.bonait.bnframework.common.db.mode.BPA_SILOS_CALIBRATE;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.ViewModel.CustomView.MyStatus;

import java.util.ArrayList;
import java.util.HashMap;
@@ -1095,27 +1093,6 @@ public class ExecuteTheRecipe {
}
}

new Thread(new Runnable() {
@Override
public void run() {
try {
WritePLC("初始化", true, null);
Thread.sleep(500);
WritePLC("初始化", false, null);

ExecuteTheRecipe.WritePLC("温控开关", false, null);//开关闭合
ExecuteTheRecipe.WritePLC("暂停开关", false, null);//开关闭合

ExecuteTheRecipe.WritePLC("校准时间", 50, null);//默认校准时间5秒
ExecuteTheRecipe.WritePLC("料仓1校准开关", false, null);//默认校准时间5秒
ExecuteTheRecipe.WritePLC("料仓2校准开关", false, null);//默认校准时间5秒
ExecuteTheRecipe.WritePLC("料仓3校准开关", false, null);//默认校准时间5秒
} catch (InterruptedException e) {
ToastUtils.info("异常信息:" + e.getMessage());
}
}
}).start();


ThreadManager.get().StartLong("PLC设备数据监听", true, new IThread() {
@Override
@@ -1140,7 +1117,7 @@ public class ExecuteTheRecipe {
LogUtils.d("异常信息:" + ex.getMessage());
ToastUtils.error("异常信息:" + ex.getMessage());
}
Thread.sleep(100);
Thread.sleep(50);
}
});
}


+ 2
- 2
app/src/main/java/com/bonait/bnframework/common/utils/DisplayManager.java View File

@@ -38,9 +38,9 @@ public class DisplayManager
/******************************参考的屏幕数据***************************/

/** 参照分辨率 */
private static int miReferencedMaxWidth = 1024;
private static int miReferencedMaxWidth = 800;
/** 参照分辨率 */
private static int miReferencedMaxHeight = 768;
private static int miReferencedMaxHeight = 1208;

/** 参照屏幕密度,基于160dpi */
private static float mfReferencedScreenDensity = 1.0f;


+ 12
- 1
app/src/main/java/com/bonait/bnframework/ui/activity/EditClassifyActivity.java View File

@@ -354,11 +354,22 @@ public class EditClassifyActivity extends BaseActivity {
viewBinding.topbar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
finishActivity();
}
});
}

@Override
protected void doOnBackPressed() {
super.doOnBackPressed();
finishActivity();
}

private void finishActivity(){
setResult(RESULT_OK, null);
finish();
}

@Override
protected String getClassName() {
return TAG;


+ 5
- 2
app/src/main/java/com/bonait/bnframework/ui/adapter/ClassifyAdapter.java View File

@@ -30,7 +30,9 @@ public abstract class ClassifyAdapter extends BaseAdapter<BPA_GOODS_CLASSIFY,Cla
@SuppressLint("SetTextI18n")
@Override
public void onBindViewHolder(@NonNull ClassifyAdapter.ViewHolder holder, @SuppressLint("RecyclerView") int position) {
DisplayManager.scaleViewGroup(holder.binding.getRoot());
if(holder.binding.name.getTextSize()>34||holder.binding.name.getTextSize()<30){
DisplayManager.scaleViewGroup(holder.binding.getRoot());
}
holder.binding.name.setText(mData.get(position).name+"");
if(mCurrentPosition==position){
holder.binding.name.setTextColor(Color.parseColor("#ffffff"));
@@ -42,8 +44,8 @@ public abstract class ClassifyAdapter extends BaseAdapter<BPA_GOODS_CLASSIFY,Cla
holder.binding.name.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mCurrentPosition= position;
int lastPos = mCurrentPosition;
mCurrentPosition= position;
notifyItemChanged(lastPos);
notifyItemChanged(mCurrentPosition);
onItemClick(view,position);
@@ -63,6 +65,7 @@ public abstract class ClassifyAdapter extends BaseAdapter<BPA_GOODS_CLASSIFY,Cla
public ViewHolder(ItemClassifyBinding view) {
super(view.getRoot());
binding = view;
// DisplayManager.scaleViewGroup(binding.getRoot());
}
}


+ 3
- 1
app/src/main/java/com/bonait/bnframework/ui/adapter/CloudGoodsAdapter.java View File

@@ -33,7 +33,9 @@ public abstract class CloudGoodsAdapter extends BaseAdapter<BPA_GOODS,CloudGoods
@Override
public void onBindViewHolder(@NonNull GoodsViewHolder holder, @SuppressLint("RecyclerView") int position) {
try {
DisplayManager.scaleViewGroup(holder.binding.getRoot());
if(holder.binding.name.getTextSize()>28||holder.binding.name.getTextSize()<24){
DisplayManager.scaleViewGroup(holder.binding.getRoot());
}
holder.binding.add.setVisibility(View.GONE);

BPA_GOODS goods = mData.get(position);


+ 4
- 2
app/src/main/java/com/bonait/bnframework/ui/adapter/LocalGoodsAdapter.java View File

@@ -32,7 +32,9 @@ public abstract class LocalGoodsAdapter extends BaseAdapter<BPA_GOODS,LocalGoods
@Override
public void onBindViewHolder(@NonNull GoodsViewHolder holder, @SuppressLint("RecyclerView") int position) {
try {
DisplayManager.scaleViewGroup(holder.binding.getRoot());
if(holder.binding.name.getTextSize()>28||holder.binding.name.getTextSize()<24){
DisplayManager.scaleViewGroup(holder.binding.getRoot());
}
holder.binding.add.setVisibility(View.GONE);
if(!ConfigName.getInstance().user.name.equals("一般用户")){
holder.binding.edit.setVisibility(View.VISIBLE);
@@ -40,7 +42,7 @@ public abstract class LocalGoodsAdapter extends BaseAdapter<BPA_GOODS,LocalGoods
holder.binding.edit.setVisibility(View.GONE);
}

if(position == mData.size()-1&&!ConfigName.getInstance().user.name.equals("一般用户")){
if(position == mData.size()&&!ConfigName.getInstance().user.name.equals("一般用户")){
holder.binding.add.setVisibility(View.VISIBLE);
holder.binding.add.setOnClickListener(new View.OnClickListener() {
@Override


+ 9
- 9
app/src/main/java/com/bonait/bnframework/ui/fragment/CloudGoodsFragment.java View File

@@ -32,8 +32,8 @@ import com.bonait.bnframework.common.db.util.SubAttributeDBUtil;
import com.bonait.bnframework.common.db.util.SubAttributeGroupDBUtil;
import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.databinding.FragmentCloudGoodsBinding;
import com.bonait.bnframework.databinding.FragmentLocalGoodsBinding;
import com.bonait.bnframework.ui.activity.EditClassifyActivity;
import com.bonait.bnframework.ui.adapter.ClassifyAdapter;
import com.bonait.bnframework.ui.adapter.CloudGoodsAdapter;

@@ -46,8 +46,7 @@ import java.util.List;
* @date: 2024/5/9 9:48.
*/
public class CloudGoodsFragment extends BaseFragment {
private FragmentLocalGoodsBinding viewBinding;
private Context context;
private FragmentCloudGoodsBinding viewBinding;
private CloudGoodsAdapter goodsAdapter;
private ClassifyAdapter classifyAdapter;
private ArrayList<BPA_GOODS> goodsList = new ArrayList<>();
@@ -69,24 +68,25 @@ public class CloudGoodsFragment extends BaseFragment {
@Override
protected View onCreateView() {
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_cloud_goods, null);
viewBinding = FragmentLocalGoodsBinding.bind(root);
viewBinding = FragmentCloudGoodsBinding.bind(root);
return root;
}

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
context = getContext();
initView();
updateData();
}

@Override
protected int backViewInitOffset() {
return 0;
}

@SuppressLint("NotifyDataSetChanged")
private void initView(){
DisplayManager.scaleViewGroup(viewBinding.getRoot());
viewBinding.addClassify.setOnClickListener(view -> {
OpenActivity(EditClassifyActivity.class);
});

goodsAdapter = new CloudGoodsAdapter(){

@@ -148,7 +148,7 @@ public class CloudGoodsFragment extends BaseFragment {
}
}
}
goodsAdapter.notifyDataSetChanged();
goodsAdapter.setNewData(goodsList);
}

@Override


+ 12
- 0
app/src/main/java/com/bonait/bnframework/ui/fragment/HomeFoodsFragment.java View File

@@ -107,6 +107,18 @@ public class HomeFoodsFragment extends BaseFragment {

}

/**
* 刷新本地商品
*/
public void updateLocalData(){
LogUtils.d("updateLocalData");
if(fragment!=null){
if(fragment instanceof LocalGoodsFragment){
((LocalGoodsFragment) fragment).updateData();
}
}
}

private void requestData(){
if (NetworkUtils.checkNetworkAvailable(context)) {
if(ConfigName.getInstance().cloudGoodsList.isEmpty()){


+ 12
- 3
app/src/main/java/com/bonait/bnframework/ui/fragment/LocalGoodsFragment.java View File

@@ -15,7 +15,9 @@ import androidx.appcompat.app.AppCompatActivity;

import com.apkfuns.logutils.LogUtils;
import com.bonait.bnframework.R;
import com.bonait.bnframework.ViewModel.ActivityViewModel.BottomNavigationNewActivity;
import com.bonait.bnframework.common.base.BaseFragment;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.mode.BPA_GOODS;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_CLASSIFY;
import com.bonait.bnframework.common.db.util.GoodsClassifyDBUtil;
@@ -27,7 +29,6 @@ import com.bonait.bnframework.common.utils.DisplayManager;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.databinding.DialogDeleteClassifyBinding;
import com.bonait.bnframework.databinding.FragmentLocalGoodsBinding;
import com.bonait.bnframework.ui.activity.EditClassifyActivity;
import com.bonait.bnframework.ui.adapter.ClassifyAdapter;
import com.bonait.bnframework.ui.adapter.LocalGoodsAdapter;

@@ -61,6 +62,7 @@ public class LocalGoodsFragment extends BaseFragment {
}
};


@Override
protected View onCreateView() {
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_local_goods, null);
@@ -79,8 +81,10 @@ public class LocalGoodsFragment extends BaseFragment {
@SuppressLint("NotifyDataSetChanged")
private void initView(){
DisplayManager.scaleViewGroup(viewBinding.getRoot());
viewBinding.addClassify.setVisibility(!ConfigName.getInstance().user.name.equals("一般用户")?View.VISIBLE:View.GONE);

viewBinding.addClassify.setOnClickListener(view -> {
OpenActivity(EditClassifyActivity.class);
((BottomNavigationNewActivity)getActivity()).jumpClassifyActivity();
});

goodsAdapter = new LocalGoodsAdapter(){
@@ -119,6 +123,7 @@ public class LocalGoodsFragment extends BaseFragment {

@Override
protected void addGoods() {

}
};
viewBinding.recyclerGoods.setAdapter(goodsAdapter);
@@ -139,6 +144,7 @@ public class LocalGoodsFragment extends BaseFragment {
*/
@SuppressLint("NotifyDataSetChanged")
public void updateData() {
LogUtils.d("updateData");
goodsList.clear();
classifyList.clear();

@@ -147,8 +153,10 @@ public class LocalGoodsFragment extends BaseFragment {
goodsList.addAll(GoodsDBUtil.getByClassifyId(classifyList.get(0).id));
}

goodsAdapter.setNewData(goodsList);
classifyAdapter.setCurrentPosition(0);
classifyAdapter.setNewData(classifyList);
goodsAdapter.notifyDataSetChanged();
}

@Override
@@ -161,6 +169,7 @@ public class LocalGoodsFragment extends BaseFragment {
public void onResume() {
super.onResume();
LogUtils.d("LocalGoodsFragment onResume");

}

@Override


+ 6
- 0
app/src/main/res/anim/slide_left_in.xml View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android">
<!--<translate android:duration="300" android:fromXDelta="-50.0%p" android:toXDelta="0.0" />-->
<translate android:duration="300" android:fromXDelta="0.0" android:toXDelta="0.0" />
</set>

+ 6
- 0
app/src/main/res/anim/slide_left_out.xml View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android">
<!--<translate android:duration="300" android:fromXDelta="0.0" android:toXDelta="-50.0%p" />-->
<translate android:duration="300" android:fromXDelta="0.0" android:toXDelta="0.0" />
</set>

+ 20
- 0
app/src/main/res/anim/slide_right_in.xml View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="true">
<translate android:duration="300" android:fromXDelta="100.0%p" android:toXDelta="0.0" />
<!--<alpha android:fromAlpha="0.0"-->
<!--android:toAlpha="1.0"-->
<!--android:fillAfter="true"-->
<!--android:fillBefore="false"-->
<!--android:duration="300"/>-->
<!--<scale android:fromXScale="0.5"-->
<!--android:fromYScale="0.5"-->
<!--android:toXScale="1.0"-->
<!--android:toYScale="1.0"-->
<!--android:pivotX="65%"-->
<!--android:pivotY="50%"-->
<!--android:fillAfter="true"-->
<!--android:fillBefore="false"-->
<!--android:duration="300"/>-->
</set>

+ 20
- 0
app/src/main/res/anim/slide_right_out.xml View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="true">
<translate android:duration="300" android:fromXDelta="0.0" android:toXDelta="100.0%p" />
<!--<alpha android:fromAlpha="1.0"-->
<!--android:toAlpha="0.0"-->
<!--android:fillAfter="true"-->
<!--android:fillBefore="false"-->
<!--android:duration="300"/>-->
<!--<scale android:fromXScale="1.0"-->
<!--android:fromYScale="1.0"-->
<!--android:toYScale="0.5"-->
<!--android:toXScale="0.5"-->
<!--android:pivotX="65%"-->
<!--android:pivotY="50%"-->
<!--android:fillAfter="true"-->
<!--android:fillBefore="false"-->
<!--android:duration="300"/>-->
</set>

+ 2
- 2
app/src/main/res/layout/dialog/layout/dialog_add_classify.xml View File

@@ -48,9 +48,9 @@
android:textColor="@color/white"
android:text="确认"
android:background="@drawable/bg_round25_yellow_btn"
android:layout_gravity="bottom|right"
android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_40"
android:layout_marginLeft="@dimen/dp_500"
/>

</FrameLayout>


+ 38
- 33
app/src/main/res/layout/fragment_cloud_goods.xml View File

@@ -1,43 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">


<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_classify"
android:layout_width="@dimen/dp_140"
android:orientation="vertical"
android:layout_marginBottom="@dimen/dp_95"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_classify"
android:layout_width="@dimen/dp_140"
android:orientation="vertical"
android:layout_marginBottom="@dimen/dp_95"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>

<TextView
android:id="@+id/line1"
android:layout_width="@dimen/dp_1"
android:layout_height="match_parent"
android:background="@color/color3"
android:layout_marginLeft="@dimen/dp_140"
/>
<TextView
android:id="@+id/line1"
android:layout_width="@dimen/dp_1"
android:layout_height="match_parent"
android:background="@color/color3"
android:layout_marginLeft="@dimen/dp_140"
/>

<TextView
android:id="@+id/line2"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_3"
android:background="@color/color3"
/>
<TextView
android:id="@+id/line2"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_3"
android:background="@color/color3"
/>

<androidx.recyclerview.widget.RecyclerView
android:layout_marginLeft="@dimen/dp_141"
android:id="@+id/recycler_goods"
android:layout_width="match_parent"
android:layout_marginBottom="@dimen/dp_95"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.StaggeredGridLayoutManager"
app:spanCount="3"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:layout_marginLeft="@dimen/dp_161"
android:id="@+id/recycler_goods"
android:layout_width="match_parent"
android:layout_marginBottom="@dimen/dp_95"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.StaggeredGridLayoutManager"
app:spanCount="3"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>


</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 10
- 5
app/src/main/res/layout/fragment_home_foods.xml View File

@@ -6,9 +6,10 @@
<com.qmuiteam.qmui.widget.QMUITopBarLayout
android:id="@+id/topbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="?attr/qmui_topbar_height" />

<RelativeLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_marginTop="?attr/qmui_topbar_height"
android:layout_height="match_parent">
@@ -18,24 +19,28 @@
android:layout_height="@dimen/dp_70">
<TextView
android:id="@+id/localFoods"
android:layout_width="@dimen/dp_140"
android:layout_width="wrap_content"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10"
android:layout_height="@dimen/dp_70"
android:text="本地菜谱"
android:gravity="center"
android:textColor="#BEAA6A"
android:textSize="@dimen/sp_32"
android:textSize="@dimen/sp_36"
android:textStyle="bold" />

<TextView
android:id="@+id/cloudFoods"
android:layout_width="@dimen/dp_140"
android:layout_width="wrap_content"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10"
android:layout_height="@dimen/dp_70"
android:layout_centerInParent="true"
android:text="云端菜谱"
android:textColor="#797373"
android:layout_marginLeft="@dimen/dp_10"
android:gravity="center"
android:textSize="@dimen/sp_32"
android:textSize="@dimen/sp_36"
android:textStyle="bold" />

<!--暂时去掉-->


+ 57
- 47
app/src/main/res/layout/fragment_local_goods.xml View File

@@ -1,57 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:id="@+id/add_classify"
android:layout_width="@dimen/dp_140"
android:visibility="gone"
tools:visibility="visible"
android:layout_below="@+id/line2"
android:layout_height="@dimen/dp_70"
android:maxLines="1"
android:ellipsize="middle"
android:textSize="@dimen/sp_28"
android:text="添加分类"
android:textColor="#823E17"
android:gravity="center"
android:background="#EFE9D2"/>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_classify"
android:layout_width="@dimen/dp_140"
android:layout_below="@+id/add_classify"
android:orientation="vertical"
android:layout_marginBottom="@dimen/dp_95"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>
<TextView
android:id="@+id/add_classify"
android:layout_width="@dimen/dp_140"
android:visibility="gone"
tools:visibility="visible"
android:layout_below="@+id/line2"
android:layout_height="@dimen/dp_90"
android:maxLines="1"
android:paddingTop="@dimen/dp_25"
android:paddingBottom="@dimen/dp_25"
android:layout_marginBottom="2dp"
android:ellipsize="middle"
android:textSize="@dimen/sp_32"
android:text="添加分类"
android:textColor="#823E17"
android:gravity="center"
android:background="#EFE9D2"/>

<TextView
android:id="@+id/line1"
android:layout_width="@dimen/dp_1"
android:layout_height="match_parent"
android:background="@color/color3"
android:layout_marginLeft="@dimen/dp_140"
/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_classify"
android:layout_width="@dimen/dp_140"
android:layout_below="@+id/add_classify"
android:orientation="vertical"
android:layout_marginBottom="@dimen/dp_95"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>

<TextView
android:id="@+id/line2"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_3"
android:background="@color/color3"
/>
<TextView
android:id="@+id/line1"
android:layout_width="@dimen/dp_1"
android:layout_height="match_parent"
android:background="@color/color3"
android:layout_marginLeft="@dimen/dp_140"
/>

<androidx.recyclerview.widget.RecyclerView
android:layout_marginLeft="@dimen/dp_141"
android:id="@+id/recycler_goods"
android:layout_width="match_parent"
android:layout_marginBottom="@dimen/dp_95"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.StaggeredGridLayoutManager"
app:spanCount="3"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>
<TextView
android:id="@+id/line2"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_3"
android:background="@color/color3"
/>

<androidx.recyclerview.widget.RecyclerView
android:layout_marginLeft="@dimen/dp_21"
android:id="@+id/recycler_goods"
android:layout_width="match_parent"
android:layout_marginBottom="@dimen/dp_95"
android:layout_toRightOf="@id/recycler_classify"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.StaggeredGridLayoutManager"
app:spanCount="3"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>

</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 6
- 8
app/src/main/res/layout/item/layout/item_classify.xml View File

@@ -1,23 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_70"
android:layout_height="wrap_content"
tools:background="@color/blue"
android:paddingBottom="@dimen/dp_2"
xmlns:tools="http://schemas.android.com/tools">

<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:maxLines="4"
android:ellipsize="middle"
android:textSize="@dimen/sp_28"
android:textSize="@dimen/sp_32"
android:textColor="#823E17"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10"
android:paddingTop="@dimen/dp_15"
android:paddingBottom="@dimen/dp_15"
android:paddingTop="@dimen/dp_25"
android:paddingBottom="@dimen/dp_25"
android:layout_marginBottom="2dp"
tools:text="川菜系列"
android:gravity="center"
android:background="#EFE9D2"


+ 7
- 7
app/src/main/res/layout/item/layout/item_cloud_goods.xml View File

@@ -29,7 +29,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="三月瓜"
tools:text="三月瓜"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="@dimen/sp_26"
@@ -45,18 +45,18 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:background="#ddFFFFFF"
android:layout_height="@dimen/dp_40">
android:layout_height="@dimen/dp_60">
<RelativeLayout
android:id="@+id/downLoad"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="@dimen/dp_40">
android:gravity="center"
android:layout_height="match_parent">

<ImageView
android:id="@+id/img3"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginLeft="60dp"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_centerVertical="true"
android:src="@mipmap/yxz" />

@@ -67,7 +67,7 @@
android:layout_toRightOf="@id/img3"
android:layout_centerVertical="true"
android:textColor="@color/black"
android:textSize="@dimen/sp_18" />
android:textSize="@dimen/sp_24" />
</RelativeLayout>

</LinearLayout>


+ 17
- 12
app/src/main/res/layout/item/layout/item_local_goods.xml View File

@@ -29,7 +29,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="三月瓜"
tools:text="三月瓜"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="@dimen/sp_26"
@@ -45,20 +45,20 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:background="#ddFFFFFF"
android:layout_height="@dimen/dp_40">
android:layout_height="@dimen/dp_60">

<RelativeLayout
android:id="@+id/upload"
android:layout_width="0dp"
android:layout_height="@dimen/dp_40"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:layout_centerHorizontal="true">

<ImageView
android:id="@+id/img1"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginLeft="15dp"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_centerVertical="true"
android:src="@mipmap/ysc" />

@@ -69,21 +69,26 @@
android:layout_toRightOf="@id/img1"
android:layout_centerVertical="true"
android:textColor="@color/black"
android:textSize="@dimen/sp_18" />
android:textSize="@dimen/sp_24" />
</RelativeLayout>
<TextView
android:layout_width="3dp"
android:layout_height="match_parent"
android:background="@color/white"
/>

<RelativeLayout
android:id="@+id/delete"
android:layout_width="0dp"
android:layout_height="@dimen/dp_40"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:layout_centerHorizontal="true">

<ImageView
android:id="@+id/img2"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginLeft="15dp"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_centerVertical="true"
android:src="@mipmap/ysc1" />

@@ -94,7 +99,7 @@
android:layout_toRightOf="@id/img2"
android:layout_centerVertical="true"
android:textColor="@color/black"
android:textSize="@dimen/sp_18" />
android:textSize="@dimen/sp_24" />
</RelativeLayout>
</LinearLayout>



+ 9
- 0
app/src/main/res/values/styles.xml View File

@@ -46,7 +46,16 @@
<item name="qmui_dialog_max_width">@dimen/dp_400</item>
<item name="qmui_dialog_min_width">@dimen/dp_600</item>
<item name="qmui_dialog_edit_content_style">@style/DialogTheme2ContentStyle</item>
<item name="android:windowAnimationStyle">@style/activityanim</item>


</style>

<style name="activityanim" parent="@android:style/Animation">
<item name="android:activityOpenEnterAnimation">@anim/slide_right_in</item>
<item name="android:activityOpenExitAnimation">@anim/slide_left_out</item>
<item name="android:activityCloseEnterAnimation">@anim/slide_left_in</item>
<item name="android:activityCloseExitAnimation">@anim/slide_right_out</item>
</style>

<style name="ProgressBar" parent="@android:style/Widget.ProgressBar.Horizontal">


Loading…
Cancel
Save