-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update some deps, add simple-stack-example-scoping-java
- Loading branch information
Showing
84 changed files
with
820 additions
and
53 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
69 changes: 69 additions & 0 deletions
69
samples/scoping-samples/simple-stack-example-scoping-java/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
|
||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
74 changes: 74 additions & 0 deletions
74
...ples/simple-stack-example-scoping-java/src/main/java/com/google/auto/value/AutoValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
* | ||
* @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> | ||
* @AutoValue | ||
* abstract class Person { | ||
* static Builder builder() { | ||
* return new AutoValue_Person.Builder(); | ||
* } | ||
* <p> | ||
* abstract String name(); | ||
* abstract int id(); | ||
* <p> | ||
* @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 { | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...g-java/src/main/java/com/zhuinden/simplestackexamplescoping/application/MainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
Oops, something went wrong.