Skip to content

Commit

Permalink
Create icons library in :ui_icons module
Browse files Browse the repository at this point in the history
- Export some icons from Figma
  • Loading branch information
tonykolomeytsev committed Jun 20, 2023
1 parent f6a0cd5 commit b8ae35d
Show file tree
Hide file tree
Showing 17 changed files with 261 additions and 3 deletions.
3 changes: 1 addition & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ compose-ui-graphics = { module = "androidx.compose.ui:ui-graphics" }
compose-animation = { module = "androidx.compose.animation:animation" }
compose-foundation = { module = "androidx.compose.foundation:foundation" }
compose-material3 = { module = "androidx.compose.material3:material3" }
activity-compose = { module = "androidx.activity:activity-compose", version = "1.7.2" }
compose-activity = { module = "androidx.activity:activity-compose", version = "1.7.2" }

## Accompanist
accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist" }
Expand All @@ -183,7 +183,6 @@ compose = [
"compose-animation",
"compose-foundation",
"compose-material3",
"activity-compose",
]

accompanist = [
Expand Down
1 change: 1 addition & 0 deletions modules/app_ui_kit_demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ dependencies {
implementation(project(":common_navigation_api"))
implementation(project(":common_navigation_compose"))

implementation(libs.compose.activity)
implementation(libs.appyx.core)
}
4 changes: 4 additions & 0 deletions modules/ui/icons/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugins {
id("mpeix.android.lib")
id("mpeix.android.compose")
}
102 changes: 102 additions & 0 deletions modules/ui/icons/src/main/kotlin/kekmech/ru/ui_icons/MpeixIcons.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package kekmech.ru.ui_icons

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyGridScope
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

/**
* MpeiX Icons Library
*/
object MpeixIcons {

val WhatshotBlack24
@Composable get() = painterResource(R.drawable.ic_whatshot_black_24)

val WhatshotOutline24
@Composable get() = painterResource(R.drawable.ic_whatshot_outline_24)

val EventBlack24
@Composable get() = painterResource(R.drawable.ic_event_black_24)

val EventOutline24
@Composable get() = painterResource(R.drawable.ic_event_outline_24)

val ExploreBlack24
@Composable get() = painterResource(R.drawable.ic_explore_black_24)

val ExploreOutline24
@Composable get() = painterResource(R.drawable.ic_explore_outline_24)

val AccountBlack24
@Composable get() = painterResource(R.drawable.ic_account_black_24)

val AccountOutline24
@Composable get() = painterResource(R.drawable.ic_account_outline_24)

val Close24
@Composable get() = painterResource(R.drawable.ic_close_24)

val Search24
@Composable get() = painterResource(R.drawable.ic_search_24)

val PersonOutline24
@Composable get() = painterResource(R.drawable.ic_person_outline_24)

val GroupsOutline24
@Composable get() = painterResource(R.drawable.ic_groups_outline_24)
}

@Composable
@Preview
fun IconsPreview() {
val iconItem: LazyGridScope.(String, @Composable () -> Painter) -> Unit = { name, painter ->
item(name) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.padding(4.dp),
) {
Icon(painter = painter.invoke(), contentDescription = null, tint = Color.Black)
Text(text = name, fontSize = 8.sp, textAlign = TextAlign.Center)
}
}
}

