10 Achegas 2847a82a64 ... fc3abbfdaa

Autor SHA1 Mensaxe Data
  ltt fc3abbfdaa 0.2.9 修复数据重复 hai 1 ano
  ltt 64bcd25804 pass hai 1 ano
  ltt 5690cd0489 pass hai 1 ano
  ltt e4045c79c8 同步新赛程:查询、赛程详情、筛选联赛 hai 1 ano
  xl121 d7dd457409 1 hai 1 ano
  xl121 4d34c7cb85 1 hai 1 ano
  xl121 79295d8246 1 hai 1 ano
  xl121 2c708bbd7f Merge remote-tracking branch 'origin/master' hai 1 ano
  xl121 d9759d0a7c 1 hai 1 ano
  ltt 2020e77ab2 pass hai 1 ano
Modificáronse 56 ficheiros con 2096 adicións e 419 borrados
  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. 37 0
      TMessagesProj/src/main/java/org/telegram/onecric/adapter/MatchSearchResultAdapter.java
  8. 4 3
      TMessagesProj/src/main/java/org/telegram/onecric/adapter/SelectTournamentAdapter.java
  9. 2 2
      TMessagesProj/src/main/java/org/telegram/onecric/dialog/TournaListDialog.java
  10. 285 0
      TMessagesProj/src/main/java/org/telegram/onecric/dialog/TournamentDialog.java
  11. 3 3
      TMessagesProj/src/main/java/org/telegram/onecric/mvp/CricketFiltrateBean.java
  12. 31 0
      TMessagesProj/src/main/java/org/telegram/onecric/mvp/CricketNewPresenter.java
  13. 1 0
      TMessagesProj/src/main/java/org/telegram/onecric/mvp/CricketNewView.java
  14. 16 0
      TMessagesProj/src/main/java/org/telegram/onecric/mvp/bean/MatchSearchBean.java
  15. 1 0
      TMessagesProj/src/main/java/org/telegram/onecric/mvp/presenter/CricketDetailPresenter.java
  16. 59 0
      TMessagesProj/src/main/java/org/telegram/onecric/mvp/presenter/SearchMatchPresenter.java
  17. 13 0
      TMessagesProj/src/main/java/org/telegram/onecric/mvp/view/SearchMatchView.java
  18. 3 0
      TMessagesProj/src/main/java/org/telegram/onecric/net/ApiStores.java
  19. 2 2
      TMessagesProj/src/main/java/org/telegram/onecric/ui/activity/CricketDetailActivity.java
  20. 169 87
      TMessagesProj/src/main/java/org/telegram/onecric/ui/activity/NewMatchActivity.java
  21. 427 0
      TMessagesProj/src/main/java/org/telegram/onecric/ui/activity/SearchMatchActivity.java
  22. 31 2
      TMessagesProj/src/main/java/org/telegram/onecric/ui/fragment/CricketMatchesFragment.java
  23. 24 0
      TMessagesProj/src/main/java/org/telegram/onecric/utils/AnimUtil.java
  24. 3 2
      TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java
  25. 1 1
      TMessagesProj/src/main/res/drawable/bg_search_15.xml
  26. 1 1
      TMessagesProj/src/main/res/drawable/bg_search_25.xml
  27. 1 1
      TMessagesProj/src/main/res/drawable/selector_filtrate_color.xml
  28. 1 1
      TMessagesProj/src/main/res/drawable/selector_foreground_search.xml
  29. 5 0
      TMessagesProj/src/main/res/drawable/selector_search_tab_bg.xml
  30. 2 2
      TMessagesProj/src/main/res/drawable/selector_select_tournament.xml
  31. 7 0
      TMessagesProj/src/main/res/drawable/shape_dc3c23_5dp_rec.xml
  32. 6 0
      TMessagesProj/src/main/res/drawable/shape_e8e9ed_10dp_rec.xml
  33. 6 0
      TMessagesProj/src/main/res/drawable/shape_e8e9ed_25dp_rec.xml
  34. 6 0
      TMessagesProj/src/main/res/drawable/shape_f6f7f9_6dp_rec.xml
  35. 6 0
      TMessagesProj/src/main/res/drawable/shape_white_10dp_rec.xml
  36. 182 189
      TMessagesProj/src/main/res/layout/activity_match_new.xml
  37. 0 22
      TMessagesProj/src/main/res/layout/activity_ranking_list.xml
  38. 236 0
      TMessagesProj/src/main/res/layout/activity_search_match_new.xml
  39. 104 0
      TMessagesProj/src/main/res/layout/dialog_search_tournament.xml
  40. 12 19
      TMessagesProj/src/main/res/layout/fragment_detail.xml
  41. 68 0
      TMessagesProj/src/main/res/layout/item_search_matchs.xml
  42. 55 0
      TMessagesProj/src/main/res/layout/item_search_tours.xml
  43. 8 7
      TMessagesProj/src/main/res/layout/item_select_tournament.xml
  44. 13 0
      TMessagesProj/src/main/res/layout/layout_common_list.xml
  45. 44 0
      TMessagesProj/src/main/res/layout/layout_search_empty.xml
  46. BIN=BIN
      TMessagesProj/src/main/res/mipmap-xhdpi/btn_square_blue.png
  47. BIN=BIN
      TMessagesProj/src/main/res/mipmap-xhdpi/btn_square_bor.png
  48. BIN=BIN
      TMessagesProj/src/main/res/mipmap-xhdpi/close_ico.png
  49. BIN=BIN
      TMessagesProj/src/main/res/mipmap-xhdpi/ic_arrow_circle.png
  50. BIN=BIN
      TMessagesProj/src/main/res/mipmap-xhdpi/ic_arrow_expert_down.png
  51. BIN=BIN
      TMessagesProj/src/main/res/mipmap-xhdpi/ic_check_date.png
  52. BIN=BIN
      TMessagesProj/src/main/res/mipmap-xhdpi/icon_cric1.png
  53. BIN=BIN
      TMessagesProj/src/main/res/mipmap-xhdpi/icon_cric2.png
  54. 2 1
      TMessagesProj/src/main/res/values/colors.xml
  55. 3 0
      TMessagesProj/src/main/res/values/strings.xml
  56. 2 2
      gradle.properties

+ 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 < 2){
+                        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 < 2){
+                        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);
+        }
+    }
 }

+ 37 - 0
TMessagesProj/src/main/java/org/telegram/onecric/adapter/MatchSearchResultAdapter.java

@@ -0,0 +1,37 @@
+package org.telegram.onecric.adapter;
+
+import android.text.TextUtils;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+
+import org.telegram.messenger.R;
+import org.telegram.onecric.mvp.bean.MatchSearchBean;
+
+import java.util.List;
+
+public class MatchSearchResultAdapter extends BaseQuickAdapter<MatchSearchBean, BaseViewHolder> {
+    public MatchSearchResultAdapter(int layoutResId, @Nullable List<MatchSearchBean> data) {
+        super(layoutResId, data);
+    }
+
+    @Override
+    protected void convert(@NonNull BaseViewHolder helper, MatchSearchBean item) {
+        helper.setText(R.id.tv_left, TextUtils.isEmpty(item.title)?item.content:item.title);
+        helper.setText(R.id.tv_bottom,TextUtils.isEmpty(item.name)?item.content:item.name);
+        if(helper.getView(R.id.tv_status) != null){
+            if(item.status == 0){
+                helper.setText(R.id.tv_status,"UPCOMING");
+            }else if(item.status == 1){
+                helper.setText(R.id.tv_status,"LIVE");
+            }else{
+                helper.setText(R.id.tv_status,"COMPLETED");
+            }
+
+        }
+
+    }
+}

