mozilla-mobile / fenix

⚠️ Fenix (Firefox for Android) moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android
https://github.com/mozilla-mobile/firefox-android
Mozilla Public License 2.0
6.47k stars 1.27k forks source link

Refactor library recycler adapters #16216

Closed eliserichards closed 2 years ago

eliserichards commented 4 years ago

Related to #15577, #16215

Refactor the recycler views in history, bookmarks, downloads (and maybe logins too?) to use https://developer.android.com/reference/androidx/recyclerview/widget/ConcatAdapter (or another option).

Current implementation does some weird stuff in order to have the Delete button in the scroll view: https://github.com/mozilla-mobile/fenix/blob/655a5cbf5439c162b6c221031dc7f2606eb0bc9f/app/src/main/java/org/mozilla/fenix/library/history/HistoryAdapter.kt#L47

fun updateMode(mode: HistoryFragmentState.Mode) {
        this.mode = mode
        // Update the delete button alpha that the first item holds
        if (itemCount > 0) notifyItemChanged(0)
    }

┆Issue is synchronized with this Jira Task

jonalmeida commented 4 years ago

When we used the ConcatAdapter in the tabs tray it came with some side-effects that are worth noting:

stale[bot] commented 3 years ago

See: https://github.com/mozilla-mobile/fenix/issues/17373 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

eliserichards commented 3 years ago

Removing "won't-fix". This issue may still be valid.

stale[bot] commented 2 years ago

See: https://github.com/mozilla-mobile/fenix/issues/17373 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.