瀏覽代碼

0.2.9 修复数据重复

ltt 1 年之前
父節點
當前提交
fc3abbfdaa

+ 1 - 1
TMessagesProj/src/main/java/org/telegram/cricdit/ui/NewsFragment.java

@@ -235,7 +235,7 @@ public class NewsFragment implements BaseViewFragment, NewsView {
                 super.onScrolled(recyclerView, dx, dy);
                 if (distance < -ViewConfiguration.getTouchSlop() && !topVisible) {
                     int currentPosition = ((RecyclerView.LayoutParams) recyclerView.getChildAt(0).getLayoutParams()).getViewAdapterPosition();
-                    if(currentPosition < 5){
+                    if(currentPosition < 2){
                         showTodayBtnAnim(1);
                         topVisible = false;
                     }else{

+ 1 - 1
TMessagesProj/src/main/java/org/telegram/cricdit/ui/NewsTagActivity.java

@@ -89,7 +89,7 @@ public class NewsTagActivity extends BaseActivity<NewsPresenter> implements News
                 super.onScrolled(recyclerView, dx, dy);
                 if (distance < -ViewConfiguration.getTouchSlop() && !topVisible) {
                     int currentPosition = ((RecyclerView.LayoutParams) recyclerView.getChildAt(0).getLayoutParams()).getViewAdapterPosition();
-                    if(currentPosition < 5){
+                    if(currentPosition < 2){
                         showTodayBtnAnim(1);
                         topVisible = false;
                     }else{

+ 15 - 2
TMessagesProj/src/main/java/org/telegram/onecric/ui/activity/NewMatchActivity.java

@@ -183,7 +183,7 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
                             tournamentDialog.mAdapter.notifyDataSetChanged();
                             break;
                         }
-                    }
+                }
                 }
 
                 StringBuilder tagsId = new StringBuilder(tag);
@@ -464,6 +464,9 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
     }
 
     private void showTodayBtnAnim(int type){
+        if(!TextUtils.isEmpty(tag)){
+            return;
+        }
         switch (type){
             case 0:
                 if(tv_to_today.isSelected()){
@@ -503,6 +506,9 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
             recyclerView.setVisibility(View.GONE);
             mPresenter.getCricketMatchList(type,new SimpleDateFormat("yyyy-MM-dd").format(singleTimeInMillis),TextUtils.isEmpty(tag)?"":tag,streamType,isLiveNow);//选中日
         }else if(type == 2){
+            if(!TextUtils.isEmpty(tag)){
+                return;
+            }
             if(mAdapter.getItemCount() <= 0 && !TextUtils.isEmpty(endDay2)){
                 mPresenter.getCricketMatchList(type,endDay2,TextUtils.isEmpty(tag)?"":tag,streamType,isLiveNow);//后一天
             }else if(!TextUtils.isEmpty(endDay)){
@@ -554,7 +560,14 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
 //                mAdapter.setNewData(bean.getItem());
                 mAdapter.setData(bean.getItem());
                 recyclerView.scrollBy(0, (int) (recyclerView.getY() + UIUtil.dip2px(getContext(),60)));
-                if(mTimer == null){
+                //当前时间
+                Date now = new Date();
+                SimpleDateFormat sf = new SimpleDateFormat("yyyyMMdd");
+                //获取今天的日期
+                String nowDay = sf.format(now);
+                //对比的时间
+                String day = sf.format(singleTimeInMillis);
+                if(mTimer == null && day.equals(nowDay)){
                     refreshTodayData();
                 }
             }else{

+ 2 - 2
gradle.properties

@@ -15,8 +15,8 @@
 #Sat Mar 12 05:53:50 MSK 2016
 #APP_VERSION_NAME=9.0.2
 #APP_VERSION_CODE=2808
-APP_VERSION_NAME=0.2.8
-APP_VERSION_CODE=28
+APP_VERSION_NAME=0.2.9
+APP_VERSION_CODE=29
 #APP_PACKAGE=org.telegram.messenger
 APP_PACKAGE=com.cricdit.cricdit
 RELEASE_KEY_PASSWORD=123456