Selaa lähdekoodia

同步新赛程:查询、赛程详情、筛选联赛

ltt 1 vuosi sitten
vanhempi
commit
e4045c79c8
29 muutettua tiedostoa jossa 668 lisäystä ja 416 poistoa
  1. 4 0
      TMessagesProj/src/main/AndroidManifest.xml
  2. 37 11
      TMessagesProj/src/main/java/org/telegram/cricdit/ui/NewsFragment.java
  3. 38 14
      TMessagesProj/src/main/java/org/telegram/cricdit/ui/NewsTagActivity.java
  4. 4 30
      TMessagesProj/src/main/java/org/telegram/cricdit/ui/RankListActivity.java
  5. 40 0
      TMessagesProj/src/main/java/org/telegram/cricdit/utils/TimeUtils.java
  6. 91 17
      TMessagesProj/src/main/java/org/telegram/onecric/adapter/CricketDayAdapter.java
  7. 4 3
      TMessagesProj/src/main/java/org/telegram/onecric/adapter/SelectTournamentAdapter.java
  8. 2 2
      TMessagesProj/src/main/java/org/telegram/onecric/dialog/TournaListDialog.java
  9. 3 3
      TMessagesProj/src/main/java/org/telegram/onecric/mvp/CricketFiltrateBean.java
  10. 31 0
      TMessagesProj/src/main/java/org/telegram/onecric/mvp/CricketNewPresenter.java
  11. 1 0
      TMessagesProj/src/main/java/org/telegram/onecric/mvp/CricketNewView.java
  12. 3 0
      TMessagesProj/src/main/java/org/telegram/onecric/net/ApiStores.java
  13. 154 86
      TMessagesProj/src/main/java/org/telegram/onecric/ui/activity/NewMatchActivity.java
  14. 31 2
      TMessagesProj/src/main/java/org/telegram/onecric/ui/fragment/CricketMatchesFragment.java
  15. 0 5
      TMessagesProj/src/main/res/drawable/bg_212e58_6.xml
  16. 1 1
      TMessagesProj/src/main/res/drawable/bg_search_15.xml
  17. 1 1
      TMessagesProj/src/main/res/drawable/selector_filtrate_color.xml
  18. 1 1
      TMessagesProj/src/main/res/drawable/selector_foreground_search.xml
  19. 2 2
      TMessagesProj/src/main/res/drawable/selector_select_tournament.xml
  20. 182 189
      TMessagesProj/src/main/res/layout/activity_match_new.xml
  21. 0 22
      TMessagesProj/src/main/res/layout/activity_ranking_list.xml
  22. 12 19
      TMessagesProj/src/main/res/layout/fragment_detail.xml
  23. 8 7
      TMessagesProj/src/main/res/layout/item_select_tournament.xml
  24. 13 0
      TMessagesProj/src/main/res/layout/layout_common_list.xml
  25. BIN
      TMessagesProj/src/main/res/mipmap-xhdpi/ic_arrow_circle.png
  26. BIN
      TMessagesProj/src/main/res/mipmap-xhdpi/ic_arrow_expert_down.png
  27. BIN
      TMessagesProj/src/main/res/mipmap-xhdpi/ic_check_date.png
  28. 2 1
      TMessagesProj/src/main/res/values/colors.xml
  29. 3 0
      TMessagesProj/src/main/res/values/strings.xml

+ 4 - 0
TMessagesProj/src/main/AndroidManifest.xml

@@ -763,6 +763,10 @@
             android:name="org.telegram.onecric.ui.activity.TeamComparisonActivity"
             android:theme="@style/ThemeMatch" />
 
+        <activity
+            android:name="org.telegram.onecric.ui.activity.SearchMatchActivity"
+            android:theme="@style/ThemeMatch" />
+
         <service android:name="org.telegram.cricdit.service.SyncDataService" />
 
         <service

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

@@ -1,5 +1,8 @@
 package org.telegram.cricdit.ui;
 
+import static org.telegram.cricdit.utils.TimeUtils.getDayInfo;
+import static org.telegram.onecric.utils.AnimUtil.transAnim;
+
 import android.content.Context;
 import android.os.Bundle;
 import android.text.TextUtils;
@@ -7,7 +10,9 @@ import android.view.View;
 import android.view.ViewConfiguration;
 import android.widget.ImageView;
 import android.widget.RelativeLayout;
+import android.widget.TextView;
 
+import androidx.annotation.NonNull;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 
@@ -33,6 +38,7 @@ import org.telegram.cricdit.utils.ColorUtil;
 import org.telegram.cricdit.utils.EventBusHelper;
 import org.telegram.cricdit.utils.GsonHel;
 import org.telegram.cricdit.utils.SPUtils;
+import org.telegram.cricdit.utils.UIUtil;
 import org.telegram.cricdit.view.popup.ChooeseBottomPopup;
 import org.telegram.cricdit.view.popup.ReportBottomPopup;
 import org.telegram.messenger.R;
@@ -50,8 +56,7 @@ public class NewsFragment implements BaseViewFragment, NewsView {
     private BaseFragment mFragment;
     private RecyclerView mRecyclerView;
     private SmartRefreshLayout smartRefreshlayout;
-    private RelativeLayout ivBackTop;
-    private ImageView ivBg;
+    private TextView tv_back_top;
     private int page = 1, pagesize = 10, offset = 0, topNum = 0;
     private String newsType = "feed";
     private NewsAdapter adapter;
@@ -167,9 +172,7 @@ public class NewsFragment implements BaseViewFragment, NewsView {
         EventBusHelper.register(this);
         mRecyclerView = view.findViewById(R.id.mRecyclerView);
         smartRefreshlayout = view.findViewById(R.id.smart_refreshlayout);
-        ivBackTop = view.findViewById(R.id.iv_back_top);
-        ivBg = view.findViewById(R.id.iv_bg);
-        ivBg.setColorFilter(ColorUtil.COLOR_BLUE_TEXT);
+        tv_back_top = view.findViewById(R.id.tv_back_top);
 
         LinearLayoutManager linearLayoutManager = new LinearLayoutManager(mContext);
         linearLayoutManager.setOrientation(RecyclerView.VERTICAL);
@@ -231,11 +234,18 @@ public class NewsFragment implements BaseViewFragment, NewsView {
             public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
                 super.onScrolled(recyclerView, dx, dy);
                 if (distance < -ViewConfiguration.getTouchSlop() && !topVisible) {
-                    ivBackTop.setVisibility(View.VISIBLE);
+                    int currentPosition = ((RecyclerView.LayoutParams) recyclerView.getChildAt(0).getLayoutParams()).getViewAdapterPosition();
+                    if(currentPosition < 5){
+                        showTodayBtnAnim(1);
+                        topVisible = false;
+                    }else{
+                        showTodayBtnAnim(0);
+                        topVisible = true;
+                    }
                     distance = 0;
-                    topVisible = true;
+
                 } else if (distance > ViewConfiguration.getTouchSlop() && topVisible) {
-                    ivBackTop.setVisibility(View.GONE);
+                    showTodayBtnAnim(1);
                     distance = 0;
                     topVisible = false;
                 }
@@ -244,13 +254,13 @@ public class NewsFragment implements BaseViewFragment, NewsView {
             }
         });
 
-        ivBackTop.setOnClickListener(v -> {
+        tv_back_top.setOnClickListener(v -> {
             mRecyclerView.smoothScrollToPosition(0);
-            ivBackTop.setVisibility(View.GONE);
             distance = 0;
-            topVisible = false;
+            topVisible = true;
         });
 
+        showTodayBtnAnim(1);
         initData();
     }
 
@@ -272,4 +282,20 @@ public class NewsFragment implements BaseViewFragment, NewsView {
         return view;
     }
 
+    private void showTodayBtnAnim(int type){
+        switch (type){
+            case 0:
+                if(tv_back_top.isSelected()){
+                    transAnim(tv_back_top,tv_back_top.getMeasuredHeight() + UIUtil.dip2px(mContext,20),0);
+                    tv_back_top.setSelected(false);
+                }
+                break;
+            case 1:
+                if(!tv_back_top.isSelected()){
+                    transAnim(tv_back_top,0,tv_back_top.getMeasuredHeight() + UIUtil.dip2px(mContext,20));
+                    tv_back_top.setSelected(true);
+                }
+                break;
+        }
+    }
 }

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

@@ -1,11 +1,15 @@
 package org.telegram.cricdit.ui;
 
+import static org.telegram.onecric.utils.AnimUtil.transAnim;
+
 import android.os.Bundle;
 import android.text.TextUtils;
 import android.view.View;
 import android.view.ViewConfiguration;
 import android.widget.ImageView;
 import android.widget.RelativeLayout;
+import android.widget.TextView;
+
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 import com.classic.common.MultipleStatusView;
@@ -17,6 +21,7 @@ import org.telegram.cricdit.mvp.NewsPresenter;
 import org.telegram.cricdit.mvp.NewsView;
 import org.telegram.cricdit.net.ApiException;
 import org.telegram.cricdit.utils.ColorUtil;
+import org.telegram.cricdit.utils.UIUtil;
 import org.telegram.messenger.LocaleController;
 import org.telegram.messenger.R;
 import org.telegram.messenger.UserConfig;
@@ -28,7 +33,7 @@ public class NewsTagActivity extends BaseActivity<NewsPresenter> implements News
     private RecyclerView mRecyclerView;
     private SmartRefreshLayout smartRefreshlayout;
     private MultipleStatusView statusView;
-    private RelativeLayout ivBackTop;
+    private TextView tv_back_top;
     private ImageView ivBg;
     private NewsAdapter adapter;
     private int page = 1, pagesize = 10, offset = 0;
@@ -48,12 +53,8 @@ public class NewsTagActivity extends BaseActivity<NewsPresenter> implements News
 
         mRecyclerView = view.findViewById(R.id.mRecyclerView);
         smartRefreshlayout = view.findViewById(R.id.smart_refreshlayout);
-        mRecyclerView = view.findViewById(R.id.mRecyclerView);
-        smartRefreshlayout = view.findViewById(R.id.smart_refreshlayout);
         statusView = view.findViewById(R.id.status_view);
-        ivBackTop = view.findViewById(R.id.iv_back_top);
-        ivBg = view.findViewById(R.id.iv_bg);
-        ivBg.setColorFilter(ColorUtil.COLOR_BLUE_TEXT);
+        tv_back_top = view.findViewById(R.id.tv_back_top);
 
         LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
         linearLayoutManager.setOrientation(RecyclerView.VERTICAL);
@@ -86,12 +87,19 @@ public class NewsTagActivity extends BaseActivity<NewsPresenter> implements News
             @Override
             public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
                 super.onScrolled(recyclerView, dx, dy);
-                if(distance < -ViewConfiguration.getTouchSlop() && !topVisible){
-                    ivBackTop.setVisibility(View.VISIBLE);
+                if (distance < -ViewConfiguration.getTouchSlop() && !topVisible) {
+                    int currentPosition = ((RecyclerView.LayoutParams) recyclerView.getChildAt(0).getLayoutParams()).getViewAdapterPosition();
+                    if(currentPosition < 5){
+                        showTodayBtnAnim(1);
+                        topVisible = false;
+                    }else{
+                        showTodayBtnAnim(0);
+                        topVisible = true;
+                    }
                     distance = 0;
-                    topVisible = true;
-                }else if(distance > ViewConfiguration.getTouchSlop() && topVisible){
-                    ivBackTop.setVisibility(View.GONE);
+
+                } else if (distance > ViewConfiguration.getTouchSlop() && topVisible) {
+                    showTodayBtnAnim(1);
                     distance = 0;
                     topVisible = false;
                 }
@@ -100,13 +108,13 @@ public class NewsTagActivity extends BaseActivity<NewsPresenter> implements News
             }
         });
 
