Skip to content

Commit

Permalink
Merge pull request #34 from Omega-R/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
anton-knyazev authored Aug 17, 2020
2 parents 627138a + e231a28 commit 7f2c046
Show file tree
Hide file tree
Showing 110 changed files with 2,225 additions and 766 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
/build
/captures
.externalNativeBuild
lib/build/generated
lib/build
110 changes: 110 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/dictionaries/R12.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/dictionaries/antonknyazev.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
9 changes: 9 additions & 0 deletions annotations/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apply plugin: 'kotlin'
apply plugin: 'com.github.dcendents.android-maven'
group = 'com.github.Omega-R.OmegaBase'

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection DifferentStdlibGradleVersion
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.omega_r.base.annotations

@Retention(AnnotationRetention.SOURCE)
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class AppOmegaRepository
21 changes: 13 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ android {
compileSdkVersion 28
defaultConfig {
applicationId "com.omega_r.omegabase.simple"
multiDexEnabled true
minSdkVersion 14
targetSdkVersion 28
versionCode 1
Expand Down Expand Up @@ -39,18 +40,22 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"
implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
implementation 'androidx.core:core-ktx:1.1.0-beta01'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0-rc01'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:${kotlinCorutines_version}"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${kotlinCorutines_version}"
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha5'
testImplementation 'junit:junit:4.13-beta-3'
androidTestImplementation 'androidx.test:runner:1.2.0-beta01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0-beta01'
implementation project(':lib')
kapt 'com.github.Omega-R.OmegaMoxy:moxy-compiler:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta3'
implementation 'androidx.recyclerview:recyclerview:1.1.0'

implementation project(':core')
kapt 'com.github.Omega-R.OmegaMoxy:moxy-compiler:1.7.1'
kapt project(':processor')

implementation 'com.github.bumptech.glide:glide:4.9.0'

testImplementation 'junit:junit:4.13-beta-3'
androidTestImplementation 'androidx.test:runner:1.3.0-alpha02'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha02'


}
35 changes: 35 additions & 0 deletions app/src/main/java/com/omega_r/base/simple/InspectionRepository.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.omega_r.base.simple

import com.omega_r.base.annotations.AppOmegaRepository
import com.omega_r.base.data.OmegaRepository.Strategy
import kotlinx.coroutines.channels.ReceiveChannel

@AppOmegaRepository
interface InspectionRepository : ParentRepository {

val isAuth: Boolean?
get() = true
var age: Int

val inspectionUpdateChannel: ReceiveChannel<List<String>>

suspend fun getInspectionsChannel(strategy: Strategy, index: Int): ReceiveChannel<String>

suspend fun getInspections(strategy: Strategy, index: Int): String

suspend fun getInspections(pair: Pair<String, Int>, second: Boolean)

suspend fun pair(): Pair<String?, Int>?

suspend fun returnInt(): Int?

suspend fun returnBoolean(): Boolean {
return true
}

fun clearCache()

// TODO future code generation
// suspend fun lambda(func: (String) -> Boolean): Int

}
5 changes: 4 additions & 1 deletion app/src/main/java/com/omega_r/base/simple/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ class MainActivity : OmegaActivity(), MainView {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
title = intent.getStringExtra(EXTRA_TITLE)
setOnClickListener(R.id.button) {
showToast(Text.from("Test"))
}
}

private fun onClickItem(item: Image) {
showToast(Text.from("Click $item"))

// ActivityLauncher.launch(this, null, createLauncher("1"), createLauncher("2"))

createLauncher("1").launch(this, createLauncher("2"))
// createLauncher("1").launch(this, createLauncher("2"))
}

data class Item(
Expand Down
21 changes: 9 additions & 12 deletions app/src/main/java/com/omega_r/base/simple/MainPresenter.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.omega_r.base.simple

import android.Manifest
import com.omega_r.base.enitity.contains
import com.omega_r.base.logs.log
import com.omega_r.base.mvp.model.Action
import com.omega_r.base.mvp.presenters.OmegaPresenter
import com.omega_r.base.simple.dialog_fragment.DialogDialogFragment
import com.omega_r.libs.omegatypes.Text
import com.omegar.mvp.InjectViewState
import kotlinx.coroutines.Dispatchers
Expand All @@ -17,18 +20,12 @@ import java.io.Serializable
class MainPresenter : OmegaPresenter<MainView>() {

init {
launch {
delay(5000)
viewState.showToast(Text.from("Go"))
viewState.setWaiting(true)
delay(5000)
viewState.setWaiting(false)
}




// viewState.showMessage(Text.from("test"), Action(Text.from("Test")) {
DialogDialogFragment.createLauncher()
.launch()
// viewState.showMe
// log {
// "Message"
// }ssage(Text.from("test"), Action(Text.from("Test")) {
// viewState.showToast(Text.from("test"))
// })
//
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/com/omega_r/base/simple/ParentRepository.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.omega_r.base.simple

interface ParentRepository {

suspend fun parentMethod(): String

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.omega_r.base.simple.dialog_fragment

import android.os.Bundle
import com.omega_r.base.annotations.OmegaContentView
import com.omega_r.base.components.OmegaDialogFragment
import com.omega_r.base.simple.R
import com.omega_r.libs.omegatypes.Text
import com.omegar.libs.omegalaunchers.createDialogFragmentLauncher
import com.omegar.mvp.presenter.InjectPresenter

/**
* Created by Anton Knyazev on 10.03.2020.
*/
@OmegaContentView(R.layout.activity_main)
class DialogDialogFragment : OmegaDialogFragment(), DialogView {

companion object {
fun createLauncher() = createDialogFragmentLauncher()
}

@InjectPresenter
override lateinit var presenter: DialogPresenter

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setOnClickListener(R.id.button) {
showToast(Text.from("Test from dialog"))
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.omega_r.base.simple.dialog_fragment

import com.omega_r.base.mvp.presenters.OmegaPresenter
import com.omegar.mvp.InjectViewState

/**
* Created by Anton Knyazev on 10.03.2020.
*/
@InjectViewState
class DialogPresenter : OmegaPresenter<DialogView>() {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.omega_r.base.simple.dialog_fragment

import com.omega_r.base.mvp.views.OmegaView

/**
* Created by Anton Knyazev on 10.03.2020.
*/
interface DialogView: OmegaView
Loading

0 comments on commit 7f2c046

Please sign in to comment.