mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-24 14:05:40 +03:00
set timer for lobby
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
39fd7454c4
commit
cbe9305497
1 changed files with 23 additions and 11 deletions
|
@ -31,7 +31,8 @@ import autodagger.AutoInjector
|
|||
import com.afollestad.materialdialogs.LayoutMode.WRAP_CONTENT
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.afollestad.materialdialogs.bottomsheets.BottomSheet
|
||||
import com.afollestad.materialdialogs.datetime.dateTimePicker
|
||||
import com.afollestad.materialdialogs.datetime.datePicker
|
||||
import com.afollestad.materialdialogs.datetime.timePicker
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.nextcloud.android.common.ui.theme.utils.ColorRole
|
||||
|
@ -354,22 +355,17 @@ class ConversationInfoActivity :
|
|||
reconfigureLobbyTimerView()
|
||||
|
||||
binding.webinarInfoView.startTimeButton.setOnClickListener {
|
||||
// First, show the calendar dialog
|
||||
MaterialDialog(this, BottomSheet(WRAP_CONTENT)).show {
|
||||
val currentTimeCalendar = Calendar.getInstance()
|
||||
if (conversation!!.lobbyTimer != 0L) {
|
||||
currentTimeCalendar.timeInMillis = conversation!!.lobbyTimer * DateConstants.SECOND_DIVIDER
|
||||
}
|
||||
|
||||
dateTimePicker(
|
||||
minDateTime = Calendar.getInstance(),
|
||||
requireFutureDateTime = true,
|
||||
currentDateTime = currentTimeCalendar,
|
||||
show24HoursView = true,
|
||||
dateTimeCallback = { _, dateTime ->
|
||||
reconfigureLobbyTimerView(dateTime)
|
||||
submitLobbyChanges()
|
||||
}
|
||||
)
|
||||
datePicker { _, date ->
|
||||
// After selecting the date, now show the time picker
|
||||
showTimePicker(date)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -383,6 +379,22 @@ class ConversationInfoActivity :
|
|||
}
|
||||
}
|
||||
|
||||
private fun showTimePicker(selectedDate: Calendar) {
|
||||
MaterialDialog(this, BottomSheet(WRAP_CONTENT)).show {
|
||||
cancelable(false)
|
||||
timePicker(
|
||||
currentTime = Calendar.getInstance(),
|
||||
show24HoursView = true,
|
||||
timeCallback = { _, time ->
|
||||
selectedDate.set(Calendar.HOUR_OF_DAY, time.get(Calendar.HOUR_OF_DAY))
|
||||
selectedDate.set(Calendar.MINUTE, time.get(Calendar.MINUTE))
|
||||
reconfigureLobbyTimerView(selectedDate)
|
||||
submitLobbyChanges()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun webinaryRoomType(conversation: ConversationModel): Boolean {
|
||||
return conversation.type == ConversationEnums.ConversationType.ROOM_GROUP_CALL ||
|
||||
conversation.type == ConversationEnums.ConversationType.ROOM_PUBLIC_CALL
|
||||
|
|
Loading…
Reference in a new issue