Skip to content

Commit 3e137aa

Browse files
author
Ankit Kumar
committed
fontawesome lib added,
configured for release through jitpack
1 parent 3a49bf2 commit 3e137aa

File tree

14 files changed

+6568
-25
lines changed

14 files changed

+6568
-25
lines changed

.idea/gradle.xml

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

.idea/vcs.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.

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ dependencies {
5757
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
5858
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
5959
implementation 'androidx.activity:activity-compose:1.4.0'
60+
implementation project(path: ':font_awesome')
6061
testImplementation 'junit:junit:4.+'
6162
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
6263
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

app/src/main/java/lazycoder21/droid/fontawesome/MainActivity.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,20 @@ import androidx.compose.material.Surface
88
import androidx.compose.material.Text
99
import androidx.compose.runtime.Composable
1010
import androidx.compose.ui.tooling.preview.Preview
11+
import lazycoder21.droid.compose.FaIconType
12+
import lazycoder21.droid.compose.FaIcons
13+
import lazycoder21.droid.compose.FontAwesomeIcon
1114
import lazycoder21.droid.fontawesome.ui.theme.FontAwesomeComposeTheme
1215

1316
class MainActivity : ComponentActivity() {
1417
override fun onCreate(savedInstanceState: Bundle?) {
1518
super.onCreate(savedInstanceState)
1619
setContent {
1720
FontAwesomeComposeTheme {
18-
// A surface container using the 'background' color from the theme
1921
Surface(color = MaterialTheme.colors.background) {
20-
Greeting("Android")
22+
FontAwesomeIcon(
23+
faIconType = FaIcons.AddressBook
24+
)
2125
}
2226
}
2327
}

build.gradle

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
33
ext {
4-
compose_version = '1.0.1'
4+
compose_version = '1.1.1'
55
}
66
repositories {
77
google()
88
mavenCentral()
99
}
1010
dependencies {
11-
classpath "com.android.tools.build:gradle:7.0.2"
11+
classpath "com.android.tools.build:gradle:7.0.4"
1212
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'
13-
14-
// NOTE: Do not place your application dependencies here; they belong
15-
// in the individual module build.gradle files
1613
}
1714
}
1815

font_awesome/build.gradle

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'com.android.library'
33
id 'kotlin-android'
4+
id 'maven-publish'
45
}
56

67
android {
@@ -9,34 +10,39 @@ android {
910
defaultConfig {
1011
minSdk 21
1112
targetSdk 32
12-
versionCode 1
13-
versionName "1.0"
14-
15-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16-
consumerProguardFiles "consumer-rules.pro"
1713
}
1814

19-
buildTypes {
20-
release {
21-
minifyEnabled false
22-
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23-
}
24-
}
2515
compileOptions {
2616
sourceCompatibility JavaVersion.VERSION_1_8
2717
targetCompatibility JavaVersion.VERSION_1_8
2818
}
19+
composeOptions {
20+
kotlinCompilerExtensionVersion compose_version
21+
}
2922
kotlinOptions {
3023
jvmTarget = '1.8'
24+
useIR = true
25+
}
26+
buildFeatures {
27+
compose true
3128
}
3229
}
3330

3431
dependencies {
32+
implementation "androidx.compose.ui:ui:$compose_version"
33+
implementation "androidx.compose.ui:ui-tooling:$compose_version"
34+
implementation "androidx.compose.foundation:foundation:$compose_version"
35+
}
3536

36-
implementation 'androidx.core:core-ktx:1.7.0'
37-
implementation 'androidx.appcompat:appcompat:1.4.1'
38-
implementation 'com.google.android.material:material:1.6.0'
39-
testImplementation 'junit:junit:4.+'
40-
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
41-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
37+
afterEvaluate {
38+
publishing {
39+
publications {
40+
release(MavenPublication) {
41+
from components.release
42+
groupId = 'lazycoder21.droid.compose'
43+
artifactId = 'fontawesome'
44+
version = '1.0.0'
45+
}
46+
}
47+
}
4248
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="lazycoder21.droid.font_awesome">
3+
package="lazycoder21.droid.compose">
44

55
</manifest>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package lazycoder21.droid.compose
2+
3+
sealed class FaIconType(val src: Int) {
4+
data class Solid(private val icon: Int) : FaIconType(icon)
5+
data class Regular(private val icon: Int) : FaIconType(icon)
6+
data class Brand(private val icon: Int) : FaIconType(icon)
7+
}

0 commit comments

Comments
 (0)