+ 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) {

+ 285 - 0
TMessagesProj/src/main/java/org/telegram/onecric/dialog/TournamentDialog.java

@@ -0,0 +1,285 @@
+package org.telegram.onecric.dialog;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.graphics.Color;
+import android.graphics.drawable.GradientDrawable;
+import android.os.Build;
+import android.text.Editable;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.constraintlayout.widget.ConstraintLayout;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.alibaba.fastjson.JSONObject;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.lxj.xpopup.core.BasePopupView;
+import com.lxj.xpopup.core.BottomPopupView;
+import com.lxj.xpopup.util.XPopupUtils;
+
+import org.telegram.cricdit.utils.ColorUtil;
+import org.telegram.cricdit.utils.ToastUtil;
+import org.telegram.cricdit.utils.UIUtil;
+import org.telegram.messenger.R;
+import org.telegram.onecric.adapter.SelectTournamentAdapter;
+import org.telegram.onecric.mvp.CricketFiltrateBean;
+import org.telegram.onecric.net.ApiCallback;
+import org.telegram.onecric.net.ApiClient;
+import org.telegram.onecric.net.ApiStores;
+import org.telegram.onecric.ui.activity.NewMatchActivity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+
+public class TournamentDialog extends BottomPopupView implements View.OnClickListener {
+    private OnSelectTourListener mListener;
+    private Context mContext;
+    private RecyclerView rv_tournament;
+    private EditText et_search;
+    private TextView tv_apply;
+    private TextView tv_empty;
+    private LinearLayout ll_focus;
+    public SelectTournamentAdapter mAdapter;
+    private String mTournamentId = "";
+    private NewMatchActivity fragment;
+    private boolean isApply;
+
+    @Override
+    protected int getImplLayoutId() {
+        return R.layout.dialog_search_tournament;
+    }
+
+    public TournamentDialog(@NonNull Context context, NewMatchActivity activity, OnSelectTourListener listener) {
+        super(context);
+        this.mListener = listener;
+        this.mContext = context;
+        this.fragment = activity;
+    }
+
+    @Override
+    protected void onCreate() {
+        super.onCreate();
+        rv_tournament = findViewById(R.id.rv_tournament);
+        et_search = findViewById(R.id.et_input);
+        tv_apply = findViewById(R.id.tv_apply);
+        ll_focus = findViewById(R.id.ll_focus);
+        findViewById(R.id.iv_close).setOnClickListener(this);
+        findViewById(R.id.tv_reset).setOnClickListener(this);
+        tv_apply.setOnClickListener(this);
+
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
+            GradientDrawable gd = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{ColorUtil.COLOR_CHECKED, ColorUtil.COLOR_CHECKED});
+            gd.setSize(UIUtil.dip2px(mContext, 1.5), UIUtil.dip2px(mContext, et_search.getTextCursorDrawable().getIntrinsicHeight()));
+            et_search.setTextCursorDrawable(gd);
+        }
+        mAdapter = new SelectTournamentAdapter(R.layout.item_select_tournament, new ArrayList<>());
+        View inflate = LayoutInflater.from(getContext()).inflate(R.layout.layout_search_empty, null, false);
+        inflate.findViewById(R.id.ll_empty).setVisibility(View.VISIBLE);
+        mAdapter.setEmptyView(inflate);
+        tv_empty = mAdapter.getEmptyView().findViewById(R.id.tv_empty);
+        mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+            @Override
+            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                mAdapter.getItem(position).setCheck(!mAdapter.getItem(position).isCheck());
+                mAdapter.notifyItemChanged(position);
+                String midStr = "";
+                List<CricketFiltrateBean> temp = mAdapter.getData();
+                int checkNum = 0;
+                for (int i = temp.size()-1; i >= 0; i--) {
+                    if (temp.get(i).isCheck()) {
+                        checkNum++;
+                        midStr = midStr + temp.get(i).getId() + ",";
+                    }
+                }
+                if(midStr.equals(fragment.tag)){
+                    tv_apply.setEnabled(false);
+                    tv_apply.setTextColor(Color.parseColor("#C6C7CB"));
+                    tv_apply.setBackground(getContext().getResources().getDrawable(R.drawable.shape_c8c8c8_5dp_rec));
+                }else{
+                    tv_apply.setEnabled(true);
+                    tv_apply.setTextColor(Color.WHITE);
+                    tv_apply.setBackground(getContext().getResources().getDrawable(R.drawable.shape_dc3c23_5dp_rec));
+                }
+            }
+        });
+        rv_tournament.setLayoutManager(new LinearLayoutManager(getContext()));
+        rv_tournament.setAdapter(mAdapter);
+
+        et_search.addTextChangedListener(new TextWatcher() {
+            @Override
+            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+            }
+
+            @Override
+            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+            }
+
+            @Override
+            public void afterTextChanged(Editable editable) {
+                getTourList();
+            }
+        });
+        getTourList();
+    }
+
+
+    @Override
+    public void onClick(View view) {
+        if(view.getId() == R.id.iv_close){
+            dismiss();
+        }else if(view.getId() == R.id.tv_reset){
+            if(TextUtils.isEmpty(fragment.tag)){
+                tv_apply.setEnabled(false);
+                tv_apply.setTextColor(Color.parseColor("#C6C7CB"));
+                tv_apply.setBackground(getContext().getResources().getDrawable(R.drawable.shape_c8c8c8_5dp_rec));
+            }else{
+                tv_apply.setEnabled(true);
+                tv_apply.setTextColor(Color.WHITE);
+                tv_apply.setBackground(getContext().getResources().getDrawable(R.drawable.shape_dc3c23_5dp_rec));
+            }
+            List<CricketFiltrateBean> data = mAdapter.getData();
+            for (int i = 0; i < data.size(); i++) {
+                data.get(i).setCheck(false);
+            }
+            mAdapter.notifyDataSetChanged();
+            mTournamentId = "";
+        }else if(view.getId() == R.id.tv_apply){
+            isApply = true;
+            dismiss();
+            for(int f=0;f<fragment.mFiltrateAdapter.getData().size();f++){
+                fragment.mFiltrateAdapter.getData().get(f).setCheck(false);
+            }
+            List<CricketFiltrateBean> temp = mAdapter.getData();
+            List<CricketFiltrateBean> fList = new ArrayList<>();
+            fList.addAll(fragment.mFiltrateAdapter.getData());
+            int checkNum = 0;
+            mTournamentId = "";
+            filtrate:for (int i = 0; i < temp.size(); i++) {
+                if (temp.get(i).isCheck()) {
+                    checkNum++;
+                    mTournamentId = mTournamentId + temp.get(i).getId() + ",";
+                    for(int f=0;f<fList.size();f++){
+                        if(fList.get(f).getId() == temp.get(i).getId()){
+                            fList.get(f).setCheck(true);
+                            fragment.mFiltrateAdapter.addData(0,fList.get(f));
+                            fragment.mFiltrateAdapter.remove(f+1);
+                            continue filtrate;
+                        }
+                    }
+                }
+            }
+
+            List<CricketFiltrateBean> tList = new ArrayList<>();
+            tList.addAll(mAdapter.getData());
+            for (int i = 0; i < tList.size(); i++) {
+                if (tList.get(i).isCheck()) {
+                    mAdapter.addData(0,tList.get(i));
+                    mAdapter.remove(i+1);
+                }
+            }
+            rv_tournament.scrollToPosition(0);
+            mListener.selectedWord(mTournamentId,checkNum);
+        }
+    }
+
+    @SuppressLint("CheckResult")
+    private void getTourList() {
+        ApiClient.retrofit().create(ApiStores.class)
+                .getTournamentList(et_search.getText().toString())
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribeWith(new ApiCallback() {
+                    @Override
+                    public void onSuccess(String data,  String msg) {
+                        List<CricketFiltrateBean> list = JSONObject.parseArray(data, CricketFiltrateBean.class);
+                        List<CricketFiltrateBean> temp = new ArrayList<>();
+                        temp.addAll(list);
+                        if(list!=null && list.size()>0){
+/*                            LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) rv_tournament.getLayoutParams();
+                            if (list.size() > 20) {
+                                layoutParams.height = (int) (XPopupUtils.getScreenHeight(getContext()) * .6f);
+                            } else {
+                                layoutParams.height = (int) (XPopupUtils.getScreenHeight(getContext()) * .4f);
+                            }
+                            rv_tournament.setLayoutParams(layoutParams);*/
+                            if(!TextUtils.isEmpty(fragment.tag)){
+                                for(int i=0; i<temp.size();i++){
+                                    if(fragment.tag.contains(","+temp.get(i).getId()) || fragment.tag.contains(temp.get(i).getId()+",")){
+                                        temp.get(i).setCheck(true);
+                                        if (temp.get(i).isCheck()) {
+                                            //选中的放最前面
+                                            list.add(0,temp.get(i));
+                                            list.remove(i+1);
+                                        }
+                                    }
+                                }
+                            }
+                            mAdapter.setNewData(list);
+                            rv_tournament.scrollToPosition(0);
+                        }else{
+                            tv_empty.setText("No Result for '" + et_search.getText().toString() + "'");
+                            mAdapter.setNewData(new ArrayList<>());
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(String msg) {
+                        ToastUtil.show(mContext,msg);
+                    }
+
+                    @Override
+                    public void onError(String msg) {
+                        ToastUtil.show(mContext,msg);
+                    }
+
+                    @Override
+                    public void onFinish() {
+
+                    }
+                });
+    }
+
+    @Override
+    public void dismiss() {
+        if(!isApply){
+            List<CricketFiltrateBean> temp = mAdapter.getData();
+            for (int i = 0; i < temp.size(); i++) {
+                if (!TextUtils.isEmpty(fragment.tag) && fragment.tag.contains(temp.get(i).getId()+"")) {
+                    temp.get(i).setCheck(true);
+                }else{
+                    temp.get(i).setCheck(false);
+                }
+            }
+        }
+        mAdapter.notifyDataSetChanged();
+        super.dismiss();
+    }
+
+    public interface OnSelectTourListener{
+        void selectedWord(String tourIds,int checkNum);
+    }
+
+    @Override
+    protected void onShow() {
+        isApply = false;
+        ll_focus.requestFocus();
+        tv_apply.setEnabled(false);
+        tv_apply.setTextColor(Color.parseColor("#C6C7CB"));
+        tv_apply.setBackground(getContext().getResources().getDrawable(R.drawable.shape_c8c8c8_5dp_rec));
+        super.onShow();
+    }
+
+}

+ 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);
 }

