diff --git a/collect_app/src/main/java/org/odk/collect/android/instancemanagement/send/ReadyToSendBanner.kt b/collect_app/src/main/java/org/odk/collect/android/instancemanagement/send/ReadyToSendBanner.kt index bf0280e54a7..5f0e8712187 100644 --- a/collect_app/src/main/java/org/odk/collect/android/instancemanagement/send/ReadyToSendBanner.kt +++ b/collect_app/src/main/java/org/odk/collect/android/instancemanagement/send/ReadyToSendBanner.kt @@ -3,13 +3,16 @@ package org.odk.collect.android.instancemanagement.send import android.content.Context import android.util.AttributeSet import android.view.LayoutInflater -import androidx.constraintlayout.widget.ConstraintLayout +import android.widget.FrameLayout import org.odk.collect.android.databinding.ReadyToSendBannerBinding import org.odk.collect.shared.TimeInMs import org.odk.collect.strings.R -class ReadyToSendBanner(context: Context, attrs: AttributeSet?) : ConstraintLayout(context, attrs) { - constructor(context: Context) : this(context, null) +class ReadyToSendBanner @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyle: Int = 0 +) : FrameLayout(context, attrs, defStyle) { private val binding = ReadyToSendBannerBinding.inflate(LayoutInflater.from(context), this, true) diff --git a/collect_app/src/main/res/layout/instance_uploader_list.xml b/collect_app/src/main/res/layout/instance_uploader_list.xml index 6df0397260c..eea97197730 100644 --- a/collect_app/src/main/res/layout/instance_uploader_list.xml +++ b/collect_app/src/main/res/layout/instance_uploader_list.xml @@ -16,6 +16,8 @@ android:id="@+id/ready_to_send_banner" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginHorizontal="@dimen/margin_standard" + android:layout_marginTop="@dimen/margin_extra_small" app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"/> @@ -26,6 +28,7 @@ android:layout_height="0dp" android:nestedScrollingEnabled="true" android:divider="@drawable/list_item_divider" + android:layout_marginTop="@dimen/margin_extra_small" app:layout_constraintBottom_toTopOf="@id/buttonholder" app:layout_constraintTop_toBottomOf="@id/ready_to_send_banner" /> diff --git a/collect_app/src/main/res/layout/ready_to_send_banner.xml b/collect_app/src/main/res/layout/ready_to_send_banner.xml index 0ad8db15341..4d39ceeed07 100644 --- a/collect_app/src/main/res/layout/ready_to_send_banner.xml +++ b/collect_app/src/main/res/layout/ready_to_send_banner.xml @@ -1,46 +1,57 @@ - - + - + - + - \ No newline at end of file + + + + + + + diff --git a/collect_app/src/test/java/org/odk/collect/android/instancemanagement/send/ReadyToSendBannerTest.kt b/collect_app/src/test/java/org/odk/collect/android/instancemanagement/send/ReadyToSendBannerTest.kt index a58da636184..7978810294d 100644 --- a/collect_app/src/test/java/org/odk/collect/android/instancemanagement/send/ReadyToSendBannerTest.kt +++ b/collect_app/src/test/java/org/odk/collect/android/instancemanagement/send/ReadyToSendBannerTest.kt @@ -2,7 +2,7 @@ package org.odk.collect.android.instancemanagement.send import android.app.Application import android.view.View -import androidx.constraintlayout.widget.ConstraintLayout +import android.widget.FrameLayout import androidx.test.core.app.ApplicationProvider import androidx.test.espresso.matcher.ViewMatchers.assertThat import androidx.test.ext.junit.runners.AndroidJUnit4 @@ -27,7 +27,7 @@ class ReadyToSendBannerTest { it.setData(data) } - assertThat(view.findViewById(R.id.banner).visibility, equalTo(View.GONE)) + assertThat(view.findViewById(R.id.banner).visibility, equalTo(View.GONE)) } @Test @@ -37,12 +37,12 @@ class ReadyToSendBannerTest { it.setData(data) } - assertThat(view.findViewById(R.id.banner).visibility, equalTo(View.GONE)) + assertThat(view.findViewById(R.id.banner).visibility, equalTo(View.GONE)) data = ReadyToSendViewModel.Data(1, 1, 0) view.setData(data) - assertThat(view.findViewById(R.id.banner).visibility, equalTo(View.VISIBLE)) + assertThat(view.findViewById(R.id.banner).visibility, equalTo(View.VISIBLE)) } @Test @@ -52,12 +52,12 @@ class ReadyToSendBannerTest { it.setData(data) } - assertThat(view.findViewById(R.id.banner).visibility, equalTo(View.VISIBLE)) + assertThat(view.findViewById(R.id.banner).visibility, equalTo(View.VISIBLE)) data = ReadyToSendViewModel.Data(0, 0, 0) view.setData(data) - assertThat(view.findViewById(R.id.banner).visibility, equalTo(View.GONE)) + assertThat(view.findViewById(R.id.banner).visibility, equalTo(View.GONE)) } @Test @@ -67,7 +67,7 @@ class ReadyToSendBannerTest { it.setData(data) } - assertThat(view.findViewById(R.id.banner).visibility, equalTo(View.GONE)) + assertThat(view.findViewById(R.id.banner).visibility, equalTo(View.GONE)) } @Test @@ -77,7 +77,7 @@ class ReadyToSendBannerTest { it.setData(data) } - assertThat(view.findViewById(R.id.banner).visibility, equalTo(View.GONE)) + assertThat(view.findViewById(R.id.banner).visibility, equalTo(View.GONE)) } @Test @@ -88,7 +88,7 @@ class ReadyToSendBannerTest { } assertThat( - view.findViewById(R.id.banner).visibility, + view.findViewById(R.id.banner).visibility, equalTo(View.VISIBLE) ) }