diff --git a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollCreateOptionViewHolder.kt b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollCreateOptionViewHolder.kt index 6d40969dc..91afdd16c 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollCreateOptionViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollCreateOptionViewHolder.kt @@ -24,6 +24,7 @@ import android.annotation.SuppressLint import android.text.Editable import android.text.TextWatcher import androidx.recyclerview.widget.RecyclerView +import com.nextcloud.talk.R import com.nextcloud.talk.databinding.PollCreateOptionsItemBinding import com.nextcloud.talk.utils.EmojiTextInputEditText @@ -43,13 +44,13 @@ class PollCreateOptionViewHolder( ) { textListener?.let { - binding.pollOptionText.removeTextChangedListener(it) + binding.pollOptionTextEdit.removeTextChangedListener(it) } - binding.pollOptionText.setText(pollCreateOptionItem.pollOption) + binding.pollOptionTextEdit.setText(pollCreateOptionItem.pollOption) if (focus) { - itemsListener.requestFocus(binding.pollOptionText) + itemsListener.requestFocus(binding.pollOptionTextEdit) } binding.pollOptionDelete.setOnClickListener { @@ -57,7 +58,16 @@ class PollCreateOptionViewHolder( } textListener = getTextWatcher(pollCreateOptionItem, itemsListener) - binding.pollOptionText.addTextChangedListener(textListener) + binding.pollOptionTextEdit.addTextChangedListener(textListener) + binding.pollOptionTextInputLayout.hint = String.format( + binding.pollOptionTextInputLayout.resources.getString(R.string.polls_option_hint), + position + 1 + ) + + binding.pollOptionDelete.contentDescription = String.format( + binding.pollOptionTextInputLayout.resources.getString(R.string.polls_option_delete), + position + 1 + ) } private fun getTextWatcher( diff --git a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollCreateOptionsAdapter.kt b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollCreateOptionsAdapter.kt index 39c8f7d7f..e827a56a6 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollCreateOptionsAdapter.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollCreateOptionsAdapter.kt @@ -29,7 +29,7 @@ class PollCreateOptionsAdapter( private val clickListener: PollCreateOptionsItemListener ) : RecyclerView.Adapter() { - internal var list: ArrayList = ArrayList() + internal var list: ArrayList = ArrayList() override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PollCreateOptionViewHolder { val itemBinding = PollCreateOptionsItemBinding.inflate(LayoutInflater.from(parent.context), parent, false) diff --git a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVotersOverviewViewHolder.kt b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVotersOverviewViewHolder.kt index c3805afe1..d071cc76b 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVotersOverviewViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVotersOverviewViewHolder.kt @@ -72,10 +72,10 @@ class PollResultVotersOverviewViewHolder( roundingParams.roundAsCircle = true roundingParams.borderColor = ResourcesCompat.getColor( itemView.context.resources!!, - R.color.colorPrimary, + R.color.vote_dialog_background, null ) - roundingParams.borderWidth = 2.0f + roundingParams.borderWidth = DisplayUtils.convertDpToPixel(2.0f, itemView.context) avatar.hierarchy.roundingParams = roundingParams avatar.controller = getAvatarDraweeController(pollDetails) @@ -134,7 +134,7 @@ class PollResultVotersOverviewViewHolder( const val AVATAR_SIZE = 60 const val AVATAR_RADIUS = 5f const val MAX_AVATARS = 10 - const val AVATAR_OFFSET = AVATAR_SIZE - 10 + const val AVATAR_OFFSET = AVATAR_SIZE - 20 const val DOTS_OFFSET = 70 const val DOTS_TEXT = "…" } diff --git a/app/src/main/java/com/nextcloud/talk/polls/ui/PollCreateDialogFragment.kt b/app/src/main/java/com/nextcloud/talk/polls/ui/PollCreateDialogFragment.kt index cdaa8fa58..e94f1e750 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/ui/PollCreateDialogFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/ui/PollCreateDialogFragment.kt @@ -102,7 +102,7 @@ class PollCreateDialogFragment : DialogFragment(), PollCreateOptionsItemListener dismiss() } - binding.pollCreateQuestion.addTextChangedListener(object : TextWatcher { + binding.pollCreateQuestionTextEdit.addTextChangedListener(object : TextWatcher { override fun afterTextChanged(s: Editable) { // unused atm } @@ -161,8 +161,8 @@ class PollCreateDialogFragment : DialogFragment(), PollCreateOptionsItemListener } override fun requestFocus(textField: EditText) { - if (binding.pollCreateQuestion.text.isBlank()) { - binding.pollCreateQuestion.requestFocus() + if (binding.pollCreateQuestionTextEdit.text?.isBlank() == true) { + binding.pollCreateQuestionTextEdit.requestFocus() } else { textField.requestFocus() } diff --git a/app/src/main/res/layout/dialog_poll_create.xml b/app/src/main/res/layout/dialog_poll_create.xml index 9106aa53c..da0fe5f7f 100644 --- a/app/src/main/res/layout/dialog_poll_create.xml +++ b/app/src/main/res/layout/dialog_poll_create.xml @@ -1,7 +1,9 @@ + android:orientation="vertical" + tools:background="@color/white"> diff --git a/app/src/main/res/layout/dialog_poll_vote.xml b/app/src/main/res/layout/dialog_poll_vote.xml index c69f0a946..2ce6d32e3 100644 --- a/app/src/main/res/layout/dialog_poll_vote.xml +++ b/app/src/main/res/layout/dialog_poll_vote.xml @@ -55,32 +55,36 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/standard_margin" + android:layout_marginEnd="4dp" android:gravity="end"> + tools:visibility="visible" /> diff --git a/app/src/main/res/layout/poll_create_options_item.xml b/app/src/main/res/layout/poll_create_options_item.xml index 2ae9e0fcf..e0d71edba 100644 --- a/app/src/main/res/layout/poll_create_options_item.xml +++ b/app/src/main/res/layout/poll_create_options_item.xml @@ -1,7 +1,9 @@ - #8dd4f6 - #FFFFFF + #FFFFFF diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index e4dc99eb7..9f4ad1f17 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -59,6 +59,8 @@ 8dp 8dp 400dp + 24dp + 18dp 180dp 110dp @@ -71,5 +73,7 @@ 40dp 2dp + 18dp + 50dp diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ec961c518..e67af0332 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -537,13 +537,16 @@ Add option Edit vote Vote - Successfully voted + Vote submitted End poll Do you really want to end this poll? This can\'t be undone. You can\'t vote with more options for this poll. Results Question + Your question Options + Option %1$s + Delete option %1$s Settings Private poll Multiple answers