Skip to content

Commit

Permalink
Update some deps, add simple-stack-example-scoping-java
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuinden committed Mar 27, 2021
1 parent fa12ecb commit 2f2419a
Show file tree
Hide file tree
Showing 84 changed files with 820 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

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

3 changes: 2 additions & 1 deletion .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.

6 changes: 3 additions & 3 deletions samples/advanced-samples/extensions-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ dependencies {
implementation("androidx.activity:activity-ktx:1.2.0")
implementation("androidx.fragment:fragment-ktx:1.3.0")

implementation("androidx.lifecycle:lifecycle-common-java8:2.3.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.3.0")
implementation("androidx.lifecycle:lifecycle-common-java8:2.3.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.3.1")

implementation(project(":simple-stack"))
implementation "com.github.Zhuinden:simple-stack-extensions:2.1.0"
Expand Down
8 changes: 4 additions & 4 deletions samples/advanced-samples/mvvm-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ dependencies {

implementation("androidx.activity:activity:1.2.0")
implementation("androidx.cardview:cardview:1.0.0")
implementation("com.google.android.material:material:1.2.1")
implementation("com.google.android.material:material:1.3.0")
implementation("androidx.recyclerview:recyclerview:1.1.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")

// live data
implementation("androidx.lifecycle:lifecycle-common-java8:2.3.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.3.0")
implementation("androidx.lifecycle:lifecycle-common-java8:2.3.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.3.1")

// Dependencies for local unit tests
testImplementation("junit:junit:4.13.2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ dependencies {
androidTestImplementation("androidx.test:runner:1.3.0")
androidTestImplementation("androidx.test:rules:1.3.0")
implementation("androidx.appcompat:appcompat:1.2.0")
implementation("androidx.fragment:fragment:1.2.5")
implementation("com.google.android.material:material:1.2.1")
implementation("androidx.fragment:fragment:1.3.2")
implementation("com.google.android.material:material:1.3.0")
implementation("androidx.vectordrawable:vectordrawable:1.1.0")
implementation("com.github.Zhuinden.simple-stack-extensions:fragments:2.1.0") {
implementation("com.github.Zhuinden.simple-stack-extensions:fragments:2.2.0") {
exclude(module = "simple-stack") // only needed because of jitpack vs local
}
annotationProcessor("frankiesardo:auto-parcel:1.0.3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies {
androidTestImplementation("androidx.test:runner:1.3.0")
androidTestImplementation("androidx.test:rules:1.3.0")
implementation("androidx.appcompat:appcompat:1.2.0")
implementation("com.google.android.material:material:1.2.1")
implementation("com.google.android.material:material:1.3.0")
implementation("androidx.vectordrawable:vectordrawable:1.1.0")
annotationProcessor("frankiesardo:auto-parcel:1.0.3")
testImplementation("junit:junit:4.13.2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ dependencies {
//implementation(mapOf("dir" to "libs", "include" to listOf("*.jar")))
implementation(project(":simple-stack"))

implementation("com.github.Zhuinden.simple-stack-extensions:fragments:2.1.0") {
implementation("com.github.Zhuinden.simple-stack-extensions:fragments:2.2.0") {
exclude(module = "simple-stack") // only needed because of jitpack vs local
}
implementation("com.github.Zhuinden.simple-stack-extensions:fragments-ktx:2.1.0") {
implementation("com.github.Zhuinden.simple-stack-extensions:fragments-ktx:2.2.0") {
exclude(module = "simple-stack") // only needed because of jitpack vs local
}
implementation("com.github.Zhuinden.simple-stack-extensions:navigator-ktx:2.1.0") {
implementation("com.github.Zhuinden.simple-stack-extensions:navigator-ktx:2.2.0") {
exclude(module = "simple-stack") // only needed because of jitpack vs local
}

Expand All @@ -51,7 +51,7 @@ dependencies {
implementation("androidx.activity:activity:1.2.0")
implementation("androidx.fragment:fragment-ktx:1.3.0")

implementation("com.google.android.material:material:1.2.1")
implementation("com.google.android.material:material:1.3.0")
testImplementation("junit:junit:4.13.2")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ android {
dependencies {
//implementation(mapOf("dir" to "libs", "include" to listOf("*.jar")))
implementation(project(":simple-stack"))
implementation("com.github.Zhuinden.simple-stack-extensions:navigator-ktx:2.1.0") {
implementation("com.github.Zhuinden.simple-stack-extensions:navigator-ktx:2.2.0") {
exclude(module = "simple-stack") // only needed because of jitpack vs local
}

Expand All @@ -50,7 +50,7 @@ dependencies {
androidTestImplementation("androidx.test:runner:1.3.0")
androidTestImplementation("androidx.test:rules:1.3.0")
implementation("androidx.appcompat:appcompat:1.2.0")
implementation("com.google.android.material:material:1.2.1")
implementation("com.google.android.material:material:1.3.0")
implementation("androidx.vectordrawable:vectordrawable:1.1.0")

testImplementation("junit:junit:4.13.2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ dependencies {

implementation(project(":simple-stack"))

implementation("com.github.Zhuinden.simple-stack-extensions:fragments:2.1.0") {
implementation("com.github.Zhuinden.simple-stack-extensions:fragments:2.2.0") {
exclude(module = "simple-stack") // only needed because of jitpack vs local
}
implementation("com.github.Zhuinden.simple-stack-extensions:fragments-ktx:2.1.0") {
implementation("com.github.Zhuinden.simple-stack-extensions:fragments-ktx:2.2.0") {
exclude(module = "simple-stack") // only needed because of jitpack vs local
}
implementation("com.github.Zhuinden.simple-stack-extensions:navigator-ktx:2.1.0") {
implementation("com.github.Zhuinden.simple-stack-extensions:navigator-ktx:2.2.0") {
exclude(module = "simple-stack") // only needed because of jitpack vs local
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ dependencies {
implementation("androidx.activity:activity:1.2.0")
implementation("androidx.fragment:fragment-ktx:1.3.0")

implementation("androidx.lifecycle:lifecycle-common-java8:2.3.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.3.0")
implementation("androidx.lifecycle:lifecycle-common-java8:2.3.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.3.1")

implementation("androidx.recyclerview:recyclerview:1.1.0")
implementation("com.google.android.material:material:1.2.1")
implementation("com.google.android.material:material:1.3.0")
implementation("com.bartoszlipinski:viewpropertyobjectanimator:1.4.5")

implementation("it.sephiroth.android.library.bottomnavigation:bottom-navigation:2.0.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ dependencies {
implementation("androidx.activity:activity:1.2.0")
implementation("androidx.fragment:fragment-ktx:1.3.0")

implementation("androidx.lifecycle:lifecycle-common-java8:2.3.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.3.0")
implementation("androidx.lifecycle:lifecycle-common-java8:2.3.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.3.1")

implementation("androidx.recyclerview:recyclerview:1.1.0")
implementation("com.google.android.material:material:1.2.1")
implementation("com.google.android.material:material:1.3.0")
implementation("com.bartoszlipinski:viewpropertyobjectanimator:1.4.5")

implementation("it.sephiroth.android.library.bottomnavigation:bottom-navigation:2.0.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ android {
dependencies {
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "androidx.recyclerview:recyclerview:1.1.0"

implementation "androidx.fragment:fragment-ktx:1.3.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.0"
implementation "androidx.lifecycle:lifecycle-common-java8:2.3.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1"
implementation "androidx.lifecycle:lifecycle-common-java8:2.3.1"

implementation(project(":simple-stack"))
implementation 'com.github.Zhuinden:simple-stack-extensions:2.1.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
plugins {
id("com.android.application")
}

android {
compileSdkVersion(28)

defaultConfig {
applicationId = "com.zhuinden.simplestackexamplescopingjava"
minSdkVersion(16)
targetSdkVersion(28)
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

buildFeatures {
viewBinding = true
}
}

dependencies {
//implementation(mapOf("dir" to "libs", "include" to listOf("*.jar")))
implementation(project(":simple-stack"))

androidTestImplementation("androidx.test.espresso:espresso-core:3.3.0")
implementation("androidx.appcompat:appcompat:1.2.0")
implementation("com.google.android.material:material:1.3.0")
testImplementation("junit:junit:4.13.2")

implementation("androidx.lifecycle:lifecycle-common-java8:2.3.1")
implementation("androidx.lifecycle:lifecycle-viewmodel:2.3.1")
implementation("androidx.lifecycle:lifecycle-livedata:2.3.1")

implementation("com.github.Zhuinden.simple-stack-extensions:fragments:2.2.0") {
exclude(module = "simple-stack") // only needed because of jitpack vs local
}
implementation("com.github.Zhuinden.simple-stack-extensions:services:2.2.0") {
exclude(module = "simple-stack") // only needed because of jitpack vs local
}

implementation("com.github.Zhuinden:fragmentviewbindingdelegate-kt:1.0.0")

annotationProcessor("frankiesardo:auto-parcel:1.0.3")

implementation("io.reactivex.rxjava2:rxjava:2.2.21")
implementation("io.reactivex.rxjava2:rxandroid:2.1.1")
implementation("com.jakewharton.rxbinding2:rxbinding:2.2.0")
implementation("com.jakewharton.rxrelay2:rxrelay:2.1.1")

implementation("androidx.lifecycle:lifecycle-viewmodel:2.3.1")
implementation("androidx.lifecycle:lifecycle-livedata:2.3.1")

implementation("com.github.Zhuinden:event-emitter:1.2.0")


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Copyright (C) 2012 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.auto.value;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Specifies that <a href="https://github.com/google/auto/tree/master/value">AutoValue</a> should
* generate an implementation class for the annotated abstract class, implementing the standard
* {@link Object} methods like {@link Object#equals equals} to have conventional value semantics. A
* simple example: <pre>
*
* &#64;AutoValue
* abstract class Person {
* static Person create(String name, int id) {
* return new AutoValue_Person(name, id);
* }
*
* abstract String name();
* abstract int id();
* }</pre>
*
* @author Éamonn McManus
* @author Kevin Bourrillion
* @see <a href="https://github.com/google/auto/tree/master/value">AutoValue User's Guide</a>
*/
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface AutoValue {

/**
* Specifies that AutoValue should generate an implementation of the annotated class or interface,
* to serve as a <i>builder</i> for the value-type class it is nested within. As a simple example,
* here is an alternative way to write the {@code Person} class mentioned in the {@link AutoValue}
* example: <pre>
* <p>
* &#64;AutoValue
* abstract class Person {
* static Builder builder() {
* return new AutoValue_Person.Builder();
* }
* <p>
* abstract String name();
* abstract int id();
* <p>
* &#64;AutoValue.Builder
* interface Builder {
* Builder name(String x);
* Builder id(int x);
* Person build();
* }
* }</pre>
*
* @author Éamonn McManus
*/
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface Builder {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.zhuinden.simplestackexamplescoping.application;

import android.os.Bundle;

import com.zhuinden.simplestack.History;
import com.zhuinden.simplestack.SimpleStateChanger;
import com.zhuinden.simplestack.StateChange;
import com.zhuinden.simplestack.navigator.Navigator;
import com.zhuinden.simplestackexamplescoping.R;
import com.zhuinden.simplestackexamplescoping.features.words.WordListKey;
import com.zhuinden.simplestackextensions.fragments.DefaultFragmentStateChanger;
import com.zhuinden.simplestackextensions.services.DefaultServiceProvider;

import javax.annotation.Nonnull;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class MainActivity
extends AppCompatActivity
implements SimpleStateChanger.NavigationHandler {
private DefaultFragmentStateChanger fragmentStateChanger;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

fragmentStateChanger = new DefaultFragmentStateChanger(getSupportFragmentManager(), R.id.container);

Navigator.configure().setStateChanger(new SimpleStateChanger(this)).setScopedServices(new DefaultServiceProvider()).install(this, findViewById(R.id.container), History.of(WordListKey.create()));
}

@Override
public void onBackPressed() {
if(!Navigator.onBackPressed(this)) {
super.onBackPressed();
}
}

@Override
public void onNavigationEvent(@Nonnull StateChange stateChange) {
fragmentStateChanger.handleStateChange(stateChange);
}
}
Loading

0 comments on commit 2f2419a

Please sign in to comment.