Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change import android.support.v7 ... to import androidx.appcompat #263

Open
wants to merge 86 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
9e72af0
tmp update for readMe
May 25, 2018
761a4aa
dowgrade version in readMe
May 25, 2018
13ae645
Merge branch 'release/1.5.4'
Jun 4, 2018
7e1cd88
Merge branch 'release/1.5.5'
Jun 4, 2018
1a24a56
update build.gradle for use sub project deps
Jul 7, 2018
0e335e3
merge origin/develop into develop
Jul 7, 2018
3863ea4
update dagger version
Jul 30, 2018
005c4d4
Merge branch 'develop2' into develop
Jul 30, 2018
b1db5b0
add hasNotView
Aug 14, 2018
f90b889
fix
Aug 29, 2018
34849b1
Merge origin/dev into my/dev
Aug 29, 2018
8085376
Merge orDev into dev
Aug 29, 2018
cdb607a
update LaunchFragment.kt
Aug 29, 2018
a9881ef
Updated kotlin fragment template for support lib >= 27
Dosssik Oct 22, 2018
83c608d
[feature] Minor improvement for templates
senneco Nov 24, 2018
040da05
[artifact] Prepare version 1.5.6
senneco Nov 24, 2018
c789dea
add androidX support
VovaStelmashchuk Feb 3, 2019
77497d9
Merge branch 'release/1.5.6' into develop
VovaStelmashchuk Feb 3, 2019
670aa47
Update README.md
VovaStelmashchuk Feb 3, 2019
22f2095
update gradle paths
Feb 18, 2019
3a12209
Merge branch 'develop' of github.com:jordan1997/Moxy into develop
Feb 18, 2019
f8e7fae
Update MvpAppCompatDialogFragment.java
VovaStelmashchuk Mar 1, 2019
164c309
update
VovaStelmashchuk Mar 1, 2019
6615c1e
Merge branch 'develop' of github.com:jordan1997/Moxy into develop
VovaStelmashchuk Mar 1, 2019
74020c8
update read me
VovaStelmashchuk Mar 2, 2019
b12f919
Update README.md
VovaStelmashchuk Mar 2, 2019
567f349
update licenses for maven and move common to the gradle.properties
VovaStelmashchuk Mar 2, 2019
092d1f7
Merge branch 'develop' of github.com:jordan1997/Moxy into develop
VovaStelmashchuk Mar 2, 2019
b97769f
Add android arsenal bange
VovaStelmashchuk Mar 3, 2019
297294a
Update README.md
VovaStelmashchuk Mar 5, 2019
7f6802a
Update README.md
VovaStelmashchuk Mar 5, 2019
b25896d
remove presenter type and add material mvp
VovaStelmashchuk Mar 5, 2019
17ca12a
Merge branch 'develop' of github.com:jordan1997/Moxy into develop
VovaStelmashchuk Mar 5, 2019
4b8f7b5
fixed pom files
VovaStelmashchuk Mar 17, 2019
a7271af
update readme
VovaStelmashchuk Mar 17, 2019
ebc32ad
Merge remote-tracking branch 'moxy/master' into develop
VovaStelmashchuk Mar 17, 2019
b6d768f
Update README.md
VovaStelmashchuk Mar 17, 2019
0c31b27
remove all sample and add one sample app for testing module
VovaStelmashchuk Mar 18, 2019
2258f64
Merge branch 'develop' of github.com:jordan1997/Moxy into develop
VovaStelmashchuk Mar 18, 2019
437f248
remove m prefix in some class and update read me
VovaStelmashchuk Mar 18, 2019
6fd0fde
small readme update
VovaStelmashchuk Mar 18, 2019
2006697
Update README.md
VovaStelmashchuk Mar 19, 2019
5dd1046
Create SchemeOfStrategies.md
VovaStelmashchuk Mar 22, 2019
a17c722
Update SchemeOfStrategies.md
VovaStelmashchuk Mar 22, 2019
05ed199
Update SchemeOfStrategies.md
VovaStelmashchuk Mar 22, 2019
2ea6ee9
Update README.md
VovaStelmashchuk Mar 22, 2019
a91e79c
Update SchemeOfStrategies.md
phoenixxt Mar 22, 2019
a5f0098
Merge pull request #5 from phoenixxt/patch-1
VovaStelmashchuk Mar 22, 2019
ab1e7b1
Bump asm-util from 6.0 to 7.1
dependabot-support Mar 24, 2019
f0c3921
Bump javapoet from 1.10.0 to 1.11.1
dependabot-support Mar 24, 2019
8fbac56
Bump guava from 21.0 to 23.0
dependabot-support Mar 24, 2019
bd3ddfa
Bump robolectric from 3.0 to 4.2.1
dependabot-support Mar 24, 2019
5ab5e42
Bump mockito-core from 1.10.19 to 2.25.1
dependabot-support Mar 24, 2019
e32a64b
Merge pull request #6 from schoolhelper/dependabot/gradle/org.ow2.asm…
VovaStelmashchuk Mar 24, 2019
e06fadf
Merge pull request #7 from schoolhelper/dependabot/gradle/com.squareu…
VovaStelmashchuk Mar 24, 2019
c9fc404
Merge pull request #8 from schoolhelper/dependabot/gradle/com.google.…
VovaStelmashchuk Mar 24, 2019
447bc8f
Merge pull request #9 from schoolhelper/dependabot/gradle/org.robolec…
VovaStelmashchuk Mar 24, 2019
ae0ab73
Merge pull request #10 from schoolhelper/dependabot/gradle/org.mockit…
VovaStelmashchuk Mar 24, 2019
7ed2ce6
Bump truth from 0.34 to 0.43
dependabot-support Mar 25, 2019
d050030
Merge pull request #11 from schoolhelper/dependabot/gradle/develop/co…
VovaStelmashchuk Mar 25, 2019
aff59ff
Bump auto-service from 1.0-rc4 to 1.0-rc5
dependabot-support Mar 26, 2019
da196f3
Merge pull request #12 from schoolhelper/dependabot/gradle/develop/co…
VovaStelmashchuk Mar 27, 2019
c7afba9
Bump daggerVersion from 2.21 to 2.22.1
dependabot-support Apr 3, 2019
b525e7d
Merge pull request #14 from schoolhelper/dependabot/gradle/develop/da…
VovaStelmashchuk Apr 3, 2019
f618e6b
Bump mockito-core from 2.25.1 to 2.26.0
dependabot-support Apr 5, 2019
c7b82eb
Merge pull request #15 from schoolhelper/dependabot/gradle/develop/or…
VovaStelmashchuk Apr 5, 2019
bdfdb17
Bump truth from 0.43 to 0.44
dependabot-support Apr 8, 2019
ed8b661
Merge pull request #16 from schoolhelper/dependabot/gradle/develop/co…
VovaStelmashchuk Apr 8, 2019
cbdd4f3
Bump mockito-core from 2.26.0 to 2.27.0
dependabot-support Apr 11, 2019
6825646
Merge pull request #17 from schoolhelper/dependabot/gradle/develop/or…
VovaStelmashchuk Apr 11, 2019
1ea3d84
Bump kotlin_version from 1.3.21 to 1.3.30
dependabot-support Apr 12, 2019
2e8e1b6
Merge pull request #18 from schoolhelper/dependabot/gradle/develop/ko…
VovaStelmashchuk Apr 12, 2019
f6b4a09
Bump gradle from 3.3.2 to 3.4.0
dependabot-support Apr 18, 2019
eb2f1a0
Bump compile-testing from 0.15 to 0.16
dependabot-support Apr 25, 2019
873daa7
Bump kotlin_version from 1.3.30 to 1.3.31
dependabot-support Apr 26, 2019
a4354e0
Merge pull request #20 from schoolhelper/dependabot/gradle/develop/co…
VovaStelmashchuk Apr 27, 2019
18783ea
Merge pull request #19 from schoolhelper/dependabot/gradle/develop/co…
VovaStelmashchuk Apr 27, 2019
e40c93c
Merge pull request #21 from schoolhelper/dependabot/gradle/develop/ko…
VovaStelmashchuk Apr 27, 2019
99e7fb6
Bump compile-testing from 0.16 to 0.17
dependabot-support May 9, 2019
6dd576c
Merge pull request #22 from schoolhelper/dependabot/gradle/develop/co…
VovaStelmashchuk May 9, 2019
9aa93ee
Bump gradle from 3.4.0 to 3.4.1
dependabot-support May 16, 2019
2f43358
Merge pull request #23 from schoolhelper/dependabot/gradle/develop/co…
VovaStelmashchuk May 16, 2019
35961ee
Update README.md
VovaStelmashchuk Oct 3, 2019
f73984c
Update README.md
VovaStelmashchuk Oct 3, 2019
3c3958e
Merge pull request #47 from schoolhelper/jordan1997-patch-1
VovaStelmashchuk Oct 3, 2019
1847843
Fix bolt in readme
VovaStelmashchuk Jan 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ captures/
# Moxy artifacts
VERSION
artifacts/
artifacts-maven/
artifacts-maven/