+ 16 - 0
TMessagesProj/src/main/java/org/telegram/onecric/mvp/bean/MatchSearchBean.java

@@ -0,0 +1,16 @@
+package org.telegram.onecric.mvp.bean;
+
+
+public class MatchSearchBean {
+    public int id;
+    public String scheduled;
+    public String title;
+    public String content;
+    public int status;
+
+    public String name;
+    public String type;
+    public String createdAt;
+    public String updatedAt;
+
+}

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

@@ -56,6 +56,7 @@ public class CricketDetailPresenter extends BasePresenter<CricketDetailView> {
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("id", matchId);
         jsonObject.put("type", 0);
+        jsonObject.put("app", "cricdit");
         addSubscription(apiStores.getCricketDetailUpdates(getRequestBody(jsonObject)), new ApiCallback() {
             @Override
             public void onSuccess(String data, String msg) {

+ 59 - 0
TMessagesProj/src/main/java/org/telegram/onecric/mvp/presenter/SearchMatchPresenter.java

@@ -0,0 +1,59 @@
+package org.telegram.onecric.mvp.presenter;
+
+import com.alibaba.fastjson.JSONObject;
+
+import org.telegram.onecric.mvp.bean.MatchSearchBean;
+import org.telegram.onecric.mvp.view.SearchMatchView;
+import org.telegram.onecric.net.ApiCallback;
+import org.telegram.onecric.base.BasePresenter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TimeZone;
+
+public class SearchMatchPresenter extends BasePresenter<SearchMatchView> {
+    public SearchMatchPresenter(SearchMatchView view) {
+        attachView(view);
+    }
+
+    public void searchMatch(String content,int type,int page,boolean isMore) {
+        addSubscription(apiStores.searchMatchNew(TimeZone.getDefault().getID(),content,type==1?"match":"tour",page),
+                new ApiCallback() {
+                    @Override
+                    public void onSuccess(String data, String msg) {
+                        List<MatchSearchBean> bean;
+                        try{
+                            bean = JSONObject.parseArray(JSONObject.parseObject(data).getString("data"),MatchSearchBean.class);
+                        }catch (Exception e){
+                            bean = new ArrayList<>();
+                        }
+                        if(isMore){
+                            mvpView.getMoreData(type,bean);
+                        }else{
+                            mvpView.getDataSuccess(bean,type);
+                            if(type == 1){
+                                searchMatch(content,2,page,false);
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(String msg) {
+                        if(!isMore){
+                            mvpView.getDataFail(msg,type);
+                        }
+                    }
+
+                    @Override
+                    public void onError(String msg) {
+                        if(!isMore){
+                            mvpView.getDataFail(msg,type);
+                        }
+                    }
+
+                    @Override
+                    public void onFinish() {
+
+                    }
+                });
+    }
+}

+ 13 - 0
TMessagesProj/src/main/java/org/telegram/onecric/mvp/view/SearchMatchView.java

@@ -0,0 +1,13 @@
+package org.telegram.onecric.mvp.view;
+
+
+import org.telegram.onecric.base.BaseView;
+import org.telegram.onecric.mvp.bean.MatchSearchBean;
+
+import java.util.List;
+
+public interface SearchMatchView extends BaseView<MatchSearchBean> {
+    void getMoreData(int type, List<MatchSearchBean> list);
+    void getDataSuccess(List<MatchSearchBean> bean,int type);
+    void getDataFail(String msg,int type);
+}

+ 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);
 }

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

@@ -514,7 +514,7 @@ public class CricketDetailActivity extends MvpActivity<CricketDetailPresenter> i
 
     private void getSubscribeType(CricketMatchBean item, ImageView subscribeIv) {//订阅推送消息
         showLoadingDialog();
-        new SubscribePresenter().getSubscribeType(item.getId(), new ApiCallback() {
+        new SubscribePresenter().getSubscribeType(item.getMatch_id(), new ApiCallback() {
             @Override
             public void onSuccess(String data, String msg) {
                 dismissLoadingDialog();
@@ -524,7 +524,7 @@ public class CricketDetailActivity extends MvpActivity<CricketDetailPresenter> i
                     DialogUtil.showSelectSubscribeDialog(CricketDetailActivity.this, item.getHome_name() + " VS " + item.getAway_name(), list, new DialogUtil.SelectSubscribeBack() {
                         @Override
                         public void onSelectSubscribe(String type) {
-                            doSubscribe(item.getId() + "", type, subscribeIv);
+                            doSubscribe(item.getMatch_id() + "", type, subscribeIv);
                         }
                     });
                 }

+ 169 - 87
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,8 +23,8 @@ 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.lxj.xpopup.core.BasePopupView;
 import com.scwang.smart.refresh.layout.SmartRefreshLayout;
 import com.scwang.smart.refresh.layout.api.RefreshLayout;
 import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
@@ -35,6 +32,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 +47,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 +54,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 +77,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;
+    private BasePopupView popupView;
     @Override
     protected int getLayoutResId() {
         return R.layout.activity_match_new;
@@ -117,10 +118,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 +130,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 +145,23 @@ 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);
+            }
+        });
+        popupView = new XPopup.Builder(getContext())
+                .moveUpToKeyboard(true)
+                .isDestroyOnDismiss(false)
+                .isLightNavigationBar(true)
+                .navigationBarColor(getContext().getResources().getColor(R.color.colorWhite))
+                .asCustom(tournamentDialog);
         initData();
     }
 
@@ -157,29 +171,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!=null && 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 +227,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 +234,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 +256,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 +276,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 +375,11 @@ 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) {
+                    popupView.show();
+                }
+            }
         }else if(id == R.id.ll_all_live){
             if(streamType!=0){
                 streamType = 0;
@@ -372,7 +396,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 +412,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 +428,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 +454,27 @@ 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){
+        if(!TextUtils.isEmpty(tag)){
+            return;
+        }
         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 +483,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 +492,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 +504,15 @@ 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(!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)){
+                mPresenter.getCricketMatchList(type,endDay,TextUtils.isEmpty(tag)?"":tag,streamType,isLiveNow);//后一天
             }
         }
     }
@@ -499,6 +524,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 +536,55 @@ 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)));
+                //当前时间
+                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{
                 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 +605,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]);
