diff --git a/app/src/main/java/com/bonait/bnframework/common/base/BaseFragment.java b/app/src/main/java/com/bonait/bnframework/common/base/BaseFragment.java index 01c91a80..c8cfd2c1 100644 --- a/app/src/main/java/com/bonait/bnframework/common/base/BaseFragment.java +++ b/app/src/main/java/com/bonait/bnframework/common/base/BaseFragment.java @@ -1,6 +1,7 @@ package com.bonait.bnframework.common.base; import android.content.Intent; +import android.media.MediaPlayer; import android.net.Uri; import android.provider.Settings; import android.view.View; @@ -98,6 +99,22 @@ public abstract class BaseFragment extends QMUIFragment implements EasyPermissio fragmentTransaction.commit(); } + /** + * 播放 + * @param resid + */ + public void Speak(int resid) + { + getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + MediaPlayer mediaPlayer = MediaPlayer.create(getContext(), resid); + mediaPlayer.start(); + } + }); + + } + @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); diff --git a/app/src/main/java/com/bonait/bnframework/common/constant/DataBus.java b/app/src/main/java/com/bonait/bnframework/common/constant/DataBus.java index e0669fc8..94c1e63d 100644 --- a/app/src/main/java/com/bonait/bnframework/common/constant/DataBus.java +++ b/app/src/main/java/com/bonait/bnframework/common/constant/DataBus.java @@ -172,7 +172,11 @@ public class DataBus { GoodsMake.add(make); MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, "[" + make.good.name + "]准备配料!"); - if(loadinggoodAdapter!=null)loadinggoodAdapter.refresh(); + if(loadinggoodAdapter!=null) + { + loadinggoodAdapter.Speak(R.raw.plks); + loadinggoodAdapter.refresh(); + } }catch(Exception e){ MessageLog.ShowInfo( "增加订单异常!"+e.getMessage()); } @@ -202,8 +206,10 @@ public class DataBus { GoodsMake.get(m).makeMs=makeMs; GoodsMake.get(m).makeProcess=(int)(((count*1.00)/ GoodsMake.get(m).recipes.size())*100); - if(loadinggoodAdapter!=null)loadinggoodAdapter.refresh(); - + if(loadinggoodAdapter!=null) { + loadinggoodAdapter.Speak(R.raw.plzqsh); + loadinggoodAdapter.refresh(); + } return; } } @@ -236,7 +242,11 @@ public class DataBus { GoodsMake.remove(good); } - if(loadinggoodAdapter!=null)loadinggoodAdapter.refresh(); + if(loadinggoodAdapter!=null) + { + loadinggoodAdapter.Speak(R.raw.plwc); + loadinggoodAdapter.refresh(); + } }catch(Exception e){ } diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/adapter/loadinggood_adapter.java b/app/src/main/java/com/bonait/bnframework/modules/home/adapter/loadinggood_adapter.java index 0f975f49..38a72774 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/adapter/loadinggood_adapter.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/adapter/loadinggood_adapter.java @@ -3,6 +3,7 @@ package com.bonait.bnframework.modules.home.adapter; import android.app.Activity; import android.content.Context; import android.content.ContextWrapper; +import android.media.MediaPlayer; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -136,6 +137,22 @@ public class loadinggood_adapter extends RecyclerView.Adapter + android:layout_centerVertical="true"/> diff --git a/app/src/main/res/mipmap-xxhdpi/image1.png b/app/src/main/res/mipmap-xxhdpi/image1.png index 9ef4f137..1f341d52 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/image1.png and b/app/src/main/res/mipmap-xxhdpi/image1.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/image2.png b/app/src/main/res/mipmap-xxhdpi/image2.png index c257e070..5e06d817 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/image2.png and b/app/src/main/res/mipmap-xxhdpi/image2.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/image3.png b/app/src/main/res/mipmap-xxhdpi/image3.png index 22091790..01dc22f1 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/image3.png and b/app/src/main/res/mipmap-xxhdpi/image3.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/image4.png b/app/src/main/res/mipmap-xxhdpi/image4.png index 6636524f..9f957531 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/image4.png and b/app/src/main/res/mipmap-xxhdpi/image4.png differ diff --git a/app/src/main/res/raw/plks.mp3 b/app/src/main/res/raw/plks.mp3 new file mode 100644 index 00000000..cdcf0fc3 Binary files /dev/null and b/app/src/main/res/raw/plks.mp3 differ diff --git a/app/src/main/res/raw/plwc.mp3 b/app/src/main/res/raw/plwc.mp3 new file mode 100644 index 00000000..51e17762 Binary files /dev/null and b/app/src/main/res/raw/plwc.mp3 differ diff --git a/app/src/main/res/raw/plzqsh.mp3 b/app/src/main/res/raw/plzqsh.mp3 new file mode 100644 index 00000000..3c0f32a6 Binary files /dev/null and b/app/src/main/res/raw/plzqsh.mp3 differ diff --git a/app/src/main/res/raw/qxksqsh.mp3 b/app/src/main/res/raw/qxksqsh.mp3 new file mode 100644 index 00000000..6ccfc813 Binary files /dev/null and b/app/src/main/res/raw/qxksqsh.mp3 differ diff --git a/app/src/main/res/raw/qxwc.mp3 b/app/src/main/res/raw/qxwc.mp3 new file mode 100644 index 00000000..d23ab58a Binary files /dev/null and b/app/src/main/res/raw/qxwc.mp3 differ