Browse Source

修改bug

调味吧台
liup 7 months ago
parent
commit
4576011ed3
6 changed files with 64 additions and 64 deletions
  1. +51
    -50
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/loadinggood_adapter.java
  2. +1
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java
  3. +4
    -11
      app/src/main/res/layout/fragment_make_good.xml
  4. +5
    -0
      app/src/main/res/layout/item/layout/dialog_add_makegood.xml
  5. +1
    -1
      app/src/main/res/layout/item/layout/loadinggood_item.xml
  6. +2
    -2
      app/src/main/res/layout/item/layout/newmakegood.xml

+ 51
- 50
app/src/main/java/com/bonait/bnframework/modules/home/adapter/loadinggood_adapter.java View File

@@ -80,57 +80,56 @@ public class loadinggood_adapter extends RecyclerView.Adapter<RecyclerView.ViewH

@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
if (holder instanceof MyViewHolder) {
MyViewHolder myViewHolder = (MyViewHolder) holder;
ResGoodsMake goodsMake =datas.get(position);
// 设置要显示的图片和文字
myViewHolder.loading_ProgressBar.setProgress(goodsMake.makeProcess);
myViewHolder.loading_name.setText(goodsMake.good.name);
myViewHolder.loading_status.setText(goodsMake.makeStatus.name());
myViewHolder.loading_zuofa.setText(goodsMake.subOrder.exp);
DecimalFormat decimalFormat =new DecimalFormat("00");
myViewHolder.loading_xuhao.setText(decimalFormat.format(position+1));
LogUtils.error("****","刷新 position="+position);
MyViewHolder myViewHolder = (MyViewHolder) holder;
ResGoodsMake goodsMake =datas.get(position);
// 设置要显示的图片和文字
myViewHolder.loading_ProgressBar.setProgress(goodsMake.makeProcess);
myViewHolder.loading_name.setText(goodsMake.good.name);
myViewHolder.loading_status.setText(goodsMake.makeStatus.name());
myViewHolder.loading_zuofa.setText(goodsMake.subOrder.exp);
DecimalFormat decimalFormat =new DecimalFormat("00");
myViewHolder.loading_xuhao.setText(decimalFormat.format(position+1));
// myViewHolder.loading_time.setText(new SimpleDateFormat("HH:mm:ss").format(Date.parse(goodsMake.subOrder.createTime)));
switch (goodsMake.makeStatus.name())
{
case "等待中":
//myViewHolder.quxiaozhizuo.setVisibility(View.GONE);
//myViewHolder.loading_status.setTextColor(conmain.getResources().getColor(R.color.text4));
break;
case "制作中":
// myViewHolder.quxiaozhizuo.setVisibility(View.VISIBLE);//取消制作
myViewHolder.loading_status.setTextColor(myViewHolder.loading_status.getContext().getResources().getColor(R.color.green_primary_dark));
break;
case "制作完成":
// myViewHolder.quxiaozhizuo.setVisibility(View.VISIBLE);//取消制作
//myViewHolder.loading_status.setTextColor(conmain.getResources().getColor(R.color.tab_text_normal));
break;
switch (goodsMake.makeStatus.name())
{
case "等待中":
//myViewHolder.quxiaozhizuo.setVisibility(View.GONE);
//myViewHolder.loading_status.setTextColor(conmain.getResources().getColor(R.color.text4));
break;
case "制作中":
// myViewHolder.quxiaozhizuo.setVisibility(View.VISIBLE);//取消制作
myViewHolder.loading_status.setTextColor(myViewHolder.loading_status.getContext().getResources().getColor(R.color.green_primary_dark));
break;
case "制作完成":
// myViewHolder.quxiaozhizuo.setVisibility(View.VISIBLE);//取消制作
//myViewHolder.loading_status.setTextColor(conmain.getResources().getColor(R.color.tab_text_normal));
break;
}
myViewHolder.loading_main.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(mListener!=null) mListener.clickListener(view,goodsMake);
}
myViewHolder.loading_main.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(mListener!=null) mListener.clickListener(view,goodsMake);
}
});

myViewHolder.quxiaozhizuo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String title = "温馨提示!";
String message = "客官确定要取消制作【"+goodsMake.good.name+"】吗?";
AlertDialogUtils.showDialog( mLayoutInflater.getContext(), title, message, new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
DataBus.getInstance().DeleteGoodsMake(goodsMake.subOrder.id);
ToastUtils.info("取消订单制作成功!");
dialog.dismiss();
}
});
});

myViewHolder.quxiaozhizuo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String title = "温馨提示!";
String message = "客官确定要取消制作【"+goodsMake.good.name+"】吗?";
AlertDialogUtils.showDialog( myViewHolder.quxiaozhizuo.getContext(), title, message, new QMUIDialogAction.ActionListener() {
@Override
public void onClick(QMUIDialog dialog, int index) {
DataBus.getInstance().DeleteGoodsMake(goodsMake.subOrder.id);
ToastUtils.info("取消订单制作成功!");
dialog.dismiss();
}
});

}
});
}
}
});
}

private Activity findActivity(@NonNull Context context) {
@@ -149,14 +148,16 @@ public class loadinggood_adapter extends RecyclerView.Adapter<RecyclerView.ViewH
*/
public void refresh() {
if(handler!=null){
datas = DataBus.getInstance().GoodsMake;

handler.postDelayed(new Runnable() {
@Override
public void run() {
datas= DataBus.getInstance().GoodsMake;
notifyDataSetChanged();

LogUtils.error("****","刷新 size="+datas.size());
}
},500);
},200);
}

}


+ 1
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java View File

@@ -165,6 +165,7 @@ public class MakeGoodFragment extends BaseFragment {
TextView dianzichen;
@BindView(R.id.loadgoodliebiao)
RelativeLayout loadgoodliebiao;
private loadinggood_adapter loadinggoodAdapter;


private Handler handler = new Handler(Looper.getMainLooper()){


+ 4
- 11
app/src/main/res/layout/fragment_make_good.xml View File

@@ -72,7 +72,6 @@

<LinearLayout
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/dp_10"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:orientation="vertical">
@@ -87,17 +86,11 @@
android:layout_marginTop="@dimen/dp_10"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/datatab_paiduishangping"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadingEdge="vertical"
tools:ignore="Suspicious0dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/datatab_paiduishangping"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/main_background"/>
</ScrollView>
android:layout_height="wrap_content"
android:background="@color/main_background"/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>


+ 5
- 0
app/src/main/res/layout/item/layout/dialog_add_makegood.xml View File

@@ -30,6 +30,11 @@
android:layout_height="wrap_content"
android:text="星星知多少奶茶"
android:textSize="20dp"
android:paddingLeft="43dp"
android:gravity="center"
android:layout_centerHorizontal="true"
android:maxLines="2"
android:paddingRight="43dp"
android:layout_marginLeft="30dp"
android:layout_marginTop="@dimen/dp_10">
</TextView>


+ 1
- 1
app/src/main/res/layout/item/layout/loadinggood_item.xml View File

@@ -21,7 +21,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:max="100"
android:progress="18" />
android:progress="0" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"


+ 2
- 2
app/src/main/res/layout/item/layout/newmakegood.xml View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="205dp"
android:layout_width="190dp"
android:layout_height="180dp">


@@ -36,7 +36,7 @@
android:paddingLeft="5dp"
android:paddingRight="5dp"
tools:text="清炒三月瓜"
android:maxLength="2"
android:maxLines="2"
android:ellipsize="end"
android:textColor="@color/black"
android:textSize="20sp"


Loading…
Cancel
Save