@@ -580,7 +627,7 @@ public class NewMatchActivity extends BaseTabActivity implements CricketNewView,
         picker = new CalendarPicker(getParentActivity());
         picker.setColorScheme(new ColorScheme()
                 .weekTextColor(0xFFBDBFC8)
-                .daySelectBackgroundColor(0xFFDC3C23)
+                .daySelectBackgroundColor(0xFF527da3)
                 .daySelectTextColor(0xFFFFFFFF)
                 .dayStressTextColor(0xFF000000)
                 .dayNormalTextColor(0xFF000000)
@@ -637,4 +684,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();
+        }
+
+    }
 }

+ 427 - 0
TMessagesProj/src/main/java/org/telegram/onecric/ui/activity/SearchMatchActivity.java

@@ -0,0 +1,427 @@
+package org.telegram.onecric.ui.activity;
+
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.GradientDrawable;
+import android.os.Build;
+import android.text.Editable;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.widget.EditText;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ScrollView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.core.content.res.ResourcesCompat;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+
+import org.telegram.cricdit.utils.ColorUtil;
+import org.telegram.cricdit.utils.ToastUtil;
+import org.telegram.cricdit.utils.UIUtil;
+import org.telegram.messenger.R;
+import org.telegram.onecric.adapter.MatchSearchResultAdapter;
+import org.telegram.onecric.base.MvpActivity;
+import org.telegram.onecric.mvp.bean.MatchSearchBean;
+import org.telegram.onecric.mvp.presenter.SearchMatchPresenter;
+import org.telegram.onecric.mvp.view.SearchMatchView;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class SearchMatchActivity extends MvpActivity<SearchMatchPresenter> implements SearchMatchView, View.OnClickListener {
+
+    public static void forward(Context context) {
+        Intent intent = new Intent(context, SearchMatchActivity.class);
+        context.startActivity(intent);
+    }
+
+    private EditText et_input;
+    private ImageView iv_close;
+    private RecyclerView recyclerView_match;
+    private RecyclerView recyclerView_tours;
+    private MatchSearchResultAdapter mMatchAdapter;
+    private MatchSearchResultAdapter mToursAdapter;
+    private FrameLayout fl_tab_all;
+    private FrameLayout fl_tab_matches;
+    private FrameLayout fl_tab_tours;
+    private TextView tv_tab_all;
+    private TextView tv_tab_matches;
+    private TextView tv_tab_tours;
+    private TextView tv_chat_info;
+    private LinearLayout ll_tab;
+    private TextView tv_title_match;
+    private TextView tv_title_tours;
+    private LinearLayout ll_empty;
+    private TextView tv_empty;
+    private String searchWord;
+    private Drawable drawableArrRight;
+    private FrameLayout fl_loading;
+    private View view_line;
+    private ScrollView sl_main;
+
+    private List<MatchSearchBean> matchsList;
+    private List<MatchSearchBean> toursList;
+    private int mMPage = 1;
+    private int mTPage = 1;
+
+    @Override
+    protected SearchMatchPresenter createPresenter() {
+        return new SearchMatchPresenter(this);
+    }
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.activity_search_match_new;
+    }
+
+    @Override
+    protected void initView() {
+        et_input = findViewById(R.id.et_input);
+        iv_close = findViewById(R.id.iv_close);
+        recyclerView_match = findViewById(R.id.recyclerView_match);
+        recyclerView_tours = findViewById(R.id.recyclerView_tours);
+        fl_tab_all = findViewById(R.id.fl_tab_all);
+        fl_tab_matches = findViewById(R.id.fl_tab_matches);
+        fl_tab_tours = findViewById(R.id.fl_tab_tours);
+        tv_tab_all = findViewById(R.id.tv_tab_all);
+        tv_tab_matches = findViewById(R.id.tv_tab_matches);
+        tv_tab_tours = findViewById(R.id.tv_tab_tours);
+        tv_chat_info = findViewById(R.id.tv_chat_info);
+        ll_tab = findViewById(R.id.ll_tab);
+        tv_title_match = findViewById(R.id.tv_title_match);
+        tv_title_tours = findViewById(R.id.tv_title_tours);
+        ll_empty = findViewById(R.id.ll_empty);
+        tv_empty = findViewById(R.id.tv_empty);
+        fl_loading = findViewById(R.id.fl_loading);
+        view_line = findViewById(R.id.view_line);
+        sl_main = findViewById(R.id.sl_main);
+
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
+            GradientDrawable gd = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{ColorUtil.COLOR_CHECKED, ColorUtil.COLOR_CHECKED});
+            gd.setSize(UIUtil.dip2px(this, 1.5), UIUtil.dip2px(this, et_input.getTextCursorDrawable().getIntrinsicHeight()));
+            et_input.setTextCursorDrawable(gd);
+        }
+        iv_close.setOnClickListener(this);
+        tv_tab_all.setOnClickListener(this);
+        tv_tab_matches.setOnClickListener(this);
+        tv_tab_tours.setOnClickListener(this);
+        tv_title_match.setOnClickListener(this);
+        tv_title_tours.setOnClickListener(this);
+        findViewById(R.id.iv_back).setOnClickListener(this);
+        drawableArrRight = getResources().getDrawable(R.mipmap.icon_arrow_right_three);
+        drawableArrRight.setBounds(0, 0, drawableArrRight.getMinimumWidth(),drawableArrRight.getMinimumHeight());
+        matchsList = new ArrayList<>();
+        toursList = new ArrayList<>();
+    }
+
+    @Override
+    protected void initData() {
+        et_input.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                /*判断是否是“发送”键*/
+                if (actionId == EditorInfo.IME_ACTION_SEARCH) {
+                    searchWord = et_input.getText().toString();
+                    searchContent();
+                    return true;
+                }
+                return false;
+            }
+        });
+
+        et_input.addTextChangedListener(new TextWatcher() {
+            @Override
+            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+            }
+
+            @Override
+            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+            }
+
+            @Override
+            public void afterTextChanged(Editable editable) {
+                if (editable.length() == 0) {
+                    iv_close.setVisibility(View.GONE);
+                } else {
+                    iv_close.setVisibility(View.VISIBLE);
+                }
+                searchWord = et_input.getText().toString();
+                searchContent();
+            }
+        });
+
+        //搜索出来的内容
+        mMatchAdapter = new MatchSearchResultAdapter(R.layout.item_search_matchs,matchsList);
+        mMatchAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+            @Override
+            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                if(mMatchAdapter.getItem(position).id!=0){
+                    CricketDetailActivity.forward(mActivity, mMatchAdapter.getItem(position).id);
+                }
+            }
+        });
+        recyclerView_match.setLayoutManager(new LinearLayoutManager(this));
+        recyclerView_match.setAdapter(mMatchAdapter);
+
+        mToursAdapter = new MatchSearchResultAdapter(R.layout.item_search_tours,toursList);
+        mToursAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+            @Override
+            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                CricketInnerActivity.forward(mActivity, mToursAdapter.getItem(position).name, "1", mToursAdapter.getItem(position).id);
+            }
+        });
+        recyclerView_tours.setLayoutManager(new LinearLayoutManager(this));
+        recyclerView_tours.setAdapter(mToursAdapter);
+
+        recyclerView_match.addOnScrollListener(new RecyclerView.OnScrollListener() {
+            @Override
+            public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
+                if (tv_tab_all.isSelected() != true){
+                    LinearLayoutManager manager = (LinearLayoutManager) recyclerView.getLayoutManager();
+                    if (newState == RecyclerView.SCROLL_STATE_IDLE) {
+                        int lastVisibleItem = manager.findLastVisibleItemPosition();
+                        int totalItemCount = manager.getItemCount();
+                        if (lastVisibleItem == (totalItemCount - 1)) {
+                            mMPage++;
+                            mvpPresenter.searchMatch(searchWord, 1, mMPage,true);
+                        }
+                    }
+                }
+            }
+        });
+
+        recyclerView_tours.addOnScrollListener(new RecyclerView.OnScrollListener() {
+            @Override
+            public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
+                if (tv_tab_all.isSelected() != true){
+                    LinearLayoutManager manager = (LinearLayoutManager) recyclerView.getLayoutManager();
+                    if (newState == RecyclerView.SCROLL_STATE_IDLE) {
+                        int lastVisibleItem = manager.findLastVisibleItemPosition();
+                        int totalItemCount = manager.getItemCount();
+                        if (lastVisibleItem == (totalItemCount - 1)) {
+                            mTPage++;
+                            mvpPresenter.searchMatch(searchWord, 2, mTPage,true);
+                        }
+                    }
+                }
+            }
+        });
+
+    }
+
+    private void searchContent() {
+        mTPage = 1;
+        mMPage = 1;
+        toursList = null;
+        matchsList = null;
+        mToursAdapter.setNewData(toursList);
+        mMatchAdapter.setNewData(matchsList);
+        ll_tab.setVisibility(View.GONE);
+        ll_empty.setVisibility(View.GONE);
+        sl_main.setVisibility(View.GONE);
+        tv_title_match.setVisibility(View.GONE);
+        tv_title_tours.setVisibility(View.GONE);
+        if (!TextUtils.isEmpty(searchWord) && searchWord.length()>2) {
+            tv_chat_info.setVisibility(View.GONE);
+            fl_loading.setVisibility(View.VISIBLE);
+            mvpPresenter.searchMatch(searchWord,1,mMPage,false);
+        }else{
+            tv_chat_info.setVisibility(View.VISIBLE);
+        }
+    }
+
+    @Override
+    public void getDataSuccess(MatchSearchBean bean) {}
+
+
+    @Override
+    public void getDataFail(String msg) {}
+
+    @Override
+    public void onClick(View v) {
+        if(v.getId() == R.id.iv_close){
+            et_input.setText("");
+        }else if(v.getId() == R.id.iv_back){
+            finish();
+        }else if(v.getId() == R.id.tv_tab_all){
+            showSelectTabList(0);
+        }else if(v.getId() == R.id.tv_tab_matches){
+            showSelectTabList(1);
+        }else if(v.getId() == R.id.tv_tab_tours){
+            showSelectTabList(2);
+        }else if(v.getId() == R.id.tv_title_match){
+            if(tv_tab_all.isSelected()){
+                showSelectTabList(1);
+            }
+        }else if(v.getId() == R.id.tv_title_tours){
+            if(tv_tab_all.isSelected()){
+                showSelectTabList(2);
+            }
+        }
+    }
+
+    private void showSelectTabList(int type){
+        tv_tab_all.setTypeface(ResourcesCompat.getFont(this, R.font.noto_sans_display_regular));
+        tv_tab_matches.setTypeface(ResourcesCompat.getFont(this, R.font.noto_sans_display_regular));
+        tv_tab_tours.setTypeface(ResourcesCompat.getFont(this, R.font.noto_sans_display_regular));
+        tv_title_match.setCompoundDrawables(null,null,null,null);
+        tv_title_tours.setCompoundDrawables(null,null,null,null);
+        tv_tab_all.setSelected(false);
+        tv_tab_tours.setSelected(false);
+        tv_tab_matches.setSelected(false);
+        recyclerView_match.setVisibility(View.VISIBLE);
+        recyclerView_tours.setVisibility(View.VISIBLE);
+        tv_title_match.setVisibility((matchsList != null && matchsList.size()>0)?View.VISIBLE:View.GONE);
+        tv_title_tours.setVisibility((toursList != null && toursList.size()>0)?View.VISIBLE:View.GONE);
+        switch (type){
+            case 0:
+                if(!tv_tab_all.isSelected()){
+                    if(matchsList != null && matchsList.size()>9){
+                        mMatchAdapter.setNewData(matchsList.subList(0,9));
+                        tv_title_match.setCompoundDrawables(null,null,drawableArrRight,null);
+                    }else{
+                        mMatchAdapter.setNewData(matchsList);
+                    }
+
+                    if(toursList != null && toursList.size()>9){
+                        mToursAdapter.setNewData(toursList.subList(0,9));
+                        tv_title_tours.setCompoundDrawables(null,null,drawableArrRight,null);
+                    }else{
+                        mToursAdapter.setNewData(toursList);
+                    }
+
+                    tv_tab_all.setSelected(true);
+                    tv_tab_all.setTypeface(ResourcesCompat.getFont(this, R.font.noto_sans_display_semibold));
+                    if(mMatchAdapter.getItemCount() != 0 && mToursAdapter.getItemCount() != 0){
+                        view_line.setVisibility(View.VISIBLE);
+                    }
+                }
+                break;
+            case 1:
+                if(!tv_tab_matches.isSelected()){
+                    mMatchAdapter.setNewData(matchsList);
+                    tv_tab_matches.setSelected(true);
+                    recyclerView_tours.setVisibility(View.GONE);
+                    tv_title_tours.setVisibility(View.GONE);
+                    tv_tab_matches.setTypeface(ResourcesCompat.getFont(this, R.font.noto_sans_display_semibold));
+                    view_line.setVisibility(View.GONE);
+                }
+                break;
+            case 2:
+                if(!tv_tab_tours.isSelected()){
+                    mToursAdapter.setNewData(toursList);
+                    tv_tab_tours.setSelected(true);
+                    recyclerView_match.setVisibility(View.GONE);
+                    tv_title_match.setVisibility(View.GONE);
+                    tv_tab_tours.setTypeface(ResourcesCompat.getFont(this, R.font.noto_sans_display_semibold));
+                    view_line.setVisibility(View.GONE);
+                }
+                break;
+            default:break;
+        }
+    }
+
+    @Override
+    public void getMoreData(int type, List<MatchSearchBean> list) {
+        if(list == null || list.size() <= 0){
+            if(type == 1){
+                mMPage--;
+            }else {
+                mTPage--;
+            }
+            return;
+        }
+        if(type == 1){
+            mMatchAdapter.addData(list);
+        }else if(type == 2){
+            mToursAdapter.addData(list);
+        }
+    }
+
+    @Override
+    public void getDataSuccess(List<MatchSearchBean> bean, int type) {
+        fl_loading.setVisibility(View.GONE);
+        sl_main.setVisibility(View.VISIBLE);
+
+        if(type == 1){
+            tv_tab_all.setSelected(true);
+            tv_tab_matches.setSelected(false);
+            tv_tab_tours.setSelected(false);
+            tv_tab_all.setTypeface(ResourcesCompat.getFont(this, R.font.noto_sans_display_semibold));
+            tv_tab_matches.setTypeface(ResourcesCompat.getFont(this, R.font.noto_sans_display_regular));
+            tv_tab_tours.setTypeface(ResourcesCompat.getFont(this, R.font.noto_sans_display_regular));
+            if (bean != null && bean.size() > 0) {
+                ll_tab.setVisibility(View.VISIBLE);
+                fl_tab_matches.setVisibility(View.VISIBLE);
+                recyclerView_match.setVisibility(View.VISIBLE);
+                tv_title_match.setVisibility(View.VISIBLE);
+                matchsList = bean;
+                if(bean.size()>9){
+                    mMatchAdapter.setNewData(bean.subList(0,9));
+                    tv_title_match.setCompoundDrawables(null,null,drawableArrRight,null);
+                }else{
+                    mMatchAdapter.setNewData(bean);
+                    tv_title_match.setCompoundDrawables(null,null,null,null);
+                }
+            }else{
+                fl_tab_matches.setVisibility(View.GONE);
+                tv_title_match.setVisibility(View.GONE);
+            }
+        }else if(type == 2){
+            if (bean != null && bean.size() > 0) {
+                ll_tab.setVisibility(View.VISIBLE);
+                fl_tab_tours.setVisibility(View.VISIBLE);
+                recyclerView_tours.setVisibility(View.VISIBLE);
+                tv_title_tours.setVisibility(View.VISIBLE);
+                toursList = bean;
+                if(bean.size()>9){
+                    mToursAdapter.setNewData(bean.subList(0,9));
+                    tv_title_tours.setCompoundDrawables(null,null,drawableArrRight,null);
+                }else{
+                    mToursAdapter.setNewData(bean);
+                    tv_title_tours.setCompoundDrawables(null,null,null,null);
+                }
+            }else{
+                fl_tab_tours.setVisibility(View.GONE);
+                tv_title_tours.setVisibility(View.GONE);
+            }
+
+            if(mMatchAdapter.getItemCount() == 0){
+                if(mToursAdapter.getItemCount() == 0){
+                    recyclerView_match.setVisibility(View.GONE);
+                    recyclerView_tours.setVisibility(View.GONE);
+                    sl_main.setVisibility(View.GONE);
+                    ll_empty.setVisibility(View.VISIBLE);
+                    tv_empty.setText("No Result for '" + searchWord + "'");
+                }
+            }
+
+        }
+
+    }
+
+    @Override
+    public void getDataFail(String msg, int type) {
+        fl_loading.setVisibility(View.GONE);
+        if(type == 1){
+            recyclerView_match.setVisibility(View.GONE);
+            tv_title_match.setVisibility(View.GONE);
+        }else{
+            recyclerView_tours.setVisibility(View.GONE);
+            tv_title_tours.setVisibility(View.GONE);
+        }
+        ToastUtil.show(this,msg);
+    }
+}

