Skip to content

Commit 69bf63d

Browse files
committed
fix: update editprofile buttons color and use materialbutton
Fixes: 1532 Changes: - Changes color of update button and profile photo FAB to secondary color - Refactored 'buttonUpdate' to 'updateButton' for consistency - Moved a hardcoded string to string resources
1 parent d4e8f8c commit 69bf63d

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import androidx.lifecycle.Observer
2222
import com.google.android.material.snackbar.Snackbar
2323
import com.squareup.picasso.Picasso
2424
import kotlinx.android.synthetic.main.fragment_edit_profile.view.editProfileCoordinatorLayout
25-
import kotlinx.android.synthetic.main.fragment_edit_profile.view.buttonUpdate
25+
import kotlinx.android.synthetic.main.fragment_edit_profile.view.updateButton
2626
import kotlinx.android.synthetic.main.fragment_edit_profile.view.firstName
2727
import kotlinx.android.synthetic.main.fragment_edit_profile.view.lastName
2828
import kotlinx.android.synthetic.main.fragment_edit_profile.view.profilePhoto
@@ -105,7 +105,7 @@ class EditProfileFragment : Fragment() {
105105
permissionGranted = (ContextCompat.checkSelfPermission(requireContext(),
106106
Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED)
107107

108-
rootView.buttonUpdate.setOnClickListener {
108+
rootView.updateButton.setOnClickListener {
109109
hideSoftKeyboard(context, rootView)
110110
editProfileViewModel.updateProfile(encodedImage, rootView.firstName.text.toString(),
111111
rootView.lastName.text.toString())

app/src/main/res/layout/fragment_edit_profile.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@
2424
app:layout_constraintRight_toRightOf="parent"
2525
android:layout_gravity="center_horizontal"
2626
android:padding="@dimen/padding_large"
27-
android:contentDescription="Profile Photo"
27+
android:contentDescription="@string/profile_photo"
2828
app:srcCompat="@drawable/ic_account_circle_grey" />
2929

3030
<com.google.android.material.floatingactionbutton.FloatingActionButton
3131
android:id="@+id/profilePhotoFab"
3232
android:layout_width="@dimen/fab_width"
3333
android:layout_height="@dimen/fab_height"
3434
app:fabCustomSize="@dimen/fab_height"
35-
app:backgroundTint="@color/colorPrimary"
3635
android:layout_margin="@dimen/layout_margin_medium"
3736
app:layout_constraintRight_toRightOf="@id/profilePhoto"
3837
app:layout_constraintBottom_toBottomOf="@id/profilePhoto"
@@ -79,12 +78,11 @@
7978

8079
</LinearLayout>
8180

82-
<androidx.appcompat.widget.AppCompatButton
83-
android:id="@+id/buttonUpdate"
81+
<com.google.android.material.button.MaterialButton
82+
android:id="@+id/updateButton"
8483
android:layout_width="match_parent"
8584
android:layout_height="wrap_content"
8685
android:layout_gravity="center"
87-
app:backgroundTint="@color/colorPrimary"
8886
android:text="@string/update"
8987
android:textColor="@android:color/white" />
9088

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
<string name="last_name_optional">Last Name (Optional)</string>
6969
<string name="welcome_back">Welcome back!</string>
7070
<string name="update">Update</string>
71+
<string name="profile_photo">Profile Photo</string>
7172

7273
<!--eventyay-->
7374
<string name="eventyay_logo" translatable="false">eventyay</string>

0 commit comments

Comments
 (0)