Элементы управления для двойного экрана пользовательского интерфейса Fluent
Нижний экран всегда отображается только на одном экране, чтобы не попадать в область петли:
Один экран
Два экрана — отображается только на одном экране
Чтобы использовать BottomSheetView
в пользовательском интерфейсе Fluent, настройте файл gradle и импортируйте требуемые классы:
import com.microsoft.fluentui.bottomsheet.BottomSheet
import com.microsoft.fluentui.bottomsheet.BottomSheetDialog
import com.microsoft.fluentui.bottomsheet.BottomSheetItem
Элемент управления BottomSheet
// Single line items
val bottomSheet = BottomSheet.newInstance(
arrayListOf(
BottomSheetItem(
R.id.bottom_sheet_item_flag,
R.drawable.ic_fluent_flag_24_regular,
getString(R.string.bottom_sheet_item_flag_title)
),
BottomSheetItem(
R.id.bottom_sheet_item_reply,
R.drawable.ic_fluent_reply_24_regular,
getString(R.string.bottom_sheet_item_reply_title)
),
// more items as required
)
)
bottomSheet.show(supportFragmentManager, null)
Элемент управления BottomSheetDialog
if (bottomSheetDialog == null) {
bottomSheetDialog = BottomSheetDialog(
this,
arrayListOf(
BottomSheetItem(
R.id.bottom_sheet_item_clock,
R.drawable.ic_clock_24_regular,
getString(R.string.bottom_sheet_item_clock_title)
),
BottomSheetItem(
R.id.bottom_sheet_item_alarm,
R.drawable.ic_alert_24_regular,
getString(R.string.bottom_sheet_item_alarm_title)
),
// more items as required
)
)
bottomSheetDialog?.onItemClickListener = this // implement BottomSheetItem.OnClickListener
}
bottomSheetDialog?.show()