mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-19 10:45:13 +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.PollCreateOptionsAdapter
|
||||||
import com.nextcloud.talk.polls.adapters.PollCreateOptionsItemListener
|
import com.nextcloud.talk.polls.adapters.PollCreateOptionsItemListener
|
||||||
import com.nextcloud.talk.polls.viewmodels.PollCreateViewModel
|
import com.nextcloud.talk.polls.viewmodels.PollCreateViewModel
|
||||||
|
import com.nextcloud.talk.ui.theme.ViewThemeUtils
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AutoInjector(NextcloudTalkApplication::class)
|
@AutoInjector(NextcloudTalkApplication::class)
|
||||||
@ -51,6 +52,9 @@ class PollCreateDialogFragment : DialogFragment(), PollCreateOptionsItemListener
|
|||||||
@Inject
|
@Inject
|
||||||
lateinit var viewModelFactory: ViewModelProvider.Factory
|
lateinit var viewModelFactory: ViewModelProvider.Factory
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
lateinit var viewThemeUtils: ViewThemeUtils
|
||||||
|
|
||||||
private lateinit var binding: DialogPollCreateBinding
|
private lateinit var binding: DialogPollCreateBinding
|
||||||
private lateinit var viewModel: PollCreateViewModel
|
private lateinit var viewModel: PollCreateViewModel
|
||||||
|
|
||||||
@ -88,10 +92,26 @@ class PollCreateDialogFragment : DialogFragment(), PollCreateOptionsItemListener
|
|||||||
adapter = PollCreateOptionsAdapter(this)
|
adapter = PollCreateOptionsAdapter(this)
|
||||||
binding.pollCreateOptionsList.adapter = adapter
|
binding.pollCreateOptionsList.adapter = adapter
|
||||||
|
|
||||||
|
themeDialog()
|
||||||
|
|
||||||
setupListeners()
|
setupListeners()
|
||||||
setupStateObserver()
|
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() {
|
private fun setupListeners() {
|
||||||
binding.pollAddOptionsItem.setOnClickListener {
|
binding.pollAddOptionsItem.setOnClickListener {
|
||||||
viewModel.addOption()
|
viewModel.addOption()
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
android:paddingTop="@dimen/dialog_padding_top_bottom">
|
android:paddingTop="@dimen/dialog_padding_top_bottom">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/poll_question"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="@dimen/dialog_padding"
|
android:paddingStart="@dimen/dialog_padding"
|
||||||
@ -73,6 +74,7 @@
|
|||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/poll_options"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/standard_padding"
|
android:paddingTop="@dimen/standard_padding"
|
||||||
@ -102,6 +104,7 @@
|
|||||||
app:icon="@drawable/ic_add_grey600_24px" />
|
app:icon="@drawable/ic_add_grey600_24px" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/poll_settings"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/standard_margin"
|
android:layout_marginTop="@dimen/standard_margin"
|
||||||
|
Loading…
Reference in New Issue
Block a user