lucanicoletti / hiddensearchwithrecyclerview Goto Github PK
View Code? Open in Web Editor NEWSimple library to have a hidden/shown search bar
License: MIT License
Simple library to have a hidden/shown search bar
License: MIT License
Hi, I'm having issues getting to work the hidden search in my app. I do have a Users Fragment in which the search works flawlessly, but in my Events Fragment it does not.
I'm posting the code snippets where it does work and where it does not.
Here it does work:
<RelativeLayout>
<com.nicolettilu.hiddensearchwithrecyclerview.HiddenSearchWithRecyclerView
android:id="@+id/hidden_Search_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:scrollToTopBeforeShow="true"
app:filterWhileTyping="true">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/user_recycler_view"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.nicolettilu.hiddensearchwithrecyclerview.HiddenSearchWithRecyclerView>
</RelativeLayout>
<ConstraintLayout>
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/user_profile_image"
android:layout_width="76dp"
android:layout_height="76dp"
android:contentDescription="@string/user_picture_desc"
app:civ_border_color="#FF000000"
app:civ_border_width="2dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/ic_launcher_round" />
<TextView
android:id="@+id/user_profile_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="center"
android:textStyle="bold"
android:text="@string/user_profile_row_name_text"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.473"
app:layout_constraintStart_toEndOf="@+id/user_profile_image"
app:layout_constraintTop_toTopOf="parent" />
<RatingBar
android:id="@+id/user_rating"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:isIndicator="true"
android:numStars="5"
android:stepSize="0.1"
android:theme="@style/RatingBar"
app:layout_constraintStart_toEndOf="@+id/user_profile_image"
app:layout_constraintStart_toStartOf="@id/user_profile_name"
app:layout_constraintTop_toBottomOf="@id/user_profile_name" />
<TextView
android:id="@+id/user_goal_keeper"
android:layout_width="wrap_content"
android:layout_height="@+id/user_rating"
android:gravity="center"
android:text="@string/goal_keeper"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.225"
app:layout_constraintStart_toEndOf="@+id/user_rating"
app:layout_constraintTop_toBottomOf="@+id/user_profile_name"
app:layout_constraintVertical_bias="0.266" />
</ConstraintLayout>
And here not:
<ConstraintLayout>
<com.nicolettilu.hiddensearchwithrecyclerview.HiddenSearchWithRecyclerView
android:id="@+id/hidden_Search_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:scrollToTopBeforeShow="true"
app:filterWhileTyping="true">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/event_recycler_view"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.nicolettilu.hiddensearchwithrecyclerview.HiddenSearchWithRecyclerView>
</ConstraintLayout>
<ConstraintLayout >
<ImageView
android:id="@+id/event_cover"
android:layout_width="match_parent"
android:layout_height="50dp"
android:contentDescription="@string/event_cover_image"
android:src="@drawable/terrain_foot_png"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/event_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="0dp"
android:text="@string/event_title"
android:textSize="24dp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/event_cover" />
<TextView
android:id="@+id/event_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="24dp"
android:layout_marginTop="5dp"
android:drawableLeft="@drawable/ic_location_on_black_24dp"
android:drawablePadding="5dp"
android:text="@string/event_location"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/event_title" />
<TextView
android:id="@+id/event_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="24dp"
android:layout_marginTop="5dp"
android:drawablePadding="5dp"
android:drawableLeft="@drawable/ic_date_range_black_24dp"
android:text="@string/event_date"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/event_location" />
<TextView
android:id="@+id/event_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="24dp"
android:layout_marginTop="5dp"
android:drawablePadding="5dp"
android:drawableLeft="@drawable/ic_access_time_black_24dp"
android:text="@string/event_time"
android:textSize="20sp"
app:layout_constraintStart_toEndOf="@+id/event_date"
app:layout_constraintTop_toBottomOf="@+id/event_location" />
<TextView
android:id="@+id/event_attendees"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="24dp"
android:layout_marginTop="5dp"
android:drawablePadding="5dp"
android:drawableLeft="@drawable/ic_group_black_24dp"
android:text="@string/event_attendees"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/event_date" />
<Button
android:id="@+id/event_details_button"
android:layout_height="40dp"
android:layout_width="wrap_content"
android:text="@string/show_details"
android:layout_marginLeft="25dp"
app:layout_constraintStart_toEndOf="@id/event_attendees"
app:layout_constraintTop_toBottomOf="@id/event_time"/>
</ConstraintLayout>
I'm interested in using your library but I need the hamburger icon to open the left drawer menu
Do you have any suggestion on how to do it?
When specifying visibleAtInit it overlaps first item in the recycler list.
Is it possible to use visibleAtInit without it overlapping the first item?
I will try forcing a scroll to the top but that isn't ideal.
I think this library is great btw.
Edit: Sorry, I think this may be due to the way I load the recycler content after initialization (because it's a long slow load), will investigate.
Hello @lnicolet
Please make java compatible so we can use this library in java code for search in recycler view.
Thanks.
not getting the right position of touch.
I have a fork with minor changes to demonstrate the problem:
https://github.com/Serg-Shar/HiddenSearchWithRecyclerView
Case 1: search bar is hidden:
Click on any item calls click on the selected item:
Case 1: search bar is visible:
Click on any item calls click on the following one:
Is it possible to avoid the mismatching independently of scroll bar state?
when we click in a position of item of recyclerView it suppose to touch for scroll the search. very bad :(, please do somthing
It seems to jump when hiding/showing the searchview.
You can see the items be displaced
Hello @lnicolet
It give wrong position on scroll state. if using card view with linear layout manger then it is give wrong position, if you use click on single child of layout like Text View, then click not working when search view open.
please look in to it.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.