diff --git a/GDGFinder-Starter/app/src/main/java/com/example/android/gdgfinder/add/AddGdgFragment.kt b/GDGFinder-Starter/app/src/main/java/com/example/android/gdgfinder/add/AddGdgFragment.kt index a02663c..4a22e68 100644 --- a/GDGFinder-Starter/app/src/main/java/com/example/android/gdgfinder/add/AddGdgFragment.kt +++ b/GDGFinder-Starter/app/src/main/java/com/example/android/gdgfinder/add/AddGdgFragment.kt @@ -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) } }) diff --git a/GDGFinder-Starter/app/src/main/res/layout/add_gdg_fragment.xml b/GDGFinder-Starter/app/src/main/res/layout/add_gdg_fragment.xml index 7a0a014..9badf19 100644 --- a/GDGFinder-Starter/app/src/main/res/layout/add_gdg_fragment.xml +++ b/GDGFinder-Starter/app/src/main/res/layout/add_gdg_fragment.xml @@ -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" /> @@ -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" @@ -70,11 +71,12 @@ 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"> + app:layout_constraintTop_toBottomOf="@+id/imageView" /> + app:layout_constraintTop_toBottomOf="@+id/EditTextName" /> + app:layout_constraintTop_toBottomOf="@+id/EditTextEmail" /> + app:layout_constraintTop_toBottomOf="@+id/EditTextCity" /> + app:layout_constraintTop_toBottomOf="@+id/EditTextCountry" /> - - - + app:layout_constraintEnd_toEndOf="@+id/EditTextRegion" + app:layout_constraintStart_toStartOf="@+id/EditTextRegion" + app:layout_constraintTop_toBottomOf="@id/EditTextRegion"> + + + + +