Column(
modifier = Modifier
.background(Color.White)
.padding(16.dp),
) {
Text("Icons 24x24", fontSize = 24.sp, modifier = Modifier.padding(8.dp))
LazyVerticalGrid(
columns = GridCells.Fixed(6)
) {
iconItem("Whatshot\nBlack24") { MpeixIcons.WhatshotBlack24 }
iconItem("Whatshot\nOutilne24") { MpeixIcons.WhatshotOutline24 }
iconItem("Event\nBlack24") { MpeixIcons.EventBlack24 }
iconItem("Event\nOutilne24") { MpeixIcons.EventOutline24 }
iconItem("Explore\nBlack24") { MpeixIcons.ExploreBlack24 }
iconItem("Explore\nOutilne24") { MpeixIcons.ExploreOutline24 }
iconItem("Account\nBlack24") { MpeixIcons.AccountBlack24 }
iconItem("Account\nOutilne24") { MpeixIcons.AccountOutline24 }
iconItem("Close24") { MpeixIcons.Close24 }
iconItem("Search24") { MpeixIcons.Search24 }
iconItem("Person\nOutline24") { MpeixIcons.PersonOutline24 }
iconItem("Groups\nOutilne24") { MpeixIcons.GroupsOutline24 }
}
}
}
13 changes: 13 additions & 0 deletions modules/ui/icons/src/main/res/drawable/ic_account_black_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group>
<clip-path
android:pathData="M0,0h24v24h-24z"/>
<path
android:pathData="M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2ZM12,6C13.93,6 15.5,7.57 15.5,9.5C15.5,11.43 13.93,13 12,13C10.07,13 8.5,11.43 8.5,9.5C8.5,7.57 10.07,6 12,6ZM12,20C9.97,20 7.57,19.18 5.86,17.12C7.55,15.8 9.68,15 12,15C14.32,15 16.45,15.8 18.14,17.12C16.43,19.18 14.03,20 12,20Z"
android:fillColor="#232A35"/>
</group>
</vector>
16 changes: 16 additions & 0 deletions modules/ui/icons/src/main/res/drawable/ic_account_outline_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group>
<clip-path
android:pathData="M0,0h24v24h-24z"/>
<path
android:pathData="M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2ZM7.35,18.5C8.66,17.56 10.26,17 12,17C13.74,17 15.34,17.56 16.65,18.5C15.34,19.44 13.74,20 12,20C10.26,20 8.66,19.44 7.35,18.5ZM18.14,17.12C16.45,15.8 14.32,15 12,15C9.68,15 7.55,15.8 5.86,17.12C4.7,15.73 4,13.95 4,12C4,7.58 7.58,4 12,4C16.42,4 20,7.58 20,12C20,13.95 19.3,15.73 18.14,17.12Z"
android:fillColor="#000000"/>
<path
android:pathData="M12,6C10.07,6 8.5,7.57 8.5,9.5C8.5,11.43 10.07,13 12,13C13.93,13 15.5,11.43 15.5,9.5C15.5,7.57 13.93,6 12,6ZM12,11C11.17,11 10.5,10.33 10.5,9.5C10.5,8.67 11.17,8 12,8C12.83,8 13.5,8.67 13.5,9.5C13.5,10.33 12.83,11 12,11Z"
android:fillColor="#000000"/>
</group>
</vector>
9 changes: 9 additions & 0 deletions modules/ui/icons/src/main/res/drawable/ic_close_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M6.4,19L5,17.6L10.6,12L5,6.4L6.4,5L12,10.6L17.6,5L19,6.4L13.4,12L19,17.6L17.6,19L12,13.4L6.4,19Z"
android:fillColor="#232A35"/>
</vector>
13 changes: 13 additions & 0 deletions modules/ui/icons/src/main/res/drawable/ic_event_black_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group>
<clip-path
android:pathData="M0,0h24v24h-24z"/>
<path
android:pathData="M16,13H13C12.45,13 12,13.45 12,14V17C12,17.55 12.45,18 13,18H16C16.55,18 17,17.55 17,17V14C17,13.45 16.55,13 16,13ZM16,3V4H8V3C8,2.45 7.55,2 7,2C6.45,2 6,2.45 6,3V4H5C3.89,4 3.01,4.9 3.01,6L3,20C3,21.1 3.89,22 5,22H19C20.1,22 21,21.1 21,20V6C21,4.9 20.1,4 19,4H18V3C18,2.45 17.55,2 17,2C16.45,2 16,2.45 16,3ZM18,20H6C5.45,20 5,19.55 5,19V9H19V19C19,19.55 18.55,20 18,20Z"
android:fillColor="#232A35"/>
</group>
</vector>
13 changes: 13 additions & 0 deletions modules/ui/icons/src/main/res/drawable/ic_event_outline_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group>
<clip-path
android:pathData="M0,0h24v24h-24z"/>
<path
android:pathData="M19,3H18V1H16V3H8V1H6V3H5C3.89,3 3.01,3.9 3.01,5L3,19C3,20.1 3.89,21 5,21H19C20.1,21 21,20.1 21,19V5C21,3.9 20.1,3 19,3ZM19,19H5V9H19V19ZM19,7H5V5H19V7ZM17,12H12V17H17V12Z"
android:fillColor="#000000"/>
</group>
</vector>
13 changes: 13 additions & 0 deletions modules/ui/icons/src/main/res/drawable/ic_explore_black_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group>
<clip-path
android:pathData="M0,0h24v24h-24z"/>
<path
android:pathData="M12,10.9C11.39,10.9 10.9,11.39 10.9,12C10.9,12.61 11.39,13.1 12,13.1C12.61,13.1 13.1,12.61 13.1,12C13.1,11.39 12.61,10.9 12,10.9ZM12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2ZM14.19,14.19L6,18L9.81,9.81L18,6L14.19,14.19Z"
android:fillColor="#232A35"/>
</group>
</vector>
13 changes: 13 additions & 0 deletions modules/ui/icons/src/main/res/drawable/ic_explore_outline_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group>
<clip-path
android:pathData="M0,0h24v24h-24z"/>
<path
android:pathData="M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2ZM12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20ZM6.5,17.5L14.01,14.01L17.5,6.5L9.99,9.99L6.5,17.5ZM12,10.9C12.61,10.9 13.1,11.39 13.1,12C13.1,12.61 12.61,13.1 12,13.1C11.39,13.1 10.9,12.61 10.9,12C10.9,11.39 11.39,10.9 12,10.9Z"
android:fillColor="#000000"/>
</group>
</vector>
15 changes: 15 additions & 0 deletions modules/ui/icons/src/main/res/drawable/ic_groups_outline_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group>
<clip-path
android:pathData="M0,0h24v24h-24z"/>
<path
android:pathData="M4,13C5.1,13 6,12.1 6,11C6,9.9 5.1,9 4,9C2.9,9 2,9.9 2,11C2,12.1 2.9,13 4,13ZM5.13,14.1C4.76,14.04 4.39,14 4,14C3.01,14 2.07,14.21 1.22,14.58C0.48,14.9 0,15.62 0,16.43V18H4.5V16.39C4.5,15.56 4.73,14.78 5.13,14.1ZM20,13C21.1,13 22,12.1 22,11C22,9.9 21.1,9 20,9C18.9,9 18,9.9 18,11C18,12.1 18.9,13 20,13ZM24,16.43C24,15.62 23.52,14.9 22.78,14.58C21.93,14.21 20.99,14 20,14C19.61,14 19.24,14.04 18.87,14.1C19.27,14.78 19.5,15.56 19.5,16.39V18H24V16.43ZM16.24,13.65C15.07,13.13 13.63,12.75 12,12.75C10.37,12.75 8.93,13.14 7.76,13.65C6.68,14.13 6,15.21 6,16.39V18H18V16.39C18,15.21 17.32,14.13 16.24,13.65ZM8.07,16C8.16,15.77 8.2,15.61 8.98,15.31C9.95,14.93 10.97,14.75 12,14.75C13.03,14.75 14.05,14.93 15.02,15.31C15.79,15.61 15.83,15.77 15.93,16H8.07ZM12,8C12.55,8 13,8.45 13,9C13,9.55 12.55,10 12,10C11.45,10 11,9.55 11,9C11,8.45 11.45,8 12,8ZM12,6C10.34,6 9,7.34 9,9C9,10.66 10.34,12 12,12C13.66,12 15,10.66 15,9C15,7.34 13.66,6 12,6Z"
android:fillColor="#000000"
tools:ignore="VectorPath" />
</group>
</vector>
13 changes: 13 additions & 0 deletions modules/ui/icons/src/main/res/drawable/ic_person_outline_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group>
<clip-path
android:pathData="M0,0h24v24h-24z"/>
<path
android:pathData="M12,6C13.1,6 14,6.9 14,8C14,9.1 13.1,10 12,10C10.9,10 10,9.1 10,8C10,6.9 10.9,6 12,6ZM12,16C14.7,16 17.8,17.29 18,18H6C6.23,17.28 9.31,16 12,16ZM12,4C9.79,4 8,5.79 8,8C8,10.21 9.79,12 12,12C14.21,12 16,10.21 16,8C16,5.79 14.21,4 12,4ZM12,14C9.33,14 4,15.34 4,18V20H20V18C20,15.34 14.67,14 12,14Z"
android:fillColor="#000000"/>
</group>
</vector>
9 changes: 9 additions & 0 deletions modules/ui/icons/src/main/res/drawable/ic_search_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M19.6,21L13.3,14.7C12.8,15.1 12.225,15.417 11.575,15.65C10.925,15.883 10.233,16 9.5,16C7.683,16 6.146,15.371 4.887,14.113C3.629,12.854 3,11.317 3,9.5C3,7.683 3.629,6.146 4.887,4.887C6.146,3.629 7.683,3 9.5,3C11.317,3 12.854,3.629 14.113,4.887C15.371,6.146 16,7.683 16,9.5C16,10.233 15.883,10.925 15.65,11.575C15.417,12.225 15.1,12.8 14.7,13.3L21,19.6L19.6,21ZM9.5,14C10.75,14 11.813,13.563 12.688,12.688C13.563,11.813 14,10.75 14,9.5C14,8.25 13.563,7.188 12.688,6.313C11.813,5.438 10.75,5 9.5,5C8.25,5 7.188,5.438 6.313,6.313C5.438,7.188 5,8.25 5,9.5C5,10.75 5.438,11.813 6.313,12.688C7.188,13.563 8.25,14 9.5,14Z"
android:fillColor="#232A35"/>
</vector>
13 changes: 13 additions & 0 deletions modules/ui/icons/src/main/res/drawable/ic_whatshot_black_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group>
<clip-path
android:pathData="M0,0h24v24h-24z"/>
<path
android:pathData="M17.09,4.56C16.39,3.53 15.59,2.57 14.69,1.71C14.34,1.37 13.75,1.69 13.85,2.17C14.04,3.11 14.24,4.35 14.24,5.46C14.24,7.52 12.89,9.19 10.83,9.19C9.29,9.19 8.03,8.26 7.48,6.93C7.38,6.73 7.34,6.61 7.28,6.39C7.17,5.97 6.62,5.84 6.38,6.21C6.2,6.48 6.03,6.75 5.87,7.04C4.68,9.08 4,11.46 4,14C4,18.42 7.58,22 12,22C16.42,22 20,18.42 20,14C20,10.51 18.92,7.27 17.09,4.56ZM11.71,19C9.93,19 8.49,17.6 8.49,15.86C8.49,14.24 9.54,13.1 11.3,12.74C12.77,12.44 14.28,11.81 15.33,10.82C15.61,10.56 16.07,10.68 16.15,11.05C16.38,12.07 16.5,13.13 16.5,14.2C16.51,16.85 14.36,19 11.71,19Z"
android:fillColor="#232A35"/>
</group>
</vector>
13 changes: 13 additions & 0 deletions modules/ui/icons/src/main/res/drawable/ic_whatshot_outline_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group>
<clip-path
android:pathData="M0,0h24v24h-24z"/>
<path
android:pathData="M11.57,13.16C10.21,13.44 9.4,14.32 9.4,15.57C9.4,16.91 10.51,17.99 11.89,17.99C13.94,17.99 15.6,16.33 15.6,14.28C15.6,13.21 15.45,12.16 15.14,11.16C14.35,12.23 12.94,12.88 11.57,13.16ZM13.5,0.67C13.5,0.67 14.24,3.32 14.24,5.47C14.24,7.53 12.89,9.2 10.83,9.2C8.76,9.2 7.2,7.53 7.2,5.47L7.23,5.11C5.21,7.51 4,10.62 4,14C4,18.42 7.58,22 12,22C16.42,22 20,18.42 20,14C20,8.61 17.41,3.8 13.5,0.67ZM12,20C8.69,20 6,17.31 6,14C6,12.47 6.3,10.96 6.86,9.57C7.87,10.58 9.27,11.2 10.83,11.2C13.49,11.2 15.58,9.37 16.11,6.77C17.34,8.97 18,11.44 18,14C18,17.31 15.31,20 12,20Z"
android:fillColor="#000000"/>
</group>
</vector>
1 change: 0 additions & 1 deletion modules/ui/theme/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ plugins {
id("mpeix.android.lib")
id("mpeix.android.compose")
}

0 comments on commit b8ae35d

Please sign in to comment.