├── ktor
├── app
│ ├── .gitignore
│ ├── src
│ │ └── main
│ │ │ ├── ic_launcher-playstore.png
│ │ │ ├── res
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── values
│ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── drawable
│ │ │ │ ├── ic_plus.xml
│ │ │ │ ├── ic_check.xml
│ │ │ │ ├── ic_delete.xml
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── layout
│ │ │ │ ├── view_item_book.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ └── activity_book.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── ykanivets
│ │ │ │ └── emojibooks
│ │ │ │ ├── SplashActivity.kt
│ │ │ │ ├── BookAdapter.kt
│ │ │ │ ├── MainActivity.kt
│ │ │ │ └── BookActivity.kt
│ │ │ └── AndroidManifest.xml
│ ├── proguard-rules.pro
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── settings.gradle
├── .gitignore
├── common
│ ├── src
│ │ └── commonMain
│ │ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── ykanivets
│ │ │ │ └── emojibooks
│ │ │ │ ├── BookBody.kt
│ │ │ │ ├── Book.kt
│ │ │ │ ├── BookRepository.kt
│ │ │ │ └── HttpClientFactory.kt
│ │ │ └── sqldelight
│ │ │ └── com
│ │ │ └── ykanivets
│ │ │ └── emojibooks
│ │ │ └── Book.sq
│ └── build.gradle
├── build.gradle
├── gradle.properties
└── gradlew.bat
├── realm
├── app
│ ├── .gitignore
│ ├── src
│ │ └── main
│ │ │ ├── ic_launcher-playstore.png
│ │ │ ├── res
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── values
│ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── drawable
│ │ │ │ ├── ic_plus.xml
│ │ │ │ ├── ic_check.xml
│ │ │ │ ├── ic_delete.xml
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── layout
│ │ │ │ ├── view_item_book.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ └── activity_book.xml
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ └── com
│ │ │ └── ykanivets
│ │ │ └── emojibooks
│ │ │ ├── RealmMigration.kt
│ │ │ ├── BookAdapter.kt
│ │ │ ├── MainActivity.kt
│ │ │ └── BookActivity.kt
│ ├── proguard-rules.pro
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── .gitignore
├── settings.gradle
├── common
│ ├── src
│ │ └── commonMain
│ │ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── ykanivets
│ │ │ │ └── emojibooks
│ │ │ │ ├── Book.kt
│ │ │ │ └── BookRepository.kt
│ │ │ └── sqldelight
│ │ │ └── com
│ │ │ └── ykanivets
│ │ │ └── emojibooks
│ │ │ └── Book.sq
│ └── build.gradle
├── build.gradle
├── gradle.properties
└── gradlew.bat
├── room
├── app
│ ├── .gitignore
│ ├── src
│ │ └── main
│ │ │ ├── ic_launcher-playstore.png
│ │ │ ├── res
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── values
│ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── drawable
│ │ │ │ ├── ic_plus.xml
│ │ │ │ ├── ic_check.xml
│ │ │ │ ├── ic_delete.xml
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── layout
│ │ │ │ ├── view_item_book.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ └── activity_book.xml
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ └── com
│ │ │ └── ykanivets
│ │ │ └── emojibooks
│ │ │ ├── BookAdapter.kt
│ │ │ ├── MainActivity.kt
│ │ │ └── BookActivity.kt
│ ├── proguard-rules.pro
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── .gitignore
├── settings.gradle
├── common
│ ├── src
│ │ └── commonMain
│ │ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── ykanivets
│ │ │ │ └── emojibooks
│ │ │ │ ├── Book.kt
│ │ │ │ └── BookRepository.kt
│ │ │ └── sqldelight
│ │ │ └── com
│ │ │ └── ykanivets
│ │ │ └── emojibooks
│ │ │ └── Book.sq
│ └── build.gradle
├── build.gradle
├── gradle.properties
└── gradlew.bat
├── sample
├── app
│ ├── .gitignore
│ ├── src
│ │ └── main
│ │ │ ├── ic_launcher-playstore.png
│ │ │ ├── res
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── values
│ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── drawable
│ │ │ │ ├── ic_plus.xml
│ │ │ │ ├── ic_check.xml
│ │ │ │ ├── ic_delete.xml
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── layout
│ │ │ │ ├── view_item_book.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ └── activity_book.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── ykanivets
│ │ │ │ └── emojibooks
│ │ │ │ ├── Book.kt
│ │ │ │ ├── BookRepository.kt
│ │ │ │ ├── BookAdapter.kt
│ │ │ │ ├── MainActivity.kt
│ │ │ │ └── BookActivity.kt
│ │ │ └── AndroidManifest.xml
│ ├── proguard-rules.pro
│ └── build.gradle
├── settings.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── .gitignore
├── build.gradle
├── gradle.properties
└── gradlew.bat
├── sqlite
├── app
│ ├── .gitignore
│ ├── src
│ │ └── main
│ │ │ ├── ic_launcher-playstore.png
│ │ │ ├── res
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── values
│ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── drawable
│ │ │ │ ├── ic_plus.xml
│ │ │ │ ├── ic_check.xml
│ │ │ │ ├── ic_delete.xml
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── layout
│ │ │ │ ├── view_item_book.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ └── activity_book.xml
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ └── com
│ │ │ └── ykanivets
│ │ │ └── emojibooks
│ │ │ ├── BookAdapter.kt
│ │ │ └── MainActivity.kt
│ ├── proguard-rules.pro
│ └── build.gradle
├── .DS_Store
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── settings.gradle
├── .gitignore
├── common
│ ├── src
│ │ └── commonMain
│ │ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── ykanivets
│ │ │ │ └── emojibooks
│ │ │ │ ├── Book.kt
│ │ │ │ └── BookRepository.kt
│ │ │ └── sqldelight
│ │ │ └── com
│ │ │ └── ykanivets
│ │ │ └── emojibooks
│ │ │ └── Book.sq
│ └── build.gradle
├── build.gradle
├── gradle.properties
└── gradlew.bat
├── README.md
└── .DS_Store
/ktor/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/realm/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/room/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/sample/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/sqlite/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # emoji_books
2 | Demo application for Droidcon EMEA 2020
3 |
--------------------------------------------------------------------------------
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/.DS_Store
--------------------------------------------------------------------------------
/sample/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name = "Emoji Books"
3 |
--------------------------------------------------------------------------------
/sqlite/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sqlite/.DS_Store
--------------------------------------------------------------------------------
/ktor/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/ktor/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/realm/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/realm/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/room/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/room/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/sample/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sample/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/sqlite/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sqlite/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/ktor/app/src/main/ic_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/ktor/app/src/main/ic_launcher-playstore.png
--------------------------------------------------------------------------------
/realm/app/src/main/ic_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/realm/app/src/main/ic_launcher-playstore.png
--------------------------------------------------------------------------------
/room/app/src/main/ic_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/room/app/src/main/ic_launcher-playstore.png
--------------------------------------------------------------------------------
/ktor/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = "Emoji Books"
2 |
3 | include 'app'
4 | include 'common'
5 |
6 | enableFeaturePreview('GRADLE_METADATA')
7 |
--------------------------------------------------------------------------------
/realm/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | local.properties
4 | .idea/
5 | .DS_Store
6 | build/
7 | captures/
8 | .externalNativeBuild
9 | .cxx
10 |
--------------------------------------------------------------------------------
/realm/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = "Emoji Books"
2 |
3 | include 'app'
4 | include 'common'
5 |
6 | enableFeaturePreview('GRADLE_METADATA')
7 |
--------------------------------------------------------------------------------
/room/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | local.properties
4 | .idea/
5 | .DS_Store
6 | build/
7 | captures/
8 | .externalNativeBuild
9 | .cxx
10 |
--------------------------------------------------------------------------------
/room/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = "Emoji Books"
2 |
3 | include 'app'
4 | include 'common'
5 |
6 | enableFeaturePreview('GRADLE_METADATA')
7 |
--------------------------------------------------------------------------------
/sample/app/src/main/ic_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sample/app/src/main/ic_launcher-playstore.png
--------------------------------------------------------------------------------
/sqlite/app/src/main/ic_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sqlite/app/src/main/ic_launcher-playstore.png
--------------------------------------------------------------------------------
/sqlite/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = "Emoji Books"
2 |
3 | include 'app'
4 | include 'common'
5 |
6 | enableFeaturePreview('GRADLE_METADATA')
7 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/ktor/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ktor/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/ktor/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/room/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/room/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/room/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/room/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | local.properties
4 | .idea/
5 | .DS_Store
6 | build/
7 | captures/
8 | .externalNativeBuild
9 | .cxx
10 |
--------------------------------------------------------------------------------
/sqlite/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | local.properties
4 | .idea/
5 | .DS_Store
6 | build/
7 | captures/
8 | .externalNativeBuild
9 | .cxx
10 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/ktor/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ktor/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/ktor/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/realm/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/realm/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/realm/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/realm/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/realm/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/realm/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/room/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/room/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/room/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/room/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sample/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sample/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sqlite/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sqlite/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ktor/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/ktor/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/realm/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/realm/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/realm/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/realm/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/room/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/room/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sample/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sqlite/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sqlite/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sqlite/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ktor/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/ktor/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ktor/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/ktor/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ktor/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/ktor/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/realm/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/realm/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/realm/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/realm/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/room/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/room/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/room/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/room/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/room/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/room/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ktor/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | local.properties
4 | .idea/
5 | .DS_Store
6 | build/
7 | captures/
8 | .externalNativeBuild
9 | .cxx
10 | google-services.json
11 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/ktor/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ktor/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/ktor/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/realm/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/realm/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/realm/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/realm/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/realm/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/realm/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/room/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/room/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/room/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/room/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sqlite/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sqlite/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sqlite/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sqlite/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yev-kanivets/emoji_books/HEAD/sqlite/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ktor/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #9D87FF
4 |
--------------------------------------------------------------------------------
/realm/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #9D87FF
4 |
--------------------------------------------------------------------------------
/room/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #9D87FF
4 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #9D87FF
4 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #9D87FF
4 |
--------------------------------------------------------------------------------
/sample/app/src/main/java/com/ykanivets/emojibooks/Book.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | data class Book(
4 | val id: Long?,
5 | val emoji: String,
6 | val title: String,
7 | val author: String
8 | )
9 |
--------------------------------------------------------------------------------
/realm/common/src/commonMain/kotlin/com/ykanivets/emojibooks/Book.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | data class Book(
4 | val id: Long?,
5 | val emoji: String,
6 | val title: String,
7 | val author: String
8 | )
9 |
--------------------------------------------------------------------------------
/room/common/src/commonMain/kotlin/com/ykanivets/emojibooks/Book.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | data class Book(
4 | val id: Long?,
5 | val emoji: String,
6 | val title: String,
7 | val author: String
8 | )
9 |
--------------------------------------------------------------------------------
/sqlite/common/src/commonMain/kotlin/com/ykanivets/emojibooks/Book.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | data class Book(
4 | val id: Long?,
5 | val emoji: String,
6 | val title: String,
7 | val author: String
8 | )
9 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #9d87ff
4 | #8a80ff
5 | #0ce8ce
6 |
7 |
--------------------------------------------------------------------------------
/realm/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #9d87ff
4 | #8a80ff
5 | #0ce8ce
6 |
7 |
--------------------------------------------------------------------------------
/room/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #9d87ff
4 | #8a80ff
5 | #0ce8ce
6 |
7 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #9d87ff
4 | #8a80ff
5 | #0ce8ce
6 |
7 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #9d87ff
4 | #8a80ff
5 | #0ce8ce
6 |
7 |
--------------------------------------------------------------------------------
/ktor/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Sep 13 21:44:40 EEST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/realm/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Sep 13 21:44:40 EEST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/room/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Sep 13 21:44:40 EEST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/ktor/common/src/commonMain/kotlin/com/ykanivets/emojibooks/BookBody.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import kotlinx.serialization.Serializable
4 |
5 | @Serializable
6 | data class BookBody(
7 | val emoji: String,
8 | val title: String,
9 | val author: String
10 | )
11 |
--------------------------------------------------------------------------------
/sample/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Sep 13 21:44:40 EEST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/sqlite/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Sep 13 21:44:40 EEST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/ktor/common/src/commonMain/kotlin/com/ykanivets/emojibooks/Book.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import kotlinx.serialization.Serializable
4 |
5 | @Serializable
6 | data class Book(
7 | val id: String,
8 | val emoji: String,
9 | val title: String,
10 | val author: String
11 | )
12 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/room/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/realm/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/realm/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/room/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/drawable/ic_plus.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/realm/app/src/main/res/drawable/ic_plus.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/room/app/src/main/res/drawable/ic_plus.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/drawable/ic_plus.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/drawable/ic_plus.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/drawable/ic_check.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/realm/app/src/main/res/drawable/ic_check.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/room/app/src/main/res/drawable/ic_check.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/drawable/ic_check.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/drawable/ic_check.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/drawable/ic_delete.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/realm/app/src/main/res/drawable/ic_delete.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/room/app/src/main/res/drawable/ic_delete.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/drawable/ic_delete.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/drawable/ic_delete.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/ktor/common/src/commonMain/sqldelight/com/ykanivets/emojibooks/Book.sq:
--------------------------------------------------------------------------------
1 | CREATE TABLE DbBook (
2 | id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
3 | emoji TEXT NOT NULL,
4 | title TEXT NOT NULL,
5 | author TEXT NOT NULL
6 | );
7 |
8 | getAll:
9 | SELECT * FROM DbBook;
10 |
11 | add:
12 | INSERT OR REPLACE INTO DbBook(emoji, title, author) VALUES(?,?,?);
13 |
14 | update:
15 | INSERT OR REPLACE INTO DbBook(id, emoji, title, author) VALUES(?,?,?,?);
16 |
17 | delete:
18 | DELETE FROM DbBook WHERE id = ?;
19 |
--------------------------------------------------------------------------------
/realm/common/src/commonMain/sqldelight/com/ykanivets/emojibooks/Book.sq:
--------------------------------------------------------------------------------
1 | CREATE TABLE DbBook (
2 | id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
3 | emoji TEXT NOT NULL,
4 | title TEXT NOT NULL,
5 | author TEXT NOT NULL
6 | );
7 |
8 | getAll:
9 | SELECT * FROM DbBook;
10 |
11 | add:
12 | INSERT OR REPLACE INTO DbBook(emoji, title, author) VALUES(?,?,?);
13 |
14 | update:
15 | INSERT OR REPLACE INTO DbBook(id, emoji, title, author) VALUES(?,?,?,?);
16 |
17 | delete:
18 | DELETE FROM DbBook WHERE id = ?;
19 |
--------------------------------------------------------------------------------
/room/common/src/commonMain/sqldelight/com/ykanivets/emojibooks/Book.sq:
--------------------------------------------------------------------------------
1 | CREATE TABLE DbBook (
2 | id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
3 | emoji TEXT NOT NULL,
4 | title TEXT NOT NULL,
5 | author TEXT NOT NULL
6 | );
7 |
8 | getAll:
9 | SELECT * FROM DbBook;
10 |
11 | add:
12 | INSERT OR REPLACE INTO DbBook(emoji, title, author) VALUES(?,?,?);
13 |
14 | update:
15 | INSERT OR REPLACE INTO DbBook(id, emoji, title, author) VALUES(?,?,?,?);
16 |
17 | delete:
18 | DELETE FROM DbBook WHERE id = ?;
19 |
--------------------------------------------------------------------------------
/sqlite/common/src/commonMain/sqldelight/com/ykanivets/emojibooks/Book.sq:
--------------------------------------------------------------------------------
1 | CREATE TABLE DbBook (
2 | id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
3 | emoji TEXT NOT NULL,
4 | title TEXT NOT NULL,
5 | author TEXT NOT NULL
6 | );
7 |
8 | getAll:
9 | SELECT * FROM DbBook;
10 |
11 | add:
12 | INSERT OR REPLACE INTO DbBook(emoji, title, author) VALUES(?,?,?);
13 |
14 | update:
15 | INSERT OR REPLACE INTO DbBook(id, emoji, title, author) VALUES(?,?,?,?);
16 |
17 | delete:
18 | DELETE FROM DbBook WHERE id = ?;
19 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Emoji Books
3 | Emoji
4 | Title
5 | Author
6 | Add book
7 | Update book
8 | Can\'t be empty
9 | Add
10 | Done
11 | Delete
12 |
13 |
--------------------------------------------------------------------------------
/realm/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Emoji Books
3 | Emoji
4 | Title
5 | Author
6 | Add book
7 | Update book
8 | Can\'t be empty
9 | Add
10 | Done
11 | Delete
12 |
13 |
--------------------------------------------------------------------------------
/room/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Emoji Books
3 | Emoji
4 | Title
5 | Author
6 | Add book
7 | Update book
8 | Can\'t be empty
9 | Add
10 | Done
11 | Delete
12 |
13 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Emoji Books
3 | Emoji
4 | Title
5 | Author
6 | Add book
7 | Update book
8 | Can\'t be empty
9 | Add
10 | Done
11 | Delete
12 |
13 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Emoji Books
3 | Emoji
4 | Title
5 | Author
6 | Add book
7 | Update book
8 | Can\'t be empty
9 | Add
10 | Done
11 | Delete
12 |
13 |
--------------------------------------------------------------------------------
/sample/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | ext.kotlin_version = "1.4.0"
4 | repositories {
5 | google()
6 | jcenter()
7 | }
8 | dependencies {
9 | classpath "com.android.tools.build:gradle:4.0.1"
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | google()
20 | jcenter()
21 | }
22 | }
23 |
24 | task clean(type: Delete) {
25 | delete rootProject.buildDir
26 | }
27 |
--------------------------------------------------------------------------------
/sample/app/src/main/java/com/ykanivets/emojibooks/BookRepository.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | class BookRepository {
4 |
5 | private val books = mutableListOf(
6 | Book(0, "\uD83D\uDE31", "The Shining", "Stephen King")
7 | )
8 |
9 | fun getAll(): List = books
10 |
11 | fun add(book: Book): Boolean {
12 | return books.add(book.copy(id = books.size.toLong()))
13 | }
14 |
15 | fun update(book: Book): Boolean {
16 | val index = books.indexOfFirst { it.id == book.id }.takeUnless { it == -1 } ?: return false
17 | books[index] = book
18 | return true
19 | }
20 |
21 | fun delete(book: Book): Boolean {
22 | return books.remove(book)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/room/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | ext.kotlin_version = "1.4.0"
4 | ext.sqlDelight_version = '1.4.0'
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath "com.android.tools.build:gradle:4.0.1"
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 | classpath "com.squareup.sqldelight:gradle-plugin:$sqlDelight_version"
13 |
14 | // NOTE: Do not place your application dependencies here; they belong
15 | // in the individual module build.gradle files
16 | }
17 | }
18 |
19 | allprojects {
20 | repositories {
21 | google()
22 | jcenter()
23 | }
24 | }
25 |
26 | task clean(type: Delete) {
27 | delete rootProject.buildDir
28 | }
29 |
--------------------------------------------------------------------------------
/sqlite/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | ext.kotlin_version = "1.4.0"
4 | ext.sqlDelight_version = '1.4.0'
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath "com.android.tools.build:gradle:4.0.1"
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 | classpath "com.squareup.sqldelight:gradle-plugin:$sqlDelight_version"
13 |
14 | // NOTE: Do not place your application dependencies here; they belong
15 | // in the individual module build.gradle files
16 | }
17 | }
18 |
19 | allprojects {
20 | repositories {
21 | google()
22 | jcenter()
23 | }
24 | }
25 |
26 | task clean(type: Delete) {
27 | delete rootProject.buildDir
28 | }
29 |
--------------------------------------------------------------------------------
/ktor/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/realm/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/room/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/sample/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/sqlite/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/ktor/common/src/commonMain/kotlin/com/ykanivets/emojibooks/BookRepository.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import io.ktor.client.request.*
4 |
5 | class BookRepository(token: String) {
6 |
7 | private val httpClient = HttpClientFactory().create(token)
8 |
9 | suspend fun getAll(): List = httpClient.get(path = "books")
10 |
11 | suspend fun add(book: BookBody): List = httpClient.post(path = "books") {
12 | body = book
13 | }
14 |
15 | suspend fun update(book: Book): List = httpClient.put(path = "books/${book.id}") {
16 | body = book.toBookBody()
17 | }
18 |
19 | suspend fun delete(book: Book): List = httpClient.delete(path = "books/${book.id}")
20 |
21 | private fun Book.toBookBody() = BookBody(
22 | emoji = emoji,
23 | title = title,
24 | author = author
25 | )
26 | }
27 |
--------------------------------------------------------------------------------
/realm/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | ext.kotlin_version = "1.4.0"
4 | ext.sqlDelight_version = '1.4.0'
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath "com.android.tools.build:gradle:4.0.1"
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 | classpath "io.realm:realm-gradle-plugin:6.1.0"
13 | classpath "com.squareup.sqldelight:gradle-plugin:$sqlDelight_version"
14 |
15 | // NOTE: Do not place your application dependencies here; they belong
16 | // in the individual module build.gradle files
17 | }
18 | }
19 |
20 | allprojects {
21 | repositories {
22 | google()
23 | jcenter()
24 | }
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/ktor/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | ext.kotlin_version = '1.4.0'
4 | ext.ktor_version = '1.5.2'
5 |
6 | repositories {
7 | google()
8 | jcenter()
9 | }
10 | dependencies {
11 | classpath "com.android.tools.build:gradle:4.0.1"
12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13 | classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
14 | classpath "com.google.gms:google-services:4.3.5"
15 |
16 | // NOTE: Do not place your application dependencies here; they belong
17 | // in the individual module build.gradle files
18 | }
19 | }
20 |
21 | allprojects {
22 | repositories {
23 | google()
24 | jcenter()
25 | }
26 | }
27 |
28 | task clean(type: Delete) {
29 | delete rootProject.buildDir
30 | }
31 |
--------------------------------------------------------------------------------
/realm/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/room/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/sample/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/ktor/app/src/main/java/com/ykanivets/emojibooks/SplashActivity.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.os.Bundle
4 | import androidx.appcompat.app.AppCompatActivity
5 | import com.google.firebase.auth.FirebaseAuth
6 |
7 | class SplashActivity : AppCompatActivity() {
8 |
9 | override fun onCreate(savedInstanceState: Bundle?) {
10 | super.onCreate(savedInstanceState)
11 |
12 | FirebaseAuth.getInstance()
13 | .signInWithEmailAndPassword("emoji.books@gmail.com", "!Smtv6RN7mr3")
14 | .addOnCompleteListener { task ->
15 | task.result?.user?.getIdToken(false)?.addOnCompleteListener {
16 | it.result?.token?.let { token ->
17 | startActivity(MainActivity.newIntent(this, token))
18 | finish()
19 | }
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
14 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/realm/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
14 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/room/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
14 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
14 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
14 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/realm/common/src/commonMain/kotlin/com/ykanivets/emojibooks/BookRepository.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import com.squareup.sqldelight.db.SqlDriver
4 |
5 | class BookRepository(
6 | sqlDriver: SqlDriver
7 | ) {
8 |
9 | private val database = EBDatabase(sqlDriver)
10 |
11 | fun getAll(): List = database.bookQueries.getAll().executeAsList().map { it.toBook() }
12 |
13 | fun add(book: Book) = database.bookQueries.add(
14 | emoji = book.emoji,
15 | title = book.title,
16 | author = book.author
17 | )
18 |
19 | fun update(book: Book) = database.bookQueries.update(
20 | id = book.id,
21 | emoji = book.emoji,
22 | title = book.title,
23 | author = book.author
24 | )
25 |
26 | fun delete(book: Book) = book.id?.let { database.bookQueries.delete(it) }
27 |
28 | private fun DbBook.toBook() = Book(
29 | id = id,
30 | emoji = emoji,
31 | title = title,
32 | author = author
33 | )
34 | }
35 |
--------------------------------------------------------------------------------
/room/common/src/commonMain/kotlin/com/ykanivets/emojibooks/BookRepository.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import com.squareup.sqldelight.db.SqlDriver
4 |
5 | class BookRepository(
6 | sqlDriver: SqlDriver
7 | ) {
8 |
9 | private val database = EBDatabase(sqlDriver)
10 |
11 | fun getAll(): List = database.bookQueries.getAll().executeAsList().map { it.toBook() }
12 |
13 | fun add(book: Book) = database.bookQueries.add(
14 | emoji = book.emoji,
15 | title = book.title,
16 | author = book.author
17 | )
18 |
19 | fun update(book: Book) = database.bookQueries.update(
20 | id = book.id,
21 | emoji = book.emoji,
22 | title = book.title,
23 | author = book.author
24 | )
25 |
26 | fun delete(book: Book) = book.id?.let { database.bookQueries.delete(it) }
27 |
28 | private fun DbBook.toBook() = Book(
29 | id = id,
30 | emoji = emoji,
31 | title = title,
32 | author = author
33 | )
34 | }
35 |
--------------------------------------------------------------------------------
/sqlite/common/src/commonMain/kotlin/com/ykanivets/emojibooks/BookRepository.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import com.squareup.sqldelight.db.SqlDriver
4 |
5 | class BookRepository(
6 | sqlDriver: SqlDriver
7 | ) {
8 |
9 | private val database = EBDatabase(sqlDriver)
10 |
11 | fun getAll(): List = database.bookQueries.getAll().executeAsList().map { it.toBook() }
12 |
13 | fun add(book: Book) = database.bookQueries.add(
14 | emoji = book.emoji,
15 | title = book.title,
16 | author = book.author
17 | )
18 |
19 | fun update(book: Book) = database.bookQueries.update(
20 | id = book.id,
21 | emoji = book.emoji,
22 | title = book.title,
23 | author = book.author
24 | )
25 |
26 | fun delete(book: Book) = book.id?.let { database.bookQueries.delete(it) }
27 |
28 | private fun DbBook.toBook() = Book(
29 | id = id,
30 | emoji = emoji,
31 | title = title,
32 | author = author
33 | )
34 | }
35 |
--------------------------------------------------------------------------------
/ktor/common/src/commonMain/kotlin/com/ykanivets/emojibooks/HttpClientFactory.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import io.ktor.client.*
4 | import io.ktor.client.features.*
5 | import io.ktor.client.features.json.*
6 | import io.ktor.client.features.json.serializer.*
7 | import io.ktor.client.features.logging.*
8 | import io.ktor.client.request.*
9 | import io.ktor.http.*
10 |
11 | const val BACKEND_LINK = "boiling-brushlands-48368.herokuapp.com"
12 |
13 | class HttpClientFactory {
14 |
15 | fun create(
16 | token: String
17 | ) = HttpClient {
18 | defaultRequest {
19 | url {
20 | host = BACKEND_LINK
21 | protocol = URLProtocol.HTTPS
22 | }
23 | header("Authorization", "Bearer $token")
24 | header(HttpHeaders.ContentType, ContentType.Application.Json)
25 | }
26 | Json {
27 | serializer = KotlinxSerializer()
28 | }
29 | Logging {
30 | logger = Logger.DEFAULT
31 | level = LogLevel.INFO
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/realm/app/src/main/java/com/ykanivets/emojibooks/RealmMigration.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import io.realm.Realm
4 | import io.realm.RealmObject
5 | import io.realm.annotations.PrimaryKey
6 | import io.realm.kotlin.where
7 |
8 | class RealmMigration(
9 | private val bookRepository: BookRepository
10 | ) {
11 |
12 | fun executeIfNeeded() {
13 | val realm = Realm.getDefaultInstance()
14 |
15 | val realmBooks = realm.where().findAll()
16 | val books = realm.copyFromRealm(realmBooks).map { it.toBook() }.takeUnless { it.isEmpty() } ?: return
17 |
18 | books.forEach { bookRepository.update(it) }
19 |
20 | deleteAll(realm)
21 | }
22 |
23 | private fun deleteAll(realm: Realm) {
24 | realm.beginTransaction()
25 | realm.deleteAll()
26 | realm.commitTransaction()
27 | }
28 |
29 | private fun RealmBook.toBook() = Book(
30 | id = id,
31 | emoji = emoji,
32 | title = title,
33 | author = author
34 | )
35 | }
36 |
37 | open class RealmBook(
38 | @PrimaryKey var id: Long = -1,
39 | var emoji: String = "",
40 | var title: String = "",
41 | var author: String = ""
42 | ) : RealmObject()
43 |
--------------------------------------------------------------------------------
/ktor/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
25 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/ktor/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
22 |
--------------------------------------------------------------------------------
/realm/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
22 |
--------------------------------------------------------------------------------
/room/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
22 |
--------------------------------------------------------------------------------
/sample/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
22 |
--------------------------------------------------------------------------------
/sqlite/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
22 |
--------------------------------------------------------------------------------
/sample/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 |
5 | android {
6 | compileSdkVersion 29
7 |
8 | defaultConfig {
9 | applicationId "com.ykanivets.emojibooks"
10 | minSdkVersion 21
11 | targetSdkVersion 29
12 | versionCode 1
13 | versionName "1.0"
14 |
15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | }
25 |
26 | dependencies {
27 | implementation fileTree(dir: "libs", include: ["*.jar"])
28 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
29 | implementation 'androidx.core:core-ktx:1.3.1'
30 | implementation 'androidx.appcompat:appcompat:1.2.0'
31 | implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
32 | implementation 'androidx.recyclerview:recyclerview:1.1.0'
33 | implementation 'com.google.android.material:material:1.2.1'
34 | testImplementation 'junit:junit:4.13'
35 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
36 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
37 | }
38 |
--------------------------------------------------------------------------------
/room/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-multiplatform'
3 | apply plugin: 'kotlin-android-extensions'
4 |
5 | android {
6 | compileSdkVersion 29
7 |
8 | defaultConfig {
9 | applicationId "com.ykanivets.emojibooks"
10 | minSdkVersion 21
11 | targetSdkVersion 29
12 | versionCode 1
13 | versionName "1.0"
14 |
15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | }
25 |
26 | kotlin {
27 | sourceSets {
28 | commonMain {
29 | dependencies {
30 | implementation project(':common')
31 | }
32 | }
33 |
34 | androidMain { }
35 | }
36 |
37 | android { }
38 | }
39 |
40 | dependencies {
41 | implementation fileTree(dir: "libs", include: ["*.jar"])
42 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
43 | implementation 'androidx.core:core-ktx:1.3.1'
44 | implementation 'androidx.appcompat:appcompat:1.2.0'
45 | implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
46 | implementation 'androidx.recyclerview:recyclerview:1.1.0'
47 | implementation 'com.google.android.material:material:1.2.1'
48 | implementation "com.squareup.sqldelight:android-driver:$sqlDelight_version"
49 | testImplementation 'junit:junit:4.13'
50 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
51 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
52 | }
53 |
--------------------------------------------------------------------------------
/sqlite/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-multiplatform'
3 | apply plugin: 'kotlin-android-extensions'
4 |
5 | android {
6 | compileSdkVersion 29
7 |
8 | defaultConfig {
9 | applicationId "com.ykanivets.emojibooks"
10 | minSdkVersion 21
11 | targetSdkVersion 29
12 | versionCode 1
13 | versionName "1.0"
14 |
15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | }
25 |
26 | kotlin {
27 | sourceSets {
28 | commonMain {
29 | dependencies {
30 | implementation project(':common')
31 | }
32 | }
33 |
34 | androidMain { }
35 | }
36 |
37 | android { }
38 | }
39 |
40 | dependencies {
41 | implementation fileTree(dir: "libs", include: ["*.jar"])
42 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
43 | implementation 'androidx.core:core-ktx:1.3.1'
44 | implementation 'androidx.appcompat:appcompat:1.2.0'
45 | implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
46 | implementation 'androidx.recyclerview:recyclerview:1.1.0'
47 | implementation 'com.google.android.material:material:1.2.1'
48 | implementation "com.squareup.sqldelight:android-driver:$sqlDelight_version"
49 | testImplementation 'junit:junit:4.13'
50 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
51 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
52 | }
53 |
--------------------------------------------------------------------------------
/ktor/app/src/main/java/com/ykanivets/emojibooks/BookAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.view.LayoutInflater
4 | import android.view.View
5 | import android.view.ViewGroup
6 | import android.widget.ImageButton
7 | import android.widget.TextView
8 | import androidx.recyclerview.widget.RecyclerView
9 |
10 | class BookAdapter(
11 | var books: List,
12 | var listener: Listener
13 | ) : RecyclerView.Adapter() {
14 |
15 | override fun getItemCount() = books.size
16 |
17 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = ViewHolder(
18 | view = LayoutInflater.from(parent.context).inflate(R.layout.view_item_book, parent, false)
19 | )
20 |
21 | override fun onBindViewHolder(holder: ViewHolder, position: Int) = with(books[position]) {
22 | holder.tvEmoji.text = emoji
23 | holder.tvTitle.text = title
24 | holder.tvSubtitle.text = author
25 |
26 | holder.itemView.setOnClickListener { listener.onBookClicked(this) }
27 | holder.btnDelete.setOnClickListener { listener.onBookDeleteClicked(this) }
28 | }
29 |
30 | class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
31 |
32 | val tvEmoji: TextView = view.findViewById(R.id.tvEmoji)
33 | val tvTitle: TextView = view.findViewById(R.id.tvTitle)
34 | val tvSubtitle: TextView = view.findViewById(R.id.tvAuthor)
35 | val btnDelete: ImageButton = view.findViewById(R.id.btnDelete)
36 | }
37 |
38 | interface Listener {
39 |
40 | fun onBookClicked(book: Book)
41 |
42 | fun onBookDeleteClicked(book: Book)
43 | }
44 |
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/realm/app/src/main/java/com/ykanivets/emojibooks/BookAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.view.LayoutInflater
4 | import android.view.View
5 | import android.view.ViewGroup
6 | import android.widget.ImageButton
7 | import android.widget.TextView
8 | import androidx.recyclerview.widget.RecyclerView
9 |
10 | class BookAdapter(
11 | var books: List,
12 | var listener: Listener
13 | ) : RecyclerView.Adapter() {
14 |
15 | override fun getItemCount() = books.size
16 |
17 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = ViewHolder(
18 | view = LayoutInflater.from(parent.context).inflate(R.layout.view_item_book, parent, false)
19 | )
20 |
21 | override fun onBindViewHolder(holder: ViewHolder, position: Int) = with(books[position]) {
22 | holder.tvEmoji.text = emoji
23 | holder.tvTitle.text = title
24 | holder.tvSubtitle.text = author
25 |
26 | holder.itemView.setOnClickListener { listener.onBookClicked(this) }
27 | holder.btnDelete.setOnClickListener { listener.onBookDeleteClicked(this) }
28 | }
29 |
30 | class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
31 |
32 | val tvEmoji: TextView = view.findViewById(R.id.tvEmoji)
33 | val tvTitle: TextView = view.findViewById(R.id.tvTitle)
34 | val tvSubtitle: TextView = view.findViewById(R.id.tvAuthor)
35 | val btnDelete: ImageButton = view.findViewById(R.id.btnDelete)
36 | }
37 |
38 | interface Listener {
39 |
40 | fun onBookClicked(book: Book)
41 |
42 | fun onBookDeleteClicked(book: Book)
43 | }
44 |
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/room/app/src/main/java/com/ykanivets/emojibooks/BookAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.view.LayoutInflater
4 | import android.view.View
5 | import android.view.ViewGroup
6 | import android.widget.ImageButton
7 | import android.widget.TextView
8 | import androidx.recyclerview.widget.RecyclerView
9 |
10 | class BookAdapter(
11 | var books: List,
12 | var listener: Listener
13 | ) : RecyclerView.Adapter() {
14 |
15 | override fun getItemCount() = books.size
16 |
17 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = ViewHolder(
18 | view = LayoutInflater.from(parent.context).inflate(R.layout.view_item_book, parent, false)
19 | )
20 |
21 | override fun onBindViewHolder(holder: ViewHolder, position: Int) = with(books[position]) {
22 | holder.tvEmoji.text = emoji
23 | holder.tvTitle.text = title
24 | holder.tvSubtitle.text = author
25 |
26 | holder.itemView.setOnClickListener { listener.onBookClicked(this) }
27 | holder.btnDelete.setOnClickListener { listener.onBookDeleteClicked(this) }
28 | }
29 |
30 | class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
31 |
32 | val tvEmoji: TextView = view.findViewById(R.id.tvEmoji)
33 | val tvTitle: TextView = view.findViewById(R.id.tvTitle)
34 | val tvSubtitle: TextView = view.findViewById(R.id.tvAuthor)
35 | val btnDelete: ImageButton = view.findViewById(R.id.btnDelete)
36 | }
37 |
38 | interface Listener {
39 |
40 | fun onBookClicked(book: Book)
41 |
42 | fun onBookDeleteClicked(book: Book)
43 | }
44 |
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/sample/app/src/main/java/com/ykanivets/emojibooks/BookAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.view.LayoutInflater
4 | import android.view.View
5 | import android.view.ViewGroup
6 | import android.widget.ImageButton
7 | import android.widget.TextView
8 | import androidx.recyclerview.widget.RecyclerView
9 |
10 | class BookAdapter(
11 | var books: List,
12 | var listener: Listener
13 | ) : RecyclerView.Adapter() {
14 |
15 | override fun getItemCount() = books.size
16 |
17 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = ViewHolder(
18 | view = LayoutInflater.from(parent.context).inflate(R.layout.view_item_book, parent, false)
19 | )
20 |
21 | override fun onBindViewHolder(holder: ViewHolder, position: Int) = with(books[position]) {
22 | holder.tvEmoji.text = emoji
23 | holder.tvTitle.text = title
24 | holder.tvSubtitle.text = author
25 |
26 | holder.itemView.setOnClickListener { listener.onBookClicked(this) }
27 | holder.btnDelete.setOnClickListener { listener.onBookDeleteClicked(this) }
28 | }
29 |
30 | class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
31 |
32 | val tvEmoji: TextView = view.findViewById(R.id.tvEmoji)
33 | val tvTitle: TextView = view.findViewById(R.id.tvTitle)
34 | val tvSubtitle: TextView = view.findViewById(R.id.tvAuthor)
35 | val btnDelete: ImageButton = view.findViewById(R.id.btnDelete)
36 | }
37 |
38 | interface Listener {
39 |
40 | fun onBookClicked(book: Book)
41 |
42 | fun onBookDeleteClicked(book: Book)
43 | }
44 |
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/java/com/ykanivets/emojibooks/BookAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.view.LayoutInflater
4 | import android.view.View
5 | import android.view.ViewGroup
6 | import android.widget.ImageButton
7 | import android.widget.TextView
8 | import androidx.recyclerview.widget.RecyclerView
9 |
10 | class BookAdapter(
11 | var books: List,
12 | var listener: Listener
13 | ) : RecyclerView.Adapter() {
14 |
15 | override fun getItemCount() = books.size
16 |
17 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = ViewHolder(
18 | view = LayoutInflater.from(parent.context).inflate(R.layout.view_item_book, parent, false)
19 | )
20 |
21 | override fun onBindViewHolder(holder: ViewHolder, position: Int) = with(books[position]) {
22 | holder.tvEmoji.text = emoji
23 | holder.tvTitle.text = title
24 | holder.tvSubtitle.text = author
25 |
26 | holder.itemView.setOnClickListener { listener.onBookClicked(this) }
27 | holder.btnDelete.setOnClickListener { listener.onBookDeleteClicked(this) }
28 | }
29 |
30 | class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
31 |
32 | val tvEmoji: TextView = view.findViewById(R.id.tvEmoji)
33 | val tvTitle: TextView = view.findViewById(R.id.tvTitle)
34 | val tvSubtitle: TextView = view.findViewById(R.id.tvAuthor)
35 | val btnDelete: ImageButton = view.findViewById(R.id.btnDelete)
36 | }
37 |
38 | interface Listener {
39 |
40 | fun onBookClicked(book: Book)
41 |
42 | fun onBookDeleteClicked(book: Book)
43 | }
44 |
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/realm/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 | apply plugin: 'kotlin-kapt'
5 | apply plugin: 'realm-android'
6 |
7 | android {
8 | compileSdkVersion 29
9 |
10 | defaultConfig {
11 | applicationId "com.ykanivets.emojibooks"
12 | minSdkVersion 21
13 | targetSdkVersion 29
14 | versionCode 1
15 | versionName "1.0"
16 |
17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18 | }
19 |
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 | }
27 |
28 | kotlin {
29 | sourceSets {
30 | commonMain {
31 | dependencies {
32 | implementation project(':common')
33 | }
34 | }
35 |
36 | androidMain { }
37 | }
38 |
39 | android { }
40 | }
41 |
42 | dependencies {
43 | implementation fileTree(dir: "libs", include: ["*.jar"])
44 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
45 | implementation 'androidx.core:core-ktx:1.3.1'
46 | implementation 'androidx.appcompat:appcompat:1.2.0'
47 | implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
48 | implementation 'androidx.recyclerview:recyclerview:1.1.0'
49 | implementation 'com.google.android.material:material:1.2.1'
50 | implementation "com.squareup.sqldelight:android-driver:$sqlDelight_version"
51 | testImplementation 'junit:junit:4.13'
52 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
53 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
54 | }
55 |
--------------------------------------------------------------------------------
/ktor/common/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'kotlin-multiplatform'
2 | apply plugin: 'kotlinx-serialization'
3 |
4 | kotlin {
5 | jvm()
6 |
7 | sourceSets {
8 | commonMain {
9 | dependencies {
10 | implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
11 | implementation "io.ktor:ktor-client-core:$ktor_version"
12 | implementation "io.ktor:ktor-client-serialization:$ktor_version"
13 | implementation "io.ktor:ktor-client-logging:$ktor_version"
14 | }
15 | }
16 |
17 | commonTest {
18 | dependencies {
19 | implementation "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version"
20 | }
21 | }
22 |
23 | iOSMain {
24 | dependencies {}
25 | }
26 |
27 | jvmMain {
28 | dependencies {
29 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
30 | }
31 | }
32 |
33 | jvmTest {
34 | dependencies {
35 | implementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
36 | implementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
37 | implementation "junit:junit:4.13"
38 | }
39 | }
40 | }
41 |
42 | targets {
43 | def buildForDevice = project.findProperty("kotlin.native.cocoapods.target") == "ios_arm"
44 | if (buildForDevice) {
45 | iosArm64("iOS64")
46 | iosArm32("iOS32")
47 | } else {
48 | iosX64('iosX')
49 | }
50 | }
51 |
52 | targets.all {
53 | compilations.all {
54 | kotlinOptions {
55 | freeCompilerArgs += '-Xobjc-generics'
56 | }
57 | }
58 | }
59 | }
60 |
61 | configurations {
62 | compileClasspath
63 | }
64 |
--------------------------------------------------------------------------------
/ktor/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-multiplatform'
3 | apply plugin: 'kotlin-android-extensions'
4 | apply plugin: 'com.google.gms.google-services'
5 |
6 | android {
7 | compileSdkVersion 29
8 |
9 | defaultConfig {
10 | applicationId "com.ykanivets.emojibooks"
11 | minSdkVersion 21
12 | targetSdkVersion 29
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 | }
26 |
27 | kotlin {
28 | sourceSets {
29 | commonMain {
30 | dependencies {
31 | implementation project(':common')
32 | }
33 | }
34 |
35 | androidMain { }
36 | }
37 |
38 | android { }
39 | }
40 |
41 | dependencies {
42 | implementation fileTree(dir: "libs", include: ["*.jar"])
43 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
44 | implementation 'androidx.core:core-ktx:1.3.1'
45 | implementation 'androidx.appcompat:appcompat:1.2.0'
46 | implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
47 | implementation 'androidx.recyclerview:recyclerview:1.1.0'
48 | implementation 'com.google.android.material:material:1.2.1'
49 | implementation "io.ktor:ktor-client-json-jvm:$ktor_version"
50 | implementation "io.ktor:ktor-client-android:$ktor_version"
51 | implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8"
52 | implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8"
53 | implementation platform('com.google.firebase:firebase-bom:26.2.0')
54 | implementation 'com.google.firebase:firebase-auth'
55 | testImplementation 'junit:junit:4.13'
56 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
57 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
58 | }
59 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/layout/view_item_book.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
22 |
23 |
29 |
30 |
39 |
40 |
50 |
51 |
52 |
53 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/realm/app/src/main/res/layout/view_item_book.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
22 |
23 |
29 |
30 |
39 |
40 |
50 |
51 |
52 |
53 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/room/app/src/main/res/layout/view_item_book.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
22 |
23 |
29 |
30 |
39 |
40 |
50 |
51 |
52 |
53 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/layout/view_item_book.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
22 |
23 |
29 |
30 |
39 |
40 |
50 |
51 |
52 |
53 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/layout/view_item_book.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
22 |
23 |
29 |
30 |
39 |
40 |
50 |
51 |
52 |
53 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/realm/common/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'kotlin-multiplatform'
2 | apply plugin: 'com.squareup.sqldelight'
3 |
4 | kotlin {
5 | jvm()
6 |
7 | sourceSets {
8 | commonMain {
9 | dependencies {
10 | implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
11 | implementation "com.squareup.sqldelight:runtime:$sqlDelight_version"
12 | }
13 | }
14 |
15 | commonTest {
16 | dependencies {
17 | implementation "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version"
18 | }
19 | }
20 |
21 | iOSMain {
22 | dependencies {
23 | implementation "com.squareup.sqldelight:native-driver:$sqlDelight_version"
24 | }
25 | }
26 |
27 | jvmMain {
28 | dependencies {
29 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
30 | implementation "com.squareup.sqldelight:sqlite-driver:$sqlDelight_version"
31 | implementation "com.squareup.sqldelight:runtime-jvm:$sqlDelight_version"
32 | }
33 | }
34 |
35 | jvmTest {
36 | dependencies {
37 | implementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
38 | implementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
39 | implementation "junit:junit:4.13"
40 | }
41 | }
42 | }
43 |
44 | targets {
45 | def buildForDevice = project.findProperty("kotlin.native.cocoapods.target") == "ios_arm"
46 | if (buildForDevice) {
47 | iosArm64("iOS64")
48 | iosArm32("iOS32")
49 | } else {
50 | iosX64('iosX')
51 | }
52 | }
53 |
54 | targets.all {
55 | compilations.all {
56 | kotlinOptions {
57 | freeCompilerArgs += '-Xobjc-generics'
58 | }
59 | }
60 | }
61 | }
62 |
63 | configurations {
64 | compileClasspath
65 | }
66 |
67 | sqldelight {
68 | EBDatabase {
69 | packageName = "com.ykanivets.emojibooks"
70 | sourceFolders = ["sqldelight"]
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/room/common/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'kotlin-multiplatform'
2 | apply plugin: 'com.squareup.sqldelight'
3 |
4 | kotlin {
5 | jvm()
6 |
7 | sourceSets {
8 | commonMain {
9 | dependencies {
10 | implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
11 | implementation "com.squareup.sqldelight:runtime:$sqlDelight_version"
12 | }
13 | }
14 |
15 | commonTest {
16 | dependencies {
17 | implementation "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version"
18 | }
19 | }
20 |
21 | iOSMain {
22 | dependencies {
23 | implementation "com.squareup.sqldelight:native-driver:$sqlDelight_version"
24 | }
25 | }
26 |
27 | jvmMain {
28 | dependencies {
29 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
30 | implementation "com.squareup.sqldelight:sqlite-driver:$sqlDelight_version"
31 | implementation "com.squareup.sqldelight:runtime-jvm:$sqlDelight_version"
32 | }
33 | }
34 |
35 | jvmTest {
36 | dependencies {
37 | implementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
38 | implementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
39 | implementation "junit:junit:4.13"
40 | }
41 | }
42 | }
43 |
44 | targets {
45 | def buildForDevice = project.findProperty("kotlin.native.cocoapods.target") == "ios_arm"
46 | if (buildForDevice) {
47 | iosArm64("iOS64")
48 | iosArm32("iOS32")
49 | } else {
50 | iosX64('iosX')
51 | }
52 | }
53 |
54 | targets.all {
55 | compilations.all {
56 | kotlinOptions {
57 | freeCompilerArgs += '-Xobjc-generics'
58 | }
59 | }
60 | }
61 | }
62 |
63 | configurations {
64 | compileClasspath
65 | }
66 |
67 | sqldelight {
68 | EBDatabase {
69 | packageName = "com.ykanivets.emojibooks"
70 | sourceFolders = ["sqldelight"]
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/sqlite/common/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'kotlin-multiplatform'
2 | apply plugin: 'com.squareup.sqldelight'
3 |
4 | kotlin {
5 | jvm()
6 |
7 | sourceSets {
8 | commonMain {
9 | dependencies {
10 | implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
11 | implementation "com.squareup.sqldelight:runtime:$sqlDelight_version"
12 | }
13 | }
14 |
15 | commonTest {
16 | dependencies {
17 | implementation "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version"
18 | }
19 | }
20 |
21 | iOSMain {
22 | dependencies {
23 | implementation "com.squareup.sqldelight:native-driver:$sqlDelight_version"
24 | }
25 | }
26 |
27 | jvmMain {
28 | dependencies {
29 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
30 | implementation "com.squareup.sqldelight:sqlite-driver:$sqlDelight_version"
31 | implementation "com.squareup.sqldelight:runtime-jvm:$sqlDelight_version"
32 | }
33 | }
34 |
35 | jvmTest {
36 | dependencies {
37 | implementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
38 | implementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
39 | implementation "junit:junit:4.13"
40 | }
41 | }
42 | }
43 |
44 | targets {
45 | def buildForDevice = project.findProperty("kotlin.native.cocoapods.target") == "ios_arm"
46 | if (buildForDevice) {
47 | iosArm64("iOS64")
48 | iosArm32("iOS32")
49 | } else {
50 | iosX64('iosX')
51 | }
52 | }
53 |
54 | targets.all {
55 | compilations.all {
56 | kotlinOptions {
57 | freeCompilerArgs += '-Xobjc-generics'
58 | }
59 | }
60 | }
61 | }
62 |
63 | configurations {
64 | compileClasspath
65 | }
66 |
67 | sqldelight {
68 | EBDatabase {
69 | packageName = "com.ykanivets.emojibooks"
70 | sourceFolders = ["sqldelight"]
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
24 |
25 |
26 |
27 |
32 |
33 |
43 |
44 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/realm/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
24 |
25 |
26 |
27 |
32 |
33 |
43 |
44 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/room/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
24 |
25 |
26 |
27 |
32 |
33 |
43 |
44 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
24 |
25 |
26 |
27 |
32 |
33 |
43 |
44 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
24 |
25 |
26 |
27 |
32 |
33 |
43 |
44 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/ktor/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/realm/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/room/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/sample/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/sqlite/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/sample/app/src/main/java/com/ykanivets/emojibooks/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.content.Intent
4 | import android.os.Bundle
5 | import androidx.appcompat.app.AppCompatActivity
6 | import androidx.recyclerview.widget.LinearLayoutManager
7 | import kotlinx.android.synthetic.main.activity_main.fabAddBook
8 | import kotlinx.android.synthetic.main.activity_main.recyclerView
9 |
10 | class MainActivity : AppCompatActivity(), BookAdapter.Listener {
11 |
12 | private val bookRepository = BookRepository()
13 |
14 | private val adapter = BookAdapter(bookRepository.getAll(), listener = this)
15 |
16 | override fun onCreate(savedInstanceState: Bundle?) {
17 | super.onCreate(savedInstanceState)
18 | setContentView(R.layout.activity_main)
19 |
20 | initRecycler()
21 | initFab()
22 | }
23 |
24 | private fun initRecycler() {
25 | recyclerView.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
26 | recyclerView.adapter = adapter
27 | }
28 |
29 | private fun initFab() = fabAddBook.setOnClickListener {
30 | startActivityForResult(BookActivity.newIntent(this), REQUEST_ADD_BOOK)
31 | }
32 |
33 | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
34 | super.onActivityResult(requestCode, resultCode, data)
35 |
36 | if (resultCode == RESULT_OK) {
37 | when (requestCode) {
38 | REQUEST_ADD_BOOK -> data?.getBookExtra()?.let { bookExtra ->
39 | bookRepository.add(bookExtra.toBook())
40 | refresh()
41 | }
42 | REQUEST_UPDATE_BOOK -> data?.getBookExtra()?.let { bookExtra ->
43 | bookRepository.update(bookExtra.toBook())
44 | refresh()
45 | }
46 | }
47 | }
48 | }
49 |
50 | override fun onBookClicked(book: Book) {
51 | startActivityForResult(BookActivity.newIntent(this, book.toBookExtra()), REQUEST_UPDATE_BOOK)
52 | }
53 |
54 | override fun onBookDeleteClicked(book: Book) {
55 | bookRepository.delete(book)
56 | refresh()
57 | }
58 |
59 | private fun refresh() {
60 | adapter.books = bookRepository.getAll()
61 | adapter.notifyDataSetChanged()
62 | }
63 |
64 | private fun Intent.getBookExtra() = getParcelableExtra(BookActivity.EXTRA_BOOK)
65 |
66 | private fun Book.toBookExtra() = BookActivity.BookExtra(
67 | id = id,
68 | emoji = emoji,
69 | title = title,
70 | author = author
71 | )
72 |
73 | private fun BookActivity.BookExtra.toBook() = Book(
74 | id = id,
75 | emoji = emoji,
76 | title = title,
77 | author = author
78 | )
79 |
80 | companion object {
81 |
82 | private const val REQUEST_ADD_BOOK = 1
83 | private const val REQUEST_UPDATE_BOOK = 2
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/room/app/src/main/java/com/ykanivets/emojibooks/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.content.Intent
4 | import android.os.Bundle
5 | import androidx.appcompat.app.AppCompatActivity
6 | import androidx.recyclerview.widget.LinearLayoutManager
7 | import com.squareup.sqldelight.android.AndroidSqliteDriver
8 | import kotlinx.android.synthetic.main.activity_main.fabAddBook
9 | import kotlinx.android.synthetic.main.activity_main.recyclerView
10 |
11 | class MainActivity : AppCompatActivity(), BookAdapter.Listener {
12 |
13 | private val bookRepository by lazy {
14 | BookRepository(
15 | sqlDriver = AndroidSqliteDriver(EBDatabase.Schema, applicationContext, "database")
16 | )
17 | }
18 |
19 | private val adapter by lazy { BookAdapter(bookRepository.getAll(), listener = this) }
20 |
21 | override fun onCreate(savedInstanceState: Bundle?) {
22 | super.onCreate(savedInstanceState)
23 | setContentView(R.layout.activity_main)
24 |
25 | initRecycler()
26 | initFab()
27 | }
28 |
29 | private fun initRecycler() {
30 | recyclerView.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
31 | recyclerView.adapter = adapter
32 | }
33 |
34 | private fun initFab() = fabAddBook.setOnClickListener {
35 | startActivityForResult(BookActivity.newIntent(this), REQUEST_ADD_BOOK)
36 | }
37 |
38 | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
39 | super.onActivityResult(requestCode, resultCode, data)
40 |
41 | if (resultCode == RESULT_OK) {
42 | when (requestCode) {
43 | REQUEST_ADD_BOOK -> data?.getBookExtra()?.let { bookExtra ->
44 | bookRepository.add(bookExtra.toBook())
45 | refresh()
46 | }
47 | REQUEST_UPDATE_BOOK -> data?.getBookExtra()?.let { bookExtra ->
48 | bookRepository.update(bookExtra.toBook())
49 | refresh()
50 | }
51 | }
52 | }
53 | }
54 |
55 | override fun onBookClicked(book: Book) {
56 | startActivityForResult(BookActivity.newIntent(this, book.toBookExtra()), REQUEST_UPDATE_BOOK)
57 | }
58 |
59 | override fun onBookDeleteClicked(book: Book) {
60 | bookRepository.delete(book)
61 | refresh()
62 | }
63 |
64 | private fun refresh() {
65 | adapter.books = bookRepository.getAll()
66 | adapter.notifyDataSetChanged()
67 | }
68 |
69 | private fun Intent.getBookExtra() = getParcelableExtra(BookActivity.EXTRA_BOOK)
70 |
71 | private fun Book.toBookExtra() = BookActivity.BookExtra(
72 | id = id,
73 | emoji = emoji,
74 | title = title,
75 | author = author
76 | )
77 |
78 | private fun BookActivity.BookExtra.toBook() = Book(
79 | id = id,
80 | emoji = emoji,
81 | title = title,
82 | author = author
83 | )
84 |
85 | companion object {
86 |
87 | private const val REQUEST_ADD_BOOK = 1
88 | private const val REQUEST_UPDATE_BOOK = 2
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/java/com/ykanivets/emojibooks/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.content.Intent
4 | import android.os.Bundle
5 | import androidx.appcompat.app.AppCompatActivity
6 | import androidx.recyclerview.widget.LinearLayoutManager
7 | import com.squareup.sqldelight.android.AndroidSqliteDriver
8 | import kotlinx.android.synthetic.main.activity_main.fabAddBook
9 | import kotlinx.android.synthetic.main.activity_main.recyclerView
10 |
11 | class MainActivity : AppCompatActivity(), BookAdapter.Listener {
12 |
13 | private val bookRepository by lazy {
14 | BookRepository(
15 | sqlDriver = AndroidSqliteDriver(EBDatabase.Schema, applicationContext, "database")
16 | )
17 | }
18 |
19 | private val adapter by lazy { BookAdapter(bookRepository.getAll(), listener = this) }
20 |
21 | override fun onCreate(savedInstanceState: Bundle?) {
22 | super.onCreate(savedInstanceState)
23 | setContentView(R.layout.activity_main)
24 |
25 | initRecycler()
26 | initFab()
27 | }
28 |
29 | private fun initRecycler() {
30 | recyclerView.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
31 | recyclerView.adapter = adapter
32 | }
33 |
34 | private fun initFab() = fabAddBook.setOnClickListener {
35 | startActivityForResult(BookActivity.newIntent(this), REQUEST_ADD_BOOK)
36 | }
37 |
38 | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
39 | super.onActivityResult(requestCode, resultCode, data)
40 |
41 | if (resultCode == RESULT_OK) {
42 | when (requestCode) {
43 | REQUEST_ADD_BOOK -> data?.getBookExtra()?.let { bookExtra ->
44 | bookRepository.add(bookExtra.toBook())
45 | refresh()
46 | }
47 | REQUEST_UPDATE_BOOK -> data?.getBookExtra()?.let { bookExtra ->
48 | bookRepository.update(bookExtra.toBook())
49 | refresh()
50 | }
51 | }
52 | }
53 | }
54 |
55 | override fun onBookClicked(book: Book) {
56 | startActivityForResult(BookActivity.newIntent(this, book.toBookExtra()), REQUEST_UPDATE_BOOK)
57 | }
58 |
59 | override fun onBookDeleteClicked(book: Book) {
60 | bookRepository.delete(book)
61 | refresh()
62 | }
63 |
64 | private fun refresh() {
65 | adapter.books = bookRepository.getAll()
66 | adapter.notifyDataSetChanged()
67 | }
68 |
69 | private fun Intent.getBookExtra() = getParcelableExtra(BookActivity.EXTRA_BOOK)
70 |
71 | private fun Book.toBookExtra() = BookActivity.BookExtra(
72 | id = id,
73 | emoji = emoji,
74 | title = title,
75 | author = author
76 | )
77 |
78 | private fun BookActivity.BookExtra.toBook() = Book(
79 | id = id,
80 | emoji = emoji,
81 | title = title,
82 | author = author
83 | )
84 |
85 | companion object {
86 |
87 | private const val REQUEST_ADD_BOOK = 1
88 | private const val REQUEST_UPDATE_BOOK = 2
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/realm/app/src/main/java/com/ykanivets/emojibooks/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.content.Intent
4 | import android.os.Bundle
5 | import androidx.appcompat.app.AppCompatActivity
6 | import androidx.recyclerview.widget.LinearLayoutManager
7 | import com.squareup.sqldelight.android.AndroidSqliteDriver
8 | import io.realm.Realm
9 | import kotlinx.android.synthetic.main.activity_main.fabAddBook
10 | import kotlinx.android.synthetic.main.activity_main.recyclerView
11 |
12 | class MainActivity : AppCompatActivity(), BookAdapter.Listener {
13 |
14 | private val bookRepository by lazy {
15 | BookRepository(
16 | sqlDriver = AndroidSqliteDriver(EBDatabase.Schema, applicationContext, "database")
17 | )
18 | }
19 |
20 | private val adapter by lazy { BookAdapter(bookRepository.getAll(), listener = this) }
21 |
22 | override fun onCreate(savedInstanceState: Bundle?) {
23 | super.onCreate(savedInstanceState)
24 | setContentView(R.layout.activity_main)
25 |
26 | initRealm()
27 | initRecycler()
28 | initFab()
29 | }
30 |
31 | private fun initRecycler() {
32 | recyclerView.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
33 | recyclerView.adapter = adapter
34 | }
35 |
36 | private fun initFab() = fabAddBook.setOnClickListener {
37 | startActivityForResult(BookActivity.newIntent(this), REQUEST_ADD_BOOK)
38 | }
39 |
40 | private fun initRealm() {
41 | Realm.init(this)
42 | RealmMigration(bookRepository).executeIfNeeded()
43 | }
44 |
45 | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
46 | super.onActivityResult(requestCode, resultCode, data)
47 |
48 | if (resultCode == RESULT_OK) {
49 | when (requestCode) {
50 | REQUEST_ADD_BOOK -> data?.getBookExtra()?.let { bookExtra ->
51 | bookRepository.add(bookExtra.toBook())
52 | refresh()
53 | }
54 | REQUEST_UPDATE_BOOK -> data?.getBookExtra()?.let { bookExtra ->
55 | bookRepository.update(bookExtra.toBook())
56 | refresh()
57 | }
58 | }
59 | }
60 | }
61 |
62 | override fun onBookClicked(book: Book) {
63 | startActivityForResult(BookActivity.newIntent(this, book.toBookExtra()), REQUEST_UPDATE_BOOK)
64 | }
65 |
66 | override fun onBookDeleteClicked(book: Book) {
67 | bookRepository.delete(book)
68 | refresh()
69 | }
70 |
71 | private fun refresh() {
72 | adapter.books = bookRepository.getAll()
73 | adapter.notifyDataSetChanged()
74 | }
75 |
76 | private fun Intent.getBookExtra() = getParcelableExtra(BookActivity.EXTRA_BOOK)
77 |
78 | private fun Book.toBookExtra() = BookActivity.BookExtra(
79 | id = id,
80 | emoji = emoji,
81 | title = title,
82 | author = author
83 | )
84 |
85 | private fun BookActivity.BookExtra.toBook() = Book(
86 | id = id,
87 | emoji = emoji,
88 | title = title,
89 | author = author
90 | )
91 |
92 | companion object {
93 |
94 | private const val REQUEST_ADD_BOOK = 1
95 | private const val REQUEST_UPDATE_BOOK = 2
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
16 |
19 |
22 |
25 |
28 |
31 |
34 |
37 |
40 |
43 |
46 |
51 |
54 |
57 |
62 |
65 |
70 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/room/app/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
16 |
19 |
22 |
25 |
28 |
31 |
34 |
37 |
40 |
43 |
46 |
51 |
54 |
57 |
62 |
65 |
70 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/realm/app/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
16 |
19 |
22 |
25 |
28 |
31 |
34 |
37 |
40 |
43 |
46 |
51 |
54 |
57 |
62 |
65 |
70 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
16 |
19 |
22 |
25 |
28 |
31 |
34 |
37 |
40 |
43 |
46 |
51 |
54 |
57 |
62 |
65 |
70 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
16 |
19 |
22 |
25 |
28 |
31 |
34 |
37 |
40 |
43 |
46 |
51 |
54 |
57 |
62 |
65 |
70 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/ktor/app/src/main/java/com/ykanivets/emojibooks/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import androidx.appcompat.app.AppCompatActivity
7 | import androidx.recyclerview.widget.LinearLayoutManager
8 | import kotlinx.android.synthetic.main.activity_main.*
9 | import kotlinx.coroutines.CoroutineScope
10 | import kotlinx.coroutines.Dispatchers
11 | import kotlinx.coroutines.SupervisorJob
12 | import kotlinx.coroutines.launch
13 |
14 | class MainActivity : AppCompatActivity(), BookAdapter.Listener {
15 |
16 | private val presenterJob = SupervisorJob()
17 | private val uiScope = CoroutineScope(Dispatchers.Main + presenterJob)
18 |
19 | private val bookRepository by lazy { BookRepository(token = intent.getStringExtra(EXTRA_TOKEN)) }
20 | private val adapter by lazy { BookAdapter(emptyList(), listener = this) }
21 |
22 | override fun onCreate(savedInstanceState: Bundle?) {
23 | super.onCreate(savedInstanceState)
24 | setContentView(R.layout.activity_main)
25 |
26 | initRecycler()
27 | initFab()
28 | refresh()
29 | }
30 |
31 | private fun initRecycler() {
32 | recyclerView.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
33 | recyclerView.adapter = adapter
34 | }
35 |
36 | private fun initFab() = fabAddBook.setOnClickListener {
37 | startActivityForResult(BookActivity.newIntent(this), REQUEST_ADD_BOOK)
38 | }
39 |
40 | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
41 | super.onActivityResult(requestCode, resultCode, data)
42 |
43 | if (resultCode == RESULT_OK) {
44 | when (requestCode) {
45 | REQUEST_ADD_BOOK -> data?.getBookExtra()?.let { bookExtra ->
46 | uiScope.launch {
47 | bookRepository.add(bookExtra.toBookBody())
48 | refresh()
49 | }
50 | }
51 | REQUEST_UPDATE_BOOK -> data?.getBookExtra()?.let { bookExtra ->
52 | uiScope.launch {
53 | bookRepository.update(bookExtra.toBook())
54 | refresh()
55 | }
56 | }
57 | }
58 | }
59 | }
60 |
61 | override fun onBookClicked(book: Book) {
62 | startActivityForResult(
63 | BookActivity.newIntent(this, book.toBookExtra()),
64 | REQUEST_UPDATE_BOOK
65 | )
66 | }
67 |
68 | override fun onBookDeleteClicked(book: Book) = uiScope.launch {
69 | bookRepository.delete(book)
70 | refresh()
71 | }.let {}
72 |
73 | private fun refresh() = uiScope.launch {
74 | adapter.books = bookRepository.getAll()
75 | adapter.notifyDataSetChanged()
76 | }
77 |
78 | private fun Intent.getBookExtra() =
79 | getParcelableExtra(BookActivity.EXTRA_BOOK)
80 |
81 | private fun Book.toBookExtra() = BookActivity.BookExtra(
82 | id = id,
83 | emoji = emoji,
84 | title = title,
85 | author = author
86 | )
87 |
88 | private fun BookActivity.BookExtra.toBook() = Book(
89 | id = id!!,
90 | emoji = emoji,
91 | title = title,
92 | author = author
93 | )
94 |
95 | private fun BookActivity.BookExtra.toBookBody() = BookBody(
96 | emoji = emoji,
97 | title = title,
98 | author = author
99 | )
100 |
101 | companion object {
102 |
103 | private const val REQUEST_ADD_BOOK = 1
104 | private const val REQUEST_UPDATE_BOOK = 2
105 |
106 | private const val EXTRA_TOKEN = "TOKEN"
107 |
108 | fun newIntent(
109 | context: Context,
110 | token: String
111 | ) = Intent(
112 | context,
113 | MainActivity::class.java
114 | ).apply {
115 | putExtra(EXTRA_TOKEN, token)
116 | }
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/ktor/app/src/main/res/layout/activity_book.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
23 |
24 |
25 |
26 |
31 |
32 |
43 |
44 |
54 |
55 |
56 |
57 |
68 |
69 |
79 |
80 |
81 |
82 |
93 |
94 |
102 |
103 |
104 |
105 |
115 |
116 |
117 |
118 |
119 |
--------------------------------------------------------------------------------
/realm/app/src/main/res/layout/activity_book.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
23 |
24 |
25 |
26 |
31 |
32 |
43 |
44 |
54 |
55 |
56 |
57 |
68 |
69 |
79 |
80 |
81 |
82 |
93 |
94 |
102 |
103 |
104 |
105 |
115 |
116 |
117 |
118 |
119 |
--------------------------------------------------------------------------------
/room/app/src/main/res/layout/activity_book.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
23 |
24 |
25 |
26 |
31 |
32 |
43 |
44 |
54 |
55 |
56 |
57 |
68 |
69 |
79 |
80 |
81 |
82 |
93 |
94 |
102 |
103 |
104 |
105 |
115 |
116 |
117 |
118 |
119 |
--------------------------------------------------------------------------------
/sample/app/src/main/res/layout/activity_book.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
23 |
24 |
25 |
26 |
31 |
32 |
43 |
44 |
54 |
55 |
56 |
57 |
68 |
69 |
79 |
80 |
81 |
82 |
93 |
94 |
102 |
103 |
104 |
105 |
115 |
116 |
117 |
118 |
119 |
--------------------------------------------------------------------------------
/sqlite/app/src/main/res/layout/activity_book.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
23 |
24 |
25 |
26 |
31 |
32 |
43 |
44 |
54 |
55 |
56 |
57 |
68 |
69 |
79 |
80 |
81 |
82 |
93 |
94 |
102 |
103 |
104 |
105 |
115 |
116 |
117 |
118 |
119 |
--------------------------------------------------------------------------------
/realm/app/src/main/java/com/ykanivets/emojibooks/BookActivity.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import android.os.Parcelable
7 | import android.text.Editable
8 | import android.text.InputFilter
9 | import android.text.Spanned
10 | import android.text.TextWatcher
11 | import android.view.MenuItem
12 | import androidx.appcompat.app.AppCompatActivity
13 | import com.google.android.material.textfield.TextInputLayout
14 | import kotlinx.android.parcel.Parcelize
15 | import kotlinx.android.synthetic.main.activity_book.etAuthor
16 | import kotlinx.android.synthetic.main.activity_book.etEmoji
17 | import kotlinx.android.synthetic.main.activity_book.etTitle
18 | import kotlinx.android.synthetic.main.activity_book.fabDone
19 | import kotlinx.android.synthetic.main.activity_book.tilAuthor
20 | import kotlinx.android.synthetic.main.activity_book.tilEmoji
21 | import kotlinx.android.synthetic.main.activity_book.tilTitle
22 | import kotlinx.android.synthetic.main.activity_book.toolbar
23 |
24 | class BookActivity : AppCompatActivity() {
25 |
26 | private val book by lazy { intent.getParcelableExtra(EXTRA_BOOK) }
27 |
28 | override fun onCreate(savedInstanceState: Bundle?) {
29 | super.onCreate(savedInstanceState)
30 | setContentView(R.layout.activity_book)
31 |
32 | initToolbar()
33 | initEditTexts()
34 | initFab()
35 | }
36 |
37 | private fun initToolbar() {
38 | setSupportActionBar(toolbar)
39 | supportActionBar?.setDisplayHomeAsUpEnabled(true)
40 | supportActionBar?.setDisplayShowHomeEnabled(true)
41 |
42 | title = getString(if (book == null) R.string.add_book else R.string.update_book)
43 | }
44 |
45 | private fun initEditTexts() {
46 | etEmoji.setText(book?.emoji)
47 | etTitle.setText(book?.title)
48 | etAuthor.setText(book?.author)
49 |
50 | etEmoji.addTextChangedListener(ClearErrorTextWatcher(tilEmoji))
51 | etTitle.addTextChangedListener(ClearErrorTextWatcher(tilTitle))
52 | etAuthor.addTextChangedListener(ClearErrorTextWatcher(tilAuthor))
53 |
54 | etEmoji.filters = arrayOf(EmojiInputFilter(), InputFilter.LengthFilter(2))
55 | etEmoji.requestFocus()
56 | }
57 |
58 | private fun initFab() = fabDone.setOnClickListener {
59 | val emoji = etEmoji.text?.toString().takeUnless { it.isNullOrBlank() }
60 | val title = etTitle.text?.toString().takeUnless { it.isNullOrBlank() }
61 | val author = etAuthor.text?.toString().takeUnless { it.isNullOrBlank() }
62 |
63 | if (emoji == null) tilEmoji.error = getString(R.string.cant_be_empty)
64 | if (title == null) tilTitle.error = getString(R.string.cant_be_empty)
65 | if (author == null) tilAuthor.error = getString(R.string.cant_be_empty)
66 |
67 | if (emoji == null || title == null || author == null) return@setOnClickListener
68 |
69 | val bookExtra = BookExtra(
70 | id = book?.id,
71 | emoji = emoji,
72 | title = title,
73 | author = author
74 | )
75 |
76 | setResult(RESULT_OK, Intent().putExtra(EXTRA_BOOK, bookExtra))
77 | finish()
78 | }
79 |
80 | override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) {
81 | android.R.id.home -> true.also { onBackPressed() }
82 | else -> super.onOptionsItemSelected(item)
83 | }
84 |
85 | private class ClearErrorTextWatcher(
86 | private val til: TextInputLayout
87 | ) : TextWatcher {
88 | override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
89 | override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
90 | override fun afterTextChanged(s: Editable) {
91 | til.isErrorEnabled = false
92 | til.error = null
93 | }
94 | }
95 |
96 | private class EmojiInputFilter : InputFilter {
97 |
98 | override fun filter(
99 | source: CharSequence,
100 | start: Int,
101 | end: Int,
102 | dest: Spanned,
103 | dstart: Int,
104 | dend: Int
105 | ): CharSequence {
106 | for (index in start until end) {
107 | val type = Character.getType(source[index])
108 | if (type !in listOf(
109 | Character.SURROGATE,
110 | Character.OTHER_SYMBOL,
111 | Character.NON_SPACING_MARK,
112 | Character.SIZE
113 | ).map { it.toInt() }
114 | ) return ""
115 | }
116 | return source
117 | }
118 | }
119 |
120 | companion object {
121 |
122 | const val EXTRA_BOOK = "extra_book"
123 |
124 | fun newIntent(
125 | context: Context,
126 | bookExtra: BookExtra? = null
127 | ) = Intent(
128 | context,
129 | BookActivity::class.java
130 | ).apply {
131 | putExtra(EXTRA_BOOK, bookExtra)
132 | }
133 | }
134 |
135 | @Parcelize
136 | data class BookExtra(
137 | val id: Long?,
138 | val emoji: String,
139 | val title: String,
140 | val author: String
141 | ) : Parcelable
142 | }
143 |
--------------------------------------------------------------------------------
/room/app/src/main/java/com/ykanivets/emojibooks/BookActivity.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import android.os.Parcelable
7 | import android.text.Editable
8 | import android.text.InputFilter
9 | import android.text.Spanned
10 | import android.text.TextWatcher
11 | import android.view.MenuItem
12 | import androidx.appcompat.app.AppCompatActivity
13 | import com.google.android.material.textfield.TextInputLayout
14 | import kotlinx.android.parcel.Parcelize
15 | import kotlinx.android.synthetic.main.activity_book.etAuthor
16 | import kotlinx.android.synthetic.main.activity_book.etEmoji
17 | import kotlinx.android.synthetic.main.activity_book.etTitle
18 | import kotlinx.android.synthetic.main.activity_book.fabDone
19 | import kotlinx.android.synthetic.main.activity_book.tilAuthor
20 | import kotlinx.android.synthetic.main.activity_book.tilEmoji
21 | import kotlinx.android.synthetic.main.activity_book.tilTitle
22 | import kotlinx.android.synthetic.main.activity_book.toolbar
23 |
24 | class BookActivity : AppCompatActivity() {
25 |
26 | private val book by lazy { intent.getParcelableExtra(EXTRA_BOOK) }
27 |
28 | override fun onCreate(savedInstanceState: Bundle?) {
29 | super.onCreate(savedInstanceState)
30 | setContentView(R.layout.activity_book)
31 |
32 | initToolbar()
33 | initEditTexts()
34 | initFab()
35 | }
36 |
37 | private fun initToolbar() {
38 | setSupportActionBar(toolbar)
39 | supportActionBar?.setDisplayHomeAsUpEnabled(true)
40 | supportActionBar?.setDisplayShowHomeEnabled(true)
41 |
42 | title = getString(if (book == null) R.string.add_book else R.string.update_book)
43 | }
44 |
45 | private fun initEditTexts() {
46 | etEmoji.setText(book?.emoji)
47 | etTitle.setText(book?.title)
48 | etAuthor.setText(book?.author)
49 |
50 | etEmoji.addTextChangedListener(ClearErrorTextWatcher(tilEmoji))
51 | etTitle.addTextChangedListener(ClearErrorTextWatcher(tilTitle))
52 | etAuthor.addTextChangedListener(ClearErrorTextWatcher(tilAuthor))
53 |
54 | etEmoji.filters = arrayOf(EmojiInputFilter(), InputFilter.LengthFilter(2))
55 | etEmoji.requestFocus()
56 | }
57 |
58 | private fun initFab() = fabDone.setOnClickListener {
59 | val emoji = etEmoji.text?.toString().takeUnless { it.isNullOrBlank() }
60 | val title = etTitle.text?.toString().takeUnless { it.isNullOrBlank() }
61 | val author = etAuthor.text?.toString().takeUnless { it.isNullOrBlank() }
62 |
63 | if (emoji == null) tilEmoji.error = getString(R.string.cant_be_empty)
64 | if (title == null) tilTitle.error = getString(R.string.cant_be_empty)
65 | if (author == null) tilAuthor.error = getString(R.string.cant_be_empty)
66 |
67 | if (emoji == null || title == null || author == null) return@setOnClickListener
68 |
69 | val bookExtra = BookExtra(
70 | id = book?.id,
71 | emoji = emoji,
72 | title = title,
73 | author = author
74 | )
75 |
76 | setResult(RESULT_OK, Intent().putExtra(EXTRA_BOOK, bookExtra))
77 | finish()
78 | }
79 |
80 | override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) {
81 | android.R.id.home -> true.also { onBackPressed() }
82 | else -> super.onOptionsItemSelected(item)
83 | }
84 |
85 | private class ClearErrorTextWatcher(
86 | private val til: TextInputLayout
87 | ) : TextWatcher {
88 | override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
89 | override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
90 | override fun afterTextChanged(s: Editable) {
91 | til.isErrorEnabled = false
92 | til.error = null
93 | }
94 | }
95 |
96 | private class EmojiInputFilter : InputFilter {
97 |
98 | override fun filter(
99 | source: CharSequence,
100 | start: Int,
101 | end: Int,
102 | dest: Spanned,
103 | dstart: Int,
104 | dend: Int
105 | ): CharSequence {
106 | for (index in start until end) {
107 | val type = Character.getType(source[index])
108 | if (type !in listOf(
109 | Character.SURROGATE,
110 | Character.OTHER_SYMBOL,
111 | Character.NON_SPACING_MARK,
112 | Character.SIZE
113 | ).map { it.toInt() }
114 | ) return ""
115 | }
116 | return source
117 | }
118 | }
119 |
120 | companion object {
121 |
122 | const val EXTRA_BOOK = "extra_book"
123 |
124 | fun newIntent(
125 | context: Context,
126 | bookExtra: BookExtra? = null
127 | ) = Intent(
128 | context,
129 | BookActivity::class.java
130 | ).apply {
131 | putExtra(EXTRA_BOOK, bookExtra)
132 | }
133 | }
134 |
135 | @Parcelize
136 | data class BookExtra(
137 | val id: Long?,
138 | val emoji: String,
139 | val title: String,
140 | val author: String
141 | ) : Parcelable
142 | }
143 |
--------------------------------------------------------------------------------
/ktor/app/src/main/java/com/ykanivets/emojibooks/BookActivity.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import android.os.Parcelable
7 | import android.text.Editable
8 | import android.text.InputFilter
9 | import android.text.Spanned
10 | import android.text.TextWatcher
11 | import android.view.MenuItem
12 | import androidx.appcompat.app.AppCompatActivity
13 | import com.google.android.material.textfield.TextInputLayout
14 | import kotlinx.android.parcel.Parcelize
15 | import kotlinx.android.synthetic.main.activity_book.etAuthor
16 | import kotlinx.android.synthetic.main.activity_book.etEmoji
17 | import kotlinx.android.synthetic.main.activity_book.etTitle
18 | import kotlinx.android.synthetic.main.activity_book.fabDone
19 | import kotlinx.android.synthetic.main.activity_book.tilAuthor
20 | import kotlinx.android.synthetic.main.activity_book.tilEmoji
21 | import kotlinx.android.synthetic.main.activity_book.tilTitle
22 | import kotlinx.android.synthetic.main.activity_book.toolbar
23 |
24 | class BookActivity : AppCompatActivity() {
25 |
26 | private val book by lazy { intent.getParcelableExtra(EXTRA_BOOK) }
27 |
28 | override fun onCreate(savedInstanceState: Bundle?) {
29 | super.onCreate(savedInstanceState)
30 | setContentView(R.layout.activity_book)
31 |
32 | initToolbar()
33 | initEditTexts()
34 | initFab()
35 | }
36 |
37 | private fun initToolbar() {
38 | setSupportActionBar(toolbar)
39 | supportActionBar?.setDisplayHomeAsUpEnabled(true)
40 | supportActionBar?.setDisplayShowHomeEnabled(true)
41 |
42 | title = getString(if (book == null) R.string.add_book else R.string.update_book)
43 | }
44 |
45 | private fun initEditTexts() {
46 | etEmoji.setText(book?.emoji)
47 | etTitle.setText(book?.title)
48 | etAuthor.setText(book?.author)
49 |
50 | etEmoji.addTextChangedListener(ClearErrorTextWatcher(tilEmoji))
51 | etTitle.addTextChangedListener(ClearErrorTextWatcher(tilTitle))
52 | etAuthor.addTextChangedListener(ClearErrorTextWatcher(tilAuthor))
53 |
54 | etEmoji.filters = arrayOf(EmojiInputFilter(), InputFilter.LengthFilter(2))
55 | etEmoji.requestFocus()
56 | }
57 |
58 | private fun initFab() = fabDone.setOnClickListener {
59 | val emoji = etEmoji.text?.toString().takeUnless { it.isNullOrBlank() }
60 | val title = etTitle.text?.toString().takeUnless { it.isNullOrBlank() }
61 | val author = etAuthor.text?.toString().takeUnless { it.isNullOrBlank() }
62 |
63 | if (emoji == null) tilEmoji.error = getString(R.string.cant_be_empty)
64 | if (title == null) tilTitle.error = getString(R.string.cant_be_empty)
65 | if (author == null) tilAuthor.error = getString(R.string.cant_be_empty)
66 |
67 | if (emoji == null || title == null || author == null) return@setOnClickListener
68 |
69 | val bookExtra = BookExtra(
70 | id = book?.id,
71 | emoji = emoji,
72 | title = title,
73 | author = author
74 | )
75 |
76 | setResult(RESULT_OK, Intent().putExtra(EXTRA_BOOK, bookExtra))
77 | finish()
78 | }
79 |
80 | override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) {
81 | android.R.id.home -> true.also { onBackPressed() }
82 | else -> super.onOptionsItemSelected(item)
83 | }
84 |
85 | private class ClearErrorTextWatcher(
86 | private val til: TextInputLayout
87 | ) : TextWatcher {
88 | override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
89 | override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
90 | override fun afterTextChanged(s: Editable) {
91 | til.isErrorEnabled = false
92 | til.error = null
93 | }
94 | }
95 |
96 | private class EmojiInputFilter : InputFilter {
97 |
98 | override fun filter(
99 | source: CharSequence,
100 | start: Int,
101 | end: Int,
102 | dest: Spanned,
103 | dstart: Int,
104 | dend: Int
105 | ): CharSequence {
106 | for (index in start until end) {
107 | val type = Character.getType(source[index])
108 | if (type !in listOf(
109 | Character.SURROGATE,
110 | Character.OTHER_SYMBOL,
111 | Character.NON_SPACING_MARK,
112 | Character.SIZE
113 | ).map { it.toInt() }
114 | ) return ""
115 | }
116 | return source
117 | }
118 | }
119 |
120 | companion object {
121 |
122 | const val EXTRA_BOOK = "extra_book"
123 |
124 | fun newIntent(
125 | context: Context,
126 | bookExtra: BookExtra? = null
127 | ) = Intent(
128 | context,
129 | BookActivity::class.java
130 | ).apply {
131 | putExtra(EXTRA_BOOK, bookExtra)
132 | }
133 | }
134 |
135 | @Parcelize
136 | data class BookExtra(
137 | val id: String?,
138 | val emoji: String,
139 | val title: String,
140 | val author: String
141 | ) : Parcelable
142 | }
143 |
--------------------------------------------------------------------------------
/sample/app/src/main/java/com/ykanivets/emojibooks/BookActivity.kt:
--------------------------------------------------------------------------------
1 | package com.ykanivets.emojibooks
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import android.os.Parcelable
7 | import android.text.Editable
8 | import android.text.InputFilter
9 | import android.text.Spanned
10 | import android.text.TextWatcher
11 | import android.view.MenuItem
12 | import androidx.appcompat.app.AppCompatActivity
13 | import com.google.android.material.textfield.TextInputLayout
14 | import kotlinx.android.parcel.Parcelize
15 | import kotlinx.android.synthetic.main.activity_book.etAuthor
16 | import kotlinx.android.synthetic.main.activity_book.etEmoji
17 | import kotlinx.android.synthetic.main.activity_book.etTitle
18 | import kotlinx.android.synthetic.main.activity_book.fabDone
19 | import kotlinx.android.synthetic.main.activity_book.tilAuthor
20 | import kotlinx.android.synthetic.main.activity_book.tilEmoji
21 | import kotlinx.android.synthetic.main.activity_book.tilTitle
22 | import kotlinx.android.synthetic.main.activity_book.toolbar
23 |
24 | class BookActivity : AppCompatActivity() {
25 |
26 | private val book by lazy { intent.getParcelableExtra(EXTRA_BOOK) }
27 |
28 | override fun onCreate(savedInstanceState: Bundle?) {
29 | super.onCreate(savedInstanceState)
30 | setContentView(R.layout.activity_book)
31 |
32 | initToolbar()
33 | initEditTexts()
34 | initFab()
35 | }
36 |
37 | private fun initToolbar() {
38 | setSupportActionBar(toolbar)
39 | supportActionBar?.setDisplayHomeAsUpEnabled(true)
40 | supportActionBar?.setDisplayShowHomeEnabled(true)
41 |
42 | title = getString(if (book == null) R.string.add_book else R.string.update_book)
43 | }
44 |
45 | private fun initEditTexts() {
46 | etEmoji.setText(book?.emoji)
47 | etTitle.setText(book?.title)
48 | etAuthor.setText(book?.author)
49 |
50 | etEmoji.addTextChangedListener(ClearErrorTextWatcher(tilEmoji))
51 | etTitle.addTextChangedListener(ClearErrorTextWatcher(tilTitle))
52 | etAuthor.addTextChangedListener(ClearErrorTextWatcher(tilAuthor))
53 |
54 | etEmoji.filters = arrayOf(EmojiInputFilter(), InputFilter.LengthFilter(2))
55 | etEmoji.requestFocus()
56 | }
57 |
58 | private fun initFab() = fabDone.setOnClickListener {
59 | val emoji = etEmoji.text?.toString().takeUnless { it.isNullOrBlank() }
60 | val title = etTitle.text?.toString().takeUnless { it.isNullOrBlank() }
61 | val author = etAuthor.text?.toString().takeUnless { it.isNullOrBlank() }
62 |
63 | if (emoji == null) tilEmoji.error = getString(R.string.cant_be_empty)
64 | if (title == null) tilTitle.error = getString(R.string.cant_be_empty)
65 | if (author == null) tilAuthor.error = getString(R.string.cant_be_empty)
66 |
67 | if (emoji == null || title == null || author == null) return@setOnClickListener
68 |
69 | val bookExtra = BookExtra(
70 | id = book?.id,
71 | emoji = emoji,
72 | title = title,
73 | author = author
74 | )
75 |
76 | setResult(RESULT_OK, Intent().putExtra(EXTRA_BOOK, bookExtra))
77 | finish()
78 | }
79 |
80 | override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) {
81 | android.R.id.home -> true.also { onBackPressed() }
82 | else -> super.onOptionsItemSelected(item)
83 | }
84 |
85 | private class ClearErrorTextWatcher(
86 | private val til: TextInputLayout
87 | ) : TextWatcher {
88 | override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
89 | override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
90 | override fun afterTextChanged(s: Editable) {
91 | til.isErrorEnabled = false
92 | til.error = null
93 | }
94 | }
95 |
96 | private class EmojiInputFilter : InputFilter {
97 |
98 | override fun filter(
99 | source: CharSequence,
100 | start: Int,
101 | end: Int,
102 | dest: Spanned,
103 | dstart: Int,
104 | dend: Int
105 | ): CharSequence {
106 | for (index in start until end) {
107 | val type = Character.getType(source[index])
108 | if (type !in listOf(
109 | Character.SURROGATE,
110 | Character.OTHER_SYMBOL,
111 | Character.NON_SPACING_MARK,
112 | Character.SIZE
113 | ).map { it.toInt() }
114 | ) return ""
115 | }
116 | return source
117 | }
118 | }
119 |
120 | companion object {
121 |
122 | const val EXTRA_BOOK = "extra_book"
123 |
124 | fun newIntent(
125 | context: Context,
126 | bookExtra: BookExtra? = null
127 | ) = Intent(
128 | context,
129 | BookActivity::class.java
130 | ).apply {
131 | putExtra(EXTRA_BOOK, bookExtra)
132 | }
133 | }
134 |
135 | @Parcelize
136 | data class BookExtra(
137 | val id: Long?,
138 | val emoji: String,
139 | val title: String,
140 | val author: String
141 | ) : Parcelable
142 | }
143 |
--------------------------------------------------------------------------------