Skip to content

Commit

Permalink
fix AccountsInListFragment not showing any accounts (#4851)
Browse files Browse the repository at this point in the history
The problem is that the MaterialAlertDialog uses a layout with
"wrap_content" around the custom view. Even though the dialog was
stretched to the whole window size, the content was never shown.
The fix reverts to the default dialog and styles it as if it was a
MaterialAlertDialog, which works and also looks better on smaller
screens.

fixes #4850
  • Loading branch information
connyduck authored Jan 5, 2025
1 parent fc57d57 commit b52a5cd
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.keylesspalace.tusky

import android.app.Dialog
import android.content.SharedPreferences
import android.os.Bundle
import android.view.LayoutInflater
Expand All @@ -30,7 +29,6 @@ import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.ListAdapter
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.keylesspalace.tusky.databinding.FragmentAccountsInListBinding
import com.keylesspalace.tusky.databinding.ItemFollowRequestBinding
import com.keylesspalace.tusky.entity.TimelineAccount
Expand Down Expand Up @@ -73,11 +71,7 @@ class AccountsInListFragment : DialogFragment() {
viewModel.load(listId)
}

override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return MaterialAlertDialogBuilder(requireContext())
.setView(createView())
.create()
}
override fun getTheme() = R.style.TuskyDialogOverlay

override fun onStart() {
super.onStart()
Expand All @@ -90,7 +84,7 @@ class AccountsInListFragment : DialogFragment() {
}
}

private fun createView(): View {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
binding = FragmentAccountsInListBinding.inflate(layoutInflater)
val adapter = Adapter()
val searchAdapter = SearchAdapter()
Expand Down

0 comments on commit b52a5cd

Please sign in to comment.