Преглед изворни кода

2024-1-29 代码备份
1、首页秒杀、秒杀页面已完成
2、商城(原大仓)页面改版完成

zhangbing пре 2 година
родитељ
комит
73c7f94383

+ 0 - 17
.idea/deploymentTargetDropDown.xml

@@ -1,17 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="deploymentTargetDropDown">
4
-    <runningDeviceTargetSelectedWithDropDown>
5
-      <Target>
6
-        <type value="RUNNING_DEVICE_TARGET" />
7
-        <deviceKey>
8
-          <Key>
9
-            <type value="SERIAL_NUMBER" />
10
-            <value value="192.168.56.103:5555" />
11
-          </Key>
12
-        </deviceKey>
13
-      </Target>
14
-    </runningDeviceTargetSelectedWithDropDown>
15
-    <timeTargetWasSelectedWithDropDown value="2024-01-29T06:30:08.135441500Z" />
16
-  </component>
17
-</project>

+ 21 - 127
app/src/main/java/com/yihucha/hbyhc/presentation/big_storehouse/BigWarehouseFragment.java

@@ -93,25 +93,7 @@ public class BigWarehouseFragment extends BaseFragment implements View.OnClickLi
93 93
     }
94 94
 
95 95
     private void initData() {
96
-        //轮播图
97
-        bigWarehouseViewModel.getBannerData();
98
-        bigWarehouseViewModel.bannerData.observe(getActivity(), new Observer<DataResponse<List<BannerDataBean>>>() {
99
-            @Override
100
-            public void onChanged(DataResponse<List<BannerDataBean>> listDataResponse) {
101
-                LogUtil.LogInfo("listDataResponse", JSON.toJSONString(listDataResponse));
102
-                GlideUtils.loadImage(getActivity(), listDataResponse.getData().get(0).getPic(), binding.ivBanner);
103
-            }
104
-        });
105 96
         //金刚区
106
-//        bigWarehouseViewModel.getKingKongArea();
107
-//        bigWarehouseViewModel.mDcHomeMerchantList.observe(getActivity(), new Observer<List<DcHomeMerchantBean>>() {
108
-//            @Override
109
-//            public void onChanged(List<DcHomeMerchantBean> dcHomeMerchantBeans) {
110
-//                mDcHomeMerchantBean.addAll(dcHomeMerchantBeans);
111
-//                LogUtil.LogInfo("mDcHomeMerchantBean", JSON.toJSONString(mDcHomeMerchantBean));
112
-//                mDcKingKongAreaAdapter.replaceData(mDcHomeMerchantBean);
113
-//            }
114
-//        });
115 97
         mClassifyBean = new DCItemListClassificationBean();
116 98
         mClassifyBean.setCate_name("全部");
117 99
         mClassifyBean.setStore_category_id("");
@@ -171,18 +153,10 @@ public class BigWarehouseFragment extends BaseFragment implements View.OnClickLi
171 153
 //                mDcProductBean.addAll(dcProductBeans);
172 154
                 if (mDcProductBean == null || mDcProductBean.size() == 0) {
173 155
                     binding.noSearch.llNotFound.setVisibility(View.VISIBLE);
174
-                    binding.ivBanner.setVisibility(View.GONE);
175
-//                    binding.tvScrollTop.setVisibility(View.VISIBLE);
176 156
                     //上划之后的效果
177
-                    binding.viewHeaderBg.setBackgroundResource(R.color.red_fd214c);
178
-                    binding.llTop.setBackgroundResource(R.color.red_fd214c);
179 157
                     return;
180 158
                 } else {
181 159
                     binding.noSearch.llNotFound.setVisibility(View.GONE);
182
-                    binding.ivBanner.setVisibility(View.VISIBLE);
183
-                    binding.viewHeaderBg.setBackgroundResource(R.color.translate);
184
-                    binding.llTop.setBackgroundResource(R.color.translate);
185
-//                    binding.tvScrollTop.setVisibility(View.GONE);
186 160
                 }
187 161
                 mDcProductAdapter.replaceData(mDcProductBean);
188 162
                 int currentPos = itemPos.get(classify) == null ? 0 : itemPos.get(classify);
@@ -191,77 +165,44 @@ public class BigWarehouseFragment extends BaseFragment implements View.OnClickLi
191 165
         });
192 166
         binding.rvRecommendedList.setVisibility(View.VISIBLE);
193 167
         binding.rvProductList.setVisibility(View.GONE);
194
-        //大仓推荐
195
-//        bigWarehouseViewModel.recommendList();
196
-//        bigWarehouseViewModel.mRecommendListData.observe(getActivity(), new Observer<List<RecommendListBean>>() {
197
-//            @Override
198
-//            public void onChanged(List<RecommendListBean> recommendListBeans) {
199
-//                mRecommendListBean.addAll(recommendListBeans);
200
-//                mRecommendListAdapter.replaceData(mRecommendListBean);
201
-//            }
202
-//        });
203 168
     }
204 169
 
205 170
     private void initClick() {
206 171
         //商品点击
207
-        mDcProductAdapter.setOnClickListener(new DcProductAdapter.OnClickListener() {
208
-            @Override
209
-            public void onItemClick(int position) {
210
-                ProductDetailsActivity.launch(getActivity(), mDcProductBean.get(position).getProduct_id());
211
-            }
212
-        });
172
+        mDcProductAdapter.setOnClickListener(position ->
173
+                ProductDetailsActivity.launch(getActivity(), mDcProductBean.get(position).getProduct_id()));
213 174
         //大仓分类点击
214
-        mDCItemListClassificationAdapter.setOnClickListener(new DCItemListClassificationAdapter.OnClickListener() {
215
-            @Override
216
-            public void onItemClick(int position) {
217
-                for (int i = 0; i < mDCItemListClassificationBean.size(); i++) {
218
-                    mDCItemListClassificationBean.get(i).setClick(false);
219
-                }
220
-                MainActivity.storeCategoryId = mDCItemListClassificationBean.get(position).getStore_category_id();
221
-                mDCItemListClassificationBean.get(position).setClick(true);
222
-                mDCItemListClassificationAdapter.notifyDataSetChanged();
223
-                classify = mDCItemListClassificationBean.get(position).getStore_category_id();
224
-//                if (TextUtils.isEmpty(classify)) {
225
-//                    //大仓推荐
226
-//                    binding.rvProductList.setVisibility(View.GONE);
227
-//                    binding.rvRecommendedList.setVisibility(View.VISIBLE);
228
-////                    mPage = 1;
229
-//                    mRecommendListBean.clear();
230
-//                    bigWarehouseViewModel.recommendList();
231
-//
232
-//                } else {
233
-                binding.rvProductList.setVisibility(View.VISIBLE);
234
-                binding.rvRecommendedList.setVisibility(View.GONE);
235
-//                mPage = 1;
236
-                int loadPage=1;
237
-                Integer mpage = page.get(classify);
238
-                if (mpage != null) {
239
-                    mPage = mpage;
240
-                }else {
241
-                    mPage = loadPage;
242
-                }
243
-                mDcProductBean.clear();
244
-                bigWarehouseViewModel.getDaCangProductList(loadPage, classify,mPage*10);
245
-                //   }
175
+        mDCItemListClassificationAdapter.setOnClickListener(position -> {
176
+            for (int i = 0; i < mDCItemListClassificationBean.size(); i++) {
177
+                mDCItemListClassificationBean.get(i).setClick(false);
178
+            }
179
+            MainActivity.storeCategoryId = mDCItemListClassificationBean.get(position).getStore_category_id();
180
+            mDCItemListClassificationBean.get(position).setClick(true);
181
+            mDCItemListClassificationAdapter.notifyDataSetChanged();
182
+            classify = mDCItemListClassificationBean.get(position).getStore_category_id();
183
+            binding.rvProductList.setVisibility(View.VISIBLE);
184
+            binding.rvRecommendedList.setVisibility(View.GONE);
185
+            int loadPage=1;
186
+            Integer mpage = page.get(classify);
187
+            if (mpage != null) {
188
+                mPage = mpage;
189
+            }else {
190
+                mPage = loadPage;
246 191
             }
192
+            mDcProductBean.clear();
193
+            bigWarehouseViewModel.getDaCangProductList(loadPage, classify,mPage*10);
194
+            //   }
247 195
         });
248 196
 
249
-        binding.ivSeckill.setOnClickListener(this);
250
-        binding.ivBanner.setOnClickListener(this);
251 197
         binding.llSearch.setOnClickListener(this);
252 198
         binding.tvScrollTop.setOnClickListener(this);
253 199
     }
254
-
255
-    //    private int previousScrollY = 0;
256 200
     private void initView() {
257 201
         binding.scrollview.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
258 202
             @Override
259 203
             public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
260
-//                LogUtil.LogInfo("fjy", "222");
261 204
                 showHeaderAlphaAction(scrollY);
262 205
                 itemPos.put(classify, v.getScrollY());
263
-//                System.out.println(classify +" aaaaaa ---->"+v.getScrollY());
264
-
265 206
             }
266 207
         });
267 208
 
@@ -275,28 +216,15 @@ public class BigWarehouseFragment extends BaseFragment implements View.OnClickLi
275 216
         //大仓商品
276 217
         GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), 2);
