Skip to content

Commit

Permalink
[#3] - Design for TalkBack
Browse files Browse the repository at this point in the history
  • Loading branch information
jhg3410 committed Sep 5, 2022
1 parent 0562b05 commit 54c86a0
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ class AddGdgFragment : Fragment() {

binding.viewModel = viewModel

viewModel.showSnackBarEvent.observe(this, Observer {
viewModel.showSnackBarEvent.observe(viewLifecycleOwner, Observer {
if (it == true) { // Observed state is true.
Snackbar.make(
activity!!.findViewById(android.R.id.content),
requireActivity().findViewById(android.R.id.content),
getString(R.string.application_submitted),
Snackbar.LENGTH_SHORT // How long to display the message.
).show()
viewModel.doneShowingSnackbar()
binding.button.contentDescription=getString(R.string.submitted)
binding.button.text=getString(R.string.done)
}
})

Expand Down
85 changes: 51 additions & 34 deletions GDGFinder-Starter/app/src/main/res/layout/add_gdg_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
android:layout_marginStart="@dimen/spacing_normal"
android:layout_marginTop="@dimen/spacing_normal"
android:layout_marginEnd="@dimen/spacing_normal"
android:contentDescription="@string/add_gdg"
android:text="@string/add_gdg"
android:textColor="#AAAAAA"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Expand All @@ -53,6 +53,7 @@
android:layout_height="230dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="2dp"
android:contentDescription="@string/stage_image_description"
android:scaleType="centerCrop"
app:layout_constraintBottom_toTopOf="@+id/EditTextName"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -70,25 +71,28 @@
android:layout_marginTop="8dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="4dp"
android:hint="@string/your_name_label"
android:singleLine="true"
app:layout_constraintBottom_toTopOf="@+id/EditTextEmail"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView"></EditText>
app:layout_constraintTop_toBottomOf="@+id/imageView" />

<EditText
android:id="@+id/EditTextEmail"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="4dp"

android:layout_marginEnd="32dp"
android:layout_marginBottom="4dp"
android:hint="@string/email_label"
android:singleLine="true"
app:layout_constraintBottom_toTopOf="@+id/EditTextCity"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/EditTextName"></EditText>
app:layout_constraintTop_toBottomOf="@+id/EditTextName" />

<EditText
android:id="@+id/EditTextCity"
Expand All @@ -98,11 +102,12 @@
android:layout_marginTop="4dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="4dp"
android:hint="@string/city_label"
android:singleLine="true"
app:layout_constraintBottom_toTopOf="@+id/EditTextCountry"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/EditTextEmail"></EditText>
app:layout_constraintTop_toBottomOf="@+id/EditTextEmail" />

<EditText
android:id="@+id/EditTextCountry"
Expand All @@ -112,11 +117,12 @@
android:layout_marginTop="4dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="4dp"
android:hint="@string/country_label"
android:singleLine="true"
app:layout_constraintBottom_toTopOf="@+id/EditTextRegion"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/EditTextCity"></EditText>
app:layout_constraintTop_toBottomOf="@+id/EditTextCity" />

<EditText
android:id="@+id/EditTextRegion"
Expand All @@ -126,53 +132,64 @@
android:layout_marginTop="4dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="4dp"
android:hint="@string/region_label"
android:singleLine="true"
app:layout_constraintBottom_toTopOf="@+id/EditTextWhy"
app:layout_constraintBottom_toTopOf="@+id/contentGroup"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/EditTextCountry"></EditText>
app:layout_constraintTop_toBottomOf="@+id/EditTextCountry" />

<TextView
android:id="@+id/labelTextWhy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="@dimen/spacing_normal"
android:layout_marginBottom="1dp"
android:text="@string/motivation"
app:layout_constraintBottom_toTopOf="@+id/EditTextWhy"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/EditTextRegion" />

<EditText
android:id="@+id/EditTextWhy"
<LinearLayout
android:id="@+id/contentGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="32dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="8dp"
android:ems="10"
android:inputType="textMultiLine"
android:focusable="true"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/EditTextRegion" />
app:layout_constraintEnd_toEndOf="@+id/EditTextRegion"
app:layout_constraintStart_toStartOf="@+id/EditTextRegion"
app:layout_constraintTop_toBottomOf="@id/EditTextRegion">

<TextView
android:id="@+id/labelTextWhy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/motivation"
android:text="@string/motivation"
app:layout_constraintBottom_toBottomOf="@+id/contentGroup"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/contentGroup" />

<EditText
android:id="@+id/EditTextWhy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/enter_motivation"
android:inputType="textMultiLine"
app:layout_constraintBottom_toTopOf="@+id/button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/EditTextRegion" />
</LinearLayout>

<Button
android:id="@+id/button"
android:layout_width="40dp"
android:layout_height="24dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="40dp"
android:layout_marginBottom="12dp"
android:backgroundTint="#00FF00"
android:contentDescription="@string/submit_button_description"
android:onClick="@{() -> viewModel.onSubmitApplication()}"
android:text="Ok"
android:textColor="#FF0000"
android:textSize="8sp"
android:text="@string/submit"
android:accessibilityLiveRegion="polite"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/EditTextWhy" />
app:layout_constraintTop_toBottomOf="@+id/contentGroup" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

Expand Down
2 changes: 1 addition & 1 deletion GDGFinder-Starter/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<string name="city_label">city</string>
<string name="country_label">country</string>
<string name="region_label">region</string>
<string name="enter_motivation">Please enter your motivation in 1-2 sentences</string>
<string name="enter_motivation">Please enter your motivation in 12 sentences</string>
<string name="submitted">Submitted, no need to submit again</string>
<string name="done">Done</string>
<string name="submit">Submit</string>
Expand Down

0 comments on commit 54c86a0

Please sign in to comment.