Skip to content

Commit c26be08

Browse files
committed
fix: search page talkback
by @YunZiA
1 parent 3de38dc commit c26be08

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

app/src/main/java/com/sevtinge/hyperceiler/ui/page/HomePageFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ protected void onSearchRequest(View view) {
129129
if (mSearchCallBack == null) {
130130
mSearchCallBack = new ModSearchCallback(getActivity(), mSearchResultView, this);
131131
}
132-
mSearchCallBack.setup(view, mNestedHeaderLayout.getScrollableView());
132+
mSearchCallBack.setup(view, mNestedHeaderLayout.getScrollableView(),mContainerView.findViewById(com.sevtinge.hyperceiler.R.id.search_result_ll));
133133
}
134134

135135
@Override

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,23 @@
7979

8080
</androidx.core.widget.NestedScrollView>
8181

82+
</fan.springback.view.SpringBackLayout>
83+
84+
85+
</fan.nestedheader.widget.NestedHeaderLayout>
86+
87+
<LinearLayout
88+
android:id="@+id/search_result_ll"
89+
android:orientation="vertical"
90+
android:layout_width="match_parent"
91+
android:layout_height="match_parent">
92+
93+
<fan.springback.view.SpringBackLayout
94+
android:layout_width="match_parent"
95+
android:layout_height="match_parent"
96+
app:scrollOrientation="vertical|angle"
97+
app:scrollableView="@android:id/list">
98+
8299
<androidx.recyclerview.widget.RecyclerView
83100
android:id="@android:id/list"
84101
android:layout_width="match_parent"
@@ -87,7 +104,7 @@
87104

88105
</fan.springback.view.SpringBackLayout>
89106

90-
</fan.nestedheader.widget.NestedHeaderLayout>
107+
</LinearLayout>
91108

92109
</FrameLayout>
93110
</FrameLayout>

library/common-ui/java/main/src/com/sevtinge/hyperceiler/common/callback/ModSearchCallback.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public class ModSearchCallback implements SearchActionMode.Callback {
4343
private ActionMode mActionMode;
4444
private View mAnchorView;
4545
private View mAnimView;
46+
private View mSearchResultLayout;
4647
private Context mContext;
4748
private RecyclerView mSearchResultView;
4849
private SearchView.OnQueryTextListener mOnQueryTextListener;
@@ -85,9 +86,10 @@ public ModSearchCallback(Context context, RecyclerView searchResultView, OnSearc
8586
mOnSearchListener = onSearchListener;
8687
}
8788

88-
public void setup(View anchor, View anim) {
89+
public void setup(View anchor, View anim, View searchResultLayout) {
8990
mAnchorView = anchor;
9091
mAnimView = anim;
92+
mSearchResultLayout = searchResultLayout;
9193
}
9294

9395
public boolean isSearchOn() {
@@ -122,6 +124,7 @@ public boolean onCreateActionMode(ActionMode mode, Menu menu) {
122124
SearchActionMode searchActionMode = (SearchActionMode) mode;
123125
searchActionMode.setAnchorView(mAnchorView);
124126
searchActionMode.setAnimateView(mAnimView);
127+
searchActionMode.setResultView(mSearchResultLayout);
125128
mSearchInput = searchActionMode.getSearchInput();
126129
mSearchInput.setFilters(new InputFilter[]{new InputFilter.LengthFilter(MAX_SEARCH_LENGTH)});
127130
//mSearchInput.setHint("");

0 commit comments

Comments
 (0)