Skip to content

Commit

Permalink
Made some fields to be final
Browse files Browse the repository at this point in the history
  • Loading branch information
drakeet committed Sep 15, 2017
1 parent bd09e8a commit 35e2679
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions library/src/main/java/me/drakeet/floo/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
public class Configuration {

private @NonNull TargetMap targetMap;
private @NonNull final TargetMap targetMap;
private @NonNull final List<TargetNotFoundHandler> targetNotFoundHandlers;
private @NonNull final List<Interceptor> requestInterceptors;
private @NonNull final List<Interceptor> targetInterceptors;
Expand Down Expand Up @@ -126,7 +126,6 @@ Target getTarget(@NonNull String url) {
@RequiresApi(api = Build.VERSION_CODES.ICE_CREAM_SANDWICH)
void initStackObserverIfNeed(@NonNull Activity activity) {
if (!stackObserverInitialized) {

activity.getApplication().registerActivityLifecycleCallbacks(
new ActivityOnResumeCallback() {

Expand All @@ -135,6 +134,7 @@ public void onActivityResumed(@NonNull Activity activity) {
StackManager.onActivityResumed(activity);
}
});
stackObserverInitialized = true;
}
}
}
12 changes: 6 additions & 6 deletions library/src/main/java/me/drakeet/floo/Floo.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public final class Floo implements Navigation {

private static final Configuration CONFIGURATION = new Configuration();

private @NonNull Context context;
private @NonNull Bundle bundle;
private @NonNull Map<String, String> queryParams;
private @NonNull final Context context;
private @NonNull final Bundle bundle;
private @NonNull final Map<String, String> queries;
private @NonNull Uri sourceUri;

private @Nullable Uri targetUri;
Expand All @@ -64,7 +64,7 @@ private Floo(@NonNull Context context, @NonNull String url) {
this.context = context;
this.bundle = new Bundle();
this.sourceUri = Uri.parse(url);
this.queryParams = new HashMap<>();
this.queries = new HashMap<>();
}


Expand Down Expand Up @@ -173,7 +173,7 @@ public Navigation putExtras(@NonNull Bundle bundle) {
*/
@NonNull @Override @CheckResult
public Navigation appendQueryParameter(@NonNull String key, @NonNull String value) {
queryParams.put(key, value);
queries.put(key, value);
return this;
}

Expand Down Expand Up @@ -221,7 +221,7 @@ public void ifIntentNonNullSendTo(@NonNull IntentReceiver receiver) {
*/
@Nullable @Override @CheckResult
public Intent getIntent() {
sourceUri = appendSourceUri(sourceUri, queryParams);
sourceUri = appendSourceUri(sourceUri, queries);
Chain chain = interceptRequest(sourceUri);
sourceUri = chain.request();
if (chain.isProceed()) {
Expand Down

0 comments on commit 35e2679

Please sign in to comment.