Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor question type styles #1836

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 11 additions & 41 deletions app/src/ereferrals/res/layout/multi_question_radio_button_row.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.5"
android:baselineAligned="false"
android:gravity="center_vertical"
android:orientation="vertical"
android:layout_marginLeft="@dimen/question_padding"
android:layout_marginRight="@dimen/question_padding">
xmlns:tools="http://schemas.android.com/tools"
style="@style/QuestionContainer">

<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/text_first_color"/>
style="@style/QuestionDivider"/>

<LinearLayout
android:layout_width="match_parent"
Expand All @@ -31,42 +20,23 @@
android:paddingBottom="@dimen/image_padding"
android:paddingTop="@dimen/image_padding"
android:scaleType="fitCenter"
android:visibility="gone" />
android:visibility="gone"/>


<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/input_edit_text_top_bottom"
android:layout_marginTop="@dimen/input_edit_text_top_bottom">
style="@style/QuestionHeaderContainer">

<org.eyeseetea.sdk.presentation.views.CustomTextView
android:id="@+id/row_header_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.9"
android:background="@color/transparent"
android:gravity="left"
android:singleLine="true"
android:paddingLeft="@dimen/input_edit_text_left_padding"
android:paddingRight="@dimen/input_edit_text_right_padding"
android:textColor="@color/text_first_color"
android:textColorHint="@color/text_first_color"
android:textSize="?attr/font_xsmall"
app:font_name="@string/normal_font"
tools:text="Title"/>
style="@style/QuestionHeader"
tools:text="@string/label_editor_question_title"/>

<ImageView
android:id="@+id/row_header_compulsory"
android:layout_width="0dp"
android:layout_height="@dimen/compulsory_size"
android:adjustViewBounds="true"
android:layout_gravity="right|top"
android:scaleType="fitCenter"
android:layout_weight="0.1"
android:src="@drawable/compulsory"
android:visibility="gone"
tools:visibility="visible"/>
style="@style/QuestionHeaderCompulsorySign"
tools:visibility="visible"
tools:ignore="ContentDescription"/>

</LinearLayout>

</LinearLayout>
Expand Down
71 changes: 13 additions & 58 deletions app/src/ereferrals/res/layout/multi_question_tab_dropdown_row.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:baselineAligned="false"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingLeft="@dimen/question_padding"
android:paddingRight="@dimen/question_padding">
xmlns:tools="http://schemas.android.com/tools"
style="@style/QuestionContainer">

<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/text_first_color" />
style="@style/QuestionDivider"/>

<LinearLayout
android:layout_width="match_parent"
Expand All @@ -33,64 +23,29 @@
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/QuestionHeaderContainer"
android:layout_gravity="right"
android:layout_marginBottom="@dimen/input_edit_text_top_bottom"
android:layout_marginTop="@dimen/input_edit_text_top_bottom"
android:gravity="right"
android:orientation="horizontal"
android:weightSum="1">
android:orientation="horizontal">

<org.eyeseetea.sdk.presentation.views.CustomTextView
android:id="@+id/row_header_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="0.9"
android:background="@color/transparent"
android:gravity="left"
android:paddingLeft="@dimen/input_edit_text_left_padding"
android:paddingRight="@dimen/input_edit_text_right_padding"
android:textColor="@color/text_first_color"
android:textSize="?attr/font_xsmall"
app:font_name="@string/normal_font"
tools:text="Title"/>
style="@style/QuestionHeader"
tools:text="@string/label_editor_question_title"/>

<ImageView
android:id="@+id/row_header_compulsory"
android:layout_width="0dp"
android:layout_height="10dp"
android:layout_gravity="right"
android:layout_toRightOf="@+id/row_header_text"
android:layout_weight="0.1"
android:adjustViewBounds="true"
android:gravity="right"
android:scaleType="fitCenter"
android:src="@drawable/compulsory"
android:visibility="invisible"
tools:visibility="visible"/>
style="@style/QuestionHeaderCompulsorySign"
tools:visibility="visible"
tools:ignore="ContentDescription"/>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="@dimen/input_edit_text_top_bottom"
android:background="@android:color/transparent">
style="@style/QuestionAnswerContainer">

