mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
fix layouts to handle poll with many options
make options scrollable replace constraint layout with linear layouts + layout_weight="1" Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
cedbcaefee
commit
6ab5dace1c
@ -16,34 +16,37 @@
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:padding="@dimen/standard_padding"
|
android:padding="@dimen/standard_padding"
|
||||||
|
android:orientation="vertical"
|
||||||
tools:background="@color/white">
|
tools:background="@color/white">
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:id="@+id/message_poll_icon"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
android:contentDescription="@null"
|
<ImageView
|
||||||
android:src="@drawable/ic_baseline_bar_chart_24"
|
android:id="@+id/message_poll_icon"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
android:layout_height="wrap_content"
|
||||||
app:tint="@color/high_emphasis_menu_icon" />
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_baseline_bar_chart_24"
|
||||||
|
app:tint="@color/high_emphasis_menu_icon" />
|
||||||
|
|
||||||
<androidx.emoji.widget.EmojiTextView
|
<androidx.emoji.widget.EmojiTextView
|
||||||
android:id="@+id/message_poll_title"
|
android:id="@+id/message_poll_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintStart_toEndOf="@id/message_poll_icon"
|
tools:text="This is the poll title?" />
|
||||||
app:layout_constraintTop_toTopOf="@+id/message_poll_icon"
|
|
||||||
tools:text="This is the poll title?" />
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/poll_details_text"
|
android:id="@+id/poll_details_text"
|
||||||
@ -51,16 +54,13 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:textColor="@color/low_emphasis_text"
|
android:textColor="@color/low_emphasis_text"
|
||||||
app:layout_constraintStart_toStartOf="@id/message_poll_icon"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/message_poll_title"
|
|
||||||
tools:text="Poll results - 93 votes" />
|
tools:text="Poll results - 93 votes" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/message_poll_content_fragment"
|
android:id="@+id/message_poll_content_fragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
app:layout_constraintTop_toBottomOf="@id/poll_details_text"
|
android:layout_weight="1" />
|
||||||
tools:layout_height="400dp" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</LinearLayout>
|
||||||
|
@ -16,19 +16,19 @@
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:background="@color/white">
|
tools:background="@color/white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/poll_results_list_wrapper"
|
android:id="@+id/poll_results_list_wrapper"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_weight="1">
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/poll_results_list"
|
android:id="@+id/poll_results_list"
|
||||||
@ -37,25 +37,27 @@
|
|||||||
tools:listitem="@layout/poll_result_header_item" />
|
tools:listitem="@layout/poll_result_header_item" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<LinearLayout
|
||||||
android:id="@+id/poll_results_end_poll_button"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/polls_end_poll"
|
android:gravity="end">
|
||||||
style="@style/OutlinedButton"
|
|
||||||
android:layout_marginEnd="@dimen/standard_margin"
|
|
||||||
app:cornerRadius="@dimen/button_corner_radius"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/edit_vote_button"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/poll_results_list_wrapper" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/edit_vote_button"
|
android:id="@+id/poll_results_end_poll_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/edit"
|
android:text="@string/polls_end_poll"
|
||||||
android:theme="@style/Button.Primary"
|
style="@style/OutlinedButton"
|
||||||
app:cornerRadius="@dimen/button_corner_radius"
|
android:layout_marginEnd="@dimen/standard_margin"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:cornerRadius="@dimen/button_corner_radius" />
|
||||||
app:layout_constraintTop_toBottomOf="@+id/poll_results_list_wrapper" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/edit_vote_button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/edit"
|
||||||
|
android:theme="@style/Button.Primary"
|
||||||
|
app:cornerRadius="@dimen/button_corner_radius" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
@ -16,60 +16,62 @@
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:background="@color/white">
|
tools:background="@color/white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<ScrollView
|
||||||
android:id="@+id/vote_options_wrapper"
|
android:id="@+id/vote_options_wrapper"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_weight="1"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
android:padding="@dimen/standard_half_padding">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/vote_options_checkboxes_wrapper"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/vote_options_checkboxes_wrapper"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical" />
|
||||||
|
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/poll_vote_radio_group"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
tools:layout_height="400dp"
|
||||||
|
tools:layout_width="match_parent" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="end">
|
||||||
|
|
||||||
<RadioGroup
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/poll_vote_radio_group"
|
android:id="@+id/poll_vote_end_poll_button"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
tools:layout_height="400dp"
|
android:layout_height="wrap_content"
|
||||||
tools:layout_width="match_parent" />
|
android:text="@string/polls_end_poll"
|
||||||
|
style="@style/OutlinedButton"
|
||||||
|
android:layout_marginEnd="@dimen/standard_margin"
|
||||||
|
app:cornerRadius="@dimen/button_corner_radius" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/poll_vote_submit_button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/edit"
|
||||||
|
android:theme="@style/Button.Primary"
|
||||||
|
app:cornerRadius="@dimen/button_corner_radius" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/poll_vote_end_poll_button"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/polls_end_poll"
|
|
||||||
style="@style/OutlinedButton"
|
|
||||||
android:layout_marginEnd="@dimen/standard_margin"
|
|
||||||
app:cornerRadius="@dimen/button_corner_radius"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/poll_vote_submit_button"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/vote_options_wrapper" />
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/poll_vote_submit_button"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:cornerRadius="@dimen/button_corner_radius"
|
|
||||||
android:text="@string/nc_common_submit"
|
|
||||||
android:theme="@style/Button.Primary"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/vote_options_wrapper" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/standard_half_padding"
|
||||||
|
android:paddingEnd="@dimen/standard_half_padding"
|
||||||
tools:background="@color/white">
|
tools:background="@color/white">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/standard_half_padding"
|
||||||
|
android:paddingEnd="@dimen/standard_half_padding"
|
||||||
android:paddingBottom="4dp"
|
android:paddingBottom="4dp"
|
||||||
tools:background="@color/white">
|
tools:background="@color/white">
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user