From cdf839c3527e0e68e943e1374ad27603fc32e0b2 Mon Sep 17 00:00:00 2001 From: Maikel Rehl Date: Tue, 20 Feb 2018 14:54:52 +0100 Subject: [PATCH 1/2] Made sendToView public to allow to override or extend the function. --- .../src/main/java/net/grandcentrix/thirtyinch/TiPresenter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirtyinch/src/main/java/net/grandcentrix/thirtyinch/TiPresenter.java b/thirtyinch/src/main/java/net/grandcentrix/thirtyinch/TiPresenter.java index 5a815db7..3ac16f9c 100644 --- a/thirtyinch/src/main/java/net/grandcentrix/thirtyinch/TiPresenter.java +++ b/thirtyinch/src/main/java/net/grandcentrix/thirtyinch/TiPresenter.java @@ -560,7 +560,7 @@ protected void onWakeUp() { * @see #sendPostponedActionsToView * @see #onAttachView(TiView) */ - protected void sendToView(final ViewAction action) { + public void sendToView(final ViewAction action) { final V view = getView(); if (view != null) { runOnUiThread(new Runnable() { From 1aee62c5cc1ea29829092d6eaac3607702167829 Mon Sep 17 00:00:00 2001 From: Maikel Rehl Date: Wed, 21 Feb 2018 17:19:58 +0100 Subject: [PATCH 2/2] Add @RestrictTo(SUBCLASSES) annotation to sendToView --- .../main/java/net/grandcentrix/thirtyinch/TiPresenter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/thirtyinch/src/main/java/net/grandcentrix/thirtyinch/TiPresenter.java b/thirtyinch/src/main/java/net/grandcentrix/thirtyinch/TiPresenter.java index 3ac16f9c..8d6c829d 100644 --- a/thirtyinch/src/main/java/net/grandcentrix/thirtyinch/TiPresenter.java +++ b/thirtyinch/src/main/java/net/grandcentrix/thirtyinch/TiPresenter.java @@ -16,10 +16,13 @@ package net.grandcentrix.thirtyinch; +import static android.support.annotation.RestrictTo.Scope.SUBCLASSES; + import android.app.Activity; import android.content.Intent; import android.support.annotation.NonNull; import android.support.annotation.Nullable; +import android.support.annotation.RestrictTo; import android.support.annotation.VisibleForTesting; import android.support.v4.app.Fragment; import android.widget.Toast; @@ -560,6 +563,7 @@ protected void onWakeUp() { * @see #sendPostponedActionsToView * @see #onAttachView(TiView) */ + @RestrictTo(SUBCLASSES) public void sendToView(final ViewAction action) { final V view = getView(); if (view != null) {