diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100755 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100755 index 0000000..b589d56 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100755 index 0000000..0c0c338 --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100755 index 0000000..bf8727e --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100755 index 0000000..fdf8d99 --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/migrations.xml b/.idea/migrations.xml new file mode 100755 index 0000000..f8051a6 --- /dev/null +++ b/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100755 index 0000000..8978d23 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100755 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/LetterAvatar/.gitignore b/LetterAvatar/.gitignore new file mode 100755 index 0000000..42afabf --- /dev/null +++ b/LetterAvatar/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/LetterAvatar/build.gradle.kts b/LetterAvatar/build.gradle.kts new file mode 100755 index 0000000..b9399fe --- /dev/null +++ b/LetterAvatar/build.gradle.kts @@ -0,0 +1,55 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + id("maven-publish") +} + +android { + namespace = "com.pranathicodes.letteravatar" + compileSdk = 34 + + defaultConfig { + minSdk = 24 + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + + implementation("androidx.core:core-ktx:1.12.0") + implementation("com.google.android.material:material:1.11.0") +} + +afterEvaluate { + publishing { + publications { + create("release"){ + from(components["release"]) + + groupId = "com.github.Pranathi-pellakuru" + artifactId = "Letter-Avatar-Generator" + version = "1.0" + } + } + } +} + diff --git a/LetterAvatar/consumer-rules.pro b/LetterAvatar/consumer-rules.pro new file mode 100755 index 0000000..e69de29 diff --git a/LetterAvatar/proguard-rules.pro b/LetterAvatar/proguard-rules.pro new file mode 100755 index 0000000..481bb43 --- /dev/null +++ b/LetterAvatar/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/LetterAvatar/src/androidTest/java/com/pranathicodes/letteravatar/ExampleInstrumentedTest.kt b/LetterAvatar/src/androidTest/java/com/pranathicodes/letteravatar/ExampleInstrumentedTest.kt new file mode 100755 index 0000000..1da15d1 --- /dev/null +++ b/LetterAvatar/src/androidTest/java/com/pranathicodes/letteravatar/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.pranathicodes.letteravatar + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.pranathicodes.letteravatar.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/LetterAvatar/src/main/AndroidManifest.xml b/LetterAvatar/src/main/AndroidManifest.xml new file mode 100755 index 0000000..a5918e6 --- /dev/null +++ b/LetterAvatar/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/LetterAvatar/src/main/java/com/pranathicodes/letteravatar/AvatarCreator.kt b/LetterAvatar/src/main/java/com/pranathicodes/letteravatar/AvatarCreator.kt new file mode 100755 index 0000000..ecb1c3c --- /dev/null +++ b/LetterAvatar/src/main/java/com/pranathicodes/letteravatar/AvatarCreator.kt @@ -0,0 +1,98 @@ +package com.pranathicodes.letteravatar + +import android.content.Context +import android.graphics.Bitmap +import android.graphics.Bitmap.Config.ARGB_8888 +import android.graphics.Canvas +import android.graphics.Color +import android.graphics.Paint +import android.graphics.Rect +import android.graphics.RectF +import android.graphics.Typeface +import android.text.TextPaint + +class AvatarCreator(private val context: Context) { + + private var textSize = 25 + private var size = 180 + private var name = ' ' + private var font = Typeface.SANS_SERIF + private var letterColor = Color.WHITE + private var backgroundColor = Color.GRAY + + + fun setTextSize(textSize: Int) = apply { + this.textSize = textSize + } + + fun setAvatarSize(int: Int) = apply { + this.size = int + } + + fun setLetter(label: Char) = apply { + this.name = label + } + + fun setFont(fontFamily: Typeface) = apply { + this.font = fontFamily + } + + fun setLetterColor(color: Int) = apply { + this.letterColor = color + } + + fun setBackgroundColor(color: Int) = apply { + this.backgroundColor = color + } + + fun build(): Bitmap { + return avatarImageGenerate( + size, + name.toString(), + textSize, + font, + letterColor, + backgroundColor + ) + } + + private fun avatarImageGenerate( + size: Int, + name: String, + textSize: Int, + typeface: Typeface, + letterColor: Int, + backgroundColor: Int + ): Bitmap { + val painter = Paint() + val label = name.uppercase().ifEmpty { "-" } + val textPaint = textPainter(letterColor, typeface, textSize) + painter.color = backgroundColor + + val areaRect = Rect(0, 0, size, size) + val bitmap = Bitmap.createBitmap(size, size, ARGB_8888) + val canvas = Canvas(bitmap) + + val bounds = RectF(areaRect) + bounds.right = textPaint.measureText(label, 0, 1) + bounds.bottom = textPaint.descent() - textPaint.ascent() + + bounds.left += (areaRect.width() - bounds.right) / 2.0f + bounds.top += (areaRect.height() - bounds.bottom) / 2.0f + + canvas.drawRect(areaRect, painter) + canvas.drawText(label, bounds.left, bounds.top - textPaint.ascent(), textPaint) + return bitmap + + } + + private fun textPainter(color: Int, typeface: Typeface, textSize: Int): TextPaint { + val textPaint = TextPaint() + textPaint.textSize = textSize * context.resources.displayMetrics.density + textPaint.color = color + textPaint.typeface = typeface + return textPaint + } + +} + diff --git a/LetterAvatar/src/main/java/com/pranathicodes/letteravatar/RandomColors.kt b/LetterAvatar/src/main/java/com/pranathicodes/letteravatar/RandomColors.kt new file mode 100755 index 0000000..e2abbc2 --- /dev/null +++ b/LetterAvatar/src/main/java/com/pranathicodes/letteravatar/RandomColors.kt @@ -0,0 +1,33 @@ +package com.pranathicodes.letteravatar + +class RandomColors { + private var colorPairs: List> = listOf() + private var letterColors : List = listOf() + private var backgroundColors : List = listOf() + + fun getColorPair(): Pair { + return colorPairs.random() + } + + fun setColorPairs(colors : List>){ + colorPairs = colors + } + + fun setLetterColors(colors : List){ + letterColors = colors + } + + fun setBackgroundColors(colors : List){ + backgroundColors = colors + } + + fun getLetterColor():Int{ + return letterColors.random() + } + + fun getBackgroundColor():Int { + return backgroundColors.random() + } + +} + diff --git a/LetterAvatar/src/test/java/com/pranathicodes/letteravatar/ExampleUnitTest.kt b/LetterAvatar/src/test/java/com/pranathicodes/letteravatar/ExampleUnitTest.kt new file mode 100755 index 0000000..ae13051 --- /dev/null +++ b/LetterAvatar/src/test/java/com/pranathicodes/letteravatar/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.pranathicodes.letteravatar + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100755 index 0000000..d3c00dc --- /dev/null +++ b/README.md @@ -0,0 +1,91 @@ +# Letter Avatar Generator +An android library that helps in creating a letter avatar as bitmap to use as a placeholder for profile. +Includes customisation like setting colors to Background and letter , you can also set your custom color pairs to choose randomly + + + +## Installation +To include LetterAvatarGenerator dependency you need to add JitPack as repository in `settings.gradle.kts` + +```gradle +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + maven { + setUrl("https://jitpack.io") + } + } +} +``` + +Add the following dependency to your gradle file. +```gradle +implementation 'com.github.Pranathi-pellakuru:LetterAvatarGenerator:VERSION' +``` + +## How to Use + +Avatar creator class + +```kotlin +val image = AvatarCreator(this).setLetter('U') + .setTextSize(25) + .setAvatarSize(180) + .setLetterColor(Color.GRAY) + .setBackgroundColor(Color.BLACK) + .build() +``` + +To customize colors + +**If you have color pairs** + +```kotlin +val randomColors = RandomColors() +randomColors.setColorPairs(listOf(Pair(Color.WHITE,Color.CYAN), Pair(Color.MAGENTA,Color.RED), Pair(Color.GRAY,Color.BLACK))) +val colorPair = randomColors.getColorPair() +val image = AvatarCreator(this).setLetter('P') + .setLetterColor(colorPair.first) + .setBackgroundColor(colorPair.second) + .build() +``` + +**different set of colors for background and letter** +```kotlin +val randomColors = RandomColors() +randomColors.setLetterColors(listOf(Color.WHITE,Color.MAGENTA,Color.GRAY)) +randomColors.setBackgroundColors(listOf(Color.CYAN,Color.RED,Color.BLACK)) +val image1 = AvatarCreator(this).setLetter('P') + .setLetterColor(randomColors.getLetterColor()) + .setBackgroundColor(randomColors.getBackgroundColor()) + .build() + +``` + +## Displaying the generated bitmap + +**Jetpack compose** +```kotlin +Image( + bitmap = AvatarCreator(this).setLetter('U') + .setLetterColor(Color.GRAY) + .setBackgroundColor(Color.BLACK) + .build() + .asImageBitmap(), + contentDescription = "", + modifier = Modifier.size(200.dp), + contentScale = ContentScale.FillWidth +) +``` +**ImageView** +```Kotlin +imageView.setImageDrawable( + AvatarCreator(this).setLetter('U') + .setLetterColor(Color.GRAY) + .setBackgroundColor(Color.BLACK) + .build() + ) +``` + diff --git a/app/.gitignore b/app/.gitignore new file mode 100755 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100755 index 0000000..3cd34af --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,71 @@ +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "com.pranathicodes.letteravatargenerator" + compileSdk = 34 + + defaultConfig { + applicationId = "com.pranathicodes.letteravatargenerator" + minSdk = 24 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + vectorDrawables { + useSupportLibrary = true + } + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = "1.5.1" + } + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } +} + +dependencies { + + implementation("androidx.core:core-ktx:1.12.0") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0") + implementation("androidx.activity:activity-compose:1.8.2") + implementation(platform("androidx.compose:compose-bom:2023.08.00")) + implementation("androidx.compose.ui:ui") + implementation("androidx.compose.ui:ui-graphics") + implementation("androidx.compose.ui:ui-tooling-preview") + implementation("androidx.compose.material3:material3") + implementation(project(":LetterAvatar")) + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") + androidTestImplementation(platform("androidx.compose:compose-bom:2023.08.00")) + androidTestImplementation("androidx.compose.ui:ui-test-junit4") + debugImplementation("androidx.compose.ui:ui-tooling") + debugImplementation("androidx.compose.ui:ui-test-manifest") +// implementation("com.github.Pranathi-pellakuru:LetterAvatarGenerator:v1.0") +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100755 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/pranathicodes/letteravatargenerator/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/pranathicodes/letteravatargenerator/ExampleInstrumentedTest.kt new file mode 100755 index 0000000..25fc9ae --- /dev/null +++ b/app/src/androidTest/java/com/pranathicodes/letteravatargenerator/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.pranathicodes.letteravatargenerator + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.pranathicodes.letteravatargenerator", appContext.packageName) + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100755 index 0000000..89ca16e --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/pranathicodes/letteravatargenerator/MainActivity.kt b/app/src/main/java/com/pranathicodes/letteravatargenerator/MainActivity.kt new file mode 100755 index 0000000..15eaed2 --- /dev/null +++ b/app/src/main/java/com/pranathicodes/letteravatargenerator/MainActivity.kt @@ -0,0 +1,50 @@ +package com.pranathicodes.letteravatargenerator + +import android.graphics.Color +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.size +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Surface +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.asImageBitmap +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.unit.dp +import com.pranathicodes.letteravatar.AvatarCreator +import com.pranathicodes.letteravatar.RandomColors +import com.pranathicodes.letteravatargenerator.ui.theme.LetterAvatarGeneratorTheme + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + val randomColors = RandomColors() + randomColors.setLetterColors(listOf(Color.WHITE, Color.MAGENTA, Color.GRAY)) + randomColors.setBackgroundColors(listOf(Color.CYAN, Color.RED, Color.BLACK)) + val image = AvatarCreator(this).setLetter('P') + .setLetterColor(randomColors.getLetterColor()) + .setBackgroundColor(randomColors.getBackgroundColor()) + .build() + + setContent { + LetterAvatarGeneratorTheme { + // A surface container using the 'background' color from the theme + Surface( + modifier = Modifier.fillMaxSize(), + color = MaterialTheme.colorScheme.background + ) { + Image( + bitmap = image.asImageBitmap(), + contentDescription = "", + modifier = Modifier.size(200.dp), + contentScale = ContentScale.FillWidth + ) + + } + } + } + } +} + diff --git a/app/src/main/java/com/pranathicodes/letteravatargenerator/ui/theme/Color.kt b/app/src/main/java/com/pranathicodes/letteravatargenerator/ui/theme/Color.kt new file mode 100755 index 0000000..459cb96 --- /dev/null +++ b/app/src/main/java/com/pranathicodes/letteravatargenerator/ui/theme/Color.kt @@ -0,0 +1,11 @@ +package com.pranathicodes.letteravatargenerator.ui.theme + +import androidx.compose.ui.graphics.Color + +val Purple80 = Color(0xFFD0BCFF) +val PurpleGrey80 = Color(0xFFCCC2DC) +val Pink80 = Color(0xFFEFB8C8) + +val Purple40 = Color(0xFF6650a4) +val PurpleGrey40 = Color(0xFF625b71) +val Pink40 = Color(0xFF7D5260) \ No newline at end of file diff --git a/app/src/main/java/com/pranathicodes/letteravatargenerator/ui/theme/Theme.kt b/app/src/main/java/com/pranathicodes/letteravatargenerator/ui/theme/Theme.kt new file mode 100755 index 0000000..42ed689 --- /dev/null +++ b/app/src/main/java/com/pranathicodes/letteravatargenerator/ui/theme/Theme.kt @@ -0,0 +1,70 @@ +package com.pranathicodes.letteravatargenerator.ui.theme + +import android.app.Activity +import android.os.Build +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.darkColorScheme +import androidx.compose.material3.dynamicDarkColorScheme +import androidx.compose.material3.dynamicLightColorScheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.SideEffect +import androidx.compose.ui.graphics.toArgb +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalView +import androidx.core.view.WindowCompat + +private val DarkColorScheme = darkColorScheme( + primary = Purple80, + secondary = PurpleGrey80, + tertiary = Pink80 +) + +private val LightColorScheme = lightColorScheme( + primary = Purple40, + secondary = PurpleGrey40, + tertiary = Pink40 + + /* Other default colors to override + background = Color(0xFFFFFBFE), + surface = Color(0xFFFFFBFE), + onPrimary = Color.White, + onSecondary = Color.White, + onTertiary = Color.White, + onBackground = Color(0xFF1C1B1F), + onSurface = Color(0xFF1C1B1F), + */ +) + +@Composable +fun LetterAvatarGeneratorTheme( + darkTheme: Boolean = isSystemInDarkTheme(), + // Dynamic color is available on Android 12+ + dynamicColor: Boolean = true, + content: @Composable () -> Unit +) { + val colorScheme = when { + dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { + val context = LocalContext.current + if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) + } + + darkTheme -> DarkColorScheme + else -> LightColorScheme + } + val view = LocalView.current + if (!view.isInEditMode) { + SideEffect { + val window = (view.context as Activity).window + window.statusBarColor = colorScheme.primary.toArgb() + WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme + } + } + + MaterialTheme( + colorScheme = colorScheme, + typography = Typography, + content = content + ) +} \ No newline at end of file diff --git a/app/src/main/java/com/pranathicodes/letteravatargenerator/ui/theme/Type.kt b/app/src/main/java/com/pranathicodes/letteravatargenerator/ui/theme/Type.kt new file mode 100755 index 0000000..aba9ead --- /dev/null +++ b/app/src/main/java/com/pranathicodes/letteravatargenerator/ui/theme/Type.kt @@ -0,0 +1,34 @@ +package com.pranathicodes.letteravatargenerator.ui.theme + +import androidx.compose.material3.Typography +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp + +// Set of Material typography styles to start with +val Typography = Typography( + bodyLarge = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 16.sp, + lineHeight = 24.sp, + letterSpacing = 0.5.sp + ) + /* Other default text styles to override + titleLarge = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 22.sp, + lineHeight = 28.sp, + letterSpacing = 0.sp + ), + labelSmall = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 11.sp, + lineHeight = 16.sp, + letterSpacing = 0.5.sp + ) + */ +) \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100755 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100755 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100755 index 0000000..6f3b755 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100755 index 0000000..6f3b755 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100755 index 0000000..c209e78 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100755 index 0000000..b2dfe3d Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100755 index 0000000..4f0f1d6 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100755 index 0000000..62b611d Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100755 index 0000000..948a307 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100755 index 0000000..1b9a695 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100755 index 0000000..28d4b77 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100755 index 0000000..9287f50 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100755 index 0000000..aa7d642 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100755 index 0000000..9126ae3 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100755 index 0000000..f8c6127 --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100755 index 0000000..d6678fd --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + LetterAvatarGenerator + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml new file mode 100755 index 0000000..d75cace --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,5 @@ + + + +