# Mac OS
*.icloud
160 changes: 101 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
# Moxy
[![Maven Central](https://img.shields.io/maven-central/v/com.arello-mobile/moxy.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.arello-mobile%22%20AND%20(a%3A%22moxy%22%20OR%20a%3A%22moxy-compiler%22%20OR%20a%3A%22moxy-android%22%20OR%20a%3A%22moxy-app-compat%22)) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://opensource.org/licenses/MIT)
# MoxyX

Moxy is a library that helps to use MVP pattern when you do the Android Application. _Without problems of lifecycle and boilerplate code!_
**This Moxy repository is deprecated and no longer supported.**

**Please migrate to the actual version of the Moxy framework at [Moxy communuty](https://github.com/moxy-community/Moxy) repo.**

We added X to the Moxy for make this library coolest.

[![Maven Central](https://img.shields.io/maven-central/v/tech.schoolhelper/moxy-x.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22tech.schoolhelper%22%20AND%20a:%22moxy-x%22)

[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-MoxyX-blue.svg?style=flat)](https://android-arsenal.com/details/1/7547)

[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://opensource.org/licenses/MIT)

Moxy is a library that helps to use MVP pattern when you do the Android Application. Without problems of lifecycle and boilerplate code!

The main idea of using Moxy:
![schematic_using](https://habrastorage.org/files/a2e/b51/8b4/a2eb518b465a4df9b47e68794519270d.gif)

See what's happening here in the [wiki](https://github.com/Arello-Mobile/Moxy/wiki).

## Diff between us and root project
1. We support androidX
2. We don't support GLOBAL and WEAK presenter type
3. We have one more strategy to the library, [AddToEndSingleTagStrategy](https://github.com/jordan1997/Moxy/blob/master/moxy/src/main/java/com/arellomobile/mvp/viewstate/strategy/AddToEndSingleTagStrategy.java)

## RoadMap
- [ ] We will change the template for android studio (and Intellij), the templates will create a view interface and activity or fragment into one file, and this file and presenter keep into one package. We will remove template for Java.
- [ ] Implement compiler which use presenter from Dagger DI, by one annotation

## Capabilities

Moxy has a few killer features in other ways:
Expand All @@ -17,97 +38,118 @@ Moxy has a few killer features in other ways:
## Sample

View interface
```java
public interface HelloWorldView extends MvpView {
void showMessage(int message);
```kotlin
interface MainView : MvpView {
fun printLog(msg: String)
}

class MainActivity : MvpAppCompatActivity(), MainView {

@InjectPresenter
internal lateinit var presenter: MainPresenter

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}

override fun printLog(msg: String) {
Log.e(TAG, "printLog : msg : $msg activity hash code : ${hashCode()}")
}

companion object {
const val TAG = "MoxyDebug"
}
}
```
Presenter
```java
```kotlin
@InjectViewState
public class HelloWorldPresenter extends MvpPresenter<HelloWorldView> {
public HelloWorldPresenter() {
getViewState().showMessage(R.string.hello_world);
class MainPresenter : MvpPresenter<MainView>() {
override fun onFirstViewAttach() {
super.onFirstViewAttach()
Log.e(MainActivity.TAG, "presenter hash code : ${hashCode()}")
viewState.printLog("TEST")
}
}
```
View implementation
```java
public class HelloWorldActivity extends MvpAppCompatActivity implements HelloWorldView {

## Inject with Dagger2
```kotlin
@Inject
lateinit var daggerPresenter: Lazy<MainPresenter>

@InjectPresenter
HelloWorldPresenter mHelloWorldPresenter;

private TextView mHelloWorldTextView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hello_world);

mHelloWorldTextView = ((TextView) findViewById(R.id.activity_hello_world_text_view_message));
}

@Override
public void showMessage(int message) {
mHelloWorldTextView.setText(message);
}
}
lateinit var presenter: MainPresenter

@ProvidePresenter
fun providePresenter(): MainPresenter = daggerPresenter.get()
```

[Here](https://github.com/Arello-Mobile/Moxy/tree/master/sample-github) you can see "Github" sample application.
**We have plan for implement move easies way for connect moxy with dagger, but we need to implement specific compiler for this case**

## Wiki
[Scheme of MoxyX strategies](https://github.com/jordan1997/MoxyX/blob/develop/SchemeOfStrategies.md)

For all information check [Moxy Wiki](https://github.com/Arello-Mobile/Moxy/wiki)

## Android studio templates
In order to avoid boilerplate code creating for binding activity, fragments and its presentation part, we propose to use Android Studio templates for Moxy.
## Android studio and Intellij templates
**We will change this template in future**
In order to avoid boilerplate code creating for binding activity, fragments and its presentation part, we propose to use Android Studio templates for Moxy.

Templates located in [/moxy-templates](https://github.com/Arello-Mobile/Moxy/tree/master/moxy-templates)
Templates located in [/moxy-templates](https://github.com/jordan1997/Moxy/tree/develop/moxy-templates)

## Links
**Telegram channels from original moxy community**

[Telegram channel (en)](https://telegram.me/moxy_mvp_library)<br />
[Telegram channel (ru)](https://telegram.me/moxy_ru)<br />
[References](https://github.com/Arello-Mobile/Moxy/wiki#references)<br />
[FAQ](https://github.com/Arello-Mobile/Moxy/wiki/FAQ)

## Twitter
For connection with author of this repository use twitter
[Twitter](https://twitter.com/jordan29041997)

## Integration
Base modules integration:
### Base modules integration:
```groovy
dependencies {
...
compile 'com.arello-mobile:moxy:1.5.5'
annotationProcessor 'com.arello-mobile:moxy-compiler:1.5.5'
}
implementation 'tech.schoolhelper:moxy-x:1.7.0'
```
#### Java project
```groovy
annotationProcessor 'tech.schoolhelper:moxy-x-compiler:1.7.0'
```
#### Kotlin
```groovy
apply plugin: 'kotlin-kapt'
```
```groovy
kapt 'tech.schoolhelper:moxy-x-compiler:1.7.0'
```
### Default android module integration
For additional base view classes `MvpActivity` and `MvpFragment` add this:
```groovy
dependencies {
...
compile 'com.arello-mobile:moxy-android:1.5.5'
}
implementation 'tech.schoolhelper:moxy-x-android:1.7.0'
```
If you are planning to use AppCompat, then you can use `MvpAppCompatActivity` and `MvpAppCompatFragment`. Then add this:
### AppCompat module integration
If you use AppCompat, use `MvpAppCompatActivity` and `MvpAppCompatFragment` add this:
```groovy
dependencies {
...
compile 'com.arello-mobile:moxy-app-compat:1.5.5'
compile 'com.android.support:appcompat-v7:$support_version'
}
implementation 'tech.schoolhelper:moxy-x-app-compat:1.7.0'
```
### Kotlin
If you are using kotlin, use `kapt` instead of `provided`/`apt` dependency type:
### AndroidX module integration
If you use AndroidX, use `MvpAppCompatActivity` and `MvpAppCompatFragment` add this:
```groovy
apply plugin: 'kotlin-kapt'

dependencies {
...
kapt 'com.arello-mobile:moxy-compiler:1.5.5'
}
implementation 'tech.schoolhelper:moxy-x-androidx:1.7.0'
```
### AndroidX(Google material) module integration
If you use google material, use `MvpBottomSheetDialogFragment` add this:
```groovy
implementation 'tech.schoolhelper:moxy-x-material:1.7.0'
```

## ProGuard
Moxy is completely without reflection! No special ProGuard rules required.
MoxyX is completely without reflection! No special ProGuard rules required.

## License
```
Expand Down
15 changes: 15 additions & 0 deletions SchemeOfStrategies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Scheme of strategies

This page shows how MoxyX strategies work.

# AddToEndSingleStrategy
![AddToEndSingleStrategy](https://raw.githubusercontent.com/jordan1997/blog/master/images/AddToEndSingleStrategy.png)

# AddToEndStartegy
![AddToEndStartegy](https://raw.githubusercontent.com/jordan1997/blog/master/images/AddToEndStartegy.png)

# OneExecutionStartegy
![OneExecutionStartegy](https://raw.githubusercontent.com/jordan1997/blog/master/images/OneExecutionStartegy.png)

# SkipStartegy
![SkipStartegy](https://raw.githubusercontent.com/jordan1997/blog/master/images/SkipStartegy.png)
22 changes: 11 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.4.1'
}
}

Expand All @@ -20,21 +20,21 @@ allprojects {
}

ext {
targetVersionCode = 45
targetVersionName = "1.5.5"
targetVersionCode = 47
targetVersionName = "1.7.0"

deps = [
android : 'com.google.android:android:1.6_r2',
javapoet : 'com.squareup:javapoet:1.10.0',
javapoet : 'com.squareup:javapoet:1.11.1',
junit : 'junit:junit:4.12',
mockito : 'org.mockito:mockito-core:1.10.19',
truth : 'com.google.truth:truth:0.34',
robolectric : 'org.robolectric:robolectric:3.0',
compiletesting: 'com.google.testing.compile:compile-testing:0.15',
asm : ['org.ow2.asm:asm:6.0', 'org.ow2.asm:asm-util:6.0'],
autoservice : 'com.google.auto.service:auto-service:1.0-rc4',
mockito : 'org.mockito:mockito-core:2.27.0',
truth : 'com.google.truth:truth:0.44',
robolectric : 'org.robolectric:robolectric:4.2.1',
compiletesting: 'com.google.testing.compile:compile-testing:0.17',
asm : ['org.ow2.asm:asm:7.1', 'org.ow2.asm:asm-util:7.1'],
autoservice : 'com.google.auto.service:auto-service:1.0-rc5',
autocommon : 'com.google.auto:auto-common:0.10',
guava : 'com.google.guava:guava:21.0',
guava : 'com.google.guava:guava:23.0',
]
}

Expand Down
13 changes: 7 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# 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.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

#org.gradle.java.home=<path to jdk1.8 for tests>
#org.gradle.java.home=<path to jdk1.8 for tests>
POM_LICENCE_URL=https\://opensource.org/licenses/MIT
POM_LICENCE_NAME=The MIT License (MIT)
POM_SCM_CONNECTION=scm:[email protected]:jordan1997/Moxy.git
POM_URL=https://github.com/jordan1997/Moxy
URL=https://schoolhelper.tech/
POM_DESCRIPTION=MoxyX, we added X for make this librayr coolest
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 @@
#Sat Nov 24 23:06:24 NOVT 2018
#Mon Mar 18 21:21:55 EET 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
Loading