提交 8081ca2a authored 作者: lgd's avatar lgd

1.bat页面

2.//TODO erp用户激活,忘记密码测试,bat,mes,消息,我的,刷新token
上级 bbbb3fe6
......@@ -102,4 +102,5 @@ dependencies {
implementation 'com.alibaba:fastjson:1.2.54'
implementation 'com.github.tbruyelle:rxpermissions:0.10.2'
implementation 'com.ashokvarma.android:bottom-navigation-bar:2.2.0'
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.45-androidx'
}
......@@ -66,7 +66,7 @@ public class WorkApp extends BaseApp {
// layout.setReboundInterpolator(new DropBounceInterpolator());
layout.setFooterHeight(100);
layout.setDisableContentWhenLoading(false);
layout.setPrimaryColorsId(R.color.mainColor, android.R.color.white);
layout.setPrimaryColorsId(R.color.mainTextColor, android.R.color.white);
});
//全局设置默认的 Header
......
package com.wd.workoffice.bean.vo;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class BatLayoutVo {
private int img;
private String name;
public int getImg() {
return img;
}
public void setImg(int img) {
this.img = img;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
......@@ -16,6 +16,7 @@ import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkBaseActivity;
import com.wd.workoffice.ui.activity.login.LoginActivity;
import com.wd.workoffice.ui.adapter.VpMainAdapter;
import com.wd.workoffice.ui.fg.MainFragment;
import com.wd.workoffice.util.UserKeeper;
import org.greenrobot.eventbus.EventBus;
......@@ -54,13 +55,13 @@ public class MainActivity extends WorkBaseActivity implements BottomNavigationBa
return;
}
ButterKnife.bind(this);
if (Build.VERSION.SDK_INT >= 21) {
View decorView = getWindow().getDecorView();
int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
decorView.setSystemUiVisibility(option);
getWindow().setStatusBarColor(Color.TRANSPARENT);
}
// if (Build.VERSION.SDK_INT >= 21) {
// View decorView = getWindow().getDecorView();
// int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
// | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
// decorView.setSystemUiVisibility(option);
// getWindow().setStatusBarColor(Color.TRANSPARENT);
// }
bnbMainBottomBar.setMode(BottomNavigationBar.MODE_FIXED);
bnbMainBottomBar.setBackgroundStyle(BottomNavigationBar.BACKGROUND_STYLE_STATIC);
bnbMainBottomBar.setBackgroundColor(getResources().getColor(R.color.white));
......@@ -127,10 +128,10 @@ public class MainActivity extends WorkBaseActivity implements BottomNavigationBa
//// Bundle bundle = new Bundle();
//// bundle.putString("sex", getIntent().getStringExtra("sex"));
//// mainFragment.setArguments(bundle);
// fragments.add(mainFragment);
// fragments.add(new MsgFragment());
// fragments.add(new SearchFragment());
// fragments.add(new MyFragment());
fragments.add(new MainFragment());
fragments.add(new MainFragment());
fragments.add(new MainFragment());
fragments.add(new MainFragment());
return fragments;
}
......
package com.wd.workoffice.ui.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.vo.BatLayoutVo;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class BatLayoutAdapter extends BaseQuickAdapter<BatLayoutVo, BaseViewHolder> {
public BatLayoutAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, BatLayoutVo item) {
helper.setImageResource(R.id.iv_img, item.getImg());
helper.setText(R.id.tv_name, item.getName());
}
}
package com.wd.workoffice.ui.fg;
import android.widget.TextView;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkBaseFg;
import com.wd.workoffice.bean.vo.BatLayoutVo;
import com.wd.workoffice.ui.adapter.BatLayoutAdapter;
import java.util.ArrayList;
import java.util.List;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class MainFragment extends WorkBaseFg {
@BindView(R.id.tv_store)
TextView tvStore;
@BindView(R.id.rv_store)
RecyclerView rvStore;
@BindView(R.id.rv_sale)
RecyclerView rvSale;
@BindView(R.id.rv_product)
RecyclerView rvProduct;
@BindView(R.id.rv_approval)
RecyclerView rvApproval;
@BindView(R.id.rv_work)
RecyclerView rvWork;
@BindView(R.id.srl_refresh)
SmartRefreshLayout srlRefresh;
List<BatLayoutVo> saleList = new ArrayList<>();
List<BatLayoutVo> storeList = new ArrayList<>();
List<BatLayoutVo> approvalList = new ArrayList<>();
List<BatLayoutVo> workList = new ArrayList<>();
List<BatLayoutVo> productList = new ArrayList<>();
int[] saleImg = new int[]{R.mipmap.bat_sale1, R.mipmap.bat_sale2, R.mipmap.bat_sale3, R.mipmap.bat_sale4};
String[] saleName = new String[]{"销售订单", "外购订单", "供应订单", "内部订单"};
int[] storeImg = new int[]{R.mipmap.bat_store1, R.mipmap.bat_store2, R.mipmap.bat_store3, R.mipmap.bat_store4
, R.mipmap.bat_store5, R.mipmap.bat_store6, R.mipmap.bat_store7};
String[] storeName = new String[]{"销售", "外采购", "供应", "维修", "财税", "钳锅", "内部交易"};
int[] approvalImg = new int[]{R.mipmap.bat_approval1, R.mipmap.bat_approval2};
String[] approvalName = new String[]{"我审批的", "我发起的"};
int[] workImg = new int[]{R.mipmap.bat_work1, R.mipmap.bat_work2, R.mipmap.bat_work3,
R.mipmap.bat_work4, R.mipmap.bat_work5, R.mipmap.bat_work6, R.mipmap.bat_work7, R.mipmap.bat_work8, R.mipmap.bat_work9};
String[] workName = new String[]{"产品", "往来", "部门账户", "仓库", "部门", "财务中心", "设备", "报表", "库存类别"};
int[] productImg = new int[]{R.mipmap.bat_product1, R.mipmap.bat_product2, R.mipmap.bat_product3, R.mipmap.bat_product4};
String[] productName = new String[]{"销售订单", "外购订单", "供应订单", "内部订单"};
@Override
protected void initView() {
ButterKnife.bind(this, getContentView());
addDate(saleList, saleImg, saleName);
addDate(storeList, storeImg, storeName);
addDate(approvalList, approvalImg, approvalName);
addDate(workList, workImg, workName);
addDate(productList, productImg, productName);
initRvLayout(rvSale, saleList);
initRvLayout(rvStore, storeList);
initRvLayout(rvApproval, approvalList);
initRvLayout(rvWork, workList);
initRvLayout(rvProduct, productList);
}
// @Nullable
// @Override
// public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
// sex = getArguments().getString("sex");
// return super.onCreateView(inflater, container, savedInstanceState);
// }
@Override
protected void initData() {
}
@Override
protected void initEvent() {
srlRefresh.setOnRefreshListener(refreshLayout -> {
srlRefresh.finishRefresh();
});
}
@Override
protected int layoutId() {
return R.layout.fg_home;
}
private void addDate(List<BatLayoutVo> saleList, int[] saleImg, String[] saleName) {
for (int i = 0; i < saleImg.length; i++) {
BatLayoutVo batLayoutVo = new BatLayoutVo();
batLayoutVo.setImg(saleImg[i]);
batLayoutVo.setName(saleName[i]);
saleList.add(batLayoutVo);
}
}
/**
* 初始化布局
*
* @param rvSale
* @param saleList
*/
private void initRvLayout(RecyclerView rvSale, List<BatLayoutVo> saleList) {
rvSale.setLayoutManager(new GridLayoutManager(getActivity(), 4, RecyclerView.VERTICAL,
false));
BatLayoutAdapter batLayoutAdapter = new BatLayoutAdapter(R.layout.item_bat_layout, saleList);
batLayoutAdapter.bindToRecyclerView(rvSale);
switch (rvSale.getId()) {
case R.id.rv_sale:
break;
case R.id.rv_store:
break;
case R.id.rv_product:
break;
case R.id.rv_work:
break;
case R.id.rv_approval:
break;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#5D99C4" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<com.scwang.smartrefresh.layout.SmartRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/srl_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48mm"
android:background="@color/white"
android:gravity="center">
<ImageView
android:layout_width="45mm"
android:layout_height="20mm"
android:layout_centerHorizontal="true"
android:background="@mipmap/bat_icon" />
</LinearLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="180mm"
android:background="@mipmap/bat_bg" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12mm">
<ImageView
android:layout_width="24mm"
android:layout_height="24mm"
android:background="@mipmap/bat_notice" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="30mm"
android:text="通知公告"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="24mm"
android:text="更多"
android:textColor="@color/flexible_text_sup"
android:textSize="12sp"
android:textStyle="bold" />
<ImageView
android:layout_width="12mm"
android:layout_height="12mm"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10mm"
android:background="@mipmap/bat_arrow" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8mm">
<View
android:layout_width="6mm"
android:layout_height="6mm"
android:layout_centerVertical="true"
android:layout_marginLeft="20mm"
android:background="@drawable/shap_circle" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="36mm"
android:text="关于元旦假期安排的通知。"
android:textColor="#333333" />
</RelativeLayout>
<TextView
android:id="@+id/tv_store"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm"
android:paddingVertical="30mm"
android:text="商店"
android:textColor="@color/mainTextColor"
android:textSize="20sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_store"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm"
android:paddingVertical="30mm"
android:text="销售部门"
android:textColor="@color/mainTextColor"
android:textSize="20sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_sale"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm"
android:paddingVertical="30mm"
android:text="生产部门"
android:textColor="@color/mainTextColor"
android:textSize="20sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_product"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm"
android:paddingVertical="30mm"
android:text="审批"
android:textColor="@color/mainTextColor"
android:textSize="20sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_approval"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm"
android:paddingVertical="30mm"
android:text="工作台"
android:textColor="@color/mainTextColor"
android:textSize="20sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_work"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingBottom="30mm"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_img"
android:layout_width="40mm"
android:layout_height="40mm"
android:src="@mipmap/bat_work1" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8mm"
android:textSize="12sp" />
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论