Commit c9784e1c by Wyh

4.24 接單已完成

parent 4222a1bf
...@@ -221,7 +221,7 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow ...@@ -221,7 +221,7 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
private void stopDownDisposable() { private void stopDownDisposable() {
for (int i = 0; i < mDownDisposable.size(); i++) { for (int i = 0; i < mDownDisposable.size(); i++) {
if (mDownDisposable.get(i) != null && mDownDisposable.get(i).isDisposed() == false) if (mDownDisposable.get(i) != null && !mDownDisposable.get(i).isDisposed())
mDownDisposable.get(i).dispose(); mDownDisposable.get(i).dispose();
} }
mDownDisposable.clear(); mDownDisposable.clear();
......
...@@ -9,12 +9,14 @@ import android.os.Bundle; ...@@ -9,12 +9,14 @@ import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.TextView; import android.widget.TextView;
import com.billy.cc.core.component.CC; import androidx.annotation.NonNull;
import com.billy.cc.core.component.CCResult; import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.billy.cc.core.component.CCUtil; import com.billy.cc.core.component.CCUtil;
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils; import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils;
import com.gingersoft.gsa.cloud.download.R; import com.gingersoft.gsa.cloud.download.R;
...@@ -22,21 +24,14 @@ import com.gingersoft.gsa.cloud.download.R2; ...@@ -22,21 +24,14 @@ import com.gingersoft.gsa.cloud.download.R2;
import com.gingersoft.gsa.cloud.download.di.component.DaggerDownloadComponent; import com.gingersoft.gsa.cloud.download.di.component.DaggerDownloadComponent;
import com.gingersoft.gsa.cloud.download.mvp.contract.DownloadContract; import com.gingersoft.gsa.cloud.download.mvp.contract.DownloadContract;
import com.gingersoft.gsa.cloud.download.mvp.presenter.DownloadPresenter; import com.gingersoft.gsa.cloud.download.mvp.presenter.DownloadPresenter;
import com.gingersoft.gsa.cloud.ui.utils.AndroidWorkaround; import com.gingersoft.gsa.cloud.ui.view.WaveHelper;
import com.gingersoft.gsa.cloud.ui.view.WaveView;
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog; import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog;
import com.jess.arms.base.BaseActivity; import com.jess.arms.base.BaseActivity;
import com.jess.arms.base.DefaultAdapter; import com.jess.arms.base.DefaultAdapter;
import com.jess.arms.di.component.AppComponent; import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils; import com.jess.arms.utils.ArmsUtils;
import com.qmuiteam.qmui.alpha.QMUIAlphaImageButton;
import com.qmuiteam.qmui.util.QMUIDisplayHelper;
import com.qmuiteam.qmui.widget.QMUITopBar;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView; import butterknife.BindView;
import static com.jess.arms.utils.Preconditions.checkNotNull; import static com.jess.arms.utils.Preconditions.checkNotNull;
...@@ -67,13 +62,16 @@ public class DownloadActivity extends BaseActivity<DownloadPresenter> implements ...@@ -67,13 +62,16 @@ public class DownloadActivity extends BaseActivity<DownloadPresenter> implements
@BindView(R2.id.tv_progress) @BindView(R2.id.tv_progress)
TextView tv_progress; TextView tv_progress;
@BindView(R2.id.wave_download)
WaveView waveView;
private WaveHelper mWaveHelper;
/** /**
* 那個頁面跳轉下載 * 那個頁面跳轉下載
* 1#登錄頁選擇餐廳 * 1#登錄頁選擇餐廳
* 2#其他 * 2#其他
*/ */
private int fromPage =1; private int fromPage = 1;
@Override @Override
public void setupActivityComponent(@NonNull AppComponent appComponent) { public void setupActivityComponent(@NonNull AppComponent appComponent) {
...@@ -98,11 +96,27 @@ public class DownloadActivity extends BaseActivity<DownloadPresenter> implements ...@@ -98,11 +96,27 @@ public class DownloadActivity extends BaseActivity<DownloadPresenter> implements
@Override @Override
public void initData(@Nullable Bundle savedInstanceState) { public void initData(@Nullable Bundle savedInstanceState) {
mWaveHelper = new WaveHelper(waveView);
mPresenter.initAdapter(); mPresenter.initAdapter();
mPresenter.downAllList(); mPresenter.downAllList();
} }
@Override @Override
protected void onResume() {
super.onResume();
if (mWaveHelper != null)
mWaveHelper.start();
}
@Override
protected void onPause() {
super.onPause();
if (mWaveHelper != null)
mWaveHelper.cancel();
}
@Override
public void initIntent() { public void initIntent() {
fromPage = CCUtil.getNavigateParam(this, "fromPage", 1); fromPage = CCUtil.getNavigateParam(this, "fromPage", 1);
} }
...@@ -110,18 +124,8 @@ public class DownloadActivity extends BaseActivity<DownloadPresenter> implements ...@@ -110,18 +124,8 @@ public class DownloadActivity extends BaseActivity<DownloadPresenter> implements
@Override @Override
public void initTopBar() { public void initTopBar() {
tv_title.setText("數據下載"); tv_title.setText("數據下載");
btn_back.setOnClickListener(new View.OnClickListener() { btn_back.setOnClickListener(v -> killMyself());
@Override btn_refresh.setOnClickListener(v -> mPresenter.downAllList());
public void onClick(View v) {
killMyself();
}
});
btn_refresh.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mPresenter.downAllList();
}
});
} }
@Override @Override
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@mipmap/down_decoration"> android:background="@mipmap/down_decoration">
<!-- <com.qmuiteam.qmui.widget.QMUITopBar--> <!-- <com.qmuiteam.qmui.widget.QMUITopBar-->
<!-- android:id="@+id/topbar"--> <!-- android:id="@+id/topbar"-->
<!-- android:layout_width="match_parent"--> <!-- android:layout_width="match_parent"-->
<!-- android:layout_height="?attr/qmui_topbar_height"--> <!-- android:layout_height="?attr/qmui_topbar_height"-->
<!-- android:layout_marginTop="@dimen/dp_20"--> <!-- android:layout_marginTop="@dimen/dp_20"-->
<!-- android:background="@color/trans" />--> <!-- android:background="@color/trans" />-->
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -23,66 +23,79 @@ ...@@ -23,66 +23,79 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:src="@drawable/qmui_icon_topbar_back" android:layout_marginLeft="@dimen/dp_15"
android:layout_marginLeft="@dimen/dp_15"/> android:src="@drawable/qmui_icon_topbar_back" />
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/theme_white_color"
android:text="數據下載"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:textSize="@dimen/sp_16"/> android:text="數據下載"
android:textColor="@color/theme_white_color"
android:textSize="@dimen/sp_16" />
<com.qmuiteam.qmui.alpha.QMUIAlphaImageButton <com.qmuiteam.qmui.alpha.QMUIAlphaImageButton
android:id="@+id/btn_refresh" android:id="@+id/btn_refresh"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/icon_refresh"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_15"/> android:layout_marginRight="@dimen/dp_15"
android:src="@drawable/icon_refresh" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginTop="@dimen/dp_80" android:layout_marginTop="@dimen/dp_80"
android:weightSum="2"> android:orientation="vertical">
<FrameLayout <FrameLayout
android:id="@+id/frame_top"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"> app:layout_constraintBottom_toTopOf="@id/recycle_download"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_weight="1">
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@mipmap/down_cloud"/> android:src="@mipmap/down_cloud" />
<TextView <TextView
android:id="@+id/tv_progress" android:id="@+id/tv_progress"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="100%"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_12" android:layout_marginTop="@dimen/dp_12"
android:text="100%"
android:textColor="#13B7F5" android:textColor="#13B7F5"
android:textSize="@dimen/sp_24" /> android:textSize="@dimen/sp_24" />
</FrameLayout> </FrameLayout>
<com.gingersoft.gsa.cloud.ui.view.WaveView
android:id="@+id/wave_download"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:behindWaveColor="#ccc"
app:frontWaveColor="#ffffff"
app:waveShape="square" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycle_download" android:id="@+id/recycle_download"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"
android:fadeScrollbars="false" android:fadeScrollbars="false"
android:background="@mipmap/down_wave" android:listSelector="@color/theme_background_color"
android:paddingTop="@dimen/dp_50" android:paddingTop="@dimen/dp_50"
android:listSelector="@color/theme_background_color"/> app:layout_constraintBottom_toBottomOf="parent"
</LinearLayout> app:layout_constraintTop_toBottomOf="@id/frame_top"
app:layout_constraintVertical_weight="1" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> </com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>
\ No newline at end of file
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
android:id="@+id/RelativeLayout01" android:id="@+id/RelativeLayout01"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/theme_white_color"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:paddingLeft="15dp" android:paddingLeft="15dp"
......
...@@ -202,23 +202,23 @@ public class NewMainActivity extends BaseActivity<NewMainPresenter> implements N ...@@ -202,23 +202,23 @@ public class NewMainActivity extends BaseActivity<NewMainPresenter> implements N
List<Function> functions = new ArrayList<>(); List<Function> functions = new ArrayList<>();
functions.add(new Function((long) 150, 0, 5, "點餐", 0, 0)); functions.add(new Function((long) 150, 0, 5, "點餐", 0, 0));
functions.add(new Function((long) 138, 150, 5, "餐臺模式", R.drawable.ic_dining_table_mode, 0)); functions.add(new Function((long) 138, 150, 5, "餐臺模式", R.drawable.ic_dining_table_mode, 0));
functions.add(new Function((long) 139, 150, 5, "外送模式", R.drawable.ic_delivery_mode, 1)); functions.add(new Function((long) 139, 150, 5, "外送模式", R.drawable.ic_delivery_mode_close, 1));
functions.add(new Function((long) 140, 150, 5, "外賣模式", R.drawable.ic_outsourcing_model, 1)); functions.add(new Function((long) 140, 150, 5, "外賣模式", R.drawable.ic_outsourcing_model_close, 1));
functions.add(new Function((long) 141, 150, 5, "預點餐模式", R.drawable.ic_pre_order_mode, 1)); functions.add(new Function((long) 141, 150, 5, "預點餐模式", R.drawable.ic_pre_order_mode_close, 1));
functions.add(new Function((long) 151, 0, 5, "管理", 0, 0)); functions.add(new Function((long) 151, 0, 5, "管理", 0, 0));
// functions.add(new Function((long) 142, 151, 5, "餐牌管理", R.drawable.ic_meals_menu_management)); // functions.add(new Function((long) 142, 151, 5, "餐牌管理", R.drawable.ic_meals_menu_management));
functions.add(new Function((long) 142, 151, 5, "賬單管理", R.drawable.ic_meals_menu_management, 0)); functions.add(new Function((long) 142, 151, 5, "賬單管理", R.drawable.ic_meals_menu_management, 0));
functions.add(new Function((long) 142, 151, 5, "訂單管理", R.drawable.ic_meals_menu_management, 0)); functions.add(new Function((long) 142, 151, 5, "訂單管理", R.drawable.ic_meals_menu_management, 0));
functions.add(new Function((long) 143, 151, 5, "餐臺管理", R.drawable.ic_dining_table_management, 1)); functions.add(new Function((long) 143, 151, 5, "餐臺管理", R.drawable.ic_dining_table_management_close, 1));
functions.add(new Function((long) 144, 151, 5, "打印管理", R.drawable.ic_print_management, 0)); functions.add(new Function((long) 144, 151, 5, "打印管理", R.drawable.ic_print_management, 0));
functions.add(new Function((long) 145, 151, 5, "支付管理", R.drawable.ic_pay_management, 1)); functions.add(new Function((long) 145, 151, 5, "支付管理", R.drawable.ic_pay_management_close, 1));
functions.add(new Function((long) 146, 151, 5, "折扣管理", R.drawable.ic_discount_management, 1)); functions.add(new Function((long) 146, 151, 5, "折扣管理", R.drawable.ic_discount_management_close, 1));
functions.add(new Function((long) 152, 0, 5, "員工", 0, 0)); functions.add(new Function((long) 152, 0, 5, "員工", 0, 0));
functions.add(new Function((long) 147, 152, 5, "員工管理", R.drawable.ic_staff_management, 1)); functions.add(new Function((long) 147, 152, 5, "員工管理", R.drawable.ic_staff_management_close, 1));
functions.add(new Function((long) 148, 152, 5, "權限管理", R.drawable.ic_authority_management, 1)); functions.add(new Function((long) 148, 152, 5, "權限管理", R.drawable.ic_authority_management_close, 1));
functions.add(new Function((long) 149, 152, 5, "操作記錄", R.drawable.ic_operation_record, 1)); functions.add(new Function((long) 149, 152, 5, "操作記錄", R.drawable.ic_operation_record_close, 1));
//將功能列表數據分組 //將功能列表數據分組
SparseArray<String> parents = new SparseArray<>(); SparseArray<String> parents = new SparseArray<>();
SparseArray<List<Function>> funMap = new SparseArray<>(); SparseArray<List<Function>> funMap = new SparseArray<>();
......
...@@ -206,6 +206,7 @@ ...@@ -206,6 +206,7 @@
android:id="@+id/rv_staff_management" android:id="@+id/rv_staff_management"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginLeft="@dimen/main_recyclerview_marginLeft" android:layout_marginLeft="@dimen/main_recyclerview_marginLeft"
android:layout_marginRight="@dimen/main_recyclerview_marginRight" /> android:layout_marginRight="@dimen/main_recyclerview_marginRight" />
</LinearLayout> </LinearLayout>
...@@ -250,7 +251,7 @@ ...@@ -250,7 +251,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/main_recyclerview_marginLeft" android:layout_marginLeft="@dimen/main_recyclerview_marginLeft"
android:layout_marginTop="@dimen/dp_5" android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/main_recyclerview_marginRight" /> android:layout_marginRight="@dimen/main_recyclerview_marginRight" />
</LinearLayout> </LinearLayout>
</com.lihang.ShadowLayout> </com.lihang.ShadowLayout>
......
...@@ -2,14 +2,15 @@ ...@@ -2,14 +2,15 @@
<com.qmuiteam.qmui.alpha.QMUIAlphaLinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <com.qmuiteam.qmui.alpha.QMUIAlphaLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginBottom="@dimen/dp_20" android:layout_marginBottom="@dimen/dp_20"
android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:id="@+id/iv_main_home_item_function_icon" android:id="@+id/iv_main_home_item_function_icon"
android:layout_width="@dimen/dp_32" android:layout_width="@dimen/dp_26"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_26"
android:scaleType="fitCenter"
android:src="@drawable/ic_dining_table" /> android:src="@drawable/ic_dining_table" />
<TextView <TextView
......
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