Skip to content

Commit

Permalink
Merge pull request #183 from icerockdev/develop
Browse files Browse the repository at this point in the history
Release 0.1.0 dev 15
  • Loading branch information
Alex009 authored Mar 6, 2020
2 parents 01af7db + 3e27844 commit 876efdc
Show file tree
Hide file tree
Showing 74 changed files with 1,516 additions and 538 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/compilation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
- name: Cocoapods install
run: (cd sample/ios-app && pod install)
- name: Build pods-dependent and publish local
run: ./gradlew -PlibraryPublish :widgets-flat:publishToMavenLocal :widgets-bottomsheet:publishToMavenLocal :widgets-sms:publishToMavenLocal
run: ./gradlew -PlibraryPublish :widgets-flat:publishToMavenLocal :widgets-bottomsheet:publishToMavenLocal :widgets-sms:publishToMavenLocal :widgets-datetime-picker:publishToMavenLocal :widgets-collection:publishToMavenLocal
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
- name: Cocoapods install
run: (cd sample/ios-app && pod install)
- name: Build pods-dependent and publish local
run: ./gradlew -PlibraryPublish :widgets-flat:publishAllPublicationsToBintrayRepository :widgets-bottomsheet:publishAllPublicationsToBintrayRepository :widgets-sms:publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}
run: ./gradlew -PlibraryPublish :widgets-flat:publishAllPublicationsToBintrayRepository :widgets-bottomsheet:publishAllPublicationsToBintrayRepository :widgets-sms:publishAllPublicationsToBintrayRepository :widgets-datetime-picker:publishAllPublicationsToBintrayRepository :widgets-collection:publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is a Kotlin MultiPlatform library that provides declarative UI and applicat
in common code. You can implement full application for Android and iOS only from common code with it.

