File tree Expand file tree Collapse file tree
java/uk/openvk/android/refresh/ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ public void onSearchStateChanged(boolean enabled) {
7575 @ Override
7676 public void onSearchConfirmed (CharSequence text ) {
7777 String query = text .toString ();
78+ if (sectionAdapter != null ) {
79+ sectionAdapter .removeAllSections ();
80+ peopleSection = null ;
81+ commsSection = null ;
82+ }
7883 groups .search (ovk_api , query );
7984 users .search (ovk_api , query );
8085 }
@@ -96,13 +101,17 @@ private void createSearchResultsAdapter(RecyclerView rv) {
96101 if (commsSection == null ) {
97102 commsSection = new CommunitiesSearchSection (QuickSearchActivity .this , groups .getList ());
98103 sectionAdapter .addSection (commsSection );
104+ } else {
105+ commsSection = new CommunitiesSearchSection (QuickSearchActivity .this , groups .getList ());
99106 }
100107 if (peopleSection == null ) {
101108 peopleSection = new PeopleSearchSection (QuickSearchActivity .this , users .getList ());
102109 sectionAdapter .addSection (peopleSection );
110+ } else {
111+ peopleSection = new PeopleSearchSection (QuickSearchActivity .this , users .getList ());
103112 }
104-
105113 sectionAdapter .notifyDataSetChanged ();
114+
106115 }
107116
108117 private void setAPIWrapper () {
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ public void onClick(View v) {
101101 }
102102 });
103103 setTheme (convertView );
104- convertView .setOnClickListener (openProfileListener );
104+ convertView .findViewById ( R . id . card ). setOnClickListener (openProfileListener );
105105 }
106106 }
107107
Original file line number Diff line number Diff line change 66 android : layout_height =" wrap_content" >
77 <!-- suppress AndroidUnknownAttribute -->
88 <com .google.android.material.card.MaterialCardView
9+ android : id =" @+id/card"
910 android : layout_width =" match_parent"
1011 android : layout_height =" wrap_content"
1112 android : layout_marginStart =" 4dp"
You can’t perform that action at this time.
0 commit comments