<android.support.v7.widget.AppCompatSpinner
android:id="@+id/answer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:textColor="@color/text_first_color"
android:paddingBottom="2dip"
android:paddingLeft="@dimen/input_edit_text_left_padding"
android:paddingRight="@dimen/input_edit_text_right_padding"
android:paddingTop="2dip"
android:spinnerMode="dropdown"
app:backgroundTint="@color/black" />
style="@style/QuestionAnswerTypeDropdown"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Expand Down
26 changes: 5 additions & 21 deletions app/src/ereferrals/res/layout/no_keyboard_text_item.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
xmlns:tools="http://schemas.android.com/tools"
style="@style/QuestionAnswerContainer">

<org.eyeseetea.sdk.presentation.views.CustomTextView
android:id="@+id/answer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:layout_marginLeft="@dimen/input_edit_text_margin"
android:layout_marginRight="@dimen/input_edit_text_margin"
android:layout_marginTop="@dimen/input_edit_text_top_bottom"
android:background="@android:color/transparent"
android:gravity="left"
style="@style/QuestionAnswer.TypeText"
android:hint="@string/positive_hint"
android:inputType="text"
android:paddingLeft="@dimen/input_edit_text_left_padding"
android:paddingRight="@dimen/input_edit_text_left_padding"
android:editable="false"
android:textColor="@color/text_first_color"
android:textColorHint="@color/text_first_color"
android:textSize="?attr/font_small"
app:font_name="@string/normal_font" />
tools:text="@string/label_editor_question_answer_title"/>

</LinearLayout>
24 changes: 4 additions & 20 deletions app/src/ereferrals/res/layout/phone_item.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
xmlns:tools="http://schemas.android.com/tools"
style="@style/QuestionAnswerContainer">

<org.eyeseetea.sdk.presentation.views.CustomEditText
android:id="@+id/answer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:layout_marginLeft="@dimen/input_edit_text_margin"
android:layout_marginRight="@dimen/input_edit_text_margin"
android:layout_marginTop="@dimen/input_edit_text_top_bottom"
android:gravity="left"
style="@style/QuestionAnswer.TypePhone"
android:hint="@string/positive_hint"
android:background="@android:color/transparent"
android:imeOptions="actionDone"
android:inputType="phone"
android:paddingLeft="@dimen/input_edit_text_left_padding"
android:singleLine="true"
android:textColor="@color/text_first_color"
android:textColorHint="@color/text_first_color"
android:textSize="?attr/font_small"
app:font_name="@string/normal_font" />
tools:text="@string/label_editor_question_phone_answer_title"/>
</LinearLayout>
24 changes: 4 additions & 20 deletions app/src/ereferrals/res/layout/positive_int_item.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
xmlns:tools="http://schemas.android.com/tools"
style="@style/QuestionAnswerContainer">

<org.eyeseetea.sdk.presentation.views.CustomEditText
android:id="@+id/answer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:layout_marginLeft="@dimen/input_edit_text_margin"
android:layout_marginRight="@dimen/input_edit_text_margin"
android:layout_marginTop="@dimen/input_edit_text_top_bottom"
android:background="@android:color/transparent"
android:gravity="left"
android:hint="@string/positive_hint"
android:inputType="number"
style="@style/QuestionAnswer.TypeNumber"
android:maxLength="2"
android:paddingLeft="@dimen/input_edit_text_left_padding"
android:textColor="@color/text_first_color"
android:textColorHint="@color/text_first_color"
android:textSize="?attr/font_small"
app:font_name="@string/normal_font" />
tools:text="@string/label_editor_question_int_answer_title"/>
</LinearLayout>
37 changes: 8 additions & 29 deletions app/src/ereferrals/res/layout/row_header_item.xml
Original file line number Diff line number Diff line change
@@ -1,43 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:tools="http://schemas.android.com/tools">

<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/text_first_color" />
style="@style/QuestionDivider"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginBottom="@dimen/input_edit_text_top_bottom"
android:layout_marginTop="@dimen/input_edit_text_top_bottom"
android:weightSum="1">
style="@style/QuestionHeaderContainer">

<org.eyeseetea.sdk.presentation.views.CustomTextView
android:id="@+id/row_header_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.9"
android:background="@color/transparent"
android:gravity="left"
android:paddingLeft="@dimen/input_edit_text_left_padding"
android:paddingRight="@dimen/input_edit_text_right_padding"
android:singleLine="true"
android:textColor="@color/text_first_color"
android:textSize="?attr/font_xsmall"
app:font_name="@string/normal_font" />
style="@style/QuestionHeader"
tools:text="@string/label_editor_question_title"/>

