Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple platforms #1

Merged
merged 3 commits into from
Nov 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions app/build.gradle

This file was deleted.

38 changes: 38 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

plugins {
id("org.jetbrains.compose") version "1.0.0-beta5"
id("com.android.application")
kotlin("android")
}

group = "com.godaddy"
version = "1.0"


dependencies {
implementation(project(":color-picker"))
implementation ("androidx.activity:activity-compose:1.4.0")
}

android {
compileSdkVersion(31)
defaultConfig {
applicationId = "com.godaddy.android.colorpicker"
minSdkVersion(21)
targetSdkVersion(31)
versionCode = 1
versionName = "1.0"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
packagingOptions {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
}
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.ComposeColorPicker">
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<activity
android:name=".SampleColorPickerActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.ComposeColorPicker.NoActionBar">
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ExperimentalGraphicsApi
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.godaddy.android.colorpicker.theme.ComposeColorPickerTheme

Expand Down Expand Up @@ -87,7 +86,6 @@ fun ColorPreviewInfo(currentColor: Color) {


@ExperimentalGraphicsApi
@Preview(showBackground = true)
@Composable
fun DefaultPreview() {
ComposeColorPickerTheme {
Expand All @@ -102,7 +100,6 @@ fun DefaultPreview() {
}

@ExperimentalGraphicsApi
@Preview(showBackground = true)
@Composable
fun NoAlphaBarPreview() {
ComposeColorPickerTheme {
Expand Down
16 changes: 0 additions & 16 deletions app/src/main/res/values-night/themes.xml

This file was deleted.

25 changes: 0 additions & 25 deletions app/src/main/res/values/themes.xml

This file was deleted.

19 changes: 0 additions & 19 deletions build.gradle

This file was deleted.

25 changes: 25 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31")
classpath("com.android.tools.build:gradle:4.1.3")
classpath("com.vanniktech:gradle-maven-publish-plugin:0.18.0")
}
}

group = "com.godaddy"
version = "1.0"

allprojects {
repositories {
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
}
61 changes: 0 additions & 61 deletions color-picker/build.gradle

This file was deleted.

66 changes: 66 additions & 0 deletions color-picker/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import org.jetbrains.compose.compose

plugins {
kotlin("multiplatform")
id("org.jetbrains.compose") version "1.0.0-beta5"
id("com.android.library")
id("kotlin-android-extensions")
id("com.vanniktech.maven.publish")
}

group = "com.godaddy"
version = "1.0"

kotlin {
android()
jvm("desktop") {
compilations.all {
kotlinOptions.jvmTarget = "11"
}
}
sourceSets {
val commonMain by getting {
dependencies {
api(compose.runtime)
api(compose.foundation)
api(compose.material)
implementation("com.github.ajalt.colormath:colormath:3.1.1")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val androidMain by getting {
dependencies {
api("androidx.appcompat:appcompat:1.3.1")
api("androidx.core:core-ktx:1.6.0")
}
}
val androidTest by getting {
dependencies {
implementation("junit:junit:4.13.2")
}
}
val desktopMain by getting {
dependencies {
api(compose.preview)
}
}
val desktopTest by getting
}
}

android {
compileSdkVersion(31)
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdkVersion(21)
targetSdkVersion(31)
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.godaddy.android.colorpicker">
package="com.godaddy.common.colorpicker">

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fun ClassicColorPicker(
showAlphaBar: Boolean = true,
onColorChanged: (HsvColor) -> Unit
) {
val colorPickerValueState = rememberSaveable {
val colorPickerValueState = rememberSaveable(stateSaver = HsvColor.Saver) {
mutableStateOf(HsvColor.from(color))
}
Row(modifier = modifier) {
Expand Down
Loading