Skip to content

feat: advertise existing long press to refresh per section#467

Merged
eddyizm merged 3 commits intoeddyizm:developmentfrom
tvillega:feat-add-pull-to-refresh-library
Mar 2, 2026
Merged

feat: advertise existing long press to refresh per section#467
eddyizm merged 3 commits intoeddyizm:developmentfrom
tvillega:feat-add-pull-to-refresh-library

Conversation

@tvillega
Copy link
Contributor

Solves #347.

recording_20260227_231727.mp4

@tvillega tvillega changed the base branch from main to development February 28, 2026 02:23
@eddyizm
Copy link
Owner

eddyizm commented Feb 28, 2026

You are on a tear mate! 😆 I'll try and keep up.

@Kurami32
Copy link

I wonder... Works in home too?

@tvillega
Copy link
Contributor Author

tvillega commented Mar 1, 2026

@Kurami32 I implemented it on f066404, however there is a lot more going on in that fragment and performance in landscape is awful.

While debugging the problem I stumped upon these lines:

<!-- Download/Sync starred -->
<com.google.android.material.card.MaterialCardView
android:id="@+id/home_sync_starred_card"
style="?attr/materialCardViewOutlinedStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="24dp"
android:visibility="gone">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="20dp"
android:paddingVertical="12dp">
<!-- Title, secondary and supporting text -->
<TextView
android:id="@+id/home_sync_starred_title"
style="@style/TitleLarge"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/home_sync_starred_title"
android:textAppearance="?attr/textAppearanceTitleMedium"
android:textFontWeight="600"
app:layout_constraintEnd_toStartOf="@id/vertical_guideline"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/home_sync_starred_subtitle"
style="@style/TitleMedium"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/home_sync_starred_subtitle"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_sync_starred_title" />
<TextView
android:id="@+id/home_sync_starred_tracks_to_sync"
style="@style/TitleSmall"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:text="@string/home_sync_starred_subtitle"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_sync_starred_subtitle" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="end"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_sync_starred_tracks_to_sync">
<com.google.android.material.button.MaterialButton
android:id="@+id/home_sync_starred_cancel"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="@string/home_sync_starred_cancel" />
<com.google.android.material.button.MaterialButton
android:id="@+id/home_sync_starred_download"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/home_sync_starred_download" />
</LinearLayout>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/vertical_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.90" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<!-- Download/Sync starred albums -->
<com.google.android.material.card.MaterialCardView
android:id="@+id/home_sync_starred_albums_card"
style="?attr/materialCardViewOutlinedStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="24dp"
android:visibility="gone">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="20dp"
android:paddingVertical="12dp">
<!-- Title, secondary and supporting text -->
<TextView
android:id="@+id/home_sync_starred_albums_title"
style="@style/TitleLarge"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/home_sync_starred_albums_title"
android:textAppearance="?attr/textAppearanceTitleMedium"
android:textFontWeight="600"
app:layout_constraintEnd_toStartOf="@id/vertical_guideline_albums"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/home_sync_starred_albums_subtitle"
style="@style/TitleMedium"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/home_sync_starred_albums_subtitle"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_sync_starred_albums_title" />
<TextView
android:id="@+id/home_sync_starred_albums_to_sync"
style="@style/TitleSmall"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:text="@string/home_sync_starred_albums_subtitle"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_sync_starred_albums_subtitle" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="end"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_sync_starred_albums_to_sync">
<com.google.android.material.button.MaterialButton
android:id="@+id/home_sync_starred_albums_cancel"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="@string/home_sync_starred_cancel" />
<com.google.android.material.button.MaterialButton
android:id="@+id/home_sync_starred_albums_download"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/home_sync_starred_download" />
</LinearLayout>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/vertical_guideline_albums"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.90" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<!-- Download/Sync starred artists -->
<com.google.android.material.card.MaterialCardView
android:id="@+id/home_sync_starred_artists_card"
style="?attr/materialCardViewOutlinedStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="24dp"
android:visibility="gone">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="20dp"
android:paddingVertical="12dp">
<!-- Title, secondary and supporting text -->
<TextView
android:id="@+id/home_sync_starred_artists_title"
style="@style/TitleLarge"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/home_sync_starred_artists_title"
android:textAppearance="?attr/textAppearanceTitleMedium"
android:textFontWeight="600"
app:layout_constraintEnd_toStartOf="@id/vertical_guideline_artists"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/home_sync_starred_artists_subtitle"
style="@style/TitleMedium"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/home_sync_starred_artists_subtitle"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_sync_starred_artists_title" />
<TextView
android:id="@+id/home_sync_starred_artists_to_sync"
style="@style/TitleSmall"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:text="@string/home_sync_starred_artists_subtitle"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_sync_starred_artists_subtitle" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="end"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_sync_starred_artists_to_sync">
<com.google.android.material.button.MaterialButton
android:id="@+id/home_sync_starred_artists_cancel"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="@string/home_sync_starred_cancel" />
<com.google.android.material.button.MaterialButton
android:id="@+id/home_sync_starred_artists_download"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/home_sync_starred_download" />
</LinearLayout>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/vertical_guideline_artists"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.90" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>

They were always in the gone, so I set them visible and made an incredible discovery:

I had never seen that before, but apparently Tempo had a star-based offline system. I mean in settings does say sync starred * for offline use, but I didn't know that there was an offline mode built-in and already working.

Since this XML is so saturated with things I'm not sure on how to solve the performance issue =(

@tvillega tvillega marked this pull request as draft March 1, 2026 15:49
@tvillega
Copy link
Contributor Author

tvillega commented Mar 1, 2026

I updated this PR to advertise the already existent feat:

recording_20260301_193237.1.mp4

I reduced the tap area to just the icon + the title, that's why I tap in the video until I trigger the toast. The reason is landscape mode having a really wide area, which could lead to confusion of why the toast is triggered.

@tvillega tvillega marked this pull request as ready for review March 1, 2026 22:41
@eddyizm
Copy link
Owner

eddyizm commented Mar 2, 2026

this is excellent, that attention to detail is perfect. I also like that you greyed it out. My original pass that I did not ever merge still had them full white brightness which bothered me.

@eddyizm eddyizm changed the title feat: add pull to refresh library feat: advertise existing long press to refresh per section Mar 2, 2026
@eddyizm eddyizm merged commit c7f2524 into eddyizm:development Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants