Skip to content

Commit

Permalink
Demo restored
Browse files Browse the repository at this point in the history
Not finished and crashes because of an ongoing Koin bug
InsertKoinIO/koin#847
  • Loading branch information
alan.schneider committed Aug 25, 2020
1 parent 8524126 commit 296c1bd
Show file tree
Hide file tree
Showing 39 changed files with 282 additions and 473 deletions.
1 change: 0 additions & 1 deletion android/build.gradle
Expand Up @@ -8,5 +8,4 @@ apply plugin: 'com.github.dcendents.android-maven'
group='com.github.shkschneider'

apply from: 'build_android.gradle'

apply from: 'build_dependencies.gradle'
2 changes: 1 addition & 1 deletion android/build_dependencies.gradle
@@ -1,5 +1,5 @@
dependencies {
implementation project(':kotlin')
api project(':kotlin')

version = '1.2.0' // https://developer.android.com/jetpack/androidx/releases/appcompat
implementation "androidx.appcompat:appcompat:${version}"
Expand Down
Expand Up @@ -25,7 +25,7 @@ import me.shkschneider.skeleton.android.content.SkeletonReceiver
import me.shkschneider.skeleton.android.content.IntentHelper
import me.shkschneider.skeleton.android.helper.KeyboardHelper
import me.shkschneider.skeleton.android.os.ThreadHelper
import me.shkschneider.skeleton.android.widget.OverlayLoader
import me.shkschneider.skeleton.android.view.OverlayLoader
import me.shkschneider.skeleton.kotlin.log.Logger

/**
Expand Down
Expand Up @@ -7,7 +7,7 @@ import android.view.ViewGroup
import androidx.annotation.LayoutRes
import androidx.fragment.app.Fragment
import me.shkschneider.skeleton.android.R
import me.shkschneider.skeleton.android.widget.Inflater
import me.shkschneider.skeleton.android.view.Inflater
import kotlin.reflect.KClass

/**
Expand Down
Expand Up @@ -65,6 +65,9 @@ open class WebService(val gson: Gson = Gson()) {
})
}

inline fun <reified T: Any> deserialize(content: String): T? =
Deserializer(gson, T::class).deserialize(content)

class Deserializer<T : Any>(private val gson: Gson, private val klass: KClass<T>) : ResponseDeserializable<T> {

override fun deserialize(content: String): T? =
Expand Down
Expand Up @@ -13,7 +13,7 @@ import me.shkschneider.skeleton.android.R
import me.shkschneider.skeleton.android.app.cancelable
import me.shkschneider.skeleton.android.app.dimBehind
import me.shkschneider.skeleton.android.provider.SystemServices
import me.shkschneider.skeleton.android.widget.Notify
import me.shkschneider.skeleton.android.view.Notify
import me.shkschneider.skeleton.android.widget.tint
import me.shkschneider.skeleton.kotlin.jvm.TAG
import me.shkschneider.skeleton.kotlin.jvm.exhaustive
Expand Down
@@ -1,4 +1,4 @@
package me.shkschneider.skeleton.android.widget
package me.shkschneider.skeleton.android.view

import android.widget.ArrayAdapter
import androidx.appcompat.widget.AppCompatAutoCompleteTextView
Expand Down
@@ -1,4 +1,4 @@
package me.shkschneider.skeleton.android.widget
package me.shkschneider.skeleton.android.view

import android.app.Activity
import android.content.DialogInterface
Expand All @@ -14,6 +14,7 @@ import androidx.annotation.UiThread
import com.google.android.material.bottomsheet.BottomSheetDialog
import me.shkschneider.skeleton.android.R
import me.shkschneider.skeleton.android.util.Metrics
import me.shkschneider.skeleton.android.widget.expand

// <https://github.com/javiersantos/BottomDialogs>
// app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
Expand Down
@@ -1,4 +1,4 @@
package me.shkschneider.skeleton.android.widget
package me.shkschneider.skeleton.android.view

import android.content.res.ColorStateList
import android.view.View
Expand Down
@@ -1,4 +1,4 @@
package me.shkschneider.skeleton.android.widget
package me.shkschneider.skeleton.android.view

import android.view.LayoutInflater
import android.view.View
Expand Down
@@ -1,4 +1,4 @@
package me.shkschneider.skeleton.android.widget
package me.shkschneider.skeleton.android.view

import android.annotation.SuppressLint
import android.view.View
Expand Down
@@ -1,4 +1,4 @@
package me.shkschneider.skeleton.android.widget
package me.shkschneider.skeleton.android.view

import android.app.Dialog
import android.os.Bundle
Expand Down
@@ -1,4 +1,4 @@
package me.shkschneider.skeleton.android.widget
package me.shkschneider.skeleton.android.view

import android.view.View
import androidx.annotation.UiThread
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -3,7 +3,7 @@ buildscript {
java: JavaVersion.VERSION_1_8,
kotlin: '1.4.0', // https://github.com/JetBrains/kotlin
koin: '2.1.6', // https://github.com/InsertKoinIO/koin
skeleton: '10.1.6',
skeleton: '10.1.7',
gradle: [
android: '4.0.1', // <https://developer.android.com/studio/releases/gradle-plugin.html>
jitpack: '2.1'
Expand Down
82 changes: 2 additions & 80 deletions demo/build.gradle
Expand Up @@ -6,83 +6,5 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
kapt.useBuildCache = true

android {
defaultConfig {
applicationId 'me.shkschneider.skeleton.demo'
}
signingConfigs {
debug {
storeFile file('../debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
// keytool -genkey -v -keystore release.jks -keyalg RSA -keysize 2048 -validity 10000 -alias androidkey
storeFile file('../release.keystore')
storePassword 'android'
keyAlias 'androidkey'
keyPassword 'android'
}
}
buildTypes {
debug {
// applicationIdSuffix '.debug'
// versionNameSuffix '-DEBUG'
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.release
}
}
bundle {
/**
* If the user changes their device configuration at any time (such as adding another choice of language),
* then the play store will recognize this and attempt to download the new configuration splits
* for all applications that use split APKs on their device.
*/
language.enableSplit = true
density.enableSplit = true
abi.enableSplit = true
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/notice.txt'
}
externalNativeBuild {
ndkBuild {
path 'src/main/jni/Android.mk'
}
}
}

