Skip to content

Commit 7754a42

Browse files
committed
Bug fixing
1 parent bf0fb31 commit 7754a42

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<vector android:autoMirrored="true" android:height="24dp"
2+
android:tint="?attr/colorControlNormal" android:viewportHeight="24"
3+
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
4+
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM16.5,16L8,16c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3l0.14,0.01C8.58,8.28 10.13,7 12,7c2.21,0 4,1.79 4,4h0.5c1.38,0 2.5,1.12 2.5,2.5S17.88,16 16.5,16z"/>
5+
</vector>

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
android:showDividers="middle">
3636

3737
<com.goodayapps.widget.AvatarView
38-
android:id="@+id/avatarView0"
3938
style="@style/AvatarStyleHelper"
4039
android:layout_width="@dimen/avatar_size"
4140
android:layout_height="@dimen/avatar_size"
@@ -48,7 +47,18 @@
4847
app:placeholderText="OMG" />
4948

5049
<com.goodayapps.widget.AvatarView
51-
android:id="@+id/avatarView10"
50+
style="@style/AvatarStyleHelper"
51+
android:layout_width="@dimen/avatar_size"
52+
android:layout_height="@dimen/avatar_size"
53+
android:src="@drawable/ic_baseline_cloud_circle_24"
54+
app:avBorderColor="#FF0000"
55+
app:avBorderColorSecondary="#FF9D00"
56+
app:avBorderGradientAngle="135"
57+
app:avBorderWidth="5dp"
58+
app:iconDrawableScale=".3"
59+
app:placeholderText="OMG" />
60+
61+
<com.goodayapps.widget.AvatarView
5262
style="@style/AvatarStyleHelper"
5363
android:layout_width="@dimen/avatar_size"
5464
android:layout_height="@dimen/avatar_size"
@@ -61,7 +71,6 @@
6171
app:placeholderText="OMG" />
6272

6373
<com.goodayapps.widget.AvatarView
64-
android:id="@+id/avatarView1"
6574
style="@style/AvatarStyleHelper"
6675
android:layout_width="@dimen/avatar_size"
6776
android:layout_height="@dimen/avatar_size"
@@ -80,7 +89,6 @@
8089
app:placeholderText="AV" />
8190

8291
<com.goodayapps.widget.AvatarView
83-
android:id="@+id/avatarView2"
8492
style="@style/AvatarStyleHelper"
8593
android:layout_width="@dimen/avatar_size"
8694
android:layout_height="@dimen/avatar_size"
@@ -90,7 +98,6 @@
9098
app:avBorderWidth="5dp" />
9199

92100
<com.goodayapps.widget.AvatarView
93-
android:id="@+id/avatarView3"
94101
style="@style/AvatarStyleHelper"
95102
android:layout_width="@dimen/avatar_size"
96103
android:layout_height="@dimen/avatar_size"

avatar-view/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-android-extensions'
44

55
android {
6-
compileSdkVersion 29
7-
buildToolsVersion "30.0.0"
6+
compileSdkVersion 30
7+
buildToolsVersion "30.0.3"
88

99
defaultConfig {
1010
minSdkVersion 19
11-
targetSdkVersion 29
11+
targetSdkVersion 30
1212
versionCode 1
1313
versionName "1.0"
1414

avatar-view/src/main/java/com/goodayapps/widget/AvatarDrawable.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,10 @@ class AvatarDrawable private constructor(
380380
_width = intrinsicWidth / ratioOfWidth * ratio
381381
_height = maxF
382382
}
383+
ratio == 1f ->{
384+
_width = maxF
385+
_height = maxF
386+
}
383387
else -> {
384388
_width = 0f
385389
_height = 0f

0 commit comments

Comments
 (0)