+ 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--;
     }
 }

+ 24 - 0
TMessagesProj/src/main/java/org/telegram/onecric/utils/AnimUtil.java

@@ -0,0 +1,24 @@
+package org.telegram.onecric.utils;
+
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ObjectAnimator;
+import android.view.View;
+import android.view.animation.LinearInterpolator;
+
+public class AnimUtil {
+    public static 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(); // 开始播放动画
+    }
+}

+ 3 - 2
TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java

@@ -1599,7 +1599,7 @@ public class LaunchActivity extends BasePermissionsActivity implements ActionBar
         //
         // Handle possible data accompanying notification message.
         // [START handle_data_extras]
-        if (pintent.getExtras() != null) {
+        if (pintent.getExtras() != null && pintent.getExtras().containsKey("matchId")) {
 //            for (String key : getIntent().getExtras().keySet()) {
 //                Object value = getIntent().getExtras().get(key);
 //                Log.d(TAG, "Key: " + key + " Value: " + value);
@@ -1607,8 +1607,9 @@ public class LaunchActivity extends BasePermissionsActivity implements ActionBar
             Intent intent = new Intent();
             intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
             Bundle bundle = pintent.getExtras();
+            int matchId = Integer.parseInt(bundle.getString("matchId"));
             intent.setClass(this, CricketDetailActivity.class);
-            intent.putExtra("matchId", Integer.parseInt(bundle.getString("matchId")));
+            intent.putExtra("matchId", matchId);
             intent.putExtra("isNotification", true);
             startActivity(intent);
         }

+ 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/bg_212e58_6.xml → TMessagesProj/src/main/res/drawable/bg_search_25.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="6dp"/>
+    <corners android:radius="25dp"/>
     <solid android:color="@color/c_212E58"/>
 </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>

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

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_selected="true" android:drawable="@drawable/bg_search_15"/>
+    <item android:state_selected="false" android:drawable="@drawable/bg_search2_15"/>
+</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>

+ 7 - 0
TMessagesProj/src/main/res/drawable/shape_dc3c23_5dp_rec.xml

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

+ 6 - 0
TMessagesProj/src/main/res/drawable/shape_e8e9ed_10dp_rec.xml

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

+ 6 - 0
TMessagesProj/src/main/res/drawable/shape_e8e9ed_25dp_rec.xml

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

+ 6 - 0
TMessagesProj/src/main/res/drawable/shape_f6f7f9_6dp_rec.xml

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

+ 6 - 0
TMessagesProj/src/main/res/drawable/shape_white_10dp_rec.xml

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

+ 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>

+ 236 - 0
TMessagesProj/src/main/res/layout/activity_search_match_new.xml

@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:background="@color/c_1D2550"
+        android:paddingTop="45dp"
+        android:paddingBottom="6dp">
+
+        <ImageView
+            android:id="@+id/iv_back"
+            android:layout_width="40dp"
+            android:layout_height="37dp"
+            android:src="@mipmap/icon_arrow_left"
+            android:padding="12dp"/>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="37dp"
+            android:gravity="center_vertical"
+            android:layout_marginRight="15dp"
+            android:orientation="horizontal"
+            android:background="@drawable/shape_white_10dp_rec">
+
+            <ImageView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="12dp"
+                android:layout_marginRight="9dp"
+                android:background="@mipmap/icon_search_two"/>
+
+            <EditText
+                android:id="@+id/et_input"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:hint="@string/match_search_hint"
+                android:textColor="@color/c_111111"
+                android:textColorHint="@color/c_70809B"
+                android:textSize="14dp"
+                android:imeOptions="actionSearch"
+                android:singleLine="true"
+                android:background="@null"/>
+
+            <ImageView
+                android:id="@+id/iv_close"
+                android:layout_width="14dp"
+                android:layout_height="14dp"
+                android:layout_marginRight="12dp"
+                android:background="@mipmap/icon_search_close"
+                android:visibility="gone"/>
+
+        </LinearLayout>
+
+    </LinearLayout>
+
+    <FrameLayout
+        android:id="@+id/fl_loading"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@color/c_1D2550"
+        android:visibility="gone">
+
+        <ProgressBar
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_gravity="center_horizontal"
+            android:layout_marginBottom="8dp"
+            android:layout_marginTop="14dp"
+            android:indeterminateBehavior="repeat"
+            android:indeterminateDrawable="@drawable/anim_loading"
+            android:indeterminateOnly="true" />
+
+    </FrameLayout>
+
+    <LinearLayout
+        android:id="@+id/ll_tab"
+        android:layout_width="match_parent"
+        android:layout_height="42dp"
+        android:padding="6dp"
+        android:orientation="horizontal"
+        android:background="@color/c_1D2550"
+        android:visibility="gone">
+
+        <FrameLayout
+            android:id="@+id/fl_tab_all"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:layout_height="match_parent">
+
+            <TextView
+                android:id="@+id/tv_tab_all"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:text="All"
+                android:textSize="14dp"
+                android:background="@drawable/selector_search_tab_bg"
+                android:foreground="@drawable/selector_foreground_search"
+                android:gravity="center"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:textColor="@color/white"
+                android:layout_gravity="center_horizontal"/>
+
+        </FrameLayout>
+
+        <FrameLayout
+            android:id="@+id/fl_tab_matches"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:layout_height="match_parent">
+
+            <TextView
+                android:id="@+id/tv_tab_matches"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:text="Matches"
+                android:textSize="14dp"
+                android:background="@drawable/selector_search_tab_bg"
+                android:foreground="@drawable/selector_foreground_search"
+                android:gravity="center"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:textColor="@color/white"
+                android:layout_centerHorizontal="true"
+                android:layout_gravity="center_horizontal"/>
+
+        </FrameLayout>
+
+        <FrameLayout
+            android:id="@+id/fl_tab_tours"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:layout_height="match_parent">
+
+            <TextView
+                android:id="@+id/tv_tab_tours"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:text="Tours"
+                android:textSize="14dp"
+                android:background="@drawable/selector_search_tab_bg"
+                android:foreground="@drawable/selector_foreground_search"
+                android:gravity="center"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:textColor="@color/white"
+                android:layout_gravity="center_horizontal"/>
+
+        </FrameLayout>
+
+    </LinearLayout>
+
+    <TextView
+        android:id="@+id/tv_chat_info"
+        android:layout_width="match_parent"
+        android:layout_height="33dp"
+        android:text="Enter at least 3 characters to auto search..."
+        android:gravity="center_vertical"
+        android:drawableLeft="@mipmap/icon_notice"
+        android:textColor="@color/c_1D2550"
+        android:fontFamily="@font/noto_sans_display_semibold"
+        android:textSize="12sp"
+        android:paddingLeft="20dp"
+        android:drawablePadding="10dp"
+        android:background="@color/c_80DCDBE0"/>
+
+    <ScrollView
+        android:id="@+id/sl_main"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/white">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+
+            <TextView
+                android:id="@+id/tv_title_match"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:padding="12dp"
+                android:text="Matches"
+                android:textColor="@color/c_111111"
+                android:fontFamily="@font/noto_sans_display_semibold"
+                android:visibility="gone"/>
+
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/recyclerView_match"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:paddingLeft="12dp"
+                android:paddingRight="12dp"
+                android:visibility="gone"
+                android:overScrollMode="never"/>
+
+            <View
+                android:id="@+id/view_line"
+                android:layout_width="match_parent"
+                android:layout_height="8dp"
+                android:background="@color/line_color"
+                android:visibility="gone"/>
+
+            <TextView
+                android:id="@+id/tv_title_tours"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:padding="12dp"
+                android:text="Tours"
+                android:textColor="@color/c_111111"
+                android:fontFamily="@font/noto_sans_display_semibold"
+                android:visibility="gone"/>
+
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/recyclerView_tours"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:paddingLeft="12dp"
+                android:paddingRight="12dp"
+                android:visibility="gone"
+                android:overScrollMode="never"/>
+
+        </LinearLayout>
+    </ScrollView>
+
+    <include layout="@layout/layout_search_empty"/>
+
+</LinearLayout>

+ 104 - 0
TMessagesProj/src/main/res/layout/dialog_search_tournament.xml

@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@drawable/shape_white_25dp_half_rec">
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:paddingTop="12dp"
+        android:paddingBottom="17dp"
+        android:paddingLeft="12dp"
+        android:paddingRight="4dp">
+
+        <LinearLayout
+            android:id="@+id/ll_focus"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:layout_height="37dp"
+            android:gravity="center_vertical"
+            android:layout_marginRight="5dp"
+            android:orientation="horizontal"
+            android:background="@drawable/shape_e8e9ed_10dp_rec"
+            android:focusable="true"
+            android:focusableInTouchMode="true">
+
+            <ImageView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="12dp"
+                android:layout_marginRight="9dp"
+                android:background="@mipmap/icon_search_two"/>
+
+            <EditText
+                android:id="@+id/et_input"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:hint="@string/match_search_tour_hint"
+                android:textColor="@color/c_111111"
+                android:textColorHint="@color/c_70809B"
+                android:textSize="14dp"
+                android:singleLine="true"
+                android:background="@null"/>
+
+        </LinearLayout>
+
+        <ImageView
+            android:id="@+id/iv_close"
+            android:layout_width="30dp"
+            android:layout_height="30dp"
+            android:padding="9dp"
+            android:layout_gravity="center_vertical"
+            android:src="@mipmap/close_ico"/>
+
+    </LinearLayout>
+
+    <androidx.recyclerview.widget.RecyclerView
+        android:id="@+id/rv_tournament"
+        android:layout_width="match_parent"
+        android:layout_height="260dp"
+        android:overScrollMode="never" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center_horizontal"
+        android:orientation="horizontal"
+        android:paddingTop="15dp"
+        android:paddingBottom="30dp"
+        android:background="@mipmap/bg_select_tournament_footer">
+
+        <com.coorchice.library.SuperTextView
+            android:id="@+id/tv_reset"
+            android:layout_width="116dp"
+            android:layout_height="31dp"
+            android:gravity="center"
+            android:text="@string/clear_all"
+            android:textSize="14dp"
+            android:textColor="@color/colorBlue"
+            android:foreground="?android:attr/selectableItemBackground"
+            android:letterSpacing="0.1"
+            android:fontFamily="@font/noto_sans_display_semibold" />
+
+        <TextView
+            android:id="@+id/tv_apply"
+            android:layout_width="116dp"
+            android:layout_height="31dp"
+            android:layout_marginLeft="40dp"
+            android:gravity="center"
+            android:text="@string/apply2"
+            android:textSize="14dp"
+            android:foreground="?android:attr/selectableItemBackground"
+            android:textColor="#C6C7CB"
+            android:background="@drawable/shape_c8c8c8_5dp_rec"
+            android:letterSpacing="0.1"
+            android:fontFamily="@font/noto_sans_display_semibold"
+            android:enabled="false"/>
+
+    </LinearLayout>
+
+</LinearLayout>

+ 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"

+ 68 - 0
TMessagesProj/src/main/res/layout/item_search_matchs.xml

@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:paddingTop="12dp"
+    android:background="@color/white"
+    android:foreground="@drawable/selector_foreground_white">
+
+    <ImageView
+        android:id="@+id/iv_right"
+        android:layout_width="35dp"
+        android:layout_height="35dp"
+        android:layout_alignParentLeft="true"
+        android:scaleType="centerCrop"
+        android:src="@mipmap/icon_cric1"/>
+
+    <TextView
+        android:id="@+id/tv_left"
+        android:textSize="@dimen/sp_14"
+        android:textColor="@color/c_333333"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@+id/iv_right"
+        android:layout_marginLeft="15dp"
+        android:layout_toRightOf="@+id/iv_right"
+        android:layout_toLeftOf="@id/tv_status"
+        android:ellipsize="end"
+        android:maxLines="1"
+        android:singleLine="true"
+        android:fontFamily="@font/noto_sans_display_regular"/>
+
+    <TextView
+        android:id="@+id/tv_bottom"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/tv_left"
+        android:textSize="11sp"
+        android:textColor="@color/c_999999"
+        android:layout_marginTop="2dp"
+        android:layout_alignLeft="@id/tv_left"
+        android:singleLine="true"
+        android:maxLines="1"
+        android:ellipsize="end"
+        android:layout_toLeftOf="@id/tv_status"/>
+    
+    <TextView
+        android:id="@+id/tv_status"
+        android:layout_width="64dp"
+        android:layout_height="wrap_content"
+        android:paddingTop="2dp"
+        android:paddingBottom="2dp"
+        android:textColor="@color/c_999999"
+        android:textSize="10sp"
+        android:background="@drawable/shape_f6f7f9_6dp_rec"
+        android:layout_alignParentRight="true"
+        android:gravity="center_horizontal"
+        android:layout_alignBottom="@id/tv_bottom"
+        android:layout_marginLeft="5dp"/>
+
+    <View
+        android:id="@+id/view_line"
+        android:layout_width="match_parent"
+        android:layout_height="0.5dp"
+        android:layout_below="@id/tv_bottom"
+        android:layout_marginTop="12dp"
+        android:background="@color/line_color"/>
+
+</RelativeLayout>

+ 55 - 0
TMessagesProj/src/main/res/layout/item_search_tours.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:paddingTop="12dp"
+    android:background="@color/white"
+    android:foreground="@drawable/selector_foreground_white">
+
+    <ImageView
+        android:id="@+id/iv_right"
+        android:layout_width="35dp"
+        android:layout_height="35dp"
+        android:layout_alignParentLeft="true"
+        android:scaleType="centerCrop"
+        android:src="@mipmap/icon_cric2"/>
+
+    <TextView
+        android:id="@+id/tv_left"
+        android:textSize="10sp"
+        android:textColor="@color/c_666666"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@+id/iv_right"
+        android:layout_marginLeft="15dp"
+        android:layout_toRightOf="@+id/iv_right"
+        android:ellipsize="end"
+        android:maxLines="2"
+        android:textAllCaps="true"
+        android:letterSpacing="0.1"
+        android:fontFamily="@font/noto_sans_display_regular"/>
+
+    <TextView
+        android:id="@+id/tv_bottom"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/tv_left"
+        android:textSize="11sp"
+        android:textColor="@color/c_111111"
+        android:layout_marginTop="2dp"
+        android:layout_alignLeft="@id/tv_left"
+        android:singleLine="true"
+        android:maxLines="1"
+        android:ellipsize="end"
+        android:fontFamily="@font/noto_sans_display_semibold"/>
+
+
+    <View
+        android:id="@+id/view_line"
+        android:layout_width="match_parent"
+        android:layout_height="0.5dp"
+        android:layout_below="@id/tv_bottom"
+        android:layout_marginTop="12dp"
+        android:background="@color/line_color"/>
+
+</RelativeLayout>

+ 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" />

+ 44 - 0
TMessagesProj/src/main/res/layout/layout_search_empty.xml

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/ll_empty"
+    android:orientation="vertical"
+    android:gravity="center"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:visibility="gone"
+    android:layout_marginBottom="200dp"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <com.airbnb.lottie.LottieAnimationView
+        android:id="@+id/empty_view_anim"
+        android:layout_width="120dp"
+        android:layout_height="120dp"
+        app:layout_constraintBottom_toTopOf="@id/empty_view_title"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintVertical_chainStyle="packed"
+        app:lottie_autoPlay="true"
+        app:lottie_fileName="empty.json"
+        app:lottie_loop="false" />
+
+    <TextView
+        android:id="@+id/tv_empty"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textSize="18dp"
+        android:textColor="@color/c_111111"
+        android:fontFamily="@font/noto_sans_display_semibold"
+        android:layout_marginTop="15dp"/>
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="Please check the spelling or try\n different words"
+        android:textSize="15dp"
+        android:textColor="@color/c_111111"
+        android:letterSpacing="0.05"
+        android:fontFamily="@font/noto_sans_display_regular"
+        android:layout_marginTop="10dp"
+        android:gravity="center"/>
+</LinearLayout>

BIN=BIN
TMessagesProj/src/main/res/mipmap-xhdpi/btn_square_blue.png


BIN=BIN
TMessagesProj/src/main/res/mipmap-xhdpi/btn_square_bor.png


BIN=BIN
TMessagesProj/src/main/res/mipmap-xhdpi/close_ico.png


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


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


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


BIN=BIN
TMessagesProj/src/main/res/mipmap-xhdpi/icon_cric1.png


BIN=BIN
TMessagesProj/src/main/res/mipmap-xhdpi/icon_cric2.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结束================================-->
 
 

+ 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.5
-APP_VERSION_CODE=26
+APP_VERSION_NAME=0.2.9
+APP_VERSION_CODE=29
 #APP_PACKAGE=org.telegram.messenger
 APP_PACKAGE=com.cricdit.cricdit
 RELEASE_KEY_PASSWORD=123456