Skip to content

Commit

Permalink
Showkase integration
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvavra committed Dec 22, 2021
1 parent 5326cc6 commit b398592
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 5 deletions.
3 changes: 3 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
}

android {
Expand Down Expand Up @@ -58,6 +59,8 @@ dependencies {
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
implementation 'androidx.activity:activity-compose:1.3.1'
implementation "com.airbnb.android:showkase:1.0.0-beta08"
kapt "com.airbnb.android:showkase-processor:1.0.0-beta08"
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/java/me/vavra/showkase/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Button
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.airbnb.android.showkase.models.Showkase
import me.vavra.feature.FeatureGreeting
import me.vavra.feature.theme.ShowkaseTheme

Expand All @@ -28,6 +32,10 @@ class MainActivity : ComponentActivity() {
) {
AppGreeting()
FeatureGreeting()
Spacer(modifier = Modifier.height(24.dp))
Button(onClick = { startActivity(Showkase.getBrowserIntent(this@MainActivity)) }) {
Text("Showkase browser")
}
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/me/vavra/showkase/ShowkaseRoot.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package me.vavra.showkase

import com.airbnb.android.showkase.annotation.ShowkaseRoot
import com.airbnb.android.showkase.annotation.ShowkaseRootModule

@ShowkaseRoot
class ShowkaseRoot: ShowkaseRootModule
3 changes: 3 additions & 0 deletions feature/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'kotlin-kapt'
}

android {
Expand Down Expand Up @@ -47,6 +48,8 @@ dependencies {
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation "com.airbnb.android:showkase:1.0.0-beta08"
kapt "com.airbnb.android:showkase-processor:1.0.0-beta08"
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
Expand Down
5 changes: 5 additions & 0 deletions feature/src/main/java/me/vavra/feature/theme/Color.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
package me.vavra.feature.theme

import androidx.compose.ui.graphics.Color
import com.airbnb.android.showkase.annotation.ShowkaseColor

@ShowkaseColor(group = "Material Design")
val Purple200 = Color(0xFFBB86FC)
@ShowkaseColor(group = "Material Design")
val Purple500 = Color(0xFF6200EE)
@ShowkaseColor(group = "Material Design")
val Purple700 = Color(0xFF3700B3)
@ShowkaseColor(group = "Material Design")
val Teal200 = Color(0xFF03DAC5)
14 changes: 9 additions & 5 deletions feature/src/main/java/me/vavra/feature/theme/Type.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ 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
import com.airbnb.android.showkase.annotation.ShowkaseTypography

@ShowkaseTypography(group = "Material Design")
val body1 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 16.sp
)

// Set of Material typography styles to start with
val Typography = Typography(
body1 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 16.sp
)
body1 = body1
/* Other default text styles to override
button = TextStyle(
fontFamily = FontFamily.Default,
Expand Down

0 comments on commit b398592

Please sign in to comment.