Renaming of recyclerView id

csv
Laurent 6 years ago
parent 6f0fe5b104
commit f09f9a5c60
  1. 20
      app/src/main/java/net/pokeranalytics/android/ui/fragment/FeedFragment.kt
  2. 2
      app/src/main/res/layout/fragment_feed.xml

@ -88,7 +88,7 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate {
override fun onCreateContextMenu(menu: ContextMenu?, v: View?, menuInfo: ContextMenu.ContextMenuInfo?) { override fun onCreateContextMenu(menu: ContextMenu?, v: View?, menuInfo: ContextMenu.ContextMenuInfo?) {
super.onCreateContextMenu(menu, v, menuInfo) super.onCreateContextMenu(menu, v, menuInfo)
if (v?.id == R.id.recyclerView) { if (v?.id == R.id.menuRecyclerView) {
activity?.menuInflater?.inflate(R.menu.menu_session, menu) activity?.menuInflater?.inflate(R.menu.menu_session, menu)
} }
@ -171,7 +171,7 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate {
this.feedSessionAdapter = FeedSessionRowRepresentableAdapter(getRealm(), this) this.feedSessionAdapter = FeedSessionRowRepresentableAdapter(getRealm(), this)
registerForContextMenu(this.recyclerView) registerForContextMenu(this.menuRecyclerView)
val messageToShow: Preferences.FeedMessage? = Preferences.feedMessageToShow(requireContext()) val messageToShow: Preferences.FeedMessage? = Preferences.feedMessageToShow(requireContext())
@ -204,11 +204,11 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate {
when (tab.position) { when (tab.position) {
0 -> { 0 -> {
currentFilterable = FilterableType.SESSION currentFilterable = FilterableType.SESSION
recyclerView.adapter = feedSessionAdapter menuRecyclerView.adapter = feedSessionAdapter
} }
1 -> { 1 -> {
currentFilterable = FilterableType.TRANSACTION currentFilterable = FilterableType.TRANSACTION
recyclerView.adapter = feedTransactionAdapter menuRecyclerView.adapter = feedTransactionAdapter
} }
} }
} }
@ -232,7 +232,7 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate {
this.currentFilterable = FilterableType.SESSION this.currentFilterable = FilterableType.SESSION
val viewManager = SmoothScrollLinearLayoutManager(requireContext()) val viewManager = SmoothScrollLinearLayoutManager(requireContext())
recyclerView.apply { menuRecyclerView.apply {
setHasFixedSize(true) setHasFixedSize(true)
layoutManager = viewManager layoutManager = viewManager
} }
@ -350,11 +350,11 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate {
filter?.let { filter?.let {
when (it.filterableType) { when (it.filterableType) {
FilterableType.SESSION -> { FilterableType.SESSION -> {
recyclerView.adapter = feedSessionAdapter menuRecyclerView.adapter = feedSessionAdapter
this.selectTab(Tab.SESSIONS) this.selectTab(Tab.SESSIONS)
} }
FilterableType.TRANSACTION -> { FilterableType.TRANSACTION -> {
recyclerView.adapter = feedTransactionAdapter menuRecyclerView.adapter = feedTransactionAdapter
this.selectTab(Tab.TRANSACTIONS) this.selectTab(Tab.TRANSACTIONS)
} }
else -> { else -> {
@ -365,7 +365,7 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate {
if (!adapterHasBeenSet) { if (!adapterHasBeenSet) {
adapterHasBeenSet = true adapterHasBeenSet = true
recyclerView.adapter = feedSessionAdapter menuRecyclerView.adapter = feedSessionAdapter
} }
} }
@ -375,9 +375,9 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate {
this.loadSessions() this.loadSessions()
this.loadTransactions() this.loadTransactions()
if (currentFilterable == FilterableType.SESSION) { if (currentFilterable == FilterableType.SESSION) {
recyclerView.adapter = feedSessionAdapter menuRecyclerView.adapter = feedSessionAdapter
} else { } else {
recyclerView.adapter = feedTransactionAdapter menuRecyclerView.adapter = feedTransactionAdapter
} }
} }

@ -58,7 +58,7 @@
app:layout_constraintTop_toBottomOf="@+id/appBar" /> app:layout_constraintTop_toBottomOf="@+id/appBar" />
<net.pokeranalytics.android.ui.view.ContextMenuRecyclerView <net.pokeranalytics.android.ui.view.ContextMenuRecyclerView
android:id="@+id/recyclerView" android:id="@+id/menuRecyclerView"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:paddingBottom="72dp" android:paddingBottom="72dp"

Loading…
Cancel
Save