-        ivBackTop.setOnClickListener(v -> {
+        tv_back_top.setOnClickListener(v -> {
             mRecyclerView.smoothScrollToPosition(0);
-            ivBackTop.setVisibility(View.GONE);
             distance = 0;
-            topVisible = false;
+            topVisible = true;
         });
 
+        showTodayBtnAnim(1);
         initData();
     }
 
@@ -180,4 +188,20 @@ public class NewsTagActivity extends BaseActivity<NewsPresenter> implements News
         smartRefreshlayout.autoRefresh();
     }
 
+    private void showTodayBtnAnim(int type){
+        switch (type){
+            case 0:
+                if(tv_back_top.isSelected()){
+                    transAnim(tv_back_top,tv_back_top.getMeasuredHeight() + UIUtil.dip2px(getContext(),20),0);
+                    tv_back_top.setSelected(false);
+                }
+                break;
+            case 1:
+                if(!tv_back_top.isSelected()){
+                    transAnim(tv_back_top,0,tv_back_top.getMeasuredHeight() + UIUtil.dip2px(getContext(),20));
+                    tv_back_top.setSelected(true);
+                }
+                break;
+        }
+    }
 }

+ 4 - 30
TMessagesProj/src/main/java/org/telegram/cricdit/ui/RankListActivity.java

@@ -1,5 +1,7 @@
 package org.telegram.cricdit.ui;
 
+import static org.telegram.onecric.utils.AnimUtil.transAnim;
+
 import android.os.Build;
 import android.os.Bundle;
 import android.view.View;
@@ -31,6 +33,7 @@ import org.telegram.cricdit.mvp.RankListPresenter;
 import org.telegram.cricdit.mvp.RankListView;
 import org.telegram.cricdit.utils.ACache;
 import org.telegram.cricdit.utils.ColorUtil;
+import org.telegram.cricdit.utils.UIUtil;
 import org.telegram.cricdit.view.BannerIndicatorView;
 import org.telegram.messenger.AndroidUtilities;
 import org.telegram.messenger.LocaleController;
@@ -56,8 +59,6 @@ public class RankListActivity extends BaseTabActivity<RankListPresenter> impleme
     private View view_line_1;
     private RecyclerView rvHotRank;
     private RecyclerView rvAllRank;
-    private RelativeLayout ivBackTop;
-    private ImageView ivBg;
     private int rankPage = 1, rankPageSize = 10, rankOffset = 0;
     private RankListTopAdapter hotAdapter;
     private RankListAllAdapter allAdapter;
@@ -103,8 +104,6 @@ public class RankListActivity extends BaseTabActivity<RankListPresenter> impleme
         view_line_1 = view.findViewById(R.id.view_line_1);
         rvHotRank = view.findViewById(R.id.rv_hot_rank);
         rvAllRank = view.findViewById(R.id.rv_all_rank);
-        ivBackTop = view.findViewById(R.id.iv_back_top);
-        ivBg = view.findViewById(R.id.iv_bg);
 
         tv_title_1.setText(LocaleController.getString(R.string.top_of_the_list));
         tv_title_2.setText(LocaleController.getString(R.string.all_leaderboards));
@@ -117,7 +116,6 @@ public class RankListActivity extends BaseTabActivity<RankListPresenter> impleme
         tv_title_2.setTextColor(ColorUtil.COLOR_BLACK_TEXT);
         tv_banner_title.setTextColor(ColorUtil.COLOR_WHITE);
         view_line_1.setBackgroundColor(ColorUtil.COLOR_LINE_GRAY);
-        ivBg.setColorFilter(ColorUtil.COLOR_BLUE_TEXT);
 
         smartRefreshlayout.setEnableRefresh(true);
         smartRefreshlayout.setOnRefreshListener(refreshLayout -> initData());
@@ -166,31 +164,6 @@ public class RankListActivity extends BaseTabActivity<RankListPresenter> impleme
     }
 
     private void initListener() {
-        ivBackTop.setOnClickListener(v -> {
-            nestedScrollView.fullScroll(View.FOCUS_UP);
-            ivBackTop.setVisibility(View.GONE);
-            distance = 0;
-            topVisible = false;
-        });
-
-        rvAllRank.addOnScrollListener(new RecyclerView.OnScrollListener() {
-            @Override
-            public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
-                super.onScrolled(recyclerView, dx, dy);
-                if (distance < -ViewConfiguration.getTouchSlop() && !topVisible) {
-                    ivBackTop.setVisibility(View.VISIBLE);
-                    distance = 0;
-                    topVisible = true;
-                } else if (distance > ViewConfiguration.getTouchSlop() && topVisible) {
-                    ivBackTop.setVisibility(View.GONE);
-                    distance = 0;
-                    topVisible = false;
-                }
-                if ((dy > 0 && topVisible) || (dy < 0 && !topVisible))//向下滑并且可见  或者  向上滑并且不可见
-                    distance += dy;
-            }
-        });
-
         allAdapter.setmOnItemClickListener((bean, v, position) -> {
             Bundle bundle = new Bundle();
             bundle.putInt("rank_id", bean.getId());
@@ -304,4 +277,5 @@ public class RankListActivity extends BaseTabActivity<RankListPresenter> impleme
             setUnreadMsgText(getMessagesController().unreadUnmutedDialogs);
         }
     }
+
 }

+ 40 - 0
TMessagesProj/src/main/java/org/telegram/cricdit/utils/TimeUtils.java

@@ -334,6 +334,34 @@ public class TimeUtils {
         return strings;
     }
 
+    public static String[] getDayInfo(long day){
+        String[] strings = new String[4];
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//要转换的时间格式
+        Date date;
+        Calendar cal = Calendar.getInstance();
+        try {
+            date = new Date(day);
+            sdf.format(date);
+            cal.setTime(date);
+            strings[0] = (cal.get(Calendar.DATE) < 9 ? "0" : "" )+(cal.get(Calendar.DATE));
+            strings[1] = months[cal.get(Calendar.MONTH) < 0 ? 0 : cal.get(Calendar.MONTH)%11];
+            int count = (int) (( date.getTime() - sdf.parse(sdf.format(new Date())).getTime() )) / (1000*3600*24);
+            strings[3] = count+"";
+            if(count > -2 && count < 2){
+                strings[2] = (count == 0 ? "Today" : (count == -1?"Yesterday":"Tomorrow"));
+            }else{
+                strings[2] = weekDays[cal.get(Calendar.DAY_OF_WEEK) - 1 < 0 ? 0 : cal.get(Calendar.DAY_OF_WEEK) - 1];
+            }
+        }catch (Exception e){
+            strings[0] = "";
+            strings[1] = "";
+            strings[2] = "";
+            strings[3] = "0";
+            e.printStackTrace();
+        }
+        return strings;
+    }
+
     /**
      * 将字符串转为时间戳
      */
@@ -356,4 +384,16 @@ public class TimeUtils {
         res = simpleDateFormat.format(date);
         return res;
     }
+
+    //将时间字符串转为时间戳字符串
+    public static Long getStringTimes(String time,String pattern) {
+        Long longTime = null;
+        try {
+            SimpleDateFormat sdf = new SimpleDateFormat(pattern);
+            longTime = sdf.parse(time).getTime() / 1000;
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return longTime;
+    }
 }

