Skip to content

Commit 1b0ca5b

Browse files
committed
fix funny things
1 parent c04c6f6 commit 1b0ca5b

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

app/src/main/java/uk/openvk/android/refresh/ui/core/activities/QuickSearchActivity.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff 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() {

app/src/main/java/uk/openvk/android/refresh/ui/list/adapters/FriendRequestsAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

app/src/main/res/layout/list_item_friend_requests.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
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"

0 commit comments

Comments
 (0)