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

Hierarchy view styling #5885

Merged
merged 29 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
64937ff
Moved the code used to build form hierarchy to one package
grzesiek2010 Dec 21, 2023
df488b2
Converted HierarchyElement to kotlin
grzesiek2010 Dec 21, 2023
7c20704
Converted ViewOnlyFormHierarchyActivity to kotlin
grzesiek2010 Dec 22, 2023
6e246c8
Converted HierarchyListAdapter to kotlin
grzesiek2010 Dec 22, 2023
4d1c2b9
Reworked the hierarchy_element layout using ConstraintLayout
grzesiek2010 Dec 22, 2023
43e820c
Indent the answer
grzesiek2010 Dec 22, 2023
9e9367a
Use consistent font style in both form entry and form hierarchy
grzesiek2010 Dec 22, 2023
ae0c42d
Reworked the hierarchy layout and added the group icon
grzesiek2010 Dec 22, 2023
7c36d29
Fixed group title margin in form entry
grzesiek2010 Dec 22, 2023
3a3b375
Fixed the width of elements in the form hierarchy
grzesiek2010 Dec 22, 2023
ba340d5
Fixed imports
grzesiek2010 Dec 22, 2023
87448c8
Increased the vertical padding of hierarchy elements
grzesiek2010 Jan 4, 2024
7d85031
Reworked hierarchy item views
grzesiek2010 Jan 8, 2024
0a4e30b
Increase the font size of answers
grzesiek2010 Jan 8, 2024
ace07b1
Add vertical padding to the list of widgets to match the hierarchy vi…
grzesiek2010 Jan 8, 2024
a1ffdce
Get rid of the blue color in answers
grzesiek2010 Jan 9, 2024
ddec511
HierarchyListItemView should extend FrameLayout
grzesiek2010 Jan 9, 2024
7359bb6
Display proper group icons
grzesiek2010 Jan 9, 2024
b1c65e5
Use textAppearanceBodyLarge instead of a custom QuestionTitle
grzesiek2010 Jan 11, 2024
d3a5b4c
Moved handling question answers for the hierarchy view to the hierarc…
grzesiek2010 Jan 12, 2024
acc8055
Converted QuestionAnswerProcessor to kotlin
grzesiek2010 Jan 12, 2024
c111b58
Added tests
grzesiek2010 Jan 12, 2024
8e11cc5
Fixed conflicts
grzesiek2010 Jan 16, 2024
1d3f631
Use Material 3 text appearance for group labels
grzesiek2010 Jan 16, 2024
398ff29
Removed redundant constructor
grzesiek2010 Jan 16, 2024
02c9464
Fixed imports in tests
grzesiek2010 Jan 16, 2024
ef0c86f
Rename margin_extra_small to margin_extra_extra_small
grzesiek2010 Jan 17, 2024
554f599
Rename margin_small to margin_extra_small
grzesiek2010 Jan 17, 2024
66741e6
Introduced a new margin_small
grzesiek2010 Jan 17, 2024
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
36 changes: 18 additions & 18 deletions androidshared/src/main/res/layout/color_picker_dialog_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
android:id="@+id/color1"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -32,7 +32,7 @@
android:id="@+id/color2"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -50,7 +50,7 @@
android:id="@+id/color3"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -68,7 +68,7 @@
android:id="@+id/color4"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -86,7 +86,7 @@
android:id="@+id/color5"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -105,7 +105,7 @@
android:id="@+id/color6"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -123,7 +123,7 @@
android:id="@+id/color7"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -141,7 +141,7 @@
android:id="@+id/color8"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -159,7 +159,7 @@
android:id="@+id/color9"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -177,7 +177,7 @@
android:id="@+id/color10"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -196,7 +196,7 @@
android:id="@+id/color11"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -214,7 +214,7 @@
android:id="@+id/color12"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -232,7 +232,7 @@
android:id="@+id/color13"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -250,7 +250,7 @@
android:id="@+id/color14"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -268,7 +268,7 @@
android:id="@+id/color15"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:background="?attr/selectableItemBackgroundBorderless"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -286,7 +286,7 @@
android:id="@+id/current_color_container"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
android:layout_marginTop="@dimen/margin_extra_large"
app:layout_constraintWidth_percent="0.2"
app:layout_constraintDimensionRatio="w,1:1"
Expand All @@ -297,7 +297,7 @@
android:id="@+id/current_color"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/margin_extra_small"
android:padding="@dimen/margin_extra_extra_small"
android:background="@drawable/color_circle"
android:textColor="@android:color/white"
android:textAllCaps="true"
Expand All @@ -318,7 +318,7 @@
android:id="@+id/hex_color_layout"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/margin_small"
android:padding="@dimen/margin_extra_small"
app:layout_constraintTop_toTopOf="@+id/current_color_container"
app:layout_constraintBottom_toBottomOf="@+id/current_color_container"
app:layout_constraintStart_toStartOf="@+id/color13"
Expand Down
5 changes: 3 additions & 2 deletions androidshared/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- "Standard" set of margin sizes for Android (pre and post Material) -->
<dimen name="margin_extra_small">4dp</dimen>
<dimen name="margin_small">8dp</dimen>
<dimen name="margin_extra_extra_small">4dp</dimen>
<dimen name="margin_extra_small">8dp</dimen>
<dimen name="margin_small">12dp</dimen>
<dimen name="margin_standard">16dp</dimen>
<dimen name="margin_large">24dp</dimen>
<dimen name="margin_extra_large">32dp</dimen>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void notRelevantRepeatGroupsShouldNotBeVisibleInHierarchy() {
.atPositionOnView(2, R.id.primary_text))
.check(matches(withText("Guest details")));
onView(withRecyclerView(R.id.list)
.atPositionOnView(2, R.id.secondary_text))
.atPositionOnView(2, R.id.group_label))
.check(matches(withText("Repeatable Group")));