277 218
         binding.rvProductList.setLayoutManager(gridLayoutManager);
278
-//        binding.rvProductList.addItemDecoration(new GridSpacingItemDecoration(2, 50, false));
279 219
         //建立适配器
280 220
         mDcProductAdapter = new DcProductAdapter(R.layout.item_dacang_productlist, mDcProductBean, getActivity());
281 221
         //给RecyclerView设置适配器
282 222
         binding.rvProductList.setAdapter(mDcProductAdapter);
283 223
 
284
-        //大仓推荐
285
-//        LinearLayoutManager linearLayoutManager1 = new LinearLayoutManager(getActivity());
286
-//        binding.rvRecommendedList.setLayoutManager(linearLayoutManager1);
287
-////        binding.rvProductList.addItemDecoration(new GridSpacingItemDecoration(2, 50, false));
288
-//        //建立适配器
289
-//        mRecommendListAdapter = new DcRecommendListAdapter(R.layout.item_dc_recommended_date, mRecommendListBean, getActivity());
290
-//        //给RecyclerView设置适配器
291
-//        binding.rvRecommendedList.setAdapter(mRecommendListAdapter);
292
-
293
-
294 224
         binding.refreshLayout.setAutoLoadMore(true);
295 225
 
296 226
         binding.refreshLayout.setOverScrollRefreshShow(false);
297 227
 
298
-//        binding.refreshLayout.setEnableLoadmore(false);
299
-
300 228
         binding.refreshLayout.setOnRefreshListener(new RefreshListenerAdapter() {
301 229
             @Override
302 230
             public void onPullingDown(TwinklingRefreshLayout refreshLayout, float fraction) {
@@ -348,23 +276,6 @@ public class BigWarehouseFragment extends BaseFragment implements View.OnClickLi
348 276
                 LogUtil.LogInfo("qmzzzzz", "正在加载更多");
349 277
             }
350 278
         });
351
-        //刷新
352
-//        binding.refreshLayout.setOnRefreshListener(new RefreshListenerAdapter() {
353
-//            @Override
354
-//            public void onLoadMore(final TwinklingRefreshLayout refreshLayout) {
355
-//                new Handler().postDelayed(new Runnable() {
356
-//                    @Override
357
-//                    public void run() {
358
-////                        if (!TextUtils.isEmpty(classify)) {
359
-//                        //加载
360
-//                        mPage++;
361
-//                        bigWarehouseViewModel.getDaCangProductList(mPage, classify);
362
-////                        }
363
-//                        refreshLayout.finishLoadmore();
364
-//                    }
365
-//                }, 250);
366
-//            }
367
-//        });
368 279
     }
369 280
 