+ 91 - 17
TMessagesProj/src/main/java/org/telegram/onecric/adapter/CricketDayAdapter.java

@@ -3,9 +3,13 @@ package org.telegram.onecric.adapter;
 
 import static org.telegram.cricdit.utils.TimeUtils.getDayInfo;
 
+import android.content.Context;
 import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.ViewGroup;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
 
 import androidx.annotation.NonNull;
 import androidx.recyclerview.widget.LinearLayoutManager;
@@ -21,33 +25,103 @@ import org.telegram.onecric.ui.activity.NewMatchActivity;
 
 import java.util.List;
 
-public class CricketDayAdapter extends BaseQuickAdapter<CricketAllBean.CricketDayBean, BaseViewHolder> {
+public class CricketDayAdapter extends RecyclerView.Adapter<CricketDayAdapter.ViewHolder>  {
     NewMatchActivity fragment;
 
-    public CricketDayAdapter(NewMatchActivity fragment, int layoutResId, List<CricketAllBean.CricketDayBean> list) {
-        super(layoutResId,list);
+    Context context;
+    List<CricketAllBean.CricketDayBean> bean;
+
+    public CricketDayAdapter(NewMatchActivity fragment,Context context, List<CricketAllBean.CricketDayBean> mList) {
+        this.context = context;
         this.fragment = fragment;
+        this.bean = mList;
     }
 
+    @NonNull
+    @Override
+    public CricketDayAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View itemView = LayoutInflater.from(context).inflate(R.layout.item_cricket_day, parent, false);
+        return new CricketDayAdapter.ViewHolder(itemView);
+    }
 
     @Override
-    protected void convert(@NonNull BaseViewHolder helper, CricketAllBean.CricketDayBean item) {
-        String dates[] = getDayInfo(item.getDay());
-        helper.setText(R.id.tv_date,dates[0]);
-        helper.setText(R.id.tv_month,dates[1]);
-        helper.setText(R.id.tv_day,dates[2]);
-
-        CricketNewAdapter mAdapter = new CricketNewAdapter(fragment.getContext(),R.layout.item_cricket_new, item.getList());
-        mAdapter.setOnItemChildClickListener((adapter, view, position) -> {
-            if (view.getId() == R.id.ll_title && !TextUtils.isEmpty(mAdapter.getItem(position).getTournamentId())) {
-                CricketInnerActivity.forward(mContext, mAdapter.getItem(position).getName(), mAdapter.getItem(position).getType(), Integer.parseInt(mAdapter.getItem(position).getTournamentId()));
+    public void onBindViewHolder(@NonNull CricketDayAdapter.ViewHolder helper, int position) {
+        String dates[] = getDayInfo(bean.get(position).getDay());
+//        fragment.setDayInfo(dates,new Date().getTime());
+        helper.tv_date.setText(dates[0]);
+        helper.tv_month.setText(dates[1]);
+        helper.tv_day.setText(dates[2]);
+        if(dates[0].equals("Today")){
+            fragment.todayPosition = helper.getLayoutPosition();
+        }
+
+        CricketNewAdapter mAdapter = new CricketNewAdapter(context,R.layout.item_cricket_new, bean.get(position).getList());
+        mAdapter.setOnItemChildClickListener((adapter, view, index) -> {
+            if (view.getId() == R.id.ll_title && !TextUtils.isEmpty(mAdapter.getItem(index).getTournamentId())) {
+                CricketInnerActivity.forward(context, mAdapter.getItem(index).getName(), mAdapter.getItem(index).getType(), Integer.parseInt(mAdapter.getItem(index).getTournamentId()));
             }
         });
-        View inflate = LayoutInflater.from(mContext).inflate(R.layout.layout_match_rv_empty, null, false);
+        View inflate = LayoutInflater.from(context).inflate(R.layout.layout_match_rv_empty, null, false);
         mAdapter.setEmptyView(inflate);
-        RecyclerView rv_cricket = helper.getView(R.id.rv_cricket);
-
-        rv_cricket.setLayoutManager(new LinearLayoutManager(mContext));
+        RecyclerView rv_cricket = helper.rv_cricket;
+        rv_cricket.setLayoutManager(new LinearLayoutManager(context));
         rv_cricket.setAdapter(mAdapter);
     }
+
+    @Override
+    public int getItemCount() {
+        return bean.size();
+    }
+
+    public void setData(List<CricketAllBean.CricketDayBean> list) {
+        if (bean != null && bean.size() > 0) {
+            bean.clear();
+        }
+        this.bean = list;
+        notifyDataSetChanged();
+    }
+
+    public void setPositionData(int index,CricketAllBean.CricketDayBean b){
+        if (bean != null && bean.size() > 0) {
+            bean.set(index,b);
+            notifyItemChanged(index);
+        }
+    }
+
+    public void addData(List<CricketAllBean.CricketDayBean> data) {
+        if (bean != null && data != null) {
+            bean.addAll(data);
+            notifyDataSetChanged();
+        }
+    }
+
+    public void addData(int position,List<CricketAllBean.CricketDayBean> data) {
+        if (bean != null && data != null) {
+            bean.addAll(position,data);
+            notifyDataSetChanged();
+        }
+    }
+
+    public List<CricketAllBean.CricketDayBean> getData(){
+        return bean;
+    }
+
+    public class ViewHolder extends RecyclerView.ViewHolder {
+        public RelativeLayout rl_time_title;
+        public TextView tv_day;
+        public TextView tv_date;
+        public TextView tv_month;
+        public View line;
+        public RecyclerView rv_cricket;
+
+        ViewHolder(View itemView) {
+            super(itemView);
+            rl_time_title = itemView.findViewById(R.id.rl_time_title);
+            tv_day = itemView.findViewById(R.id.tv_day);
+            tv_date = itemView.findViewById(R.id.tv_date);
+            tv_month = itemView.findViewById(R.id.tv_month);
+            line = itemView.findViewById(R.id.line);
+            rv_cricket = itemView.findViewById(R.id.rv_cricket);
+        }
+    }
 }

+ 4 - 3
TMessagesProj/src/main/java/org/telegram/onecric/adapter/SelectTournamentAdapter.java

@@ -9,6 +9,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.BaseViewHolder;
 
 import org.telegram.messenger.R;
+import org.telegram.onecric.mvp.CricketFiltrateBean;
 import org.telegram.onecric.mvp.bean.CricketTournamentBean;
 
 import java.util.List;
@@ -17,13 +18,13 @@ import java.util.List;
  * 开发公司:东莞市梦幻科技有限公司
  * 时间:2022/8/27
  */
-public class SelectTournamentAdapter extends BaseQuickAdapter<CricketTournamentBean, BaseViewHolder> {
-    public SelectTournamentAdapter(int layoutResId, @Nullable List<CricketTournamentBean> data) {
+public class SelectTournamentAdapter extends BaseQuickAdapter<CricketFiltrateBean, BaseViewHolder> {
+    public SelectTournamentAdapter(int layoutResId, @Nullable List<CricketFiltrateBean> data) {
         super(layoutResId, data);
     }
 
     @Override
-    protected void convert(@NonNull BaseViewHolder helper, CricketTournamentBean item) {
+    protected void convert(@NonNull BaseViewHolder helper, CricketFiltrateBean item) {
         if (!TextUtils.isEmpty(item.getName())) {
             helper.setText(R.id.tv_name, item.getName());
         }else {

+ 2 - 2
TMessagesProj/src/main/java/org/telegram/onecric/dialog/TournaListDialog.java

@@ -53,7 +53,7 @@ public class TournaListDialog extends BottomPopupView {
         mRecyclerView.setLayoutParams(layoutParams);
 
         mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
-        if (mTournamentBeanList != null) {
+        /*if (mTournamentBeanList != null) {
             mTournamentAdapter = new SelectTournamentAdapter(R.layout.item_select_tournament, mTournamentBeanList);
             mTournamentAdapter.setOnItemClickListener((adapter, view, position) -> {
                 mTournamentAdapter.getItem(position).setCheck(!mTournamentAdapter.getItem(position).isCheck());
@@ -86,7 +86,7 @@ public class TournaListDialog extends BottomPopupView {
                 data.get(i).setCheck(false);
             }
             mTournamentAdapter.notifyDataSetChanged();
-        });
+        });*/
     }
 
     public void setData(List<CricketTournamentBean> list) {

+ 3 - 3
TMessagesProj/src/main/java/org/telegram/onecric/mvp/CricketFiltrateBean.java

@@ -3,7 +3,7 @@ package org.telegram.onecric.mvp;
 public class CricketFiltrateBean {
     private boolean isCheck;
     private String name;
-    private String id;
+    private int id;
 
     public void setCheck(boolean check) {
         isCheck = check;
@@ -21,11 +21,11 @@ public class CricketFiltrateBean {
         this.name = name;
     }
 
-    public String getId() {
+    public int getId() {
         return id;
     }
 
-    public void setId(String id) {
+    public void setId(int id) {
         this.id = id;
     }
 }

+ 31 - 0
TMessagesProj/src/main/java/org/telegram/onecric/mvp/CricketNewPresenter.java

@@ -10,6 +10,8 @@ import org.telegram.onecric.mvp.bean.CricketTournamentBean;
 import org.telegram.onecric.net.ApiCallback;
 import org.telegram.onecric.net.ApiStores;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
 import java.util.TimeZone;
 
@@ -76,4 +78,33 @@ public class CricketNewPresenter extends BasePresenter<CricketNewView> {
         });
     }
 
+    public void getRefreshTodayData(String tagIds,int streamType,boolean isLiveNow){
+        addSubscription(apiStores.getCricketDayMatchList(TimeZone.getDefault().getID(),new SimpleDateFormat("yyyy-MM-dd").format(new Date().getTime()),tagIds,streamType,isLiveNow?1:0), new ApiCallback() {
+            @Override
+            public void onSuccess(String data, String msg) {
+                CricketAllBean bean;
+                try{
+                    bean = JSONObject.parseObject(JSONObject.parseObject(data).toString(), CricketAllBean.class);
+                }catch (Exception e){
+                    bean = null;
+                }
+                mvpView.getRefreshSuccess(bean);
+            }
+
+            @Override
+            public void onFailure(String msg) {
+
+            }
+
+            @Override
+            public void onError(String msg) {
+
+            }
+
+            @Override
+            public void onFinish() {
+
+            }
+        });
+    }
 }

+ 1 - 0
TMessagesProj/src/main/java/org/telegram/onecric/mvp/CricketNewView.java

@@ -13,4 +13,5 @@ public interface CricketNewView extends BaseView<JsonBean> {
     void getDataSuccess(List<CricketFiltrateBean> list);
     void getDataSuccess(int type, CricketAllBean bean);
     void getDataFail(int type ,String msg);
+    void getRefreshSuccess(CricketAllBean bean);
 }

+ 3 - 0
TMessagesProj/src/main/java/org/telegram/onecric/net/ApiStores.java

@@ -851,4 +851,7 @@ public interface ApiStores {
     @GET("api/Cricketnew/get_search")
     Observable<JsonObject> searchMatchNew(@Query("timezone") String timezone,@Query("content") String content,@Query("type")String type,@Query("page")int page);
 
+    //新获取公开赛列表
+    @POST("api/Cricketnew/get_cricket_tournament")
+    Observable<JsonObject> getTournamentList(@Query("name") String name);
 }

+ 154 - 86
TMessagesProj/src/main/java/org/telegram/onecric/ui/activity/NewMatchActivity.java

@@ -1,10 +1,8 @@
 package org.telegram.onecric.ui.activity;
 
 import static org.telegram.cricdit.utils.TimeUtils.getDayInfo;
+import static org.telegram.onecric.utils.AnimUtil.transAnim;
 
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
-import android.animation.ObjectAnimator;
 import android.app.Dialog;
 import android.graphics.Color;
 import android.graphics.Typeface;
@@ -14,7 +12,6 @@ import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.WindowManager;
-import android.view.animation.LinearInterpolator;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
@@ -26,7 +23,6 @@ import com.ethanhua.skeleton.RecyclerViewSkeletonScreen;
 import com.ethanhua.skeleton.Skeleton;
 import com.github.gzuliyujiang.calendarpicker.CalendarPicker;
 import com.github.gzuliyujiang.calendarpicker.core.ColorScheme;
-import com.google.android.material.appbar.AppBarLayout;
 import com.lxj.xpopup.XPopup;
 import com.scwang.smart.refresh.layout.SmartRefreshLayout;
 import com.scwang.smart.refresh.layout.api.RefreshLayout;
@@ -35,6 +31,7 @@ import org.telegram.cricdit.base.BaseTabActivity;
 import org.telegram.cricdit.base.IPresenter;
 import org.telegram.onecric.adapter.CricketFiltrateAdapter;
 import org.telegram.onecric.base.JsonBean;
+import org.telegram.onecric.dialog.TournamentDialog;
 import org.telegram.onecric.mvp.CricketAllBean;
 import org.telegram.onecric.mvp.CricketFiltrateBean;
 import org.telegram.cricdit.config.Constants;
@@ -49,8 +46,6 @@ import org.telegram.messenger.LocaleController;
 import org.telegram.messenger.R;
 import org.telegram.onecric.adapter.CricketDayAdapter;
 import org.telegram.ui.ActionBar.ActionBar;
-import org.telegram.ui.ActionBar.ActionBarMenu;
-import org.telegram.ui.ActionBar.ActionBarMenuItem;
 import org.telegram.ui.ActionBar.Theme;
 import org.telegram.ui.WebviewActivity;
 import java.text.SimpleDateFormat;
@@ -58,9 +53,10 @@ import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
 
 public class NewMatchActivity extends BaseTabActivity implements CricketNewView,View.OnClickListener{
-    private ActionBarMenu menu;
     private PrivacyPolicyPopup mPopupView;
 
     private RecyclerView rv_filtrate;
@@ -80,26 +76,30 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
     private LinearLayout ll_tours;
     private TextView tv_to_today;
     private TextView tv_fresh;
+    private TextView tv_search;
     private LinearLayout ll_empty;
     private CricketDayAdapter mAdapter;
-    private CricketFiltrateAdapter mFiltrateAdapter;
+    public CricketFiltrateAdapter mFiltrateAdapter;
 
     private boolean isLiveNow = false;
     private int streamType = 0;
     private int selectToursNum = 0;
     private Dialog mStreamDialog;
-    private List<CricketFiltrateBean> filtrateCheckedList;
-    private String tag="";
+    public List<CricketFiltrateBean> filtrateCheckedList;
+    public String tag="";
     private boolean isNotNetWork;
     private long singleTimeInMillis;
     private CalendarPicker picker;
     private RecyclerViewSkeletonScreen filtrateSkeletonScreen;//会导致回到每次rv数量变化会跳回第一页
-    private String lastDay;
-    private String endDay;
+    private String lastDay,lastDay2;
+    private String endDay,endDay2;
     public int todayPosition = 0;
     private Drawable drawableTop,drawableDown;
     private LinearLayout skeletonLoadLayout;
     private CricketNewPresenter mPresenter;
+    private Timer mTimer;
+    private TournamentDialog tournamentDialog;
+
     @Override
     protected int getLayoutResId() {
         return R.layout.activity_match_new;
@@ -117,10 +117,6 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
 
     @Override
     protected void initView(View view) {
-        AppBarLayout appBarLayout = view.findViewById(R.id.match_app_bar);
-        appBarLayout.setTargetElevation(0);
-        menu = actionBar.createMenu();
-        initTopItem();
         mPresenter = new CricketNewPresenter(this);
         rv_filtrate = view.findViewById(R.id.rv_filtrate);
         tv_day = view.findViewById(R.id.tv_day);
@@ -133,13 +129,14 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
         ll_tours = view.findViewById(R.id.ll_tours);
         tv_to_today = view.findViewById(R.id.tv_to_today);
         ll_empty = view.findViewById(R.id.ll_empty);
-        tv_live_now.setOnClickListener(this);
-        tv_tours_num.setOnClickListener(this);
         tv_fresh = view.findViewById(R.id.tv_fresh);
         skeletonLoadLayout = view.findViewById(R.id.ll_skeleton);
+
+        tv_live_now.setOnClickListener(this);
         tv_fresh.setOnClickListener(this);
         view.findViewById(R.id.tv_calendar).setOnClickListener(this);
         view.findViewById(R.id.tv_to_today).setOnClickListener(this);
+        view.findViewById(R.id.tv_search).setOnClickListener(this);
         ll_tours.setOnClickListener(this);
         initStreamDialog();
         initCalendarPicker();
@@ -147,7 +144,17 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
         drawableTop.setBounds(0,0,drawableTop.getMinimumWidth(),drawableTop.getMinimumHeight());
         drawableDown = getContext().getResources().getDrawable(R.mipmap.ic_go_today_down);
         drawableDown.setBounds(0,0,drawableDown.getMinimumWidth(),drawableDown.getMinimumHeight());
-
+        tournamentDialog = new TournamentDialog(getContext(),this,new TournamentDialog.OnSelectTourListener() {
+            @Override
+            public void selectedWord(String tourIds, int checkNum) {
+                tag = tourIds;
+                selectToursNum = checkNum;
+                tv_tours_num.setText(selectToursNum+"");
+                tv_tours_num.setVisibility(selectToursNum > 0 ? View.VISIBLE : View.GONE);
+                mFiltrateAdapter.notifyDataSetChanged();
+                requestList(1);
+            }
+        });
         initData();
     }
 
@@ -157,29 +164,48 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
         mFiltrateAdapter.setOnItemChildClickListener((adapter, view, position) -> {
             if(view.getId() == R.id.tv_name){
                 mFiltrateAdapter.getItem(position).setCheck(!mFiltrateAdapter.getItem(position).isCheck());
-                if(mFiltrateAdapter.getItem(position).isCheck()){
+                int id = mFiltrateAdapter.getData().get(position).getId();
+                List<CricketFiltrateBean> tList = new ArrayList<>();
+                if(tournamentDialog.mAdapter.getItemCount()>0){
+                    tList.addAll(tournamentDialog.mAdapter.getData());
+                    for(int i=0; i<tList.size();i++){
+                        if(id == tournamentDialog.mAdapter.getData().get(i).getId()){
+                            tList.get(i).setCheck(mFiltrateAdapter.getItem(position).isCheck());
+                            tournamentDialog.mAdapter.addData(0,tList.get(i));
+                            tournamentDialog.mAdapter.remove(i+1);
+                            tournamentDialog.mAdapter.notifyDataSetChanged();
+                            break;
+                        }
+                    }
+                }
+
+                StringBuilder tagsId = new StringBuilder(tag);
+                if(mFiltrateAdapter.getData().get(position).isCheck()){
                     ++selectToursNum;
-                    filtrateCheckedList.add(mFiltrateAdapter.getItem(position));
-                    mFiltrateAdapter.addData(0,mFiltrateAdapter.getItem(position));
+                    if(!tag.contains(","+id) && !tag.contains(id+",")){
+                        tagsId.append(id+",");
+                    }
+                    filtrateCheckedList.add(mFiltrateAdapter.getData().get(position));
+                    mFiltrateAdapter.addData(0,mFiltrateAdapter.getData().get(position));
                     mFiltrateAdapter.remove(position+1);
                 }else{
                     --selectToursNum;
-                    filtrateCheckedList.remove(mFiltrateAdapter.getItem(position));
-                    mFiltrateAdapter.addData(mFiltrateAdapter.getItem(position));
+                    if(tag.contains(id+",")){
+                        tagsId.delete(tagsId.indexOf(id+","),
+                                tagsId.indexOf(id+",")+(id+",").length());
+                    }
+                    filtrateCheckedList.remove(mFiltrateAdapter.getData().get(position));
+                    mFiltrateAdapter.addData(mFiltrateAdapter.getData().get(position));
                     mFiltrateAdapter.remove(position);
                 }
+                if(TextUtils.isEmpty(tagsId.toString())){
+                    tag = "";
+                }else{
+                    tag = tagsId.toString();
+                }
                 rv_filtrate.smoothScrollToPosition(0);
                 tv_tours_num.setText(selectToursNum + "");
                 tv_tours_num.setVisibility(selectToursNum > 0 ? View.VISIBLE : View.GONE);
-                if(filtrateCheckedList.size()>0){
-                    StringBuilder tagsId = new StringBuilder();
-                    for(CricketFiltrateBean bean : filtrateCheckedList){
-                        tagsId.append(","+bean.getId());
-                    }
-                    tag = tagsId.substring(1);
-                }else{
-                    tag = "";
-                }
                 requestList(1);
             }
         });
@@ -194,7 +220,6 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
             }
         });
         mFiltrateAdapter.addHeaderView(headerStreamingView,-1, LinearLayout.HORIZONTAL);
-
         rv_filtrate.setLayoutManager(new LinearLayoutManager(getContext(),LinearLayoutManager.HORIZONTAL, false));
         rv_filtrate.setAdapter(mFiltrateAdapter);
 
@@ -202,18 +227,15 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
         smart_rl.setOnRefreshListener(new OnRefreshListener() {
             @Override
             public void onRefresh(@NonNull RefreshLayout refreshLayout) {
-                //前一天
                 requestList(0);
             }
         });
 
-//        recyclerView.getRecycledViewPool().setMaxRecycledViews(0, 20);
-//        recyclerView.setItemViewCacheSize(20);
-//        mAdapter = new CricketDayAdapter(this,getActivity(), new ArrayList<>());
-        mAdapter = new CricketDayAdapter(this,R.layout.item_cricket_day, new ArrayList<>());
+        mAdapter = new CricketDayAdapter(this,getContext(), new ArrayList<>());
         LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
         recyclerView.setLayoutManager(linearLayoutManager);
         recyclerView.setAdapter(mAdapter);
+        recyclerView.setItemAnimator(null);
         recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
             @Override
             public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
@@ -227,7 +249,9 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
                 }else if(newState == RecyclerView.SCROLL_STATE_DRAGGING){
                     if(recyclerView.getChildAt(0) != null){
                         int currentPosition = ((RecyclerView.LayoutParams) recyclerView.getChildAt(0).getLayoutParams()).getViewAdapterPosition();
-                        setDayInfo(getDayInfo(mAdapter.getItem(currentPosition).getDay()));
+                        if(currentPosition != -1 && !TextUtils.isEmpty(mAdapter.getData().get(currentPosition).getDay())){
+                            setDayInfo(getDayInfo(mAdapter.getData().get(currentPosition).getDay()));
+                        }
                     }
                 }
 
@@ -245,15 +269,6 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
         requestList(1);
     }
 
-    private void initTopItem() {
-        ActionBarMenuItem searchItem = menu.addItem(0, R.drawable.ic_ab_search);
-        searchItem.setIconColor(ColorUtil.COLOR_WHITE);
-
-        searchItem.setOnClickListener(v -> {
-//            SearchMatchActivity.forward(getContext());
-        });
-    }
-
     @Override
     protected void initActionBar(ActionBar actionBar) {
         super.initActionBar(actionBar);
@@ -353,9 +368,17 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
             picker.show();
         }else if(id == R.id.ll_tours){
             //展开筛选联赛弹窗
-
-        }else if(id == R.id.tv_tours_num){
-            //数量
+            if(tournamentDialog != null){
+                if (tournamentDialog != null) {
+                new XPopup.Builder(getContext())
+                        .moveUpToKeyboard(true)
+                        .isDestroyOnDismiss(false)
+                        .isLightNavigationBar(true)
+                        .navigationBarColor(getContext().getResources().getColor(R.color.colorWhite))
+                        .asCustom(tournamentDialog)
+                        .show();
+                }
+            }
         }else if(id == R.id.ll_all_live){
             if(streamType!=0){
                 streamType = 0;
@@ -372,7 +395,6 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
             if(mStreamDialog != null){
                 mStreamDialog.dismiss();
             }
-
         }else if(id == R.id.ll_match_live){
             if(streamType!=1){
                 streamType = 1;
@@ -389,7 +411,6 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
             if(mStreamDialog != null){
                 mStreamDialog.dismiss();
             }
-
         }else if(id == R.id.ll_author_live){
             if(streamType!=2){
                 streamType = 2;
@@ -406,18 +427,21 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
             if(mStreamDialog != null){
                 mStreamDialog.dismiss();
             }
-
         }else if(id == R.id.tv_to_today){
-            recyclerView.smoothScrollToPosition(todayPosition);
-            setDayInfo(getDayInfo(mAdapter.getItem(todayPosition).getDay()));
+            if(todayPosition<mAdapter.getData().size()){
+                recyclerView.smoothScrollToPosition(todayPosition);
+                setDayInfo(getDayInfo(mAdapter.getData().get(todayPosition).getDay()));
+            }
         }else if(id == R.id.tv_fresh){
             ll_empty.setVisibility(View.GONE);
             recyclerView.setVisibility(View.VISIBLE);
+            tv_to_today.setVisibility(View.VISIBLE);
             if(isLiveNow){
                 tv_live_now.setSelected(false);
                 isLiveNow = false;
                 smart_rl.setEnableRefresh(true);
             }
+
             if(streamType!=0){
                 streamType = 0;
                 if(iv_all != null){
@@ -429,21 +453,24 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
                 iv_streaming.setSelected(false);
                 tv_streaming.setSelected(false);
             }
+
             tag = "";
             mPresenter.getFiltrateList();
             requestList(1);
+        }else if(id == R.id.tv_search){
+            SearchMatchActivity.forward(getContext());
         }
     }
 
     private void showTodayBtnAnim(int type){
         switch (type){
-            case 0://从下往上 出现
+            case 0:
                 if(tv_to_today.isSelected()){
                     transAnim(tv_to_today,tv_to_today.getMeasuredHeight() + UIUtil.dip2px(getContext(),20),0);
                     tv_to_today.setSelected(false);
                 }
                 break;
-            case 1://从上往下 退出
+            case 1:
                 if(!tv_to_today.isSelected()){
                     transAnim(tv_to_today,0,tv_to_today.getMeasuredHeight() + UIUtil.dip2px(getContext(),20));
                     tv_to_today.setSelected(true);
@@ -452,20 +479,7 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
         }
     }
 
-    public void transAnim(View view,float start,float end) {
-        ObjectAnimator mObjectAnimator = ObjectAnimator.ofFloat(view, "translationY",start,end);
-        mObjectAnimator.setDuration(500);
-        mObjectAnimator.setInterpolator(new LinearInterpolator());
 
-        mObjectAnimator.addListener(new AnimatorListenerAdapter() {
-            @Override
-            public void onAnimationEnd(Animator animation) {
-                super.onAnimationEnd(animation);
-
-            }
-        });
-        mObjectAnimator.start(); // 开始播放动画
-    }
 
     public void requestList(int type){
         if(type == 0){
@@ -474,8 +488,10 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
             }
             if(mAdapter.getItemCount() <= 0 && isNotNetWork){
                 requestList(1);
+            }else if(mAdapter.getItemCount() <= 0 && !TextUtils.isEmpty(lastDay2)){
+                mPresenter.getCricketMatchList(type,lastDay2,TextUtils.isEmpty(tag)?"":tag,streamType,isLiveNow);//前一天
             }else if(!TextUtils.isEmpty(lastDay)){
-                mPresenter.getCricketMatchList(type,lastDay,tag,streamType,isLiveNow);
+                mPresenter.getCricketMatchList(type,lastDay,TextUtils.isEmpty(tag)?"":tag,streamType,isLiveNow);//前一天
             }else{
                 smart_rl.finishRefresh();
             }
@@ -484,10 +500,12 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
             endDay = "";
             skeletonLoadLayout.setVisibility(View.VISIBLE);
             recyclerView.setVisibility(View.GONE);
-            mPresenter.getCricketMatchList(type,new SimpleDateFormat("yyyy-MM-dd").format(singleTimeInMillis),tag,streamType,isLiveNow);
+            mPresenter.getCricketMatchList(type,new SimpleDateFormat("yyyy-MM-dd").format(singleTimeInMillis),TextUtils.isEmpty(tag)?"":tag,streamType,isLiveNow);//选中日
         }else if(type == 2){
-            if(!TextUtils.isEmpty(endDay)){
-                mPresenter.getCricketMatchList(type,endDay,tag,streamType,isLiveNow);
+            if(mAdapter.getItemCount() <= 0 && !TextUtils.isEmpty(endDay2)){
+                mPresenter.getCricketMatchList(type,endDay2,TextUtils.isEmpty(tag)?"":tag,streamType,isLiveNow);//后一天
+            }else if(!TextUtils.isEmpty(endDay)){
+                mPresenter.getCricketMatchList(type,endDay,TextUtils.isEmpty(tag)?"":tag,streamType,isLiveNow);//后一天
             }
         }
     }
@@ -499,6 +517,7 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
         tv_tours_num.setVisibility(View.GONE);
         if(list!=null){
             mFiltrateAdapter.setNewData(list);
+            ll_tours.setVisibility(View.VISIBLE);
             rv_filtrate.setBackgroundColor(Color.TRANSPARENT);
             filtrateSkeletonScreen.hide();
         }
@@ -510,32 +529,48 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
             smart_rl.finishRefresh();
         }
         skeletonLoadLayout.setVisibility(View.GONE);
+
+        if(type == 1){
+            setDayInfo(getDayInfo(singleTimeInMillis));
+        }
+
         if (bean != null && bean.getItem() != null && bean.getItem().size() > 0) {
+            ll_empty.setVisibility(View.GONE);
             if(type == 0 || type == 1){
                 this.lastDay = bean.getFrontDay();
             }
             if(type == 2 || type == 1){
                 this.endDay = bean.getEndDay();
             }
-            ll_empty.setVisibility(View.GONE);
             recyclerView.setVisibility(View.VISIBLE);
+            tv_to_today.setVisibility(View.VISIBLE);
             if(type == 0){
                 todayPosition = todayPosition+bean.getItem().size();
                 mAdapter.addData(0,bean.getItem());
             }else if(type == 1){
                 todayPosition = 0;
                 setDayInfo(getDayInfo(bean.getItem().get(0).getDay()));
-                mAdapter.setNewData(bean.getItem());;
+//                mAdapter.setNewData(bean.getItem());
+                mAdapter.setData(bean.getItem());
                 recyclerView.scrollBy(0, (int) (recyclerView.getY() + UIUtil.dip2px(getContext(),60)));
+                if(mTimer == null){
+                    refreshTodayData();
+                }
             }else{
                 mAdapter.addData(bean.getItem());
             }
-        } else if(mAdapter.getItemCount() == 0){
-            recyclerView.setVisibility(View.GONE);
-            ll_empty.setVisibility(View.VISIBLE);
-        } else if(type == 1 && (!TextUtils.isEmpty(tag) || isLiveNow || streamType != 0)){
-            mAdapter.setNewData(new ArrayList<>());
+        } else if(mAdapter.getItemCount() == 0 || type == 1){
+            if(bean != null){
+                if(type == 0 || type == 1){
+                    this.lastDay2 = bean.getFrontDay();
+                }
+                if(type == 2 || type == 1){
+                    this.endDay2 = bean.getFrontDay();
+                }
+            }
             recyclerView.setVisibility(View.GONE);
+            tv_to_today.setVisibility(View.GONE);
+            mAdapter.setData(new ArrayList<>());
             ll_empty.setVisibility(View.VISIBLE);
         }
     }
@@ -556,11 +591,9 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
         }else{
             isNotNetWork = false;
         }
-
     }
 
     public void setDayInfo(String[] info){
-        singleTimeInMillis = new Date().getTime();
         tv_date.setText(info[0]);
         tv_month.setText(info[1]);
         tv_day.setText(info[2]);
@@ -637,4 +670,39 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
         super.onResume();
         setNavigationBarColor(ColorUtil.COLOR_WHITE);
     }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        if(mTimer != null){
+            mTimer.cancel();
+        }
+    }
+
+    /**
+     * 每10s刷新今天的数据
+     */
+    private void refreshTodayData(){
+        mTimer = new Timer();
+        mTimer.schedule(new TimerTask() {
+            @Override
+            public void run() {
+                if(tv_day.getText().toString().equals("Today")){
+                    mPresenter.getRefreshTodayData(tag,streamType,isLiveNow);
+                }
+            }
+        }, 10000, 10000);
+    }
+
+    @Override
+    public void getRefreshSuccess(CricketAllBean bean) {
+        try{
+            if(mAdapter.getItemCount()-1 >= todayPosition){
+                mAdapter.setPositionData(todayPosition,bean.getItem().get(0));
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+
+    }
 }

+ 31 - 2
TMessagesProj/src/main/java/org/telegram/onecric/ui/fragment/CricketMatchesFragment.java

@@ -1,7 +1,10 @@
 package org.telegram.onecric.ui.fragment;
 
+import static org.telegram.cricdit.utils.TimeUtils.getStringTimes;
+
 import android.os.Bundle;
 import android.view.View;
+import android.widget.ProgressBar;
 
 import androidx.annotation.NonNull;
 import androidx.recyclerview.widget.LinearLayoutManager;
@@ -21,7 +24,10 @@ import org.telegram.onecric.mvp.presenter.CricketMatchesPresenter;
 import org.telegram.onecric.mvp.view.CricketMatchesView;
 import org.telegram.onecric.ui.activity.CricketDetailActivity;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -42,6 +48,8 @@ public class CricketMatchesFragment extends MvpFragment<CricketMatchesPresenter>
     private RecyclerView recyclerView;
     private CricketDetailAdapter mAdapter;
     private int mPage = 1;
+    private ProgressBar progress_bar;
+    private int todayPosition = 0;
 
     @Override
     protected int getLayoutId() {
@@ -58,6 +66,7 @@ public class CricketMatchesFragment extends MvpFragment<CricketMatchesPresenter>
         mId = getArguments().getInt("id");
         smart_rl = findViewById(R.id.smart_rl);
         recyclerView = findViewById(R.id.recyclerView);
+        progress_bar = findViewById(R.id.progress_bar);
     }
 
     @Override
@@ -66,6 +75,7 @@ public class CricketMatchesFragment extends MvpFragment<CricketMatchesPresenter>
 //        materialHeader.setColorSchemeColors(getResources().getColor(R.color.c_DC3C23));
 //        smart_rl.setRefreshHeader(materialHeader);
         smart_rl.setEnableLoadMore(false);
+        smart_rl.setEnableRefresh(false);
         smart_rl.setOnRefreshListener(new OnRefreshListener() {
             @Override
             public void onRefresh(@NonNull RefreshLayout refreshLayout) {
@@ -98,11 +108,26 @@ public class CricketMatchesFragment extends MvpFragment<CricketMatchesPresenter>
                 }
             }
         });
+        progress_bar.setVisibility(View.VISIBLE);
         mvpPresenter.getMatchList(true, mId, 1);
     }
 
     @Override
     public void getDataSuccess(boolean isRefresh, List<CricketMatchBean> list) {
+        progress_bar.setVisibility(View.GONE);
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//要转换的时间格式
+        todayPosition = list.size()-1;
+        try {
+            for(int i=0;i<list.size();i++){
+                if(getStringTimes(list.get(i).getScheduled().substring(0,10),"yyyy-MM-dd") >= (sdf.parse(sdf.format(new Date())).getTime())/1000){
+                    todayPosition = i;
+                    break;
+                }
+            }
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
         if (isRefresh) {
             smart_rl.finishRefresh();
             mPage = 2;
@@ -113,6 +138,7 @@ public class CricketMatchesFragment extends MvpFragment<CricketMatchesPresenter>
                     showEmptyView();
                 }
                 mAdapter.setNewData(list);
+                recyclerView.scrollToPosition(todayPosition);
             }else {
                 mAdapter.setNewData(new ArrayList<>());
                 showEmptyView();
@@ -122,6 +148,7 @@ public class CricketMatchesFragment extends MvpFragment<CricketMatchesPresenter>
             if (list != null && list.size() > 0) {
                 smart_rl.finishLoadMore();
                 mAdapter.addData(list);
+                recyclerView.scrollToPosition(todayPosition);
             }else {
                 smart_rl.finishLoadMoreWithNoMoreData();
             }
@@ -145,7 +172,9 @@ public class CricketMatchesFragment extends MvpFragment<CricketMatchesPresenter>
 
     @Override
     public void getDataFail(String msg) {
-        smart_rl.finishRefresh();
-        smart_rl.finishLoadMore();
+//        smart_rl.finishRefresh();
+//        smart_rl.finishLoadMore();
+        progress_bar.setVisibility(View.GONE);
+        mPage--;
     }
 }

+ 0 - 5
TMessagesProj/src/main/res/drawable/bg_212e58_6.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <corners android:radius="6dp"/>
-    <solid android:color="@color/c_212E58"/>
-</shape>

+ 1 - 1
TMessagesProj/src/main/res/drawable/bg_search_15.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
     <corners android:radius="25dp"/>
-    <solid android:color="@color/c_212E58"/>
+    <solid android:color="@color/colorDarkBlue"/>
 </shape>

+ 1 - 1
TMessagesProj/src/main/res/drawable/selector_filtrate_color.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
     <item android:color="@color/c_DC3C23" android:state_selected="true"  />
-    <item android:color="@color/c_1D2550" android:state_selected="false"/>
+    <item android:color="@color/colorBlue" android:state_selected="false"/>
 </selector>

+ 1 - 1
TMessagesProj/src/main/res/drawable/selector_foreground_search.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true" android:drawable="@drawable/bg_search2"/>
+    <item android:state_pressed="true" android:drawable="@drawable/bg_search2_15"/>
     <item android:state_pressed="false" android:drawable="@color/transparent"/>
 </selector>

+ 2 - 2
TMessagesProj/src/main/res/drawable/selector_select_tournament.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_selected="false" android:drawable="@mipmap/icon_select_tournament_false"/>
-    <item android:state_selected="true" android:drawable="@mipmap/icon_select_tournament_true"/>
+    <item android:state_selected="false" android:drawable="@mipmap/btn_square_bor"/>
+    <item android:state_selected="true" android:drawable="@mipmap/btn_square_blue"/>
 </selector>

+ 182 - 189
TMessagesProj/src/main/res/layout/activity_match_new.xml

@@ -6,223 +6,216 @@
     android:layout_height="match_parent"
     android:orientation="vertical">
 
-    <View
+    <FrameLayout
         android:layout_width="match_parent"
-        android:layout_height="@dimen/status_bar_height"
-        android:background="@color/colorActionBarBlue" />
-
-    <androidx.coordinatorlayout.widget.CoordinatorLayout
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:background="@color/c_1D2550"
+        android:paddingTop="45dp">
+        <TextView
+            android:id="@+id/tv_search"
+            android:layout_width="match_parent"
+            android:layout_height="37dp"
+            android:drawablePadding="9dp"
+            android:layout_marginLeft="15dp"
+            android:layout_marginRight="15dp"
+            android:layout_marginBottom="11dp"
+            android:gravity="center_vertical"
+            android:paddingLeft="15dp"
+            android:text="@string/match_search_hint"
+            android:textColor="@color/c_70809B"
+            android:drawableLeft="@mipmap/icon_live_search"
+            android:textSize="14dp"
+            android:background="@drawable/shape_e8e9ed_25dp_rec"
+            android:foreground="@drawable/selector_foreground_search"/>
+    </FrameLayout>
+
+
+    <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:background="@color/colorNormalBg">
+        android:orientation="vertical">
 
-        <com.google.android.material.appbar.AppBarLayout
-            android:id="@+id/match_app_bar"
+        <RelativeLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:background="@color/colorActionBarBlue"
-            android:elevation="0dp">
+            android:orientation="vertical"
+            android:background="@drawable/bg_gradient_d4d3d8_to_white">
 
-            <androidx.appcompat.widget.Toolbar
-                android:id="@+id/match_toolbar"
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/rv_filtrate"
                 android:layout_width="match_parent"
-                android:layout_height="40dp"
-                android:elevation="0dp"
-                app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
-                app:title="@string/CdMatch"
-                app:titleTextColor="#fff" />
-
-        </com.google.android.material.appbar.AppBarLayout>
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:orientation="vertical"
-            app:layout_behavior="@string/appbar_scrolling_view_behavior">
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                android:paddingTop="12dp"
+                android:paddingBottom="12dp"
+                android:background="@color/white" />
 
-            <RelativeLayout
+            <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:orientation="vertical"
-                android:background="@drawable/bg_gradient_d4d3d8_to_white">
+                android:orientation="horizontal"
+                android:paddingTop="13dp"
+                android:paddingBottom="@dimen/dp_10"
+                android:layout_below="@id/rv_filtrate">
 
-                <androidx.recyclerview.widget.RecyclerView
-                    android:id="@+id/rv_filtrate"
-                    android:layout_width="match_parent"
+                <TextView
+                    android:id="@+id/tv_day"
+                    android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:orientation="horizontal"
-                    android:paddingTop="12dp"
-                    android:paddingBottom="12dp"
-                    android:background="@color/white" />
+                    android:fontFamily="@font/noto_sans_display_semibold"
+                    android:textSize="18sp"
+                    android:textColor="@color/c_111111"
+                    android:paddingLeft="15dp"/>
 
-                <LinearLayout
-                    android:layout_width="match_parent"
+                <TextView
+                    android:id="@+id/tv_date"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textSize="16sp"
+                    android:textColor="@color/c_111111"
+                    android:paddingLeft="8dp"/>
+
+                <TextView
+                    android:id="@+id/tv_month"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
                     android:layout_height="wrap_content"
-                    android:orientation="horizontal"
-                    android:paddingTop="13dp"
-                    android:paddingBottom="@dimen/dp_10"
-                    android:layout_below="@id/rv_filtrate">
-
-                    <TextView
-                        android:id="@+id/tv_day"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:fontFamily="@font/noto_sans_display_semibold"
-                        android:textSize="18sp"
-                        android:textColor="@color/c_111111"
-                        android:paddingLeft="15dp"/>
-
-                    <TextView
-                        android:id="@+id/tv_date"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:textSize="16sp"
-                        android:textColor="@color/c_111111"
-                        android:paddingLeft="8dp"/>
-
-                    <TextView
-                        android:id="@+id/tv_month"
-                        android:layout_width="0dp"
-                        android:layout_weight="1"
-                        android:layout_height="wrap_content"
-                        android:textSize="16sp"
-                        android:textColor="@color/c_111111"
-                        android:paddingLeft="8dp"/>
-
-                    <TextView
-                        android:id="@+id/tv_live_now"
-                        android:layout_width="wrap_content"
-                        android:layout_height="24dp"
-                        android:paddingLeft="10dp"
-                        android:paddingRight="10dp"
-                        android:textSize="11sp"
-                        android:textColor="@drawable/selector_filtrate_color"
-                        android:gravity="center"
-                        android:text="Live Now"
-                        android:layout_gravity="center_vertical"
-                        android:foreground="@drawable/selector_foreground_filtrate"
-                        android:background="@drawable/selector_bg_filtrate"
-                        android:layout_marginRight="@dimen/dp_10"/>
-
-                    <View
-                        android:layout_width="0.5dp"
-                        android:layout_height="25dp"
-                        android:background="@drawable/bg_gradient_dcdbe0_line"
-                        android:layout_marginLeft="10dp"
-                        android:layout_marginRight="@dimen/dp_10"
-                        android:layout_gravity="center_vertical"
-                        android:visibility="gone"/>
-
-                    <TextView
-                        android:id="@+id/tv_calendar"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:drawableLeft="@mipmap/ic_check_date"
-                        android:layout_gravity="center_vertical"
-                        android:text="Calendar"
-                        android:drawablePadding="3dp"
-                        android:letterSpacing="0.03"
-                        android:textSize="11sp"
-                        android:textColor="@color/c_1D2550"
-                        android:gravity="center_vertical"
-                        android:fontFamily="@font/noto_sans_display_semibold"
-                        android:foreground="@drawable/selector_foreground_white"
-                        android:paddingRight="12dp"/>
-
-                </LinearLayout>
-
-                <LinearLayout
-                    android:id="@+id/ll_tours"
+                    android:textSize="16sp"
+                    android:textColor="@color/c_111111"
+                    android:paddingLeft="8dp"/>
+
+                <TextView
+                    android:id="@+id/tv_live_now"
+                    android:layout_width="wrap_content"
+                    android:layout_height="24dp"
+                    android:paddingLeft="10dp"
+                    android:paddingRight="10dp"
+                    android:textSize="11sp"
+                    android:textColor="@drawable/selector_filtrate_color"
+                    android:gravity="center"
+                    android:text="Live Now"
+                    android:layout_gravity="center_vertical"
+                    android:foreground="@drawable/selector_foreground_filtrate"
+                    android:background="@drawable/selector_bg_filtrate"
+                    android:layout_marginRight="@dimen/dp_10"/>
+
+                <View
+                    android:layout_width="0.5dp"
+                    android:layout_height="25dp"
+                    android:background="@drawable/bg_gradient_dcdbe0_line"
+                    android:layout_marginLeft="10dp"
+                    android:layout_marginRight="@dimen/dp_10"
+                    android:layout_gravity="center_vertical"
+                    android:visibility="gone"/>
+
+                <TextView
+                    android:id="@+id/tv_calendar"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:orientation="horizontal"
+                    android:drawableLeft="@mipmap/ic_check_date"
+                    android:layout_gravity="center_vertical"
+                    android:text="Calendar"
+                    android:drawablePadding="3dp"
+                    android:letterSpacing="0.03"
+                    android:textSize="11sp"
+                    android:textColor="@color/colorBlue"
                     android:gravity="center_vertical"
-                    android:paddingTop="@dimen/dp_10"
-                    android:paddingBottom="@dimen/dp_10"
-                    android:paddingLeft="8dp"
-                    android:paddingRight="8dp"
-                    android:background="@drawable/shape_white_left_4dp_solid_grey_bor"
-                    android:layout_alignParentRight="true"
-                    android:layout_marginTop="10dp"
-                    android:visibility="gone">
-
-                    <TextView
-                        android:id="@+id/tv_tours_num"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:textSize="11sp"
-                        android:textColor="@color/white"
-                        android:paddingLeft="5dp"
-                        android:paddingRight="5dp"
-                        android:layout_marginRight="5dp"
-                        android:background="@drawable/shape_btn_red_solid_oval"
-                        android:visibility="gone"/>
-
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:text="Tours"
-                        android:textSize="12sp"
-                        android:textColor="@color/c_1D2550"
-                        android:drawablePadding="7dp"
-                        android:drawableRight="@mipmap/icon_arrow_down"/>
-
-                </LinearLayout>
-
-
-            </RelativeLayout>
-
-            <View
-                android:layout_width="match_parent"
-                android:layout_height="1dp"
-                android:background="@color/c_80DCDBE0"
-                android:layout_gravity="center_vertical" />
+                    android:fontFamily="@font/noto_sans_display_semibold"
+                    android:foreground="@drawable/selector_foreground_white"
+                    android:paddingRight="12dp"/>
 
-            <com.scwang.smart.refresh.layout.SmartRefreshLayout
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:id="@+id/smart_rl"
-                android:background="#FBFBFC">
+            </LinearLayout>
 
-                <include layout="@layout/base_head_refresh" />
+            <LinearLayout
+                android:id="@+id/ll_tours"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                android:gravity="center_vertical"
+                android:paddingTop="@dimen/dp_10"
+                android:paddingBottom="@dimen/dp_10"
+                android:paddingLeft="8dp"
+                android:paddingRight="8dp"
+                android:background="@drawable/shape_white_left_4dp_solid_grey_bor"
+                android:layout_alignParentRight="true"
+                android:layout_marginTop="10dp"
+                android:visibility="gone">
+
+                <TextView
+                    android:id="@+id/tv_tours_num"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textSize="11sp"
+                    android:textColor="@color/white"
+                    android:paddingLeft="5dp"
+                    android:paddingRight="5dp"
+                    android:layout_marginRight="5dp"
+                    android:background="@drawable/shape_btn_red_solid_oval"
+                    android:visibility="gone"/>
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="Tours"
+                    android:textSize="12sp"
+                    android:textColor="@color/colorBlue"
+                    android:drawablePadding="7dp"
+                    android:drawableRight="@mipmap/ic_arrow_expert_down"/>
+
+            </LinearLayout>
 
-                <FrameLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent">
 
-                    <include layout="@layout/layout_match_empty"/>
-                    <include layout="@layout/item_cricket_skeleton"/>
+        </RelativeLayout>
 
-                    <androidx.recyclerview.widget.RecyclerView
-                        android:id="@+id/recyclerView"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:overScrollMode="never"/>
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:background="@color/c_80DCDBE0"
+            android:layout_gravity="center_vertical" />
 
-                    <!--            从下往上出现的动画-->
+        <com.scwang.smart.refresh.layout.SmartRefreshLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:id="@+id/smart_rl"
+            android:background="#FBFBFC">
 
-                    <TextView
-                        android:id="@+id/tv_to_today"
-                        android:layout_width="wrap_content"
-                        android:layout_height="43dp"
-                        android:layout_gravity="right|bottom"
-                        android:layout_marginBottom="20dp"
-                        android:layout_marginRight="12dp"
-                        android:drawableRight="@mipmap/ic_go_today_down"
-                        android:paddingLeft="11dp"
-                        android:paddingRight="11dp"
-                        android:gravity="center"
-                        android:fontFamily="@font/noto_sans_display_semibold"
-                        android:textColor="@color/white"
-                        android:background="@drawable/bg_search_15"/>
+            <include layout="@layout/base_head_refresh" />
+
+            <FrameLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent">
+
+                <include layout="@layout/layout_match_empty"/>
+                <include layout="@layout/item_cricket_skeleton"/>
+
+                <androidx.recyclerview.widget.RecyclerView
+                    android:id="@+id/recyclerView"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:overScrollMode="never"/>
+
+                <TextView
+                    android:id="@+id/tv_to_today"
+                    android:layout_width="wrap_content"
+                    android:layout_height="43dp"
+                    android:layout_gravity="right|bottom"
+                    android:layout_marginBottom="20dp"
+                    android:layout_marginRight="12dp"
+                    android:drawableRight="@mipmap/ic_go_today_down"
+                    android:paddingLeft="11dp"
+                    android:paddingRight="11dp"
+                    android:gravity="center"
+                    android:fontFamily="@font/noto_sans_display_semibold"
+                    android:textColor="@color/white"
+                    android:background="@drawable/bg_search_25"/>
 
-                </FrameLayout>
+            </FrameLayout>
 
-                <include layout="@layout/base_head_loadmore" />
+            <include layout="@layout/base_head_loadmore" />
 
-            </com.scwang.smart.refresh.layout.SmartRefreshLayout>
+        </com.scwang.smart.refresh.layout.SmartRefreshLayout>
 
-        </LinearLayout>
+    </LinearLayout>
 
-    </androidx.coordinatorlayout.widget.CoordinatorLayout>
 </LinearLayout>

+ 0 - 22
TMessagesProj/src/main/res/layout/activity_ranking_list.xml

@@ -105,26 +105,4 @@
 
     </com.scwang.smart.refresh.layout.SmartRefreshLayout>
 
-    <RelativeLayout
-        android:id="@+id/iv_back_top"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        android:layout_marginRight="15dp"
-        android:layout_marginBottom="15dp"
-        android:visibility="gone">
-        <ImageView
-            android:id="@+id/iv_bg"
-            android:layout_width="50dp"
-            android:layout_height="50dp"
-            android:layout_gravity="bottom|end"
-            android:src="@drawable/circle"/>
-        <ImageView
-            android:layout_width="25dp"
-            android:layout_height="25dp"
-            android:src="@drawable/preview_arrow"
-            android:layout_centerInParent="true"/>
-    </RelativeLayout>
-
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 12 - 19
TMessagesProj/src/main/res/layout/fragment_detail.xml

@@ -25,28 +25,21 @@
 
     </com.scwang.smart.refresh.layout.SmartRefreshLayout>
 
-    <RelativeLayout
-        android:id="@+id/iv_back_top"
+    <TextView
+        android:id="@+id/tv_back_top"
         android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+        android:layout_height="43dp"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintRight_toRightOf="parent"
-        android:layout_marginRight="15dp"
-        android:layout_marginBottom="15dp"
-        android:visibility="gone">
-        <ImageView
-            android:id="@+id/iv_bg"
-            android:layout_width="50dp"
-            android:layout_height="50dp"
-            android:layout_gravity="bottom|end"
-            android:src="@drawable/circle"/>
-        <ImageView
-            android:layout_width="25dp"
-            android:layout_height="25dp"
-            android:src="@drawable/preview_arrow"
-            android:layout_centerInParent="true"/>
-    </RelativeLayout>
-
+        android:layout_marginBottom="20dp"
+        android:layout_marginRight="12dp"
+        android:drawableRight="@mipmap/ic_go_today_up"
+        android:paddingLeft="11dp"
+        android:paddingRight="11dp"
+        android:gravity="center"
+        android:fontFamily="@font/noto_sans_display_semibold"
+        android:textColor="@color/white"
+        android:background="@drawable/bg_search_25"/>
 
     <com.classic.common.MultipleStatusView
         android:id="@+id/status_view"

+ 8 - 7
TMessagesProj/src/main/res/layout/item_select_tournament.xml

@@ -2,8 +2,9 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="horizontal"
     android:layout_width="match_parent"
-    android:layout_height="50dp"
-    android:foreground="?android:attr/selectableItemBackground">
+    android:layout_height="wrap_content"
+    android:padding="7dp"
+    android:foreground="@drawable/selector_foreground_white">
     <TextView
         android:id="@+id/tv_name"
         android:layout_width="0dp"
@@ -11,15 +12,15 @@
         android:layout_weight="1"
         android:layout_gravity="center_vertical"
         android:layout_marginLeft="14dp"
-        style="@style/TvMainBodyStyle"
         android:textSize="14dp"
         android:textColor="@color/c_333333"/>
 
     <ImageView
         android:id="@+id/iv_check"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+        android:layout_width="22dp"
+        android:layout_height="22dp"
         android:layout_gravity="center_vertical"
-        android:layout_marginRight="14dp"
-        android:background="@drawable/selector_select_tournament"/>
+        android:layout_marginRight="5dp"
+        android:src="@drawable/selector_select_tournament"/>
+
 </LinearLayout>

+ 13 - 0
TMessagesProj/src/main/res/layout/layout_common_list.xml

@@ -16,6 +16,19 @@
             android:id="@+id/recyclerView"
             android:layout_width="match_parent"
             android:layout_height="match_parent" />
+
+        <ProgressBar
+            android:id="@+id/progress_bar"
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_gravity="center"
+            android:layout_marginBottom="8dp"
+            android:layout_marginTop="14dp"
+            android:indeterminateBehavior="repeat"
+            android:indeterminateDrawable="@drawable/anim_loading"
+            android:indeterminateOnly="true"
+            android:visibility="gone"/>
+
     </FrameLayout>
 
     <include layout="@layout/base_head_loadmore" />

BIN
TMessagesProj/src/main/res/mipmap-xhdpi/ic_arrow_circle.png


BIN
TMessagesProj/src/main/res/mipmap-xhdpi/ic_arrow_expert_down.png


BIN
TMessagesProj/src/main/res/mipmap-xhdpi/ic_check_date.png


+ 2 - 1
TMessagesProj/src/main/res/values/colors.xml

@@ -195,9 +195,10 @@
     <color name="c_DCDBE0">#DCDBE0</color>
     <color name="c_80DCDBE0">#80DCDBE0</color>
     <color name="c_D4D3D8">#D4D3D8</color>
-    <color name="c_212E58">#00abf0</color>
+    <color name="c_212E58">#4c8eca</color>
     <color name="c_70809B">#70809B</color>
     <color name="c_80white">#80ffffff</color>
+    <color name="c_E8E9ED">#E8E9ED</color>
 <!-- __________________________________  OneCric Color  _________________________________________-->
 
 

+ 3 - 0
TMessagesProj/src/main/res/values/strings.xml

@@ -352,6 +352,9 @@
     <string name="empty_match_collect">You don\'t have a favorite match yet, go to it</string>
     <string name="average_value">Average</string>
 
+    <string name="match_search_tour_hint">Search cricket tours...</string>
+    <string name="clear_all">CLEAR ALL</string>
+
     <!--==============================OneCric结束================================-->