<ImageView
android:id="@+id/row_header_compulsory"
android:layout_width="0dp"
android:layout_height="10dp"
android:layout_gravity="right|top"
android:layout_weight="0.1"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/compulsory"
android:visibility="gone" />
style="@style/QuestionHeaderCompulsorySign"
tools:visibility="visible"
tools:ignore="ContentDescription"/>
</LinearLayout>
</merge>
24 changes: 4 additions & 20 deletions app/src/ereferrals/res/layout/text_item.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
xmlns:tools="http://schemas.android.com/tools"
style="@style/QuestionAnswerContainer">

<org.eyeseetea.sdk.presentation.views.CustomEditText
android:id="@+id/answer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:layout_marginLeft="@dimen/input_edit_text_margin"
android:layout_marginRight="@dimen/input_edit_text_margin"
android:layout_marginTop="@dimen/input_edit_text_top_bottom"
android:background="@android:color/transparent"
android:gravity="left"
style="@style/QuestionAnswer.TypeText"
android:hint="@string/positive_hint"
android:inputType="text"
android:paddingLeft="@dimen/input_edit_text_left_padding"
android:paddingRight="@dimen/input_edit_text_left_padding"
android:textColor="@color/text_first_color"
android:textColorHint="@color/text_first_color"
android:textSize="?attr/font_small"
app:font_name="@string/normal_font" />
tools:text="@string/label_editor_question_answer_title"/>
</LinearLayout>
1 change: 1 addition & 0 deletions app/src/ereferrals/res/values-ne/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -951,4 +951,5 @@
<string name="error_unable_to_download_translations">अनुवादहरू डाउनलोड गर्न असमर्थ</string>
<string name="error_unable_to_download_configuration_files">विन्यास फाईल डाउनलोड गर्न असमर्थ</string>
<string name="error_unable_to_download_translations_and_configuration_files">अनुवादहरू र कन्फिगरेसन फाइलहरू डाउनलोड गर्न असमर्थ</string>
<string name="compulsory_sign">अनिवार्य चिन्ह</string>
</resources>
1 change: 1 addition & 0 deletions app/src/ereferrals/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -946,4 +946,5 @@
<string name="error_unable_to_download_translations">Não é possível baixar traduções</string>
<string name="error_unable_to_download_configuration_files">Não é possível baixar os arquivos de configuração</string>
<string name="error_unable_to_download_translations_and_configuration_files">Não é possível baixar traduções e arquivos de configuração</string>
<string name="compulsory_sign">Sinal obrigatório</string>
</resources>
1 change: 1 addition & 0 deletions app/src/ereferrals/res/values-sw/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1005,4 +1005,5 @@ Ameahidi kuhudhuria"</string>
<string name="error_unable_to_download_translations">Haiwezi kupakua tafsiri</string>
<string name="error_unable_to_download_configuration_files">Haiwezi kupakua faili za usanidi</string>
<string name="error_unable_to_download_translations_and_configuration_files">Haiwezi kupakua tafsiri na faili za usanidi</string>
<string name="compulsory_sign">Ishara ya lazima</string>
</resources>
4 changes: 4 additions & 0 deletions app/src/ereferrals/res/values/donottranslate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,8 @@
<string name="no_voucher_on" translatable="false">common_btn_no</string>
<string name="demo_program_uid" translatable="false">demoProgram</string>
<string name="default_language" translatable="false">en</string>
<string name="label_editor_question_title" translatable="false">Question Title</string>
<string name="label_editor_question_answer_title" translatable="false">Answer</string>
<string name="label_editor_question_phone_answer_title" translatable="false">909 453 789</string>
<string name="label_editor_question_int_answer_title" translatable="false">9</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/ereferrals/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1107,5 +1107,5 @@
<string name="error_unable_to_download_translations">Unable to download translations</string>
<string name="error_unable_to_download_configuration_files">Unable to download configuration files</string>
<string name="error_unable_to_download_translations_and_configuration_files">Unable to download translations and configuration files</string>

<string name="compulsory_sign">Compulsory sign</string>
</resources>
Loading