370 281
     /**
@@ -376,15 +287,9 @@ public class BigWarehouseFragment extends BaseFragment implements View.OnClickLi
376 287
         final int rootPicHeight = binding.viewTop.getHeight();
377 288
 
378 289
         if (y <= rootPicHeight) {
379
-            binding.viewHeaderBg.setBackgroundResource(R.color.translate);
380
-            binding.llTop.setBackgroundResource(R.color.translate);
381 290
             binding.tvScrollTop.setVisibility(View.GONE);
382 291
         } else {
383 292
             binding.tvScrollTop.setVisibility(View.VISIBLE);
384
-            //上划之后的效果
385
-            binding.viewHeaderBg.setBackgroundResource(R.color.red_fd214c);
386
-            binding.llTop.setBackgroundResource(R.color.red_fd214c);
387
-
388 293
         }
389 294
     }
390 295
 
@@ -394,17 +299,6 @@ public class BigWarehouseFragment extends BaseFragment implements View.OnClickLi
394 299
             binding.scrollview.scrollTo(0, 0);
395 300
 //            binding.rvProductList.scrollToPosition(0);
396 301
 //            binding.rvRecommendedList.scrollToPosition(0);
397
-        } else if (view == binding.ivSeckill) {
398
-            if (LoginUtils.isLogin(getActivity())) {
399
-                //限时秒杀
400
-                DacangSeckillActivity.launch(getActivity());
401
-            }
402
-        } else if (view == binding.ivBanner) {
403
-            if (LoginUtils.isLogin(getActivity())) {
404
-                //大仓会员购买
405
-                AGuestMemberActivity.launch(getActivity());
406
-//                DcMemberActivity.launch(getActivity());
407
-            }
408 302
         } else if (view == binding.llSearch) {
409 303
             //搜索
410 304
             if (ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_COARSE_LOCATION)

+ 51 - 4
app/src/main/java/com/yihucha/hbyhc/presentation/big_storehouse/DacangSeckillActivity.java

@@ -4,6 +4,7 @@ import android.content.Context;
4 4
 import android.content.Intent;
5 5
 import android.graphics.Color;
6 6
 import android.os.Bundle;
7
+import android.os.CountDownTimer;
7 8
 import android.view.View;
8 9
 import android.widget.RelativeLayout;
9 10
 
@@ -21,8 +22,11 @@ import com.yihucha.hbyhc.presentation.big_storehouse.adapter.DcSecondsKillProduc
21 22
 import com.yihucha.hbyhc.presentation.big_storehouse.model.DcSeckillBean;
22 23
 import com.yihucha.hbyhc.presentation.big_storehouse.view_model.BigWarehouseViewModel;
23 24
 import com.yihucha.hbyhc.presentation.product.ProductDetailsActivity;
25
+import com.yihucha.hbyhc.utils.EmptyCheckUtils;
24 26
 import com.yihucha.hbyhc.utils.ImmersedStatusbarUtils;
25 27
 import com.yihucha.hbyhc.utils.LogUtil;
28
+import com.yihucha.hbyhc.utils.StringsUtil;
29
+import com.yihucha.hbyhc.utils.TimeUtils;
26 30
 
27 31
 import java.util.ArrayList;
28 32
 import java.util.List;
@@ -77,6 +81,14 @@ public class DacangSeckillActivity extends BaseActivity implements View.OnClickL
77 81
 
78 82
                     LogUtil.LogInfo("mDcSeckillBean", JSON.toJSONString(mDcSeckillBean));
79 83
                     mDcSeckillDateAdapter.replaceData(mDcSeckillBean);
84
+                    boolean hasStart = false;
85
+                    for (DcSeckillBean dcSeckillBean : mDcSeckillBean) {
86
+                        if (dcSeckillBean.getStatus() == 1) {
87
+                            hasStart = true;
88
+                            setMsNotice(dcSeckillBean.getSeckill_date());
89
+                        }
90
+                    }
91
+                    if (!hasStart) setMsNotice(null);
80 92
                     mProduct_data.clear();
81 93
                     mProduct_data.addAll(mDcSeckillBean.get(0).getProduct_data());
82 94
                     if (mProduct_data == null || mProduct_data.size() == 0) {
@@ -128,13 +140,12 @@ public class DacangSeckillActivity extends BaseActivity implements View.OnClickL
128 140
         mDcSeckillDateAdapter = new DcSeckillDateAdapter(R.layout.item_seckill, mDcSeckillBean, context);
129 141
         //给RecyclerView设置适配器
130 142
         mViewBinding.rvSeckillDate.setAdapter(mDcSeckillDateAdapter);
131
-        mDcSeckillDateAdapter.setclickPosition(0);
132 143
 
133 144
         LinearLayoutManager linearLayoutManager1 = new LinearLayoutManager(context);
134 145
         linearLayoutManager1.setOrientation(LinearLayoutManager.VERTICAL);
135 146
         mViewBinding.rvSeckillProductList.setLayoutManager(linearLayoutManager1);
136 147
         DividerItemDecoration itemDecoration = new DividerItemDecoration(this, LinearLayoutManager.VERTICAL);
137
-        itemDecoration.setDrawable(getDrawable(R.drawable.shape_divider_recycleview));
148
+//        itemDecoration.setDrawable(getDrawable(R.drawable.shape_divider_recycleview));
138 149
         mViewBinding.rvSeckillProductList.addItemDecoration(itemDecoration);
139 150
         mDcSecondsKillProductsAdapter = new DcSecondsKillProductsAdapter(R.layout.item_seconds_kill_products, mProduct_data, context);
140 151
         //给RecyclerView设置适配器
@@ -142,6 +153,42 @@ public class DacangSeckillActivity extends BaseActivity implements View.OnClickL
142 153
 
143 154
     }
144 155
 
156
+    private CountDownTimer timer;
157
+
158
+    private void setMsNotice(String time) {
159
+        if (EmptyCheckUtils.isNotEmpty(time)) {
160
+            mViewBinding.layoutTime.setVisibility(View.VISIBLE);
161
+            mViewBinding.tvNotice1.setVisibility(View.VISIBLE);
162
+            mViewBinding.tvNotice.setText("距本场结束");
163
+            if (TimeUtils.init(time)) {
164
+                long timeLong = TimeUtils.getTimeLong();
165
+                timer = new CountDownTimer(timeLong, 1000) {
166
+                    @Override
167
+                    public void onTick(long l) {
168
+                        long timeHour = StringsUtil.getHour(l);
169
+                        mViewBinding.tvHours.setText(timeHour >= 10 ? timeHour + "" : "0" + timeHour);
170
+                        long timeMinute = StringsUtil.getMinute(l);
171
+                        mViewBinding.tvMinute.setText(timeMinute >= 10 ? timeMinute + "" : "0" + timeMinute);
172
+                        long timeSecond = StringsUtil.getSecond(l);
173
+                        mViewBinding.tvSencond.setText(timeSecond >= 10 ? timeSecond + "" : "0" + timeSecond);
174
+                    }
175
+
176
+                    @Override
177
+                    public void onFinish() {
178
+                        timer.cancel();
179
+                        //重新加载秒杀数据
180
+                        mBigWarehouseViewModel.getDcSeckill();
181
+                    }
182
+                };
183
+                timer.start();
184
+            }
185
+        } else {
186
+            mViewBinding.layoutTime.setVisibility(View.INVISIBLE);
187
+            mViewBinding.tvNotice1.setVisibility(View.INVISIBLE);
188
+            mViewBinding.tvNotice.setText("秒杀即将开始,请耐心等待~");
189
+        }
190
+    }
191
+
145 192
     @Override
146 193
     public void onClick(View v) {
147 194
         if (v == mViewBinding.imgvBack) {
@@ -152,8 +199,8 @@ public class DacangSeckillActivity extends BaseActivity implements View.OnClickL
152 199
     @Override
153 200
     protected void onDestroy() {
154 201
         super.onDestroy();
155
-        if (mDcSeckillDateAdapter != null) {
156
-            mDcSeckillDateAdapter.onDestory();
202
+        if (EmptyCheckUtils.isNotEmpty(timer)) {
203
+            timer.cancel();
157 204
         }
158 205
     }
159 206
 

+ 4 - 6
app/src/main/java/com/yihucha/hbyhc/presentation/big_storehouse/adapter/DCItemListClassificationAdapter.java

@@ -1,5 +1,6 @@
1 1
 package com.yihucha.hbyhc.presentation.big_storehouse.adapter;
2 2
 
3
+import android.graphics.Color;
3 4
 import android.view.View;
4 5
 import android.widget.LinearLayout;
5 6
 
@@ -29,16 +30,13 @@ public class DCItemListClassificationAdapter extends BaseQuickAdapter<DCItemList
29 30
         View viewLine=helper.getView(R.id.view_line);
30 31
         if (item.isClick()){
31 32
             viewLine.setVisibility(View.VISIBLE);
33
+            helper.setTextColor(R.id.tv_name, Color.parseColor("#fe0032"));
32 34
         }else {
33 35
             viewLine.setVisibility(View.INVISIBLE);
36
+            helper.setTextColor(R.id.tv_name, Color.parseColor("#333333"));
34 37
         }
35 38
         LinearLayout llRoot=helper.getView(R.id.ll_root);
36
-        llRoot.setOnClickListener(new View.OnClickListener() {
37
-            @Override
38
-            public void onClick(View view) {
39
-                mClickListener.onItemClick(helper.getLayoutPosition());
40
-            }
41
-        });
39
+        llRoot.setOnClickListener(view -> mClickListener.onItemClick(helper.getLayoutPosition()));
42 40
     }
43 41
     //点击回调
44 42
     public interface OnClickListener {

+ 23 - 135
app/src/main/java/com/yihucha/hbyhc/presentation/big_storehouse/adapter/DcSeckillDateAdapter.java

@@ -31,144 +31,37 @@ import java.util.List;
31 31
 public class DcSeckillDateAdapter extends RecyclerView.Adapter<DcSeckillDateAdapter.ItemHolder> {
32 32
     private OnClickListener mClickListener;
33 33
     private List<DcSeckillBean> data;
34
-    private int position;
34
+    private int position = 0;
35 35
     private Context context;
36
-    private CountDownTimer timer;
37 36
 
38 37
     public DcSeckillDateAdapter(int layoutResId, @Nullable List<DcSeckillBean> data, Context context) {
39 38
         this.context = context;
40 39
         this.data = data;
41 40
     }
42 41
 
43
-    public void setclickPosition(int position) {
44
-        this.position = position;
45
-        if (timer != null) {
46
-            timer.cancel();
47
-        }
48
-    }
49
-
50
-    protected void convert(DcSeckillDateAdapter.ItemHolder helper, DcSeckillBean item,int pos) {
42
+    protected void convert(DcSeckillDateAdapter.ItemHolder helper, DcSeckillBean item, int pos) {
51 43
         String date = item.getSeckill_date();
52 44
         date = date.replace("即将开始","").replace("抢购中","");
53 45
         helper.binding.tvSeckillDate.setText(date);
54
-
55 46
         helper.binding.bgItem.setOnClickListener(view -> {
56 47
             mClickListener.onItemClick(helper.getLayoutPosition());
57
-            setclickPosition(helper.getLayoutPosition());
48
+            this.position = pos;
58 49
             notifyDataSetChanged();
59 50
         });
60
-        helper.binding.tvSeckillDate.setTextColor(ContextCompat.getColor(context, R.color.black_333333));
51
+
52
+        if (item.getStatus() == 1) {
53
+            helper.binding.tvNotice.setText("抢购中");
54
+        } else if (item.getStatus() == 2) {
55
+            helper.binding.tvNotice.setText("即将开枪");
56
+        } else {
57
+            helper.binding.tvNotice.setText("已结束");
58
+        }
61 59
         if (position == pos) {
62
-            helper.binding.tvSeckillDate.setTextColor(ContextCompat.getColor(context, R.color.red_fe0032));
63
-//            imgvBg.setVisibility(View.VISIBLE);
64
-            helper.binding.bgItem.setBackgroundResource(R.mipmap.img_miaosha_item_checked);
65
-            if (item.getStatus() == 1){
66
-                helper.binding.layoutTime.setVisibility(View.VISIBLE);
67
-                helper.binding.tvNotice.setVisibility(View.GONE);
68
-                //字体颜色
69
-                helper.binding.tvHours.setTextColor(Color.WHITE);
70
-                helper.binding.tvMinute.setTextColor(Color.WHITE);
71
-                helper.binding.tvSencond.setTextColor(Color.WHITE);
72
-                helper.binding.tvMaohao1.setTextColor(Color.parseColor("#333333"));
73
-                helper.binding.tvMaohao2.setTextColor(Color.parseColor("#333333"));
74
-                //背景颜色
75
-                helper.binding.tvHours.setBackgroundResource(R.drawable.shape_black_2dp);
76
-                helper.binding.tvMinute.setBackgroundResource(R.drawable.shape_black_2dp);
77
-                helper.binding.tvSencond.setBackgroundResource(R.drawable.shape_black_2dp);
78
-/*                helper.binding.tvHours.setBackgroundColor(Color.parseColor("#333333"));
79
-                helper.binding.tvMinute.setBackgroundColor(Color.parseColor("#333333"));
80
-                helper.binding.tvSencond.setBackgroundColor(Color.parseColor("#333333"));*/
81
-
82
-                if (TimeUtils.init(date)) {
83
-                    long timeLong = TimeUtils.getTimeLong();
84
-                    timer = new CountDownTimer(timeLong, 1000) {
85
-                        @Override
86
-                        public void onTick(long l) {
87
-                            long timeHour = StringsUtil.getHour(l);
88
-                            helper.binding.tvHours.setText(timeHour>=10?timeHour+"":"0"+timeHour);
89
-                            long timeMinute = StringsUtil.getMinute(l);
90
-                            helper.binding.tvMinute.setText(timeMinute>=10?timeMinute+"":"0"+timeMinute);
91
-                            long timeSecond = StringsUtil.getSecond(l);
92
-                            helper.binding.tvSencond.setText(timeSecond>=10?timeSecond+"":"0"+timeSecond);
93
-                        }
94
-                        @Override
95
-                        public void onFinish() {
96
-                            timer.cancel();
97
-                            //重新加载秒杀数据
98
-                            helper.binding.layoutTime.setVisibility(View.GONE);
99
-                            helper.binding.tvNotice.setVisibility(View.VISIBLE);
100
-                            helper.binding.tvNotice.setTextColor(Color.parseColor("#fe0032"));
101
-                            helper.binding.tvNotice.setText("已结束");
102
-                        }
103
-                    };
104
-                    timer.start();
105
-                }
106
-
107
-            }else if (item.getStatus() == 2){
108
-                helper.binding.layoutTime.setVisibility(View.GONE);
109
-                helper.binding.tvNotice.setVisibility(View.VISIBLE);
110
-                helper.binding.tvNotice.setTextColor(Color.parseColor("#fe0032"));
111
-                helper.binding.tvNotice.setText("即将开枪");
112
-            }else {
113
-                helper.binding.layoutTime.setVisibility(View.GONE);
114
-                helper.binding.tvNotice.setVisibility(View.VISIBLE);
115
-                helper.binding.tvNotice.setTextColor(Color.parseColor("#fe0032"));
116
-                helper.binding.tvNotice.setText("已结束");
117
-            }
118
-        }else {
119
-            helper.binding.tvSeckillDate.setTextColor(ContextCompat.getColor(context, R.color.white));
120
-            helper.binding.bgItem.setBackground(null);
121
-//            imgvBg.setVisibility(View.GONE);
122
-            if (item.getStatus() == 1){
123
-                helper.binding.layoutTime.setVisibility(View.VISIBLE);
124
-                helper.binding.tvNotice.setVisibility(View.GONE);
125
-                //字体颜色
126
-                helper.binding.tvHours.setTextColor(Color.parseColor("#fe0032"));
127
-                helper.binding.tvMinute.setTextColor(Color.parseColor("#fe0032"));
128
-                helper.binding.tvSencond.setTextColor(Color.parseColor("#fe0032"));
129
-                helper.binding.tvMaohao1.setTextColor(Color.WHITE);
130
-                helper.binding.tvMaohao2.setTextColor(Color.WHITE);
131
-                //背景颜色
132
-                helper.binding.tvHours.setBackgroundResource(R.drawable.shape_white_2dp);
133
-                helper.binding.tvMinute.setBackgroundResource(R.drawable.shape_white_2dp);
134
-                helper.binding.tvSencond.setBackgroundResource(R.drawable.shape_white_2dp);
135
-
136
-                if (TimeUtils.init(date)) {
137
-                    long timeLong = TimeUtils.getTimeLong();
138
-                    timer = new CountDownTimer(timeLong, 1000) {
139
-                        @Override
140
-                        public void onTick(long l) {
141
-                            long timeHour = StringsUtil.getHour(l);
142
-                            helper.binding.tvHours.setText(timeHour>=10?timeHour+"":"0"+timeHour);
143
-                            long timeMinute = StringsUtil.getMinute(l);
144
-                            helper.binding.tvMinute.setText(timeMinute>=10?timeMinute+"":"0"+timeMinute);
145
-                            long timeSecond = StringsUtil.getSecond(l);
146
-                            helper.binding.tvSencond.setText(timeSecond>=10?timeSecond+"":"0"+timeSecond);
147
-                        }
148
-                        @Override
149
-                        public void onFinish() {
150
-                            timer.cancel();
151
-                            //重新加载秒杀数据
152
-                            helper.binding.layoutTime.setVisibility(View.GONE);
153
-                            helper.binding.tvNotice.setVisibility(View.VISIBLE);
154
-                            helper.binding.tvNotice.setTextColor(Color.parseColor("#fe0032"));
155
-                            helper.binding.tvNotice.setText("已结束");
156
-                        }
157
-                    };
158
-                    timer.start();
159
-                }
160
-
161
-            }else if (item.getStatus() == 2){
162
-                helper.binding.layoutTime.setVisibility(View.GONE);
163
-                helper.binding.tvNotice.setVisibility(View.VISIBLE);
164
-                helper.binding.tvNotice.setTextColor(Color.WHITE);
165
-                helper.binding.tvNotice.setText("即将开枪");
166
-            }else {
167
-                helper.binding.layoutTime.setVisibility(View.GONE);
168
-                helper.binding.tvNotice.setVisibility(View.VISIBLE);
169
-                helper.binding.tvNotice.setTextColor(Color.WHITE);
170
-                helper.binding.tvNotice.setText("已结束");
171
-            }
60
+            helper.binding.tvNotice.setTextColor(Color.parseColor("#fe0032"));
61
+            helper.binding.tvNotice.setBackgroundResource(R.drawable.shape_white_50dp);
62
+        } else {
63
+            helper.binding.tvNotice.setTextColor(Color.WHITE);
64
+            helper.binding.tvNotice.setBackground(null);
172 65
         }