dependencies {
// implementation "com.github.shkschneider.android_Skeleton:core:${version}"
implementation project(':core')

implementation project(':arch')

implementation project(':fuel')

implementation project(':room')
version = '2.0.0'
kapt "androidx.room:room-compiler:${version}"

implementation project(':koin')

version = '2.71828' // https://github.com/square/picasso
implementation "com.squareup.picasso:picasso:${version}"

version = '0.31.2' // https://github.com/facebook/flipper
debugImplementation "com.facebook.flipper:flipper:${version}"
debugImplementation "com.facebook.flipper:flipper-network-plugin:${version}"
debugImplementation "com.facebook.soloader:soloader:0.8.2"
releaseImplementation "com.facebook.flipper:flipper-noop:${version}"
}
apply from: 'build_android.gradle'
apply from: 'build_dependencies.gradle'
74 changes: 74 additions & 0 deletions demo/build_android.gradle
@@ -0,0 +1,74 @@
android {
compileSdkVersion versions.android.sdk.target
buildToolsVersion versions.android.buildTools

defaultConfig {
minSdkVersion versions.android.sdk.min
targetSdkVersion versions.android.sdk.target
versionCode versionCode()
versionName versions.skeleton
vectorDrawables.useSupportLibrary = true
}

signingConfigs {
debug {
storeFile file('../debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
// keytool -genkey -v -keystore release.jks -keyalg RSA -keysize 2048 -validity 10000 -alias androidkey
storeFile file('../release.keystore')
storePassword 'android'
keyAlias 'androidkey'
keyPassword 'android'
}
}
sourceSets {
debug.java.srcDirs += 'src/debug/kotlin'
main.java.srcDirs += 'src/main/kotlin'
release.java.srcDirs += 'src/release/kotlin'
test.java.srcDirs += 'src/test/kotlin'
androidTest.java.srcDirs += 'src/androidTest/kotlin'
}
buildTypes {
debug {
// applicationIdSuffix '.debug'
// versionNameSuffix '-DEBUG'
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.release
}
}
compileOptions {
sourceCompatibility versions.java
targetCompatibility versions.java
}
kotlinOptions {
jvmTarget = versions.java.toString()
}
bundle {
/**
* If the user changes their device configuration at any time (such as adding another choice of language),
* then the play store will recognize this and attempt to download the new configuration splits
* for all applications that use split APKs on their device.
*/
language.enableSplit = true
density.enableSplit = true
abi.enableSplit = true
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/notice.txt'
}

}
49 changes: 49 additions & 0 deletions demo/build_dependencies.gradle
@@ -0,0 +1,49 @@
dependencies {
// implementation "com.github.shkschneider.android_Skeleton:android:${version}"
implementation project(':android')

version = '1.2.0' // https://developer.android.com/jetpack/androidx/releases/appcompat
implementation "androidx.appcompat:appcompat:${version}"
version = '1.3.1' // https://developer.android.com/jetpack/androidx/releases/core
implementation "androidx.core:core:${version}"
implementation "androidx.core:core-ktx:${version}"
version = '2.2.0' // https://developer.android.com/jetpack/androidx/releases/lifecycle
implementation "androidx.lifecycle:lifecycle-viewmodel:${version}"
implementation "androidx.lifecycle:lifecycle-livedata:${version}"
implementation "androidx.lifecycle:lifecycle-extensions:${version}"
// version = '1.0.0' // https://developer.android.com/jetpack/androidx/releases/palette
// implementation "androidx.palette:palette:${version}"
version = '1.1.1' // https://developer.android.com/jetpack/androidx/releases/preference
implementation "androidx.preference:preference:${version}"
// version = '1.1.0' // https://developer.android.com/jetpack/androidx/releases/recyclerview
// implementation "androidx.recyclerview:recyclerview:${version}"
// version = '1.1.0' // https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout
// implementation "androidx.swiperefreshlayout:swiperefreshlayout:${version}"

version = '1.2.0' // https://maven.google.com/web/index.html#com.google.android.material:material
implementation "com.google.android.material:material:${version}"
version = '2.8.6' // https://github.com/google/gson
implementation "com.google.code.gson:gson:${version}"

version = '2.1.6' // https://github.com/InsertKoinIO/koin
implementation "org.koin:koin-core:${version}"
implementation "org.koin:koin-android:${version}"
implementation "org.koin:koin-androidx-scope:${version}"
implementation "org.koin:koin-androidx-viewmodel:${version}"

version = '2.2.3' // https://github.com/kittinunf/Fuel
implementation "com.github.kittinunf.fuel:fuel:${version}"
implementation "com.github.kittinunf.fuel:fuel-android:${version}"
implementation "com.github.kittinunf.fuel:fuel-gson:${version}"
implementation "com.github.kittinunf.fuel:fuel-livedata:${version}"
implementation "com.github.kittinunf.fuel:fuel-kotlinx-serialization:${version}"

version = '2.2.5' // https://developer.android.com/jetpack/androidx/releases/room
implementation "androidx.room:room-runtime:${version}"
kapt "androidx.room:room-compiler:${version}"

version = '2.71828' // https://github.com/square/picasso
implementation "com.squareup.picasso:picasso:${version}"

// TODO https://github.com/facebook/flipper
}
7 changes: 3 additions & 4 deletions demo/src/debug/AndroidManifest.xml
@@ -1,13 +1,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="me.shkschneider.skeleton.demo">

<application
android:name=".DebugApplication">

<activity
android:name="com.facebook.flipper.android.diagnostics.FlipperDiagnosticActivity"
android:exported="true" />
<!-- <activity-->
<!-- android:name="com.facebook.flipper.android.diagnostics.FlipperDiagnosticActivity"-->
<!-- android:exported="true" />-->

</application>

Expand Down
@@ -1,39 +1,21 @@
package me.shkschneider.skeleton.demo

import com.facebook.flipper.android.AndroidFlipperClient
import com.facebook.flipper.android.utils.FlipperUtils
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin
import com.facebook.flipper.plugins.inspector.DescriptorMapping
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin
import com.facebook.soloader.SoLoader
import me.shkschneider.skeleton.demo.data.DataManager
import me.shkschneider.skeleton.kotlinx.Coroutines

class DebugApplication : MainApplication() {

override fun onCreate() {
super.onCreate()

flipper()

Coroutines.io {
DataManager.dummy()
}
}

private fun flipper() {
SoLoader.init(this, false);
if (FlipperUtils.shouldEnableFlipper(this)) {
AndroidFlipperClient.getInstance(this).also {
// Layout Inscpector
it.addPlugin(InspectorFlipperPlugin(this, DescriptorMapping.withDefaults()))
// Crash Reporter
it.addPlugin(CrashReporterPlugin.getInstance())
// Network (OkHttp: addNetworkInterceptor(FlipperOkhttpInterceptor(NetworkFlipperPlugin())))
it.addPlugin(NetworkFlipperPlugin());
}.start()
}
// SoLoader.init(this, false);
// if (FlipperUtils.shouldEnableFlipper(this)) {
// AndroidFlipperClient.getInstance(this).also {
// // Layout Inscpector
// it.addPlugin(InspectorFlipperPlugin(this, DescriptorMapping.withDefaults()))
// // Crash Reporter
// it.addPlugin(CrashReporterPlugin.getInstance())
// // Network (OkHttp: addNetworkInterceptor(FlipperOkhttpInterceptor(NetworkFlipperPlugin())))
// it.addPlugin(NetworkFlipperPlugin());
// }.start()
// }
}

}

0 comments on commit 296c1bd

Please sign in to comment.