Skip to content

Commit

Permalink
For mozilla-mobile#6791: Attempts to fit SavedLoginsAdapater crash
Browse files Browse the repository at this point in the history
  • Loading branch information
sblatz committed Nov 26, 2019
1 parent 8271f0f commit 75c0fac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package org.mozilla.fenix.logins

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
Expand All @@ -14,11 +15,12 @@ private sealed class AdapterItem {
}

class SavedLoginsAdapter(
private val context: Context,
private val interactor: SavedLoginsInteractor
) : ListAdapter<SavedLoginsItem, SavedLoginsListItemViewHolder>(DiffCallback) {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SavedLoginsListItemViewHolder {
val view = LayoutInflater.from(parent.context).inflate(viewType, parent, false)
val view = LayoutInflater.from(context).inflate(viewType, parent, false)
return SavedLoginsListItemViewHolder(view, interactor)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SavedLoginsView(
.inflate(R.layout.component_saved_logins, containerView, true)
.findViewById(R.id.saved_logins_wrapper)

private val loginsAdapter = SavedLoginsAdapter(interactor)
private val loginsAdapter = SavedLoginsAdapter(containerView.context, interactor)

init {
view.saved_logins_list.apply {
Expand Down

0 comments on commit 75c0fac

Please sign in to comment.