first steps to theme poll creation

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-07-27 00:09:43 +02:00
parent 9be4358ae0
commit 7ec78e53f0
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
2 changed files with 23 additions and 0 deletions

View File

@ -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()

View File

@ -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"