page.clickOnText("Guest details");
Expand Down
4 changes: 2 additions & 2 deletions collect_app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ the specific language governing permissions and limitations under the License.
<activity
android:name=".preferences.screens.ProjectPreferencesActivity"
android:theme="@style/Theme.Collect.Settings" />
<activity android:name=".activities.FormHierarchyActivity" />
<activity android:name=".activities.ViewOnlyFormHierarchyActivity" />
<activity android:name=".formhierarchy.FormHierarchyActivity" />
<activity android:name=".formhierarchy.ViewOnlyFormHierarchyActivity" />
<activity
android:name="org.odk.collect.geo.geopoint.GeoPointActivity"
android:theme="@style/Theme.Collect"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@
import org.odk.collect.android.formentry.saving.SaveAnswerFileErrorDialogFragment;
import org.odk.collect.android.formentry.saving.SaveAnswerFileProgressDialogFragment;
import org.odk.collect.android.formentry.saving.SaveFormProgressDialogFragment;
import org.odk.collect.android.formhierarchy.FormHierarchyActivity;
import org.odk.collect.android.formhierarchy.ViewOnlyFormHierarchyActivity;
import org.odk.collect.android.fragments.MediaLoadingFragment;
import org.odk.collect.android.fragments.dialogs.CustomDatePickerDialog;
import org.odk.collect.android.fragments.dialogs.CustomTimePickerDialog;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
import org.odk.collect.android.formentry.questions.AudioVideoImageTextLabel;
import org.odk.collect.android.formentry.questions.NoButtonsItem;
import org.odk.collect.android.utilities.MediaUtils;
import org.odk.collect.android.widgets.utilities.QuestionFontSizeUtils;
import org.odk.collect.android.utilities.HtmlUtils;
import org.odk.collect.android.utilities.Appearances;
import org.odk.collect.android.widgets.utilities.QuestionFontSizeUtils;
import org.odk.collect.audioclips.Clip;
import org.odk.collect.imageloader.GlideImageLoader;

Expand Down

This file was deleted.

This file was deleted.

Loading