Commit 2373b285 by 郑鹏

修改

parent c1f80ddb
......@@ -5,8 +5,6 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
kapt {
arguments {
arg("moduleName", project.getName())
......@@ -29,6 +27,8 @@ android {
javaCompileOptions.annotationProcessorOptions {
arguments = [moduleName: project.getName()]
}
ndk {
abiFilters "armeabi-v7a", "armeabi", "x86"
}
......@@ -97,6 +97,11 @@ android {
signingConfig signingConfigs.jenkins
}
release {
//在这里添加:
lintOptions {
checkReleaseBuilds false
abortOnError false
}
// buildConfigField 'String','NAME','value'
zipAlignEnabled true
minifyEnabled false
......@@ -255,8 +260,6 @@ dependencies {
api 'com.tencent.mid:mid:4.06-Release'
api 'com.github.liys666666:DoubleClick:V2.0.4'
api 'com.readystatesoftware.chuck:library:1.1.0'
implementation 'com.jakewharton:butterknife:8.5.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.0'
api files('libs/core-3.3.3.jar')
}
......
......@@ -108,8 +108,7 @@
android:value="@string/google_maps_key" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" /> <!-- <meta-data android:name="TA_APPKEY" android:value="AIAF8SC17A3L"/> -->
<!-- <meta-data android:name="InstallChannel" android:value="play"/> -->
android:value="@string/default_notification_channel_id" />
<activity
android:name=".ui.home.map.GoogleMapsActivity"
android:label="@string/title_activity_google_maps"
......
......@@ -83,16 +83,16 @@ public class BaseApi {
OkHttpClient
okHttpClient;
if (BuildConfig.DEBUG) {
okHttpClient = new OkHttpClient.Builder().readTimeout(18000, TimeUnit.MILLISECONDS)
.connectTimeout(18000, TimeUnit.MILLISECONDS)
okHttpClient = new OkHttpClient.Builder().readTimeout(50000, TimeUnit.SECONDS)
.connectTimeout(50000, TimeUnit.SECONDS)
.addInterceptor(httpLoggingInterceptor)
.addInterceptor(new TokenInterceptor())
.addNetworkInterceptor(new StethoInterceptor())
.addInterceptor(new ChuckInterceptor(DankalApplication.getContext()))
.build();
} else {
okHttpClient = new OkHttpClient.Builder().readTimeout(18000, TimeUnit.MILLISECONDS)
.connectTimeout(18000, TimeUnit.MILLISECONDS)
okHttpClient = new OkHttpClient.Builder().readTimeout(50000, TimeUnit.SECONDS)
.connectTimeout(50000, TimeUnit.SECONDS)
.addInterceptor(httpLoggingInterceptor)
.addInterceptor(new TokenInterceptor())
.addNetworkInterceptor(new StethoInterceptor())
......
......@@ -13,12 +13,12 @@ import cn.dankal.basiclib.util.WebViewUtil;
import cn.dankal.client.R;
public abstract class BaseWebviewActivity extends BaseActivity {
@BindView(R.id.wb)
public WebView wb;
public WebChromeClient webChromeClient;
@Override
public void initComponents() {
wb=findViewById(R.id.wb);
WebViewUtil.initWebViewSettings(wb, this);
webChromeClient = new WebChromeClient();
initData();
......@@ -56,6 +56,7 @@ public abstract class BaseWebviewActivity extends BaseActivity {
public void initData() {
wb.setWebViewClient(new WebViewClient() {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
......
......@@ -43,12 +43,12 @@ public class BigPhotoActivity extends BaseActivity {
public static final String PicIndex = "picindex";
public static boolean hasJump = false;
@BindView(R.id.progressBar)
ProgressBar progressBar;
@BindView(R.id.vp)
ViewPager viewPager;
@BindView(R.id.tv_page_index)
TextView tvPageIndex;
int picIndex;
......@@ -60,6 +60,7 @@ public class BigPhotoActivity extends BaseActivity {
@Override
protected void initComponents() {
initView();
ButterKnife.bind(this);
TitleBarUtils.compat(this, getResources().getColor(R.color.color00));
hasJump = true;
......@@ -89,6 +90,12 @@ public class BigPhotoActivity extends BaseActivity {
}
}
private void initView() {
progressBar = findViewById(R.id.progressBar);
viewPager = findViewById(R.id.vp);
tvPageIndex = findViewById(R.id.tv_page_index);
}
private ImageView loadImageVIew(String url) {
if (!url.contains("http")) {
......
......@@ -229,8 +229,7 @@ public class TabSegment extends HorizontalScrollView {
mHasIndicator = array.getBoolean(R.styleable.TabSegment_tab_has_indicator, true);
mIndicatorHeight = array.getDimensionPixelSize(R.styleable.TabSegment_tab_indicator_height,
getResources().getDimensionPixelSize(R.dimen.tab_segment_indicator_height));
mTabTextSize = array.getDimensionPixelSize(R.styleable.TabSegment_android_textSize,
getResources().getDimensionPixelSize(R.dimen.tab_segment_text_size));
mTabTextSize = getResources().getDimensionPixelSize(R.dimen.tab_segment_text_size);
mIndicatorTop = array.getBoolean(R.styleable.TabSegment_tab_indicator_top, false);
mDefaultTabIconPosition = array.getInt(R.styleable.TabSegment_tab_icon_position, ICON_POSITION_LEFT);
mMode = array.getInt(R.styleable.TabSegment_tab_mode, MODE_FIXED);
......
......@@ -137,7 +137,7 @@ public class HomeAdapter extends BaseMultiItemQuickAdapter<HomeEntity, BaseViewH
break;
case HomeEntity.MENU:
if (titles!=null && titles.size()>0){
if (titles != null && titles.size() > 0) {
tabLayout = helper.itemView.findViewById(R.id.sliding_tabs);
ViewPager viewPager = helper.itemView.findViewById(R.id.vp_pager);
viewPager.setAdapter(fragmentAdapter);
......@@ -156,13 +156,13 @@ public class HomeAdapter extends BaseMultiItemQuickAdapter<HomeEntity, BaseViewH
public class BannerItemView implements VH<String> {
@BindView(R.id.iv_img)
ImageView mIvImg;
@Override
public View createView(LayoutInflater inflater, ViewGroup container) {
View inflate = inflater.inflate(R.layout.banner_item, container, false);
ButterKnife.bind(this, inflate);
mIvImg = inflate.findViewById(R.id.iv_img);
return inflate;
}
......
......@@ -81,9 +81,7 @@ public class CarShopAdapter extends BaseQuickAdapter<ShopCarEntity.DataBean, Bas
});
carShopChildAdapter.setOnItemChildClickListener((adapter, view, position) -> {
switch (view.getId()) {
case R.id.tv_right_delete:
if (view.getId() == R.id.tv_right_delete) {
CommonDialog.Builder builder = new CommonDialog.Builder(context);
builder.setTitle(context.getString(R.string.need_to_delete));
builder.setNegativeButton(R.string.cancel, context.getResources().getColor(R.color.font_313131), type -> {
......@@ -101,9 +99,7 @@ public class CarShopAdapter extends BaseQuickAdapter<ShopCarEntity.DataBean, Bas
commonDialog = builder.create();
commonDialog.show();
break;
case R.id.cl_car_reduce:
} else if (view.getId() == R.id.cl_car_reduce) {
int number = list.get(position).getNumber();
if (number > 1) {
carShopChildAdapter.updateNumber(position, --number);
......@@ -112,19 +108,15 @@ public class CarShopAdapter extends BaseQuickAdapter<ShopCarEntity.DataBean, Bas
} else {
ToastUtils.showShort(R.string.no_more_reductions);
}
break;
case R.id.cl_car_add:
} else if (view.getId() == R.id.cl_car_add) {
int numberTow = list.get(position).getNumber();
carShopChildAdapter.updateNumber(position, ++numberTow);
carShopChildAdapter.notifyItemChanged(position);
addCart(list.get(position));
break;
case R.id.cb_select_shop:
} else if (view.getId() == R.id.cb_select_shop) {
if (selectShowListen != null) {
selectShowListen.onShowListen();
}
break;
}
});
......
......@@ -13,11 +13,13 @@ import android.support.constraint.ConstraintLayout
import android.support.v4.app.ActivityCompat
import android.support.v4.app.Fragment
import android.support.v7.widget.LinearLayoutCompat
import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import cn.dankal.basiclib.DankalApplication
import cn.dankal.basiclib.api.HomeServiceFactory
import cn.dankal.basiclib.api.RestaurantServiceFactory
import cn.dankal.basiclib.base.activity.BaseActivity
import cn.dankal.basiclib.base.fragmentactivity.FragmentAdapter
import cn.dankal.basiclib.constant.Constant
......@@ -48,8 +50,11 @@ import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import cn.dankal.basiclib.protocol.MainProtocol
import cn.dankal.client.ui.home.details.MerchantDetailsActivity
import cn.dankal.client.ui.personal.order.food.FoodOrderActivity
import cn.dankal.entities.home.QRCodeEntity
import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
@Route(path = MainProtocol.MAIN)
class HomeActivity : BaseActivity(), View.OnClickListener {
......@@ -67,10 +72,9 @@ class HomeActivity : BaseActivity(), View.OnClickListener {
when (v?.id) {
R.id.iv_home_search -> startActivity(Intent(this, SearchShopActivity::class.java))
R.id.iv_home_sweep -> {
/* requestPermission(Permission.CAMERA) {
requestPermission(Permission.CAMERA) {
startActivityForResult(Intent(this, CaptureActivity::class.java), ConstantsHomeType.SCAN)
}*/
startActivity(Intent(this, FoodOrderActivity::class.java));
}
}
R.id.iv_home_location -> {
startActivity(Intent(this, GoogleMapsActivity::class.java))
......@@ -178,6 +182,13 @@ class HomeActivity : BaseActivity(), View.OnClickListener {
//iv_home_search.setOnClickListener(this)
iv_home_sweep.setOnClickListener(this)
//iv_home_location.setOnClickListener(this)
iv_home_sweep.setOnLongClickListener(object :View.OnLongClickListener{
override fun onLongClick(v: View?): Boolean {
//startActivity(Intent(this@HomeActivity,FoodOrderActivity::class.java))
startActivity(Intent(this@HomeActivity, SearchShopActivity::class.java))
return true
}
})
}
//设置顶部数据
......@@ -228,4 +239,48 @@ class HomeActivity : BaseActivity(), View.OnClickListener {
it.notifyDataSetChanged()
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == ConstantsHomeType.SCAN && resultCode == RESULT_OK && data != null) {
var result = data.getStringExtra(com.yzq.zxinglibrary.common.Constant.CODED_CONTENT)
if (TextUtils.isEmpty(result)) {
startActivity(Intent(this@HomeActivity, ScanResultActivity::class.java))
return
}
try {
var qrCodeEntity = Gson().fromJson<QRCodeEntity>(result, QRCodeEntity::class.java)
RestaurantServiceFactory.checkTableState(qrCodeEntity.tableUuid).subscribe(object : AbstractDialogSubscriber<String>(this) {
override fun onNext(s: String) {
when (s) {
"0" -> {
startActivity(Intent(this@HomeActivity, MerchantDetailsActivity::class.java)
.putExtra(MerchantDetailsActivity.HOTELUUID, qrCodeEntity.hotelUuid)
.putExtra(MerchantDetailsActivity.TABLE_UUID, qrCodeEntity.tableUuid)
.putExtra(MerchantDetailsActivity.TABLE_NUMBER, qrCodeEntity.tableNumber.toString()))
}
"1"//不存在
-> {
startActivity(Intent(this@HomeActivity, ScanResultActivity::class.java))
}
"2"//被使用
-> {
showDialogStateTow(getString(R.string.the_table_number_is_in_use))
}
"3"//已隐藏
-> {
startActivity(Intent(this@HomeActivity, ScanResultActivity::class.java))
}
}
}
})
} catch (e: java.lang.Exception) {
startActivity(Intent(this@HomeActivity, ScanResultActivity::class.java))
}
}
}
}
\ No newline at end of file
......@@ -62,10 +62,8 @@ import io.reactivex.functions.Consumer;
public class MenuItemFragment extends BaseFragment {
@BindView(R.id.rl_menu_type)
RecyclerView rlMenuType;
@BindView(R.id.rv_bottom_child)
RecyclerView rlRoundList;
private MenuItemAdapter menuItemAdapter;
......@@ -96,6 +94,7 @@ public class MenuItemFragment extends BaseFragment {
@Override
protected void initComponents() {
initView();
EventBus.getDefault().register(this);
rxPermissions = new RxPermissions(getActivity());
......@@ -123,6 +122,13 @@ public class MenuItemFragment extends BaseFragment {
requestAllList();
}
private void initView() {
rlMenuType = mContentView.findViewById(R.id.rl_menu_type);
rlRoundList = mContentView.findViewById(R.id.rv_bottom_child);
mContentView.findViewById(R.id.tv_home_more).setOnClickListener(this::onViewClicked);
mContentView.findViewById(R.id.tv_item_filter).setOnClickListener(this::onViewClicked);
}
//开始请求数据
private void requestAllList() {
......@@ -237,15 +243,12 @@ public class MenuItemFragment extends BaseFragment {
}
@OnClick({R.id.tv_home_more, R.id.tv_item_filter})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_home_more:
if (view.getId() == R.id.tv_home_more) {
startActivity(new Intent(getActivity(), RecommendMerchantActivity.class).putExtra(RecommendMerchantActivity.UUID, uuid));
break;
case R.id.tv_item_filter:
} else if (view.getId() == R.id.tv_item_filter) {
showTopDialog();
break;
}
}
......
......@@ -52,17 +52,16 @@ import cn.dankal.client.util.UIUtile;
* Created by zhengpeng on 2019/4/29.
*/
public class SearchShopActivity extends BaseActivity implements OnRefreshLoadMoreListener {
@BindView(R.id.fl_tag_one)
TagFlowLayout flTagOne;
@BindView(R.id.lv_history)
NestedListView lvListHistory;
@BindView(R.id.et_search)
EditText etSearch;
@BindView(R.id.nv_search)
NestedScrollView nvSearch;
@BindView(R.id.rv_search_result)
RecyclerView rvSearchResult;
@BindView(R.id.refreshLayout)
SmartRefreshLayout refreshLayout;
private List<HistoryEntity> historyEntities;
......@@ -92,7 +91,7 @@ public class SearchShopActivity extends BaseActivity implements OnRefreshLoadMor
@Override
protected void initComponents() {
initView();
addSingleTitleBar(getString(R.string.search));
etSearch.setOnEditorActionListener((arg0, arg1, arg2) -> {
......@@ -167,6 +166,18 @@ public class SearchShopActivity extends BaseActivity implements OnRefreshLoadMor
requestHotListData();
}
private void initView() {
flTagOne = findViewById(R.id.fl_tag_one);
lvListHistory = findViewById(R.id.lv_history);
etSearch = findViewById(R.id.et_search);
nvSearch = findViewById(R.id.nv_search);
rvSearchResult = findViewById(R.id.rv_search_result);
refreshLayout = findViewById(R.id.refreshLayout);
findViewById(R.id.tv_search).setOnClickListener(this::onViewClicked);
findViewById(R.id.tv_clean_history).setOnClickListener(this::onViewClicked);
}
/**
* 搜索
*
......@@ -285,17 +296,14 @@ public class SearchShopActivity extends BaseActivity implements OnRefreshLoadMor
}
@OnClick({R.id.tv_search, R.id.tv_clean_history})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_search:
if (view.getId() == R.id.tv_search) {
searchContent = etSearch.getText().toString();
stareSearchData(searchContent);
//开始搜索
searchContent(true, searchContent);
break;
case R.id.tv_clean_history:
} else if (view.getId() == R.id.tv_clean_history) {
showDialog(null, getString(R.string.whether_to_clear_search_history), type -> {
LitePal.deleteAll(HistoryEntity.class);
listTow.clear();
......@@ -304,7 +312,6 @@ public class SearchShopActivity extends BaseActivity implements OnRefreshLoadMor
commonDialog.dismiss();
}
}, true, true);
break;
}
}
......
......@@ -7,6 +7,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
......@@ -71,33 +72,33 @@ import io.reactivex.disposables.Disposable;
public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMoreListener {
@BindView(R.id.rv_details_title)
RecyclerView rvDetailsTitle;
@BindView(R.id.rv_details_content)
RecyclerView rvDetailsContent;
@BindView(R.id.refreshLayout)
SmartRefreshLayout refreshLayout;
public static final String TYPEDATA = "type_data";
@BindView(R.id.ll_bg)
LinearLayout llShopBottom;
@BindView(R.id.iv_menu_picture)
ImageView ivMenuPicture;
@BindView(R.id.tv_bottom_shop_count)
TextView tvBottomShopCount;//商品数据标识
@BindView(R.id.btn_details_queue)
Button btnDetailsQueue;
@BindView(R.id.tv_shop_tip)
TextView tvShopTip;
@BindView(R.id.tv_bottom_shop_tip_text)
TextView tvBottomShopTipText;//底部提示文字
@BindView(R.id.tv_bottom_shop_button)
TextView tvBottomShopButton;//选好了按钮
private int userStampNumber = 0;//用户在当前店铺拥有的邮票数
......@@ -165,8 +166,10 @@ public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMo
return R.layout.fragment_details_shop;
}
@Override
protected void initComponents() {
initView();
EventBus.getDefault().register(this);
//配置商品内容初始化
shopTypeContentEntities = new ArrayList<>();
......@@ -179,8 +182,7 @@ public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMo
adapterContent = new ShopTypeContentAdapter(getActivity(), R.layout.item_shop_details, shopTypeContentEntities);
adapterContent.setOnItemChildClickListener((adapter, view, position) -> {
switch (view.getId()) {
case R.id.tv_select_format:
if (view.getId()==R.id.tv_select_format){
if (showState == 0) {//商家休息状态,不请求数据
return;
}
......@@ -191,8 +193,7 @@ public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMo
}
//请求规格
requestSpecsDetails(dataBean);
break;
case R.id.ll_shop_bg:
}else if (view.getId()==R.id.ll_shop_bg){
Intent intent = new Intent(getActivity(), DishesDetailsActivity.class);
intent.putExtra("hotelUuid", storeUUId);
intent.putExtra("tableUUID", tableUUID);
......@@ -212,7 +213,6 @@ public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMo
intent.putExtra("goodsUuid", shopTypeContentEntities.get(position).getUuid());
}
startActivity(intent);
break;
}
});
rvDetailsContent.setAdapter(adapterContent);
......@@ -273,12 +273,29 @@ public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMo
setBottomState(showState);
}
if (!isAgain){
if (!isAgain) {
initCar();
}
findCarShop();
}
private void initView() {
rvDetailsTitle = mContentView.findViewById(R.id.rv_details_title);
rvDetailsContent = mContentView.findViewById(R.id.rv_details_content);
refreshLayout = mContentView.findViewById(R.id.refreshLayout);
llShopBottom = mContentView.findViewById((R.id.ll_bg));
ivMenuPicture = mContentView.findViewById((R.id.iv_menu_picture));
tvBottomShopCount = mContentView.findViewById((R.id.tv_bottom_shop_count));
btnDetailsQueue = mContentView.findViewById((R.id.btn_details_queue));
tvShopTip = mContentView.findViewById((R.id.tv_shop_tip));
tvBottomShopTipText = mContentView.findViewById((R.id.tv_bottom_shop_tip_text));
tvBottomShopButton = mContentView.findViewById((R.id.tv_bottom_shop_button));
mContentView.findViewById(R.id.btn_details_queue).setOnClickListener(this::onClickView);
mContentView.findViewById(R.id.iv_menu_picture).setOnClickListener(this::onClickView);
mContentView.findViewById(R.id.tv_bottom_shop_button).setOnClickListener(this::onClickView);
}
/**
* 请求加载商品内容
*
......@@ -435,17 +452,14 @@ public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMo
});
}
@OnClick({R.id.btn_details_queue, R.id.iv_menu_picture, R.id.tv_bottom_shop_button})
public void onClickView(View view) {
switch (view.getId()) {
case R.id.btn_details_queue:
switch (type) {
case 0://预约排队
if (view.getId()==R.id.btn_details_queue){
if (type==0){
Intent intentOne = new Intent(getActivity(), QueueActivity.class);
intentOne.putExtra(ConstantsRestaurantType.UUID, storeUUId);
startActivity(intentOne);
break;
case 1://排队中
}else if (type==1){
if (commitQueueEntity != null) {
Intent intent = new Intent(getActivity(), QueueResultActivity.class);
Bundle bundle = new Bundle();
......@@ -455,9 +469,7 @@ public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMo
intent.putExtras(bundle);
startActivity(intent);
}
break;
case 2://排队过期
}else if (type==2){
if (commitQueueEntity != null) {
Intent intent = new Intent(getActivity(), QueueResultActivity.class);
Bundle bundle = new Bundle();
......@@ -467,20 +479,15 @@ public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMo
intent.putExtras(bundle);
startActivity(intent);
}
break;
}
break;
case R.id.iv_menu_picture:
}else if (view.getId()==R.id.iv_menu_picture){
if (view == null) {
return;
}
findCarShop();
showBottomListDialog();
break;
case R.id.tv_bottom_shop_button://选好了,调用去结算
}else if (view.getId()==R.id.tv_bottom_shop_button){
toPay();
break;
}
}
......@@ -525,7 +532,7 @@ public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMo
if (btnDetailsQueue != null)
btnDetailsQueue.setVisibility(View.GONE);
if (popupWindow!=null){
if (popupWindow != null) {
popupWindow.dismiss();
}
if (isAgain) {
......@@ -925,7 +932,7 @@ public class DetailsShopFragment extends BaseFragment implements OnRefreshLoadMo
tvBottomShopButton.setBackgroundColor(getResources().getColor(R.color.btn_bg));
tvBottomShopButton.setTextColor(getResources().getColor(R.color.color_171717));
tvBottomShopButton.setEnabled(true);
tvBottomShopButton.setText(R.string.go_to_settlement);
tvBottomShopButton.setText(R.string.selected);
tvSettlement.setBackgroundColor(getResources().getColor(R.color.btn_bg));
tvSettlement.setTextColor(getResources().getColor(R.color.color_171717));
......
......@@ -56,27 +56,27 @@ import io.reactivex.disposables.Disposable;
*/
public class MerchantDetailsActivity extends BaseActivity {
@BindView(R.id.sliding_tabs)
SlidingTabLayout slidingTabs;
@BindView(R.id.vp_pager)
ViewPager vpPager;
@BindView(R.id.tv_restaurant_name)
TextView tvRestaurantName;
@BindView(R.id.tv_restaurant_stamp)
TextView tvRestaurantStamp;
@BindView(R.id.tv_restaurant_coupons)
TextView tvRestaurantCoupons;
@BindView(R.id.marqueeView)
MarqueeView marqueeView;
@BindView(R.id.tv_tab_number)
TextView tvTabNumber;//桌号
@BindView(R.id.tv_stamp_tag)
TextView tvStampTag;
@BindView(R.id.tv_status_bar)
TextView tvStatusBar;
@BindView(R.id.sv_store_star)
GradeStarView svStoreStar;
@BindView(R.id.tv_grade)
TextView tvGrade;
private int userStampNumber = 0;//用户在当前店铺拥有的邮票数
......@@ -120,24 +120,20 @@ public class MerchantDetailsActivity extends BaseActivity {
return R.layout.activity_merchant_details;
}
@OnClick({R.id.iv_merchant_return, R.id.iv_merchant_scan, R.id.tv_see_evaluation})
public void onClickView(View view) {
if (ButtonUtil.isFastDoubleTowBiClick()) {
return;
}
switch (view.getId()) {
case R.id.iv_merchant_return:
if (view.getId()==R.id.iv_merchant_return){
finish();
break;
case R.id.iv_merchant_scan:
}else if (view.getId()==R.id.iv_merchant_scan){
requestPermission(Permission.CAMERA, () -> startActivityForResult(new Intent(MerchantDetailsActivity.this, CaptureActivity.class), ConstantsHomeType.SCAN));
break;
case R.id.tv_see_evaluation:
}else if (view.getId()==R.id.tv_see_evaluation){
Intent intent = new Intent(this, FoodAllEvaluateActivity.class);
intent.putExtra("hotel_uuid", storeUUId);
intent.putExtra("level", mStarLevel);
startActivity(intent);
break;
}
}
......@@ -195,9 +191,28 @@ public class MerchantDetailsActivity extends BaseActivity {
@Override
protected void initComponents() {
initView();
initData(getIntent());
}
private void initView() {
slidingTabs = findViewById(R.id.sliding_tabs);
vpPager = findViewById(R.id.vp_pager);
tvRestaurantName = findViewById(R.id.tv_restaurant_name);
tvRestaurantStamp = findViewById(R.id.tv_restaurant_stamp);
tvRestaurantCoupons = findViewById(R.id.tv_restaurant_coupons);
marqueeView = findViewById(R.id.marqueeView);
tvTabNumber = findViewById(R.id.tv_tab_number);
tvStampTag = findViewById(R.id.tv_stamp_tag);
tvStatusBar = findViewById(R.id.tv_status_bar);
svStoreStar = findViewById(R.id.sv_store_star);
tvGrade = findViewById(R.id.tv_grade);
findViewById(R.id.iv_merchant_return).setOnClickListener(this::onClickView);
findViewById(R.id.iv_merchant_scan).setOnClickListener(this::onClickView);
findViewById(R.id.tv_see_evaluation).setOnClickListener(this::onClickView);
}
@Override
protected void onResume() {
super.onResume();
......
......@@ -40,11 +40,11 @@ import io.reactivex.disposables.Disposable;
* Created by zhengpeng on 2019/6/24.
*/
public class MerchantMallFragment extends BaseFragment implements OnRefreshLoadMoreListener {
@BindView(R.id.rv_details_title)
RecyclerView rvDetailsTitle;
@BindView(R.id.rv_details_content)
RecyclerView rvDetailsContent;
@BindView(R.id.refreshLayout)
SmartRefreshLayout refreshLayout;
Unbinder unbinder;
......@@ -69,6 +69,7 @@ public class MerchantMallFragment extends BaseFragment implements OnRefreshLoadM
@Override
protected void initComponents() {
initView();
//配置商品内容
listData = new ArrayList<>();
linearLayoutManagerContent = new LinearLayoutManager(getActivity());
......@@ -101,6 +102,13 @@ public class MerchantMallFragment extends BaseFragment implements OnRefreshLoadM
}
}
private void initView() {
rvDetailsTitle = mContentView.findViewById(R.id.rv_details_title);
rvDetailsContent = mContentView.findViewById(R.id.rv_details_content);
refreshLayout = mContentView.findViewById(R.id.refreshLayout);
}
private void requestMallType(String storeUUID) {
MallServiceFactory.getStoreDetail(storeUUID).subscribe(new AbstractDialogSubscriber<MerchantHomeEntity>(this) {
@Override
......@@ -158,7 +166,7 @@ public class MerchantMallFragment extends BaseFragment implements OnRefreshLoadM
List<MerchantShopEntity.DataBean> dataBeans = entity.getData();
if (isRefreshing) {
if (adapterContent != null && rvDetailsContent!=null) {
if (adapterContent != null && rvDetailsContent != null) {
listData.clear();
if (dataBeans == null || dataBeans.size() == 0) {
adapterContent.setEmptyView(R.layout.adapter_layout_merchant_empty, rvDetailsContent);
......
......@@ -103,7 +103,7 @@ class OrderResultActivity : BaseActivity(), View.OnClickListener {
private fun callPayment() {
RestaurantServiceFactory.userPay(map).subscribe(object : AbstractDialogSubscriber<PayParameterEntity>(this) {
override fun onNext(t: PayParameterEntity) {
t.apply {
/*t.apply {
orderId = order_uuid
stampNumber = stamp_number
val intent = Intent(this@OrderResultActivity, SelectPayFoodActivity::class.java)
......@@ -112,7 +112,28 @@ class OrderResultActivity : BaseActivity(), View.OnClickListener {
bundle.putString("storeUUID", storeUUID)
intent.putExtras(bundle)
startActivity(intent)
}*/
//测试代码
//删除本地购物车商品
val entities = LitePal.where("storeUUid=? ", storeUUID).find(FoodEntity::class.java)
entities?.let {
for (j in 0 until entities.size) {
val foodEntity = entities[j]
foodEntity.delete()
}
EventBus.getDefault().post(ShopCarRefreshEvent())
}
ToastUtils.showShort(getString(R.string.successful_payment))
val intent = Intent(this@OrderResultActivity, ResultPageActivity::class.java)
var bundle = Bundle()
bundle.putString("order_id", orderId)
bundle.putSerializable("food_list", foodEntity)
bundle.putInt("stampNumber", stampNumber)
intent.putExtras(bundle)
startActivity(intent)
finish()
}
})
}
......
......@@ -8,6 +8,7 @@ import cn.dankal.entities.home.CommitHotelEntity
import cn.dankal.client.R
import cn.dankal.client.adapter.home.OrderResultAdapter
import cn.dankal.client.constants.ConstantsRestaurantType
import cn.dankal.client.ui.personal.order.food.FoodEvaluationActivity
import cn.dankal.client.ui.personal.order.food.OrderDetailsActivity
import cn.dankal.client.util.UIUtile
import kotlinx.android.synthetic.main.activity_result_page.*
......@@ -32,6 +33,10 @@ class ResultPageActivity : BaseActivity(), View.OnClickListener {
R.id.btn_order -> {//继续点餐
finish()
}
R.id.btn_evaluate->{
startActivity(Intent(this@ResultPageActivity, FoodEvaluationActivity::class.java).putExtra("order_id", orderId))
finish()
}
}
}
......@@ -68,5 +73,6 @@ class ResultPageActivity : BaseActivity(), View.OnClickListener {
btn_see_order.setOnClickListener(this)
btn_order.setOnClickListener(this)
btn_evaluate.setOnClickListener(this)
}
}
......@@ -52,6 +52,8 @@ class SelectPayFoodActivity : BaseActivity(), View.OnClickListener {
ll_w_pay.setOnClickListener(this)
ll_a_pay.setOnClickListener(this)
}
private fun payShop(payEntity: PayParameterEntity) {
......
......@@ -15,13 +15,12 @@ import cn.dankal.client.R;
* Created by zhengpeng on 2019/6/5.
*/
public class BannerItemView implements VH<String> {
@BindView(R.id.iv_img)
ImageView mIvImg;
@Override
public View createView(LayoutInflater inflater, ViewGroup container) {
View inflate = inflater.inflate(R.layout.banner_item, container, false);
ButterKnife.bind(this, inflate);
mIvImg = inflate.findViewById(R.id.iv_img);
return inflate;
}
......
......@@ -324,13 +324,12 @@ public class GoogleMapsActivity extends BaseActivity implements OnMapReadyCallba
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
findViewById(id.iv_location).setOnClickListener(this::onViewClicked);
findViewById(id.iv_menu).setOnClickListener(this::onViewClicked);
}
@OnClick({id.iv_location, id.iv_menu})
public void onViewClicked(View view) {
switch (view.getId()) {
case id.iv_location://定位到自己旁边
if (view.getId() == R.id.iv_location) {
if (mMap == null) {
return;
}
......@@ -346,10 +345,8 @@ public class GoogleMapsActivity extends BaseActivity implements OnMapReadyCallba
} catch (Exception e) {
e.printStackTrace();
}
break;
case id.iv_menu:
} else if (view.getId() == R.id.iv_menu) {
startActivity(new Intent(GoogleMapsActivity.this, NearbyMerchantActivity.class));
break;
}
}
......
......@@ -244,13 +244,12 @@ public class GoogleMapsMallActivity extends BaseActivity implements OnMapReadyCa
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
findViewById(R.id.iv_location).setOnClickListener(this::onViewClicked);
findViewById(R.id.iv_menu).setOnClickListener(this::onViewClicked);
}
@OnClick({R.id.iv_location, R.id.iv_menu})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.iv_location://定位到自己旁边
if (view.getId() == R.id.iv_location) {
if (mMap == null) {
return;
}
......@@ -260,16 +259,14 @@ public class GoogleMapsMallActivity extends BaseActivity implements OnMapReadyCa
try {
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new
LatLng(location.getLatitude(),
location.getLongitude()), 12));
location.getLongitude()), 16));
//requestAllList();
} catch (Exception e) {
e.printStackTrace();
}
break;
case R.id.iv_menu:
} else if (view.getId() == R.id.iv_menu) {
startActivity(new Intent(GoogleMapsMallActivity.this, NearbyMerchantActivity.class));
break;
}
}
......
......@@ -286,13 +286,13 @@ public class GoogleMapsMerchantActivity extends BaseActivity implements OnMapRea
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
findViewById(R.id.iv_location).setOnClickListener(this::onViewClicked);
findViewById(R.id.iv_menu).setOnClickListener(this::onViewClicked);
}
@OnClick({R.id.iv_location, R.id.iv_menu})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.iv_location://定位到自己旁边
if (view.getId() == R.id.iv_location) {
if (mMap == null) {
return;
}
......@@ -302,16 +302,14 @@ public class GoogleMapsMerchantActivity extends BaseActivity implements OnMapRea
try {
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new
LatLng(location.getLatitude(),
location.getLongitude()), 12));
location.getLongitude()), 16));
//requestAllList();
} catch (Exception e) {
e.printStackTrace();
}
break;
case R.id.iv_menu:
} else if (view.getId() == R.id.iv_menu) {
startActivity(new Intent(GoogleMapsMerchantActivity.this, NearbyMerchantActivity.class));
break;
}
}
......
......@@ -27,7 +27,6 @@ public class MyQueueFragment extends BaseFragment {
private static final String ARG_PARAM1 = "param1";
@BindView(R.id.rv_my_queue)
RecyclerView rvMyQueue;
Unbinder unbinder;
......@@ -55,6 +54,7 @@ public class MyQueueFragment extends BaseFragment {
@Override
protected void initComponents() {
rvMyQueue = mContentView.findViewById(R.id.rv_my_queue);
if (getArguments() != null) {
mParam1 = getArguments().getInt(ARG_PARAM1);
}
......
......@@ -19,7 +19,7 @@ class FoodOrderActivity : BaseActivity() {
addSingleTitleBar(getString(R.string.food_order))
var dataList = ArrayList<Fragment>()
dataList.add(FoodOrderFragment.newInstance("0"))//1-已支付 / 待上餐/ 待发货);
dataList.add(FoodOrderFragment.newInstance("1"))//1-已支付 / 待上餐/ 待发货);
dataList.add(FoodOrderFragment.newInstance("4"))//4-已完成
dataList.add(FoodOrderFragment.newInstance("11"))//8-已取消(退款成功)
dataList.add(FoodOrderFragment.newInstance("2"))//2-售后订单
......
......@@ -37,7 +37,7 @@ class OrderDetailsActivity : BaseActivity(), View.OnClickListener, CallListDialo
} else {
var map = HashMap<String, Any?>()
map["order_uuid"] = orderUUid
map["reason"] = reasonUUID
map["reason"] = reason
UserServiceFactory.submitAfterSale(map).subscribe(object : AbstractDialogSubscriber<ResponseBody>(this) {
override fun onNext(t: ResponseBody) {
startActivity(Intent(this@OrderDetailsActivity, AppealResultActivity::class.java))
......
......@@ -27,11 +27,11 @@ import io.reactivex.schedulers.Schedulers;
public class ExpressActivity extends BaseActivity {
@BindView(R.id.tv_order_code)
TextView tvOrderCode;
@BindView(R.id.tv_function)
TextView tvFunction;
@BindView(R.id.rv_logistics_list)
RecyclerView rvLogisticsList;
private String TAG = "ExpressActivity";
......@@ -46,6 +46,7 @@ public class ExpressActivity extends BaseActivity {
@Override
protected void initComponents() {
initView();
addSingleTitleBar(getString(R.string.logistics_details));
//请求物流key
......@@ -53,6 +54,13 @@ public class ExpressActivity extends BaseActivity {
//sendByOKHttp();
}
private void initView() {
tvOrderCode = findViewById(R.id.tv_order_code);
tvFunction = findViewById(R.id.tv_function);
rvLogisticsList = findViewById(R.id.rv_logistics_list);
}
private void requestLogistic() {
AddressServiceFactory.logisticsToken().subscribe(new AbstractDialogSubscriber<LogisticsEntity>(this) {
@Override
......
......@@ -46,22 +46,22 @@ import io.reactivex.schedulers.Schedulers;
* Created by zhengpeng on 2019/5/7.
*/
public class AddAddressActivity extends BaseActivity {
public static final String UUID = "uuid";
@BindView(R.id.ll_picker)
LinearLayout llPicker;
@BindView(R.id.iv_add_address_state)
ImageView ivAddAddressState;
public static final String UUID = "uuid";
@BindView(R.id.et_address_name)
EditText etAddressName;
@BindView(R.id.et_address_phone)
EditText etAddressPhone;
@BindView(R.id.et_address_area)
AutoCompleteTextView etAddressArea;
@BindView(R.id.et_address_area_detail)
EditText etAddressAreaDetail;
@BindView(R.id.btn_address_save)
Button btnAddressSave;
private String uuid = "";
......@@ -85,7 +85,7 @@ public class AddAddressActivity extends BaseActivity {
@Override
protected void initComponents() {
initView();
if (getIntent() != null) {
uuid = getIntent().getStringExtra(UUID);
}
......@@ -128,7 +128,6 @@ public class AddAddressActivity extends BaseActivity {
etAddressArea.setDropDownBackgroundResource(R.color.white);
setONEditorEvent(etAddressName);
setONEditorEvent(etAddressPhone);
setONEditorEvent(etAddressAreaDetail);
......@@ -143,6 +142,19 @@ public class AddAddressActivity extends BaseActivity {
});
}
private void initView() {
llPicker = findViewById(R.id.ll_picker);
ivAddAddressState = findViewById(R.id.iv_add_address_state);
etAddressName = findViewById(R.id.et_address_name);
etAddressPhone = findViewById(R.id.et_address_phone);
etAddressArea = findViewById(R.id.et_address_area);
etAddressAreaDetail = findViewById(R.id.et_address_area_detail);
btnAddressSave = findViewById(R.id.btn_address_save);
findViewById(R.id.iv_add_address_state).setOnClickListener(this::onViewClicked);
findViewById(R.id.btn_address_save).setOnClickListener(this::onViewClicked);
}
private void setONEditorEvent(EditText editText) {
editText.setOnEditorActionListener((v, actionId, event) -> {
if (actionId == EditorInfo.IME_ACTION_SEND
......@@ -222,10 +234,8 @@ public class AddAddressActivity extends BaseActivity {
ButterKnife.bind(this);
}
@OnClick({R.id.iv_add_address_state, R.id.btn_address_save})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.iv_add_address_state:
if (view.getId()==R.id.iv_add_address_state){
if (isDefault) {
isDefault = false;
ivAddAddressState.setImageResource(R.mipmap.ic_mall_details_coupon_close);
......@@ -233,9 +243,7 @@ public class AddAddressActivity extends BaseActivity {
isDefault = true;
ivAddAddressState.setImageResource(R.mipmap.ic_mall_details_coupon_open);
}
break;
case R.id.btn_address_save:
}else if (view.getId()==R.id.btn_address_save){
String name = etAddressName.getText().toString();
if (TextUtils.isEmpty(name)) {
ToastUtils.showShort(getString(R.string.please_fill_in_your_name));
......@@ -288,7 +296,6 @@ public class AddAddressActivity extends BaseActivity {
}
});
}
break;
}
}
......
......@@ -40,11 +40,11 @@ import io.reactivex.disposables.Disposable;
public class DetailsMerchantFragment extends BaseFragment implements OnRefreshLoadMoreListener {
@BindView(R.id.rv_details_title)
RecyclerView rvDetailsTitle;
@BindView(R.id.rv_details_content)
RecyclerView rvDetailsContent;
@BindView(R.id.refreshLayout)
SmartRefreshLayout refreshLayout;
Unbinder unbinder;
......@@ -70,6 +70,7 @@ public class DetailsMerchantFragment extends BaseFragment implements OnRefreshLo
@Override
protected void initComponents() {
initView();
//配置商品内容
listData = new ArrayList<>();
linearLayoutManagerContent = new LinearLayoutManager(getActivity());
......@@ -123,6 +124,12 @@ public class DetailsMerchantFragment extends BaseFragment implements OnRefreshLo
}
}
private void initView() {
rvDetailsTitle = mContentView.findViewById(R.id.rv_details_title);
rvDetailsContent = mContentView.findViewById(R.id.rv_details_content);
refreshLayout = mContentView.findViewById(R.id.refreshLayout);
}
private void requestContentData(String goods_type_uuid, boolean isRefreshing) {
if (isRefreshing) {
page = 1;
......@@ -149,7 +156,7 @@ public class DetailsMerchantFragment extends BaseFragment implements OnRefreshLo
List<MerchantShopEntity.DataBean> dataBeans = entity.getData();
if (isRefreshing) {
if (adapterContent != null && rvDetailsContent!=null) {
if (adapterContent != null && rvDetailsContent != null) {
listData.clear();
if (dataBeans == null || dataBeans.size() == 0) {
adapterContent.setEmptyView(R.layout.adapter_layout_merchant_empty, rvDetailsContent);
......
......@@ -28,9 +28,9 @@ import cn.dankal.client.ui.home.details.MerchantDetailsActivity;
public class QueueActivity extends BaseActivity implements TableListDialog.OnCenterItemClickListener {
@BindView(R.id.rv_queue_state)
RecyclerView rvQueueState;
@BindView(R.id.tv_tip)
TextView tvTip;
private List<QueueEntity.DataBean> list;
private QueueAdapter adapter;
......@@ -45,6 +45,7 @@ public class QueueActivity extends BaseActivity implements TableListDialog.OnCen
@Override
protected void initComponents() {
initView();
addSingleTitleBar(getString(R.string.queue_number));
Intent intent = getIntent();
......@@ -82,14 +83,19 @@ public class QueueActivity extends BaseActivity implements TableListDialog.OnCen
});
}
private void initView() {
rvQueueState = findViewById(R.id.rv_queue_state);
tvTip = findViewById(R.id.tv_tip);
findViewById(R.id.bt_take_number).setOnClickListener(this::onViewClicked);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ButterKnife.bind(this);
}
@OnClick(R.id.bt_take_number)
public void onViewClicked() {
public void onViewClicked(View view) {
if (listDialog != null) {
listDialog.show();
}
......@@ -97,8 +103,7 @@ public class QueueActivity extends BaseActivity implements TableListDialog.OnCen
@Override
public void OnCenterItemClick(TableListDialog dialog, View view, String tableUUID) {
switch (view.getId()) {
case R.id.btn_commit://提交排队
if (view.getId()==R.id.btn_commit){
RestaurantServiceFactory.submitHotelQueue(hotelUUID, tableUUID).subscribe(new AbstractDialogSubscriber<CommitQueueEntity>(this) {
@Override
public void onNext(CommitQueueEntity commitQueueEntity) {
......@@ -113,9 +118,6 @@ public class QueueActivity extends BaseActivity implements TableListDialog.OnCen
finish();
}
});
break;
default:
break;
}
}
}
......@@ -38,29 +38,29 @@ import cn.dankal.client.ui.home.details.MerchantDetailsActivity;
import okhttp3.ResponseBody;
public class QueueResultActivity extends BaseActivity {
@BindView(R.id.tv_queue_number)
TextView tvQueueNumber;
@BindView(R.id.tv_count)
TextView tvCount;
@BindView(R.id.tv_count_time)
TextView tvCountTime;
@BindView(R.id.tv_state)
TextView tvState;//排队状态
@BindView(R.id.iv_start_image)
ImageView ivStartImage;
@BindView(R.id.ll_background)
LinearLayoutCompat llBackground;
@BindView(R.id.btn_cancel)
Button btnCancel;
@BindView(R.id.btn_order)
Button btnOrder;
@BindView(R.id.tv_table_shop)
TextView tvTableShop;
@BindView(R.id.tv_tip_order)
TextView tvTipOrder;
@BindView(R.id.tv_you_queue)
TextView tvYouQueue;
@BindView(R.id.ll_layout)
LinearLayout llLayout;
/* @BindView(R.id.ll_background)
LinearLayoutCompat llBackGround;*/
......@@ -79,6 +79,7 @@ public class QueueResultActivity extends BaseActivity {
@Override
protected void initComponents() {
initView();
addSingleTitleBar(getString(R.string.queuing_results));
Intent intent = getIntent();
Bundle bundle = intent.getExtras();
......@@ -95,7 +96,7 @@ public class QueueResultActivity extends BaseActivity {
tvTableShop.setText(commitQueueEntity.getTable_specs());
tvTipOrder.setText(getString(R.string.hear_the_call) + commitQueueEntity.getOver_number() + getString(R.string.If_the_table_has_not_succeeded));
if (type!=2){
if (type != 2) {
switch (tablesNumber) {
case 0:
showQueueTip();
......@@ -127,16 +128,33 @@ public class QueueResultActivity extends BaseActivity {
tvYouQueue.setText(getString(R.string.please_queue_again));
llLayout.setVisibility(View.GONE);
ivStartImage.setImageResource(R.mipmap.ic_home_queuing);
if (DankalApplication.isDarkMode()){
LinearLayoutCompat linearLayoutCompat=findViewById(R.id.ll_top_layout);
if (DankalApplication.isDarkMode()) {
LinearLayoutCompat linearLayoutCompat = findViewById(R.id.ll_top_layout);
linearLayoutCompat.setBackground(getResources().getDrawable(R.mipmap.ic_line_background_pass));
}else {
} else {
llBackground.setBackground(getResources().getDrawable(R.mipmap.pic_home_queuing_bg_3));
}
break;
}
}
private void initView() {
tvQueueNumber = findViewById(R.id.tv_queue_number);
tvCount = findViewById(R.id.tv_count);
tvCountTime = findViewById(R.id.tv_count_time);
tvState = findViewById(R.id.tv_state);
ivStartImage = findViewById(R.id.iv_start_image);
llBackground = findViewById(R.id.ll_background);
btnCancel = findViewById(R.id.btn_cancel);
btnOrder = findViewById(R.id.btn_order);
tvTableShop = findViewById(R.id.tv_table_shop);
tvTipOrder = findViewById(R.id.tv_tip_order);
tvYouQueue = findViewById(R.id.tv_you_queue);
llLayout = findViewById(R.id.ll_layout);
findViewById(R.id.btn_cancel).setOnClickListener(this::onViewClicked);
findViewById(R.id.btn_order).setOnClickListener(this::onViewClicked);
}
//显示排队提醒弹出窗口
private void showQueueTip() {
showDialogStateTow(getString(R.string.queuing_reminders), getString(R.string.we_are_waiting_for_you));
......@@ -148,10 +166,9 @@ public class QueueResultActivity extends BaseActivity {
ButterKnife.bind(this);
}
@OnClick({R.id.btn_cancel, R.id.btn_order})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.btn_cancel:
if (view.getId()==R.id.btn_cancel){
if (type == 1) {//取消排队
showDialog("", getString(R.string.whether_to_cancel_the_queue), type -> {
if (commitQueueEntity != null) {
......@@ -167,8 +184,7 @@ public class QueueResultActivity extends BaseActivity {
} else {//返回首页
startActivity(new Intent(QueueResultActivity.this, HomeActivity.class));
}
break;
case R.id.btn_order:
}else if (view.getId()==R.id.btn_order){
if (type == 2) {//重新排队
Intent intent = new Intent(QueueResultActivity.this, QueueActivity.class);
if (commitQueueEntity != null) {
......@@ -182,7 +198,6 @@ public class QueueResultActivity extends BaseActivity {
showDialog(getString(R.string.waiting_before_ordering));
}
}
break;
}
}
......
......@@ -37,17 +37,14 @@ import cn.dankal.client.R;
public class ShopFragment extends BaseFragment {
@BindView(R.id.sliding_tabs)
SlidingTabLayout slidingTabs;
@BindView(R.id.vp_shop_pager)
ViewPager vpShopPager;
Unbinder unbinder;
@BindView(R.id.tv_state_bar)
TextView tvStateBar;
SmartRefreshLayout refreshLayout;
private List<Fragment> dataList;
private List<String> titles;
@BindView(R.id.refreshLayout)
SmartRefreshLayout refreshLayout;
private FragmentAdapter adapter;
......@@ -58,6 +55,7 @@ public class ShopFragment extends BaseFragment {
@Override
protected void initComponents() {
initView();
dataList = new ArrayList<>();
titles = new ArrayList<>();
adapter = new FragmentAdapter(getFragmentManager(), dataList, titles);
......@@ -78,6 +76,16 @@ public class ShopFragment extends BaseFragment {
refreshLayout.autoRefresh();
}
private void initView() {
slidingTabs = mContentView.findViewById(R.id.sliding_tabs);
vpShopPager = mContentView.findViewById(R.id.vp_shop_pager);
tvStateBar = mContentView.findViewById(R.id.tv_state_bar);
refreshLayout = mContentView.findViewById(R.id.refreshLayout);
mContentView.findViewById(R.id.iv_mall_search).setOnClickListener(this::onViewClicked);
}
private void requestData() {
MallServiceFactory.getHomeTopList(1, 20).subscribe(new AbstractDialogSubscriber<MallTopDataEntity>(this) {
@Override
......@@ -127,8 +135,7 @@ public class ShopFragment extends BaseFragment {
return new ShopFragment();
}
@OnClick(R.id.iv_mall_search)
public void onViewClicked() {
public void onViewClicked(View view) {
startActivity(new Intent(getActivity(), MallSearchActivity.class));
}
......
......@@ -41,7 +41,6 @@ import io.reactivex.disposables.Disposable;
public class ShopItemFragment extends BaseFragment {
@BindView(R.id.rv_shop_recycler_view)
RecyclerView rvShopRecyclerView;
private ShopAdapter shopAdapter;
private DkBannerTow<String> mDkBanner;
......@@ -59,7 +58,7 @@ public class ShopItemFragment extends BaseFragment {
@Override
protected void initComponents() {
rvShopRecyclerView = mContentView.findViewById(R.id.rv_shop_recycler_view);
homeTypeUUid = getArguments().getString("type");
bannerListBeans = (List<MallTopDataEntity.BannerListBean>) getArguments().getSerializable("banner");
......@@ -190,13 +189,13 @@ public class ShopItemFragment extends BaseFragment {
public class BannerItemView implements VH<String> {
@BindView(R.id.iv_img)
ImageView mIvImg;
@Override
public View createView(LayoutInflater inflater, ViewGroup container) {
View inflate = inflater.inflate(R.layout.banner_item, container, false);
ButterKnife.bind(this, inflate);
mIvImg = inflate.findViewById(R.id.iv_img);
return inflate;
}
......
......@@ -284,7 +284,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_9"
android:layout_marginRight="@dimen/dp_9"
android:background="@color/white"
android:background="@color/color_232323"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_18"
android:paddingTop="@dimen/dp_15"
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_191919"
tools:context="cn.dankal.client.ui.home.details.ResultPageActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:background="@color/color_232323"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_24"
android:src="@mipmap/ic_successful" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_19"
android:text="@string/successful_payment"
android:textColor="@color/color_a6a6a6"
android:textSize="@dimen/sp_18" />
<TextView
android:id="@+id/tv_get_stamp_tip"
android:layout_width="@dimen/dp_235"
android:layout_height="wrap_content"
android:gravity="center"
android:text="获得邮票数:0枚,集齐一定数量即可 抵扣商品哦!"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_15"
android:visibility="gone" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:layout_marginBottom="@dimen/dp_57"
android:text="@string/we_will_serve_you_as_soon_as_possible"
android:textColor="@color/color_a6a6a6" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:background="@color/color_232323"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginTop="@dimen/dp_13"
android:layout_marginBottom="@dimen/dp_21"
android:text="@string/currently_ordered"
android:textColor="@color/color_a6a6a6" />
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginRight="@dimen/dp_18"
android:background="@color/color_3d3d3d" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_order_result"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_18"
android:layout_marginBottom="@dimen/dp_20"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/total_price"
android:textColor="@color/color_a6a6a6"
android:textSize="@dimen/sp_14" />
<TextView
android:id="@+id/tv_shop_total_price"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:textColor="@color/color_d3d3d3"
android:textSize="@dimen/sp_16" />
</LinearLayout>
</LinearLayout>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_36"
android:layout_marginBottom="@dimen/dp_50">
<Button
android:id="@+id/btn_see_order"
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_34"
android:layout_marginLeft="@dimen/dp_30"
android:background="@drawable/bg_button_red_night"
android:text="@string/view_orders"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/btn_evaluate"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btn_evaluate"
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_34"
android:background="@drawable/bg_button_red_night"
android:text="@string/evaluate"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/btn_see_order"
app:layout_constraintRight_toLeftOf="@id/btn_order"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btn_order"
style="@style/ButtonText"
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_34"
android:layout_marginRight="@dimen/dp_30"
android:text="@string/continue_ordering"
android:textColor="@color/color_171717"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/btn_evaluate"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
......@@ -80,6 +80,7 @@
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
......
......@@ -33,7 +33,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_marginTop="@dimen/dp_12"
android:background="@color/line_one"
android:background="@color/color_3d3d3d"
app:layout_constraintTop_toBottomOf="@id/tv_dialog_title" />
<android.support.v7.widget.LinearLayoutCompat
......@@ -59,7 +59,7 @@
android:layout_marginRight="@dimen/dp_21"
android:background="@drawable/bg_dialog_btn_one_night"
android:text="@string/commit"
android:textColor="@color/white" />
android:textColor="@color/color_171717" />
</android.support.v7.widget.LinearLayoutCompat>
......
......@@ -114,7 +114,7 @@
android:layout_height="@dimen/dp_50"
android:background="@color/btn_bg"
android:text="@string/reserved_queue"
android:textColor="@color/white"
android:textColor="@color/color_171717"
android:textSize="@dimen/sp_20"
android:visibility="gone" />
......
......@@ -528,8 +528,6 @@
<string name="srl_footer_failed">Load failed</string>
<string name="srl_footer_nothing">No more data</string>
<string name="srl_content_empty">SmartRefreshLayout The content view was not found,Did you forget to add it to the XML layout file?</string>
<string name="srl_component_falsify" formatted="false">%s False area\nRepresents the height of the drag at runtime【%.1fdp】 \nIt doesn't show anything</string>
<string name="picture_camera_roll">CameraRoll</string>
<string name="picture_cancel">Cancel</string>
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionMenuTextColor">@color/colorAccent</item>
<item name="android:actionMenuTextColor">@color/colorAccent</item>
<item name="android:textAllCaps">false</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowBackground">@color/colorFF</item>
</style>
<style name="MainTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionMenuTextColor">@color/colorAccent</item>
<item name="android:actionMenuTextColor">@color/colorAccent</item>
<item name="android:textAllCaps">false</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowBackground">@color/colorFF</item>
<item name="android:windowTranslucentStatus">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="ButtonText">
<item name="android:shadowColor">#a1ff6b5c</item>
<item name="android:shadowDx">0</item>
<item name="android:shadowDy">1</item>
<item name="android:background">@drawable/bg_button_select_language</item>
</style>
<style name="translucent">
<item name="android:windowBackground">@color/translucent_background</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
</style>
</resources>
\ No newline at end of file
......@@ -28,7 +28,7 @@
<declare-styleable name="TabSegment">
<attr name="tab_indicator_height" format="dimension" />
<attr name="tab_has_indicator" format="boolean" />
<attr name="android:textSize" />
<!--<attr name="android:textSize" />-->
<attr name="tab_indicator_top" format="boolean" />
<attr name="tab_mode" format="enum">
<enum name="scrollable" value="0" />
......
......@@ -289,11 +289,24 @@
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<!-- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
&lt;!&ndash; Customize your theme here. &ndash;&gt;
<item name="colorPrimary">@color/bar_grey</item>
<item name="colorPrimaryDark">@color/bar_grey</item>
<item name="colorAccent">@color/bar_grey</item>
</style>-->
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionMenuTextColor">@color/colorAccent</item>
<item name="android:actionMenuTextColor">@color/colorAccent</item>
<item name="android:textAllCaps">false</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowBackground">@color/colorFF</item>
</style>
<style name="picture_alert_dialog" parent="android:Theme.Dialog">
......@@ -379,4 +392,21 @@
<!--相册文件夹列表选中图标-->
<item name="picture.folder_checked_dot">@drawable/orange_oval</item>
</style>
<style name="MainTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionMenuTextColor">@color/colorAccent</item>
<item name="android:actionMenuTextColor">@color/colorAccent</item>
<item name="android:textAllCaps">false</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowBackground">@color/colorFF</item>
<item name="android:windowTranslucentStatus">false</item>
</style>
</resources>
......@@ -8,7 +8,6 @@ buildscript {
jcenter()
}
dependencies {
classpath deps.butterknife.butterknife_gradle_plugin
classpath 'com.android.tools.build:gradle:3.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
......
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