Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
  • Loading branch information
apikyanrobert committed Feb 3, 2021
1 parent 538ac76 commit 089358f
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 26 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
5 changes: 5 additions & 0 deletions .idea/gradle.xml

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

2 changes: 1 addition & 1 deletion .idea/misc.xml

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

4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.21'
ext.kotlin_version = '1.4.21'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Apr 22 14:44:58 AMT 2019
#Wed Feb 03 15:00:27 AMT 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
12 changes: 6 additions & 6 deletions lifecyclemvp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28
compileSdkVersion 30

defaultConfig {
minSdkVersion 14
targetSdkVersion 28
targetSdkVersion 30
versionCode 1
versionName "1.1.0"
versionName "1.1.1"
}

buildTypes {
Expand All @@ -22,9 +22,9 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation "android.arch.lifecycle:extensions:1.1.1"
api 'com.github.RobertApikyan:AbstractMvp:1.0.5'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
api 'com.github.RobertApikyan:AbstractMvp:1.0.6'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package robertapikyan.com.lifecyclemvp.lifecycle

import android.arch.lifecycle.LifecycleOwner
import android.arch.lifecycle.ViewModelProviders
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentActivity
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.ViewModelProvider
import robertapikyan.com.abstractmvp.presentation.Mvp
import robertapikyan.com.abstractmvp.presentation.presenter.IPresenterHolder
import robertapikyan.com.abstractmvp.presentation.presenter.IPresenterLifecycleHandler
Expand Down Expand Up @@ -54,9 +52,9 @@ open class LifecycleMvpFactory<V : LifecycleView, P : LifecyclePresenter<V>>(
*/
@Suppress("UNCHECKED_CAST")
override fun getPresenterHolder(): IPresenterHolder<V, P> = when (view) {
is Fragment -> ViewModelProviders.of(view as Fragment)
is androidx.fragment.app.Fragment -> ViewModelProvider(view as androidx.fragment.app.Fragment)
.get(ViewModelPresenterHolder::class.java) as ViewModelPresenterHolder<V, P>
is FragmentActivity -> ViewModelProviders.of(view as FragmentActivity)
is androidx.fragment.app.FragmentActivity -> ViewModelProvider(view as androidx.fragment.app.FragmentActivity)
.get(ViewModelPresenterHolder::class.java) as ViewModelPresenterHolder<V, P>
else -> throw IllegalArgumentException(view::class.java.name +
" must be implemented by Fragment or FragmentActivity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package robertapikyan.com.lifecyclemvp.lifecycle

import android.arch.lifecycle.Lifecycle
import android.arch.lifecycle.LifecycleObserver
import android.arch.lifecycle.OnLifecycleEvent
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent
import robertapikyan.com.abstractmvp.presentation.presenter.IPresenterLifecycle
import robertapikyan.com.abstractmvp.presentation.presenter.IPresenterLifecycleHandler

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package robertapikyan.com.lifecyclemvp.lifecycle

import android.arch.lifecycle.LifecycleOwner
import android.arch.lifecycle.LiveData
import android.arch.lifecycle.Observer
import android.os.Handler
import android.os.Looper
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import robertapikyan.com.abstractmvp.presentation.view.*
import java.util.*
import java.util.concurrent.atomic.AtomicBoolean
Expand Down Expand Up @@ -91,7 +91,7 @@ class ViewActionDispatcherLiveData<V : IView> : LiveData<IViewAction<V>>(),
}

override fun postValue(value: IViewAction<V>?) {
uiHandler.post{
uiHandler.post {
setValue(value)
}
}
Expand All @@ -108,7 +108,7 @@ class ViewActionDispatcherLiveData<V : IView> : LiveData<IViewAction<V>>(),
lock.lock()

while (!pendingActions.isEmpty())
sendSticky(pendingActions.poll())
pendingActions.poll()?.run(::sendSticky)

lock.unlock()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package robertapikyan.com.lifecyclemvp.lifecycle

import android.arch.lifecycle.ViewModel
import androidx.lifecycle.ViewModel
import robertapikyan.com.abstractmvp.presentation.presenter.IPresenterHolder

/**
Expand Down

0 comments on commit 089358f

Please sign in to comment.