File tree Expand file tree Collapse file tree 5 files changed +22
-1
lines changed
java/com/whyranoid/presentation Expand file tree Collapse file tree 5 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ buildscript {
26
26
shimmerVersion = " 0.5.0"
27
27
desugarVersion = " 2.0.0"
28
28
calendarVersion = " 1.0.4"
29
+ glideVersion = " 4.14.2"
29
30
}
30
31
dependencies {
31
32
classpath " com.google.gms:google-services:$googleServiceVersion "
Original file line number Diff line number Diff line change @@ -80,4 +80,8 @@ dependencies {
80
80
81
81
// Calendar Library
82
82
implementation " com.github.kizitonwose:CalendarView:$calendarVersion "
83
+
84
+ // Glide
85
+ implementation " com.github.bumptech.glide:glide:$glideVersion "
86
+ annotationProcessor " com.github.bumptech.glide:compiler:$glideVersion "
83
87
}
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import androidx.fragment.app.viewModels
6
6
import com.whyranoid.presentation.R
7
7
import com.whyranoid.presentation.base.BaseFragment
8
8
import com.whyranoid.presentation.databinding.FragmentMyRunBinding
9
+ import com.whyranoid.presentation.util.loadImage
9
10
import dagger.hilt.android.AndroidEntryPoint
10
11
11
12
@AndroidEntryPoint
@@ -29,5 +30,9 @@ internal class MyRunFragment : BaseFragment<FragmentMyRunBinding>(R.layout.fragm
29
30
viewModel.nickName.observe(viewLifecycleOwner) {
30
31
binding.tvNickName.text = it
31
32
}
33
+
34
+ viewModel.profileImgUri.observe(viewLifecycleOwner) {
35
+ binding.ivProfileImage.loadImage(it)
36
+ }
32
37
}
33
38
}
Original file line number Diff line number Diff line change 1
1
package com.whyranoid.presentation.util
2
2
3
3
import android.view.View
4
+ import android.widget.ImageView
4
5
import androidx.databinding.BindingAdapter
6
+ import com.bumptech.glide.Glide
7
+ import com.whyranoid.presentation.R
5
8
import com.whyranoid.presentation.util.networkconnection.NetworkState
6
9
7
10
@BindingAdapter(" networkConnectionVisibility" )
@@ -21,3 +24,12 @@ fun View.enableWithNetworkState(networkState: NetworkState) {
21
24
is NetworkState .DisConnection -> true
22
25
}
23
26
}
27
+
28
+ @BindingAdapter(" loadImage" )
29
+ fun ImageView.loadImage (uri : String ) {
30
+ Glide .with (this .context)
31
+ .load(uri)
32
+ .error(R .drawable.thumbnail_src_small)
33
+ .circleCrop()
34
+ .into(this )
35
+ }
Original file line number Diff line number Diff line change 56
56
android : layout_marginStart =" 16dp"
57
57
android : layout_marginTop =" 20dp"
58
58
android : contentDescription =" @string/my_run_profile_image_description"
59
- android : src =" @drawable/thumbnail_src_small"
60
59
app : layout_constraintStart_toStartOf =" parent"
61
60
app : layout_constraintTop_toTopOf =" parent" />
62
61
You can’t perform that action at this time.
0 commit comments