mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 20:19:42 +01:00
first steps to theme poll creation
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
9be4358ae0
commit
7ec78e53f0
@ -43,6 +43,7 @@ import com.nextcloud.talk.polls.adapters.PollCreateOptionItem
|
||||
import com.nextcloud.talk.polls.adapters.PollCreateOptionsAdapter
|
||||
import com.nextcloud.talk.polls.adapters.PollCreateOptionsItemListener
|
||||
import com.nextcloud.talk.polls.viewmodels.PollCreateViewModel
|
||||
import com.nextcloud.talk.ui.theme.ViewThemeUtils
|
||||
import javax.inject.Inject
|
||||
|
||||
@AutoInjector(NextcloudTalkApplication::class)
|
||||
@ -51,6 +52,9 @@ class PollCreateDialogFragment : DialogFragment(), PollCreateOptionsItemListener
|
||||
@Inject
|
||||
lateinit var viewModelFactory: ViewModelProvider.Factory
|
||||
|
||||
@Inject
|
||||
lateinit var viewThemeUtils: ViewThemeUtils
|
||||
|
||||
private lateinit var binding: DialogPollCreateBinding
|
||||
private lateinit var viewModel: PollCreateViewModel
|
||||
|
||||
@ -88,10 +92,26 @@ class PollCreateDialogFragment : DialogFragment(), PollCreateOptionsItemListener
|
||||
adapter = PollCreateOptionsAdapter(this)
|
||||
binding.pollCreateOptionsList.adapter = adapter
|
||||
|
||||
themeDialog()
|
||||
|
||||
setupListeners()
|
||||
setupStateObserver()
|
||||
}
|
||||
|
||||
private fun themeDialog() {
|
||||
viewThemeUtils.colorTextViewText(binding.pollQuestion)
|
||||
viewThemeUtils.colorTextViewText(binding.pollOptions)
|
||||
viewThemeUtils.colorTextViewText(binding.pollSettings)
|
||||
|
||||
viewThemeUtils.colorMaterialButtonText(binding.pollAddOptionsItem)
|
||||
// TODO button also needs a disabled state handling for colors
|
||||
viewThemeUtils.colorMaterialButtonText(binding.pollDismiss)
|
||||
viewThemeUtils.colorMaterialButtonBackground(binding.pollCreateButton)
|
||||
|
||||
viewThemeUtils.themeCheckbox(binding.pollPrivatePollCheckbox)
|
||||
viewThemeUtils.themeCheckbox(binding.pollMultipleAnswersCheckbox)
|
||||
}
|
||||
|
||||
private fun setupListeners() {
|
||||
binding.pollAddOptionsItem.setOnClickListener {
|
||||
viewModel.addOption()
|
||||
|
@ -35,6 +35,7 @@
|
||||
android:paddingTop="@dimen/dialog_padding_top_bottom">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/poll_question"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/dialog_padding"
|
||||
@ -73,6 +74,7 @@
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/poll_options"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/standard_padding"
|
||||
@ -102,6 +104,7 @@
|
||||
app:icon="@drawable/ic_add_grey600_24px" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/poll_settings"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/standard_margin"
|
||||
|
Loading…
Reference in New Issue
Block a user