mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 02:10:44 +01:00
Adjust boost dialog fragment to behave better with keyboard.
This commit is contained in:
committed by
Greyson Parrelli
parent
35393fc331
commit
f6542440c7
@@ -1,27 +0,0 @@
|
||||
package org.thoughtcrime.securesms.util;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
||||
|
||||
public final class BottomSheetUtil {
|
||||
|
||||
public static final String STANDARD_BOTTOM_SHEET_FRAGMENT_TAG = "BOTTOM";
|
||||
|
||||
private BottomSheetUtil() {}
|
||||
|
||||
/**
|
||||
* Show preventing a possible IllegalStateException.
|
||||
*/
|
||||
public static void show(@NonNull FragmentManager manager,
|
||||
@Nullable String tag,
|
||||
@NonNull BottomSheetDialogFragment dialog)
|
||||
{
|
||||
FragmentTransaction transaction = manager.beginTransaction();
|
||||
transaction.add(dialog, tag);
|
||||
transaction.commitAllowingStateLoss();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.thoughtcrime.securesms.util
|
||||
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import org.thoughtcrime.securesms.R
|
||||
|
||||
object BottomSheetUtil {
|
||||
const val STANDARD_BOTTOM_SHEET_FRAGMENT_TAG = "BOTTOM"
|
||||
|
||||
/**
|
||||
* Show preventing a possible IllegalStateException.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun show(
|
||||
manager: FragmentManager,
|
||||
tag: String?,
|
||||
dialog: BottomSheetDialogFragment
|
||||
) {
|
||||
manager.beginTransaction().apply {
|
||||
add(dialog, tag)
|
||||
commitAllowingStateLoss()
|
||||
}
|
||||
}
|
||||
|
||||
fun BottomSheetDialogFragment.requireCoordinatorLayout(): CoordinatorLayout {
|
||||
return requireDialog().findViewById(R.id.coordinator)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user