173 66
     }
174 67
 
@@ -181,40 +74,35 @@ public class DcSeckillDateAdapter extends RecyclerView.Adapter<DcSeckillDateAdap
181 74
 
182 75
     @Override
183 76
     public void onBindViewHolder(@NonNull DcSeckillDateAdapter.ItemHolder holder, int position) {
184
-        convert(holder,data.get(position),position);
77
+        convert(holder, data.get(position), position);
185 78
     }
186 79
 
187 80
     @Override
188 81
     public int getItemCount() {
189
-        return data == null?0:data.size();
82
+        return data == null ? 0 : data.size();
190 83
     }
191 84
 
192 85
     public void replaceData(List<DcSeckillBean> data) {
193 86
         this.data = data;
194 87
         notifyDataSetChanged();
195
-        if (timer != null) {
196
-            timer.cancel();
197
-        }
198
-    }
199
-    public void onDestory(){
200
-        if (timer != null) {
201
-            timer.cancel();
202
-        }
203 88
     }
204
-    public class ItemHolder extends RecyclerView.ViewHolder{
89
+
90
+    public class ItemHolder extends RecyclerView.ViewHolder {
205 91
         public ItemSeckillBinding binding;
92
+
206 93
         public ItemHolder(@NonNull View itemView) {
207 94
             super(itemView);
208 95
             WindowManager windowManager = (WindowManager) itemView.getContext()
209 96
                     .getSystemService(Context.WINDOW_SERVICE);
210 97
             Display display = windowManager.getDefaultDisplay();
211 98
             ViewGroup.LayoutParams layoutParams = itemView.getLayoutParams();
212
-            layoutParams.width = display.getWidth()/3;
99
+            layoutParams.width = display.getWidth() / 3;
213 100
             layoutParams.height = DensityUtils.dip2px(60f);
214 101
             itemView.setLayoutParams(layoutParams);
215 102
             binding = ItemSeckillBinding.bind(itemView);
216 103
         }
217 104
     }
105
+
218 106
     //点击回调
219 107
     public interface OnClickListener {
220 108
         void onItemClick(int position);

+ 7 - 22
app/src/main/java/com/yihucha/hbyhc/presentation/big_storehouse/adapter/DcSecondsKillProductsAdapter.java

@@ -43,41 +43,26 @@ public class DcSecondsKillProductsAdapter extends BaseQuickAdapter<DcSeckillBean
43 43
         helper.setText(R.id.tv_store_name,item.getStore_name());
44 44
         helper.setText(R.id.tv_yanglaojin,"养老金¥"+item.getYanglao());
45 45
         helper.setText(R.id.tv_price,"¥"+item.getSeckill_price());
46
-        helper.setText(R.id.text_img,item.getImg_text());
47 46
         helper.setText(R.id.tv_lowestCouponPrice,"¥"+item.getOt_price());
48 47
         ImageView ivImg=helper.getView(R.id.riv_image);
49 48
         GlideUtils.loadImage(context,item.getImage(),ivImg);
50 49
 
51
-//        ImageView iv_img=helper.getView(R.id.iv_img);
52 50
         TextView iv_status=helper.getView(R.id.iv_status);
53 51
 
54 52
         if (status==1){
55
-//            iv_img.setImageResource(R.mipmap.qianggouzhong);
56
-            iv_status.setBackgroundResource(R.mipmap.mashangqiang);
53
+            iv_status.setBackgroundResource(R.mipmap.xianshiqiang);
57 54
             iv_status.setText("");
58 55
         }else if (status == 2){
59
-//            iv_img.setImageResource(R.mipmap.dacangmiaosha);
60
-            iv_status.setBackgroundResource(R.mipmap.jijiangkaiqiang);
61
-            iv_status.setText("");
56
+            iv_status.setBackgroundResource(R.drawable.shape_org_ms);
57
+            iv_status.setText("即将开始");
62 58
         }else {
63 59
             //已结束
64
-            iv_status.setBackgroundResource(R.mipmap.miaosha_yijieshu_220908);
65
-            iv_status.setText("");
66
-
60
+            iv_status.setBackgroundResource(R.drawable.shape_org_ms);
61
+            iv_status.setText("即将开始");
67 62
         }
68 63
         RelativeLayout llRoot=helper.getView(R.id.ll_root);
69
-        llRoot.setOnClickListener(new View.OnClickListener() {
70
-            @Override
71
-            public void onClick(View view) {
72
-                mClickListener.onItemClick(helper.getLayoutPosition());
73
-            }
74
-        });
75
-/*        //结束时间
76
-        long seckillDateEnd = DateUtil.dateToStamp(item.getSeckill_date_end());
77
-        //现在时间
78
-        long time = System.currentTimeMillis();
79
-        //倒计时时间
80
-        long countDown = seckillDateEnd - time;*/
64
+        llRoot.setOnClickListener(view -> mClickListener.onItemClick(helper.getLayoutPosition()));
65
+
81 66
     }
82 67
 
83 68
 

+ 8 - 0
app/src/main/res/drawable/shape_org_ms.xml

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
3
+    <gradient
4
+        android:startColor="#ff8e74"
5
+        android:endColor="#fb5022"
6
+        />
7
+    <corners android:radius="50dp"/>
8
+</shape>

+ 13 - 0
app/src/main/res/drawable/shape_red_circle.xml

@@ -0,0 +1,13 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<shape xmlns:android="http://schemas.android.com/apk/res/android"   android:shape="rectangle" >
3
+
4
+    <solid android:color="#fe0032" />
5
+
6
+<!--    <stroke-->
7
+<!--        android:color="@color/gray_9e9e9e"-->
8
+<!--        android:width="0.5dp"/>-->
9
+
10
+    <corners android:radius="50dp"/>
11
+
12
+
13
+</shape>

+ 106 - 8
app/src/main/res/layout/activity_dacang_seckill.xml

@@ -1,5 +1,6 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
3 4
     android:id="@+id/main"
4 5
     android:layout_width="match_parent"
5 6
     android:layout_height="match_parent"
@@ -8,7 +9,7 @@
8 9
     <View
9 10
         android:id="@+id/view_bg"
10 11
         android:layout_width="match_parent"
11
-        android:layout_height="150dp"
12
+        android:layout_height="220dp"
12 13
         android:background="@mipmap/xsms_bg" />
13 14
 
14 15
     <RelativeLayout
@@ -48,19 +49,117 @@
48 49
     <androidx.recyclerview.widget.RecyclerView
49 50
         android:id="@+id/rv_seckill_date"
50 51
         android:layout_width="match_parent"
51
-        android:layout_height="55dp"
52
-        android:layout_alignBottom="@+id/view_bg"
53
-        android:layout_marginBottom="-3dp"
52
+        android:layout_height="70dp"
53
+        android:layout_below="@id/title_layout"
54
+        android:layout_marginTop="24dp"
54 55
         />
56
+    <androidx.constraintlayout.widget.ConstraintLayout
57
+        android:id="@+id/layout_notice"
58
+        android:layout_width="match_parent"
59
+        android:layout_height="80dp"
60
+        android:background="@drawable/shape_white_8dp"
61
+        android:layout_below="@+id/rv_seckill_date"
62
+        android:layout_marginLeft="10dp"
63
+        android:layout_marginRight="10dp"
64
+        android:orientation="horizontal"
65
+        >
66
+        <TextView
67
+            android:id="@+id/tv_notice"
68
+            android:layout_width="wrap_content"
69
+            android:layout_height="wrap_content"
70
+            android:text="距本场结束"
71
+            android:textSize="13sp"
72
+            android:textColor="@color/black_333333"
73
+            android:layout_marginLeft="10dp"
74
+            app:layout_constraintLeft_toLeftOf="parent"
75
+            app:layout_constraintTop_toTopOf="@+id/layout_time"
76
+            app:layout_constraintBottom_toBottomOf="@+id/layout_time"
77
+            app:layout_constraintRight_toLeftOf="@+id/layout_time"
78
+            />
79
+        <LinearLayout
80
+            android:id="@+id/layout_time"
81
+            android:layout_width="0dp"
82
+            android:layout_height="wrap_content"
83
+            android:orientation="horizontal"
84
+            android:layout_gravity="center_vertical"
85
+            android:layout_marginLeft="5dp"
86
+            android:layout_marginTop="14dp"
87
+            app:layout_constraintLeft_toRightOf="@+id/tv_notice"
88
+            app:layout_constraintRight_toLeftOf="@+id/tv_notice1"
89
+            app:layout_constraintTop_toTopOf="parent"
90
+            >
91
+            <TextView
92
+                android:id="@+id/tv_hours"
93
+                android:layout_width="wrap_content"
94
+                android:layout_height="wrap_content"
95
+                android:textSize="11sp"
96
+                android:text="12"
97
+                android:textColor="@color/white"
98
+                android:padding="3dp"
99
+                android:background="@drawable/shape_red_circle"
100
+                />
101
+            <TextView
102
+                android:id="@+id/tv_maohao1"
103
+                android:layout_width="wrap_content"
104
+                android:layout_height="wrap_content"
105
+                android:text=" : "
106
+                android:textSize="11sp"
107
+                android:textColor="@color/black_333333"/>
108
+            <TextView
109
+                android:id="@+id/tv_minute"
110
+                android:layout_width="wrap_content"
111
+                android:layout_height="wrap_content"
112
+                android:textSize="11sp"
113
+                android:text="12"
114
+                android:textColor="@color/white"
115
+                android:padding="3dp"
116
+                android:background="@drawable/shape_red_circle"
117
+                />
118
+            <TextView
119
+                android:id="@+id/tv_maohao2"
120
+                android:layout_width="wrap_content"
121
+                android:layout_height="wrap_content"
122
+                android:text=" : "
123
+                android:textSize="11sp"
124
+                android:textColor="@color/black_333333"
125
+                />
126
+            <TextView
127
+                android:id="@+id/tv_sencond"
128
+                android:layout_width="wrap_content"
129
+                android:layout_height="wrap_content"
130
+                android:textSize="11sp"
131
+                android:text="12"
132
+                android:textColor="@color/white"
133
+                android:padding="3dp"
134
+                android:background="@drawable/shape_red_circle"
135
+                />
136
+        </LinearLayout>
55 137
 
138
+        <TextView
139
+            android:id="@+id/tv_notice1"
140
+            android:layout_width="wrap_content"
141
+            android:layout_height="wrap_content"
142
+            android:text="抓紧时间抢购哦~"
143
+            android:textSize="12sp"
144
+            android:textColor="@color/gray_999999"
145
+            android:drawableLeft="@mipmap/icon_notice_ms"
146
+            android:drawablePadding="5dp"
147
+            app:layout_constraintRight_toRightOf="parent"
148
+            app:layout_constraintLeft_toRightOf="@+id/layout_time"
149
+            app:layout_constraintTop_toTopOf="@id/layout_time"
150
+            app:layout_constraintBottom_toBottomOf="@id/layout_time"
151
+            android:paddingRight="16dp"
152
+            />
153
+    </androidx.constraintlayout.widget.ConstraintLayout>
56 154
     <androidx.recyclerview.widget.RecyclerView
57 155
         android:id="@+id/rv_seckill_product_list"
58 156
         android:layout_width="match_parent"
59
-        android:layout_height="wrap_content"
60
-        android:layout_below="@+id/rv_seckill_date"
157
+        android:layout_height="match_parent"
158
+        android:layout_alignTop="@+id/layout_notice"
61 159
         android:paddingLeft="16dp"
62 160
         android:paddingRight="16dp"
63
-        android:layout_marginTop="7dp"
161
+        android:layout_marginTop="50dp"
162
+        android:background="@color/white"
64 163
         />
65 164
 
66 165
     <include
@@ -70,7 +169,6 @@
70 169
         android:layout_height="wrap_content"
71 170
         android:layout_centerInParent="true"
72 171
         android:visibility="gone" />
73
-    <!--        </com.laolaixiang.bjtdba.view.NaviBarChangeStatusScrollView>-->
74 172
 
75 173
 
76 174
 </RelativeLayout>

+ 71 - 104
app/src/main/res/layout/fragment_big_warehouse.xml

@@ -5,13 +5,80 @@
5 5
     android:layout_height="match_parent"
6 6
     android:background="@color/white_f8f8f8"
7 7
     android:orientation="vertical">
8
+    <LinearLayout
9
+        android:id="@+id/ll_top"
10
+        android:layout_width="match_parent"
11
+        android:layout_height="wrap_content"
12
+        android:orientation="vertical"
13
+        android:background="@mipmap/bg_shop_home"
14
+        android:paddingBottom="8dp">
15
+        <com.yihucha.hbyhc.view.BoldText
16
+            android:layout_width="wrap_content"
17
+            android:layout_height="wrap_content"
18
+            android:text="一壶茶商城"
19
+            android:textColor="@color/black_333333"
20
+            android:textSize="17sp"
21
+            android:layout_marginTop="55dp"
22
+            android:layout_marginLeft="16dp"
23
+            />
24
+        <LinearLayout
25
+            android:id="@+id/ll_search"
26
+            android:layout_width="match_parent"
27
+            android:layout_height="32dp"
28
+            android:layout_marginLeft="16dp"
29
+            android:layout_marginTop="16dp"
30
+            android:layout_marginRight="16dp"
31
+            android:gravity="center_vertical"
32
+            android:orientation="horizontal"
33
+            android:background="@drawable/shape_line_fe0032_15dp"
34
+            >
35
+
36
+            <ImageView
37
+                android:layout_width="wrap_content"
38
+                android:layout_height="wrap_content"
39
+                android:layout_marginLeft="16dp"
40
+                android:src="@mipmap/home_search_220614" />
41
+
42
+            <TextView
43
+                android:layout_width="0dp"
44
+                android:layout_height="wrap_content"
45
+                android:layout_marginLeft="1dp"
46
+                android:layout_weight="1"
47
+                android:text="搜索"
48
+                android:textColor="@color/gray_999999" />
49
+
50
+            <TextView
51
+                android:layout_width="48.5dp"
52
+                android:layout_height="29dp"
53
+                android:layout_marginRight="1dp"
54
+                android:background="@drawable/shape_fe0032_15dp"
55
+                android:gravity="center"
56
+                android:text="@string/search"
57
+                android:textColor="@color/white"
58
+                android:textSize="14sp" />
59
+        </LinearLayout>
8 60
 
61
+        <androidx.recyclerview.widget.RecyclerView
62
+            android:id="@+id/rv_king_kong_area"
63
+            android:layout_width="match_parent"
64
+            android:layout_height="wrap_content"
65
+            android:visibility="visible"
66
+            android:paddingTop="13dp" />
67
+    </LinearLayout>
68
+
69
+
70
+    <View
71
+        android:id="@+id/view_top"
72
+        android:layout_width="wrap_content"
73
+        android:layout_height="51dp"></View>
9 74
 
10 75
     <com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout
11 76
         android:id="@+id/refreshLayout"
12 77
         android:layout_width="match_parent"
13 78
         android:layout_height="match_parent"
14
-        app:tr_pureScrollMode_on="true">
79
+        app:tr_pureScrollMode_on="true"
80
+        android:layout_marginTop="180dp"
81
+        >
15 82
 
16 83
         <com.yihucha.hbyhc.view.NaviBarChangeStatusScrollView
17 84
             android:id="@+id/scrollview"
@@ -30,19 +97,6 @@
30 97
                 android:focusableInTouchMode="true"
31 98
                 android:orientation="vertical">
32 99
 
33
-                <RelativeLayout
34
-                    android:layout_width="match_parent"
35
-                    android:layout_height="wrap_content">
36
-
37
-                    <ImageView
38
-                        android:id="@+id/iv_banner"
39
-                        android:layout_width="match_parent"
40
-                        android:layout_height="250dp"
41
-                        android:scaleType="fitXY" />
42
-
43
-
44
-                </RelativeLayout>
45
-
46 100
                 <LinearLayout
47 101
                     android:layout_width="match_parent"
48 102
                     android:layout_height="wrap_content"
@@ -56,40 +110,15 @@
56 110
                         android:layout_height="wrap_content" />
57 111
                 </LinearLayout>
58 112
 
59
-                <LinearLayout
60
-                    android:layout_width="match_parent"
61
-                    android:layout_height="wrap_content"
62
-                    android:layout_marginLeft="16dp"
63
-                    android:layout_marginTop="22dp"
64
-                    android:layout_marginRight="16dp"
65
-                    android:orientation="horizontal"
66
-                    android:visibility="gone">
67
-
68
-                    <ImageView
69
-                        android:id="@+id/iv_seckill"
70
-                        android:layout_width="0dp"
71
-                        android:layout_height="108.5dp"
72
-                        android:layout_weight="1"
73
-                        android:src="@mipmap/xianshimiaosha" />
74
-
75
-                    <View
76
-                        android:layout_width="12.5dp"
77
-                        android:layout_height="1dp" />
78
-
79
-                    <ImageView
80
-                        android:layout_width="0dp"
81
-                        android:layout_height="108.5dp"
82
-                        android:layout_weight="1"
83
-                        android:src="@mipmap/mianfeilingshangpin" />
84
-                </LinearLayout>
85 113
 
86 114
                 <androidx.recyclerview.widget.RecyclerView
87 115
                     android:id="@+id/rv_product_list"
88 116
                     android:layout_width="match_parent"
89 117
                     android:layout_height="wrap_content"
90 118
                     android:layout_marginTop="13dp"
91
-                    android:paddingLeft="16dp"
92
-                    android:paddingRight="16dp" />
119
+                    android:paddingLeft="10dp"
120
+                    android:paddingRight="10dp"
121
+                    />
93 122
 
94 123
                 <androidx.recyclerview.widget.RecyclerView
95 124
                     android:id="@+id/rv_recommended_list"
@@ -101,68 +130,6 @@
101 130
         </com.yihucha.hbyhc.view.NaviBarChangeStatusScrollView>
102 131
 
103 132
     </com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout>
104
-
105
-    <LinearLayout
106
-        android:id="@+id/ll_top"
107
-        android:layout_width="match_parent"
108
-        android:layout_height="wrap_content"
109
-        android:orientation="vertical"
110
-        android:paddingBottom="8dp">
111
-
112
-        <LinearLayout
113
-            android:id="@+id/ll_search"
114
-            android:layout_width="match_parent"
115
-            android:layout_height="32dp"
116
-            android:layout_marginLeft="16dp"
117
-            android:layout_marginTop="55dp"
118
-            android:layout_marginRight="16dp"
119
-            android:background="@drawable/shape_ffffff_15dp"
120
-            android:gravity="center_vertical"
121
-            android:orientation="horizontal">
122
-
123
-            <ImageView
124
-                android:layout_width="wrap_content"
125
-                android:layout_height="wrap_content"
126
-                android:layout_marginLeft="16dp"
127
-                android:src="@mipmap/home_search_220614" />
128
-
129
-            <TextView
130
-                android:layout_width="0dp"
131
-                android:layout_height="wrap_content"
132
-                android:layout_marginLeft="1dp"
133
-                android:layout_weight="1"
134
-                android:text="搜索"
135
-                android:textColor="@color/gray_999999" />
136
-
137
-            <TextView
138
-                android:layout_width="48.5dp"
139
-                android:layout_height="29dp"
140
-                android:layout_marginRight="1dp"
141
-                android:background="@drawable/shape_fe0032_15dp"
142
-                android:gravity="center"
143
-                android:text="@string/search"
144
-                android:textColor="@color/white"
145
-                android:textSize="14sp" />
146
-        </LinearLayout>
147
-
148
-        <androidx.recyclerview.widget.RecyclerView
149
-            android:id="@+id/rv_king_kong_area"
150
-            android:layout_width="match_parent"
151
-            android:layout_height="wrap_content"
152
-            android:paddingTop="13dp" />
153
-    </LinearLayout>
154
-
155
-    <View
156
-        android:id="@+id/view_header_bg"
157
-        android:layout_width="match_parent"
158
-        android:layout_height="51dp"
159
-
160
-        />
161
-
162
-    <View
163
-        android:id="@+id/view_top"
164
-        android:layout_width="wrap_content"
165
-        android:layout_height="51dp"></View>
166 133
     <!--站位-->
167 134
     <ImageView
168 135
         android:id="@+id/tv_scroll_top"

+ 12 - 8
app/src/main/res/layout/fragment_home.xml

@@ -99,7 +99,7 @@
99 99
                     android:paddingTop="13dp"
100 100
                     android:paddingRight="3dp"
101 101
                     android:paddingBottom="13dp"
102
-                    android:visibility="gone">
102
+                    android:visibility="visible">
103 103
 
104 104
                     <com.yihucha.hbyhc.view.BoldText
105 105
                         android:id="@+id/imgv_vip"
@@ -107,7 +107,9 @@
107 107
                         android:layout_height="wrap_content"
108 108
                         android:text="会员专区\t好物超值购"
109 109
                         android:textColor="@color/white"
110
-                        android:textSize="17sp" />
110
+                        android:textSize="17sp"
111
+                        android:paddingLeft="13dp"
112
+                        />
111 113
 
112 114
                     <com.yihucha.hbyhc.view.BoldText
113 115
                         android:id="@+id/tv_buy_now"
@@ -151,11 +153,11 @@
151 153
                     android:layout_marginTop="10dp"
152 154
                     android:layout_marginRight="12dp"
153 155
                     android:background="@mipmap/bg_ms_home"
154
-                    android:paddingLeft="10dp"
156
+                    android:paddingLeft="3dp"
155 157
                     android:paddingTop="13dp"
156 158
                     android:paddingRight="10dp"
157
-                    android:paddingBottom="13dp"
158
-                    android:visibility="gone">
159
+                    android:paddingBottom="3dp"
160
+                    android:visibility="visible">
159 161
 
160 162
                     <com.yihucha.hbyhc.view.BoldText
161 163
                         android:id="@+id/imgv_xsms"
@@ -163,7 +165,9 @@
163 165
                         android:layout_height="wrap_content"
164 166
                         android:text="超级秒杀\t低价限时抢"
165 167
                         android:textColor="@color/white"
166
-                        android:textSize="17sp" />
168
+                        android:textSize="17sp"
169
+                        android:paddingLeft="13dp"
170
+                        />
167 171
 
168 172
                     <LinearLayout
169 173
                         android:id="@+id/layout_time"
@@ -247,8 +251,8 @@
247 251
                         android:layout_height="wrap_content"
248 252
                         android:layout_alignParentBottom="true"
249 253
                         android:layout_centerHorizontal="true"
250
-                        android:layout_marginTop="23dp"
251
-                        android:layout_marginBottom="13dp"
254
+                        android:layout_marginTop="20dp"
255
+                        android:layout_marginBottom="10dp"
252 256
                         android:background="@drawable/shape_white_50dp"
253 257
                         android:orientation="horizontal"
254 258
                         android:paddingLeft="15dp"

+ 3 - 3
app/src/main/res/layout/item_dacang_classification.xml

@@ -12,8 +12,8 @@
12 12
         android:id="@+id/tv_name"
13 13
         android:layout_width="wrap_content"
14 14
         android:layout_height="wrap_content"
15
-        android:textColor="@color/white"
16
-        android:textSize="15sp"
15
+        android:textColor="@color/black_333333"
16
+        android:textSize="14sp"
17 17
         android:text="内衣"/>
18 18
 
19 19
     <View
@@ -22,5 +22,5 @@
22 22
         android:visibility="invisible"
23 23
         android:layout_width="25dp"
24 24
         android:layout_height="3dp"
25
-        android:background="@drawable/shape_ffffff_1d5dp"/>
25
+        android:background="@drawable/shape_fe0032_8dp"/>
26 26
 </LinearLayout>

+ 4 - 2
app/src/main/res/layout/item_home_miaosha.xml

@@ -80,7 +80,9 @@
80 80
                 android:layout_height="wrap_content"
81 81
                 android:layout_centerVertical="true"
82 82
                 android:orientation="horizontal"
83
-                android:paddingLeft="15dp">
83
+                android:layout_centerHorizontal="true"
84
+                android:paddingRight="15dp"
85
+                >
84 86
 
85 87
                 <TextView
86 88
                     android:id="@+id/tv_rmb_item"
@@ -94,7 +96,7 @@
94 96
                     android:id="@+id/tv_price_item"
95 97
                     android:layout_width="wrap_content"
96 98
                     android:layout_height="wrap_content"
97
-                    android:text="86"
99
+                    android:text="86.6666"
98 100
                     android:textColor="@color/red_fe0032"
99 101
                     android:textSize="15sp" />
100 102
             </LinearLayout>

+ 14 - 63
app/src/main/res/layout/item_seckill.xml

@@ -2,87 +2,38 @@
2 2
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 3
     android:orientation="vertical"
4 4
     android:layout_width="wrap_content"
5
-    android:layout_height="55dp"
5
+    android:layout_height="70dp"
6 6
     android:id="@+id/bg_item"
7
-    android:background="@mipmap/img_miaosha_item_checked"
8 7
     >
9
-    <TextView
8
+    <com.yihucha.hbyhc.view.BoldText
10 9
         android:id="@+id/tv_seckill_date"
11 10
         android:layout_width="wrap_content"
12 11
         android:layout_height="wrap_content"
12
+        android:textFontWeight="1"
13 13
         android:text="11:00"
14
-        android:textSize="16sp"
14
+        android:textSize="19sp"
15 15
         android:paddingLeft="15dp"
16 16
         android:paddingRight="15dp"
17
-        android:textColor="@color/black_333333"
17
+        android:textColor="@color/white"
18 18
         android:layout_centerHorizontal="true"
19 19
         android:layout_marginTop="5dp"
20
+        android:gravity="center_vertical"
20 21
         />
21 22
     <TextView
22 23
         android:id="@+id/tv_notice"
23 24
         android:layout_width="wrap_content"
24 25
         android:layout_height="wrap_content"
25 26
         android:text="即将开枪"
26
-        android:textColor="@color/red_fe0032"
27
+        android:textColor="@color/white"
27 28
         android:layout_centerHorizontal="true"
28 29
         android:layout_alignParentBottom="true"
29 30
         android:layout_marginBottom="10dp"
30
-        android:textSize="13sp"
31
-        android:visibility="gone"
31
+        android:textSize="10sp"
32
+        android:visibility="visible"
33
+        android:paddingLeft="4dp"
34
+        android:paddingRight="4dp"
35
+        android:paddingTop="2dp"
36
+        android:paddingBottom="2dp"
37
+        android:gravity="center_vertical"
32 38
         />
33
-    <LinearLayout
34
-        android:id="@+id/layout_time"
35
-        android:layout_width="wrap_content"
36
-        android:layout_height="wrap_content"
37
-        android:layout_centerHorizontal="true"
38
-        android:layout_alignParentBottom="true"
39
-        android:orientation="horizontal"
40
-        android:layout_marginBottom="10dp"
41
-        >
42
-        <TextView
43
-            android:id="@+id/tv_hours"
44
-            android:layout_width="wrap_content"
45
-            android:layout_height="wrap_content"
46
-            android:textSize="11sp"
47
-            android:text="12"
48
-            android:textColor="@color/white"
49
-            android:padding="1dp"
50
-            android:background="@drawable/shape_white_2dp"
51
-            />
52
-        <TextView
53
-            android:id="@+id/tv_maohao1"
54
-            android:layout_width="wrap_content"
55
-            android:layout_height="wrap_content"
56
-            android:text=" : "
57
-            android:textSize="11sp"
58
-            android:textColor="@color/black_333333"/>
59
-        <TextView
60
-            android:id="@+id/tv_minute"
61
-            android:layout_width="wrap_content"
62
-            android:layout_height="wrap_content"
63
-            android:textSize="11sp"
64
-            android:text="12"
65
-            android:textColor="@color/white"
66
-            android:padding="1dp"
67
-            android:background="@drawable/shape_white_2dp"
68
-            />
69
-        <TextView
70
-            android:id="@+id/tv_maohao2"
71
-            android:layout_width="wrap_content"
72
-            android:layout_height="wrap_content"
73
-            android:text=" : "
74
-            android:textSize="11sp"
75
-            android:textColor="@color/black_333333"
76
-            />
77
-        <TextView
78
-            android:id="@+id/tv_sencond"
79
-            android:layout_width="wrap_content"
80
-            android:layout_height="wrap_content"
81
-            android:textSize="11sp"
82
-            android:text="12"
83
-            android:textColor="@color/white"
84
-            android:padding="1dp"
85
-            android:background="@drawable/shape_white_2dp"
86
-            />
87
-    </LinearLayout>
88 39
 </RelativeLayout>

+ 22 - 37
app/src/main/res/layout/item_seconds_kill_products.xml

@@ -15,45 +15,28 @@
15 15
         android:layout_marginBottom="13dp"
16 16
         android:scaleType="fitXY"
17 17
         app:rciv_radius="8dp" />
18
-
19
-    <TextView
20
-        android:id="@+id/text_img"
21
-        android:layout_width="wrap_content"
22
-        android:layout_height="wrap_content"
23
-        android:layout_alignTop="@id/riv_image"
24
-        android:layout_marginLeft="13dp"
25
-        android:layout_toRightOf="@+id/riv_image"
26
-        android:background="@mipmap/home_dacang_220615"
27
-        android:gravity="center"
28
-        android:orientation="vertical"
29
-        android:paddingLeft="4dp"
30
-        android:paddingTop="1.5dp"
31
-        android:paddingRight="4dp"
32
-        android:paddingBottom="1.5dp"
33
-        android:text="大仓秒杀"
34
-        android:textColor="@color/white"
35
-        android:textSize="10sp" />
36
-
37
-    <TextView
18
+    <com.yihucha.hbyhc.view.BoldText
38 19
         android:id="@+id/tv_store_name"
39 20
         android:layout_width="wrap_content"
40 21
         android:layout_height="wrap_content"
41
-        android:layout_below="@+id/text_img"
42
-        android:layout_alignLeft="@+id/text_img"
22
+        android:layout_toRightOf="@+id/riv_image"
23
+        android:layout_alignTop="@+id/riv_image"
43 24
         android:ellipsize="end"
44 25
         android:maxLines="1"
45 26
         android:text="此处商品显示一行"
46
-        android:textColor="@color/black_202020"
47
-        android:textSize="15sp" />
27
+        android:textColor="@color/black_333333"
28
+        android:textSize="15sp"
29
+        android:layout_marginLeft="10dp"
30
+        />
48 31
 
49 32
     <LinearLayout
50 33
         android:layout_width="wrap_content"
51 34
         android:layout_height="wrap_content"
52 35
         android:layout_below="@+id/tv_store_name"
53
-        android:layout_alignLeft="@+id/text_img"
36
+        android:layout_alignLeft="@+id/tv_store_name"
37
+        android:layout_marginTop="5dp"
54 38
         android:layout_marginRight="10dp"
55 39
         android:layout_marginBottom="6.5dp"
56
-        android:layout_marginTop="5dp"
57 40
         android:background="@drawable/shape_line_fe0032_2dp"
58 41
         android:orientation="horizontal">
59 42
 
@@ -78,11 +61,10 @@
78 61
         android:id="@+id/layout_bottom"
79 62
         android:layout_width="match_parent"
80 63
         android:layout_height="30dp"
81
-        android:layout_alignLeft="@+id/text_img"
64
+        android:layout_alignLeft="@+id/tv_store_name"
82 65
         android:layout_alignParentBottom="true"
83
-        android:layout_marginBottom="13dp"
84 66
         android:layout_marginRight="8dp"
85
-        android:background="#FEDCD3">
67
+        android:layout_marginBottom="13dp">
86 68
 
87 69
 
88 70
         <LinearLayout
@@ -103,25 +85,28 @@
103 85
             <com.yihucha.hbyhc.view.DrawLineTextView
104 86
                 android:id="@+id/tv_lowestCouponPrice"
105 87
                 android:layout_width="wrap_content"
106
-                android:layout_height="wrap_content"
107
-                android:layout_gravity="center_vertical"
88
+                android:layout_height="match_parent"
89
+                android:gravity="bottom"
108 90
                 android:layout_marginLeft="8dp"
109
-                android:text="$100.00"
91
+                android:text="100.00"
110 92
                 android:textColor="@color/gray_999999"
111
-                android:textSize="12sp" />
93
+                android:textSize="12sp"
94
+                android:paddingBottom="3dp"
95
+                />
112 96
         </LinearLayout>
113 97
 
114 98
         <TextView
115 99
             android:id="@+id/iv_status"
116 100
             android:layout_width="wrap_content"
117
-            android:layout_height="30dp"
101
+            android:layout_height="match_parent"
118 102
             android:layout_alignParentRight="true"
119
-            android:layout_gravity="bottom"
120
-            android:background="@mipmap/img_bg_buy"
103
+            android:background="@mipmap/xianshiqiang"
121 104
             android:gravity="center"
122
-            android:text="马上抢"
123 105
             android:textColor="@color/white"
124 106
             android:textSize="14sp"
107
+            android:layout_centerHorizontal="true"
108
+            android:paddingLeft="8dp"
109
+            android:paddingRight="8dp"
125 110
             />
126 111
     </RelativeLayout>
127 112
 </RelativeLayout>

BIN
app/src/main/res/mipmap-xxxhdpi/bg_shop_home.png


BIN
app/src/main/res/mipmap-xxxhdpi/icon_notice_ms.png


BIN
app/src/main/res/mipmap-xxxhdpi/xianshiqiang.png


BIN
app/src/main/res/mipmap-xxxhdpi/xsms_bg.png