-
Notifications
You must be signed in to change notification settings - Fork 24
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
support multi-platform #4
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5f52953
support multiple platforms
HuixingWong f9c540e
clean
HuixingWong edf75d4
add desktop sample
HuixingWong 7492cf4
Merge pull request #1 from HuixingWong/Multiple_platforms
HuixingWong c260f8f
rename
HuixingWong fbbe037
fix 'Multiply' mode not work on desktop (it seems no need alpha chann…
HuixingWong 4da35c2
Merge pull request #2 from HuixingWong/Multiple_platforms
HuixingWong d0d93ba
resolve changes
HuixingWong 46af455
Merge branch 'main' into pr/4
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
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") | ||
implementation("com.google.android.material:material: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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
color-picker/src/main/AndroidManifest.xml → ...icker/src/androidMain/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly thinking out loud here, but I'm wondering if there isn't a way to only use this dependency only if its the Desktop version, and if that makes sense to do. I think all we need it for is color conversions to and from HSV right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's true that we can rely on this only on the desktop, but there are a lot of color conversion tools in this library, and since I don't know so much about color things , it might be useful to keep it if you want to expand other functions for this library in the future, What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me give it a bit more thinking and chat with the rest of the GoDaddy Studio Android Team about it tomorrow.
Otherwise, the PR looks good and it is now working for me on Desktop. I'll revert back tomorrow 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright I think we are good to go with this library 💯 Thanks so much for the contribution, merging it now.