replace MaterialDialog with MaterialAlertDialogBuilder in AboutFragment

This commit is contained in:
Jannik 2022-02-05 20:10:59 +01:00
parent 0b5a8e69fb
commit a51001ec2e
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
2 changed files with 8 additions and 7 deletions

View File

@ -9,7 +9,7 @@ import android.view.ViewGroup
import android.widget.Toast import android.widget.Toast
import androidx.annotation.RawRes import androidx.annotation.RawRes
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import com.afollestad.materialdialogs.MaterialDialog import com.google.android.material.dialog.MaterialAlertDialogBuilder
import org.mosad.teapod.BuildConfig import org.mosad.teapod.BuildConfig
import org.mosad.teapod.R import org.mosad.teapod.R
import org.mosad.teapod.databinding.FragmentAboutBinding import org.mosad.teapod.databinding.FragmentAboutBinding
@ -68,9 +68,9 @@ class AboutFragment : Fragment() {
} }
binding.linearLicense.setOnClickListener { binding.linearLicense.setOnClickListener {
MaterialDialog(requireContext()) MaterialAlertDialogBuilder(requireContext())
.title(text = License.GPL3.long) .setTitle(License.GPL3.long)
.message(text = parseLicense(R.raw.gpl_3_full)) .setMessage(parseLicense(R.raw.gpl_3_full))
.show() .show()
} }
} }
@ -132,9 +132,9 @@ class AboutFragment : Fragment() {
License.MIT -> parseLicense(R.raw.mit_full) License.MIT -> parseLicense(R.raw.mit_full)
} }
MaterialDialog(requireContext()) MaterialAlertDialogBuilder(requireContext())
.title(text = license.long) .setTitle(license.long)
.message(text = licenseText) .setMessage(licenseText)
.show() .show()
} }

View File

@ -31,6 +31,7 @@ import com.afollestad.materialdialogs.customview.customView
import com.afollestad.materialdialogs.customview.getCustomView import com.afollestad.materialdialogs.customview.getCustomView
import org.mosad.teapod.R import org.mosad.teapod.R
// TODO rework and port away from MaterialDialog
class LoginDialog(val context: Context, firstTry: Boolean) { class LoginDialog(val context: Context, firstTry: Boolean) {
private val dialog = MaterialDialog(context, BottomSheet()) private val dialog = MaterialDialog(context, BottomSheet())