## Current status
Current version - `0.1.0-dev-14`. Dev version is not tested in production tasks yet, API can be changed and
Current version - `0.1.0-dev-15`. Dev version is not tested in production tasks yet, API can be changed and
bugs may be found. But dev version is chance to test limits of API and concepts to feedback and improve lib.
We open for any feedback and ideas (go to issues or #moko at [kotlinlang.slack.com](https://kotlinlang.slack.com))!

Expand Down Expand Up @@ -222,6 +222,7 @@ val loginScreen = Theme(baseTheme) {
- 0.1.0-dev-12
- 0.1.0-dev-13
- 0.1.0-dev-14
- 0.1.0-dev-15

## Installation
root build.gradle
Expand All @@ -236,7 +237,7 @@ allprojects {
project build.gradle
```groovy
dependencies {
commonMainApi("dev.icerock.moko:widgets:0.1.0-dev-14")
commonMainApi("dev.icerock.moko:widgets:0.1.0-dev-15")
}
```

Expand All @@ -254,7 +255,7 @@ buildscript {
}
dependencies {
classpath "dev.icerock.moko.widgets:gradle-plugin:0.1.0-dev-14"
classpath "dev.icerock.moko.widgets:gradle-plugin:0.1.0-dev-15"
}
}
Expand Down Expand Up @@ -370,19 +371,18 @@ Please see more examples in the [sample directory](sample).
- The [widgets directory](widgets) contains the `widgets` library;
- The [widgets-bottomsheet directory](widgets-bottomsheet) contains the `widgets-bottomsheet` library;
- The [widgets-sms directory](widgets-sms) contains the `widgets-sms` library;
- The [widgets-datetime-picker directory](widgets-datetime-picker) contains the `datetime-picker` library;
- The [widgets-collection directory](widgets-collection) contains the `collection` library;
- The [gradle-plugin directory](gradle-plugin) contains the gradle-plugin which apply compiler plugins for Native and JVM;
- The [kotlin-plugin directory](kotlin-plugin) contains the JVM compiler plugin with code-generation from @WidgetDef annotation;
- The [kotlin-native-plugin directory](kotlin-native-plugin) contains the Native compiler plugin with code-generation from @WidgetDef annotation;
- The [kotlin-common-plugin directory](kotlin-common-plugin) contains the common code of JVM and Native compiler plugins;
- The [sample directory](sample) contains sample apps for Android and iOS; plus the mpp-library connected to the apps;
- For local testing a library use:
- `./gradlew -PpluginPublish publishPluginPublicationToMavenLocal`
- `./gradlew -PlibraryPublish :widgets:publishToMavenLocal`
- `cd sample/ios-app && pod install`
- `./gradlew -PlibraryPublish :widgets-flat:publishToMavenLocal :widgets-bottomsheet:publishToMavenLocal :widgets-sms:publishToMavenLocal`
- `./publishToMavenLocal.sh`
- `cd sample/ios-app`
- `pod install`
- sample apps priority use the locally published version
- `./gradlew :sample:mpp-library:syncMultiPlatformLibraryDebugFrameworkIosX64` - compile sample shared code for iOS
- `cd sample/ios-app && pod install` - install pods with compiled shared code
- run android from `Android Studio` - module `android-app`, run iOS from xcode workspace `sample/ios-app/ios-app.xcworkspace`

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repositories {
}

dependencies {
implementation("dev.icerock:mobile-multiplatform:0.5.2")
implementation("dev.icerock:mobile-multiplatform:0.5.3")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61")
implementation("com.android.tools.build:gradle:3.5.2")
}
Expand Down
10 changes: 10 additions & 0 deletions buildSrc/src/main/kotlin/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ object Deps {
iosX64 = "dev.icerock.moko:widgets-bottomsheet-iosx64:${Versions.Libs.MultiPlatform.mokoWidgets}",
iosArm64 = "dev.icerock.moko:widgets-bottomsheet-iosarm64:${Versions.Libs.MultiPlatform.mokoWidgets}"
)
val mokoWidgetsCollection = MultiPlatformLibrary(
common = "dev.icerock.moko:widgets-collection:${Versions.Libs.MultiPlatform.mokoWidgets}",
iosX64 = "dev.icerock.moko:widgets-collection-iosx64:${Versions.Libs.MultiPlatform.mokoWidgets}",
iosArm64 = "dev.icerock.moko:widgets-collection-iosarm64:${Versions.Libs.MultiPlatform.mokoWidgets}"
)
val mokoWidgetsDateTimePicker = MultiPlatformLibrary(
common = "dev.icerock.moko:widgets-datetime-picker:${Versions.Libs.MultiPlatform.mokoWidgets}",
iosX64 = "dev.icerock.moko:widgets-datetime-picker-iosx64:${Versions.Libs.MultiPlatform.mokoWidgets}",
iosArm64 = "dev.icerock.moko:widgets-datetime-picker-iosarm64:${Versions.Libs.MultiPlatform.mokoWidgets}"
)
val mokoResources = MultiPlatformLibrary(
common = "dev.icerock.moko:resources:${Versions.Libs.MultiPlatform.mokoResources}",
iosX64 = "dev.icerock.moko:resources-iosx64:${Versions.Libs.MultiPlatform.mokoResources}",
Expand Down
20 changes: 20 additions & 0 deletions moko-widgets-collection.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Pod::Spec.new do |spec|
spec.name = 'moko-widgets-collection'
spec.version = '0.1.0'
spec.homepage = 'https://github.com/icerockdev/moko-widgets'
spec.source = { :git => "https://github.com/icerockdev/moko-widgets.git", :tag => "release/#{spec.version}" }
spec.authors = 'IceRock Development'
spec.license = { :type => 'Apache 2', :file => 'LICENSE.md' }
spec.summary = 'Swift additions to moko-widgets Kotlin/Native library'
spec.module_name = "mokoWidgetsCollection"

spec.source_files = "widgets-collection/src/iosMain/swift/**/*.{h,m,swift}"
spec.resources = "widgets-collection/src/iosMain/bundle/**/*"

spec.ios.deployment_target = '11.0'
spec.swift_version = '5.0'

spec.pod_target_xcconfig = {
'VALID_ARCHS' => '$(ARCHS_STANDARD_64_BIT)'
}
end
3 changes: 2 additions & 1 deletion publishToMavenLocal.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
./gradlew -PpluginPublish publishPluginPublicationToMavenLocal
./gradlew -PlibraryPublish :widgets:publishToMavenLocal
./gradlew -PlibraryPublish :widgets-flat:publishToMavenLocal :widgets-bottomsheet:publishToMavenLocal :widgets-sms:publishToMavenLocal
(cd sample/ios-app && pod install)
./gradlew -PlibraryPublish :widgets-flat:publishToMavenLocal :widgets-bottomsheet:publishToMavenLocal :widgets-sms:publishToMavenLocal :widgets-datetime-picker:publishToMavenLocal :widgets-collection:publishToMavenLocal
3 changes: 1 addition & 2 deletions sample/ios-app/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ target 'TestProj' do
pod 'mppLibraryIos', :path => '../mpp-library'
pod 'moko-widgets-flat', :path => '../../'
pod 'moko-widgets-bottomsheet', :path => '../../'

pod 'MultiPlatformLibraryMvvm', :git => 'https://github.com/icerockdev/moko-mvvm.git', :tag => 'release/0.4.0-dev-2'
pod 'moko-widgets-collection', :path => '../../'
end
42 changes: 7 additions & 35 deletions sample/ios-app/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,76 +1,48 @@
PODS:
- Alamofire (4.9.1)
- AlamofireImage (3.6.0):
- Alamofire (~> 4.9)
- FloatingPanel (1.7.2)
- InputMask (5.0.0)
- moko-widgets-bottomsheet (0.1.0):
- FloatingPanel
- moko-widgets-collection (0.1.0)
- moko-widgets-flat (0.1.0):
- InputMask (~> 5.0.0)
- mppLibraryIos (0.1.0)
- MultiPlatformLibrary (0.1.0)
- MultiPlatformLibraryMvvm (0.3.0):
- MultiPlatformLibrary
- MultiPlatformLibraryMvvm/AlamofireImage (= 0.3.0)
- MultiPlatformLibraryMvvm/Core (= 0.3.0)
- MultiPlatformLibraryMvvm/SkyFloatingLabelTextField (= 0.3.0)
- MultiPlatformLibraryMvvm/AlamofireImage (0.3.0):
- AlamofireImage
- MultiPlatformLibrary
- MultiPlatformLibraryMvvm/Core (0.3.0):
- MultiPlatformLibrary
- MultiPlatformLibraryMvvm/SkyFloatingLabelTextField (0.3.0):
- MultiPlatformLibrary
- SkyFloatingLabelTextField
- SkyFloatingLabelTextField (3.7.0)

DEPENDENCIES:
- moko-widgets-bottomsheet (from `../../`)
- moko-widgets-collection (from `../../`)
- moko-widgets-flat (from `../../`)
- mppLibraryIos (from `../mpp-library`)
- MultiPlatformLibrary (from `../mpp-library`)
- MultiPlatformLibraryMvvm (from `https://github.com/icerockdev/moko-mvvm.git`, tag `release/0.4.0-dev-2`)

SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
- Alamofire
- AlamofireImage
- InputMask
- SkyFloatingLabelTextField
trunk:
- FloatingPanel

EXTERNAL SOURCES:
moko-widgets-bottomsheet:
:path: "../../"
moko-widgets-collection:
:path: "../../"
moko-widgets-flat:
:path: "../../"
mppLibraryIos:
:path: "../mpp-library"
MultiPlatformLibrary:
:path: "../mpp-library"
MultiPlatformLibraryMvvm:
:git: https://github.com/icerockdev/moko-mvvm.git
:tag: release/0.4.0-dev-2

CHECKOUT OPTIONS:
MultiPlatformLibraryMvvm:
:git: https://github.com/icerockdev/moko-mvvm.git
:tag: release/0.4.0-dev-2

SPEC CHECKSUMS:
Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18
AlamofireImage: be9963c6582d68b39e89191f64c82a7d7bf40fdd
FloatingPanel: b275a35d0a09be4bd37025e710a6a1d063bfc161
InputMask: 8a10dbc8ac3f94f0a5b4c380424bbe6795c69b16
moko-widgets-bottomsheet: 68e942940b15bf0c6605675140d907fdb79db31d
moko-widgets-collection: 722c6fca0b0dcab0b54fdb674b4638d4f715434c
moko-widgets-flat: 3d68acddc0469a1288ede5b5b63b6588de5aa5e1
mppLibraryIos: 72c3984fbaa53978d678e62096fd613e67839f0c
MultiPlatformLibrary: 176fb8ade516666cd47e93de1b71ba0441a541bb
MultiPlatformLibraryMvvm: 999ac3896d8214fd65e0e0a376a2e553bf4515b3
SkyFloatingLabelTextField: 4b46db0ab1ccde0919cded29c656e6b4805eda04

PODFILE CHECKSUM: 4b3a5440fa9c919597e5ebac2ced886871ffb124
PODFILE CHECKSUM: d67011d3954d166daed6874ad60b67569d84c8b3

COCOAPODS: 1.8.4
COCOAPODS: 1.9.0
2 changes: 2 additions & 0 deletions sample/ios-app/src/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
Expand Down
8 changes: 4 additions & 4 deletions sample/mpp-library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ val deps = listOf(
Deps.Libs.MultiPlatform.mokoGraphics,
Deps.Libs.MultiPlatform.mokoWidgets,
Deps.Libs.MultiPlatform.mokoWidgetsFlat,
Deps.Libs.MultiPlatform.mokoWidgetsBottomSheet
Deps.Libs.MultiPlatform.mokoWidgetsBottomSheet,
Deps.Libs.MultiPlatform.mokoWidgetsCollection
)

setupFramework(
exports = deps
)
setupFramework(exports = emptyList())

dependencies {
mppLibrary(Deps.Libs.MultiPlatform.kotlinStdLib)
Expand All @@ -58,5 +57,6 @@ cocoaPods {

pod("moko-widgets-flat", "mokoWidgetsFlat", onlyLink = true)
pod("moko-widgets-bottomsheet", "mokoWidgetsBottomSheet", onlyLink = true)
pod("moko-widgets-collection", "mokoWidgetsCollection", onlyLink = true)
pod("mppLibraryIos")
}
66 changes: 66 additions & 0 deletions sample/mpp-library/src/commonMain/kotlin/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.icerockdev.library.AppTheme
import com.icerockdev.library.MR
import com.icerockdev.library.SharedFactory
import com.icerockdev.library.sample.PostsScreen
import com.icerockdev.library.sample.PostsViewModel
import com.icerockdev.library.universal.CartScreen
import com.icerockdev.library.universal.InfoWebViewScreen
import com.icerockdev.library.universal.LoginScreen
Expand All @@ -24,6 +26,8 @@ import dev.icerock.moko.widgets.ImageWidget
import dev.icerock.moko.widgets.InputWidget
import dev.icerock.moko.widgets.TabsWidget
import dev.icerock.moko.widgets.button
import dev.icerock.moko.widgets.collection.CollectionWidget
import dev.icerock.moko.widgets.collection.SimpleCollectionViewFactory
import dev.icerock.moko.widgets.container
import dev.icerock.moko.widgets.core.Theme
import dev.icerock.moko.widgets.core.Value
Expand All @@ -36,6 +40,8 @@ import dev.icerock.moko.widgets.factory.SystemInputViewFactory
import dev.icerock.moko.widgets.factory.SystemTabsViewFactory
import dev.icerock.moko.widgets.factory.SystemTextViewFactory
import dev.icerock.moko.widgets.flat.FlatInputViewFactory
import dev.icerock.moko.widgets.sample.CollectionImageUnitItem
import dev.icerock.moko.widgets.sample.CollectionScreen
import dev.icerock.moko.widgets.sample.InputWidgetGalleryScreen
import dev.icerock.moko.widgets.sample.ProductsSearchScreen
import dev.icerock.moko.widgets.sample.ScrollContentScreen
Expand All @@ -45,6 +51,7 @@ import dev.icerock.moko.widgets.screen.Args
import dev.icerock.moko.widgets.screen.BaseApplication
import dev.icerock.moko.widgets.screen.Screen
import dev.icerock.moko.widgets.screen.ScreenDesc
import dev.icerock.moko.widgets.screen.TemplateScreen
import dev.icerock.moko.widgets.screen.TypedScreenDesc
import dev.icerock.moko.widgets.screen.WidgetScreen
import dev.icerock.moko.widgets.screen.navigation.BottomNavigationItem
Expand All @@ -60,6 +67,7 @@ import dev.icerock.moko.widgets.screen.navigation.createRouter
import dev.icerock.moko.widgets.screen.navigation.route
import dev.icerock.moko.widgets.style.background.Background
import dev.icerock.moko.widgets.style.background.Fill
import dev.icerock.moko.widgets.style.background.Orientation
import dev.icerock.moko.widgets.style.state.PressableState
import dev.icerock.moko.widgets.style.state.SelectableState
import dev.icerock.moko.widgets.style.view.MarginValues
Expand Down Expand Up @@ -108,6 +116,8 @@ class App() : BaseApplication() {
buildInputGalleryRouteInfo(theme, router),
buildSearchRouteInfo(theme, router),
buildTabsRouteInfo(theme, router),
buildCollectionRouteInfo(theme, router),
buildPostsRouteInfo(theme, router),
SelectGalleryScreen.RouteInfo(
name = "Old Demo".desc(),
route = router.createPushRoute(oldDemo(router))
Expand Down Expand Up @@ -177,6 +187,53 @@ class App() : BaseApplication() {
)
}

private fun buildCollectionRouteInfo(
theme: Theme,
router: NavigationScreen.Router
): SelectGalleryScreen.RouteInfo {
val collectionTheme = Theme(theme) {
factory[CollectionWidget.DefaultCategory] = SimpleCollectionViewFactory(
orientation = Orientation.HORIZONTAL,
margins = MarginValues(top = 16f, bottom = 16f)
)
factory[CollectionImageUnitItem.Id.Image] = SystemImageViewFactory(
cornerRadius = 8f,
margins = MarginValues(start = 4f, end = 4f)
)
}
val collectionScreen = registerScreen(CollectionScreen::class) {
CollectionScreen(collectionTheme)
}

return SelectGalleryScreen.RouteInfo(
name = "Collection in list".desc(),
route = router.createPushRoute(collectionScreen)
)
}

private fun buildPostsRouteInfo(
theme: Theme,
router: NavigationScreen.Router
): SelectGalleryScreen.RouteInfo {
val postsTheme = Theme(theme) {
factory[PostsScreen.Id.Collection] = SimpleCollectionViewFactory(
padding = PaddingValues(4f)
)
}

val postsScreen = registerScreen(PostsScreen::class) {
PostsScreen(
postsTheme,
PostsViewModel()
)
}

return SelectGalleryScreen.RouteInfo(
name = "Posts Collection".desc(),
route = router.createPushRoute(postsScreen)
)
}

private fun oldDemo(
router: NavigationScreen.Router
): TypedScreenDesc<Args.Empty, LoginScreen> {
Expand Down Expand Up @@ -230,6 +287,10 @@ class App() : BaseApplication() {
val mainScreen = registerScreen(MainBottomNavigationScreen::class) {
val bottomRouter = createRouter()

val templateScreen = registerScreen(TemplateScreen::class) {
TemplateScreen(navTitle = "Template".desc(), labelText = "Template Screen".desc(), theme = theme)
}

val cartNavigation = registerScreen(CartNavigationScreen::class) {
val navigationRouter = createRouter()
val profileScreen = registerScreen(PlatformProfileScreen::class) {
Expand Down Expand Up @@ -306,6 +367,11 @@ class App() : BaseApplication() {
title = "Logout".desc(),
screenDesc = logoutScreen
)
tab(
id = 5,
title = "Empty".desc(),
screenDesc = templateScreen
)
}
}

Expand Down
Loading

0 comments on commit 876efdc

Please sign in to comment.