Skip to content

Commit ef25737

Browse files
committed
Bug fixing
1 parent 7e169fd commit ef25737

File tree

9 files changed

+981
-863
lines changed

9 files changed

+981
-863
lines changed

.idea/google-java-format.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/goodayapps/avatarview/MainActivity.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package com.goodayapps.avatarview
22

3+
import android.graphics.Color
34
import android.os.Bundle
45
import android.util.DisplayMetrics
56
import android.widget.SeekBar
67
import androidx.appcompat.app.AppCompatActivity
8+
import androidx.core.content.res.ResourcesCompat
9+
import androidx.core.view.children
710
import com.goodayapps.widget.AvatarDrawable
811
import com.goodayapps.widget.AvatarView
912
import com.goodayapps.widget.avatarDrawable
@@ -107,7 +110,7 @@ class MainActivity : AppCompatActivity() {
107110
}
108111

109112
private inline fun applyToAvatars(action: (AvatarView) -> Unit) {
110-
arrayOf(avatarView0, avatarView1, avatarView2, avatarView3).forEach { action.invoke(it) }
113+
avatars_list.children.mapNotNull { it as? AvatarView }.forEach { action.invoke(it) }
111114
}
112115

113116
private fun convertDpToPixel(dp: Int): Int {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="17dp"
3+
android:height="21dp"
4+
android:viewportWidth="17"
5+
android:viewportHeight="21">
6+
<path
7+
android:fillColor="#FF000000"
8+
android:pathData="M14.219,7.69v3.184c0,0.856 0.075,2.242 0.166,3.09L14.498,15L1.962,15l0.112,-1.036c0.093,-0.85 0.168,-2.237 0.168,-3.09L2.242,7.69c0,-3.207 2.686,-5.815 5.988,-5.815 3.303,0 5.989,2.608 5.989,5.815zM9.969,16.875v0.187c0,0.93 -0.78,1.688 -1.74,1.688 -0.958,0 -1.738,-0.757 -1.738,-1.688v-0.187zM11.899,17.062v-0.187h2.898c0.487,0 0.946,-0.2 1.259,-0.549a1.57,1.57 0,0 0,0.395 -1.234l-0.144,-1.325a32.48,32.48 0,0 1,-0.157 -2.893L16.15,7.69C16.15,3.45 12.597,0 8.23,0S0.31,3.45 0.31,7.69v3.184c0,0.8 -0.07,2.097 -0.157,2.893L0.01,15.092c-0.05,0.457 0.09,0.895 0.394,1.234 0.313,0.349 0.772,0.549 1.26,0.549h2.895v0.187c0,1.965 1.647,3.563 3.67,3.563 2.024,0 3.67,-1.598 3.67,-3.563z"/>
9+
</vector>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="13dp"
3+
android:height="3dp"
4+
android:viewportWidth="13"
5+
android:viewportHeight="3">
6+
<path
7+
android:pathData="M0,1.5a1.5,1.5 0,1 1,3 0,1.5 1.5,0 0,1 -3,0z"
8+
android:fillColor="#abafb3"/>
9+
<path
10+
android:pathData="M5,1.5a1.5,1.5 0,1 1,3 0,1.5 1.5,0 0,1 -3,0z"
11+
android:fillColor="#abafb3"/>
12+
<path
13+
android:pathData="M10,1.5a1.5,1.5 0,1 1,3 0,1.5 1.5,0 0,1 -3,0z"
14+
android:fillColor="#abafb3"/>
15+
</vector>

0 commit comments

Comments
 (0)