Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

It just only works on single Fragment of the same Activity #12

Closed
mmveracruz opened this issue May 20, 2020 · 5 comments
Closed

It just only works on single Fragment of the same Activity #12

mmveracruz opened this issue May 20, 2020 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@mmveracruz
Copy link

mmveracruz commented May 20, 2020

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>
@mmveracruz
Copy link
Author

I do not know why github formatted my code on parts, sorry

@lucanicoletti
Copy link
Owner

Please edit the code, it's not readable at all like this. Also, by providing only the layouts I'm not able to understand the problem. What's not working? How do you set up the library? More code and more explanations are required for me to take a look into this.

@lucanicoletti lucanicoletti added the question Further information is requested label May 20, 2020
@lucanicoletti lucanicoletti self-assigned this May 20, 2020
@mmveracruz
Copy link
Author

mmveracruz commented May 20, 2020

Ok, now the code is formatted right.
The library is bee setted up by gradle using this

implementation 'com.nicolettilu:hiddensearchwithrecyclerview:0.0.6'

In the second snippet(fragment) which I mentioned that"s not working, isn't filtering anything. I can record you a video if it helps.

@lucanicoletti
Copy link
Owner

I need the code you're using as well, can't understand the problem just by using a layout.

@lucanicoletti
Copy link
Owner

Closing this as no more context was provided.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants