Releases: GCX-HCI/ThirtyInch
v0.8.0-rc1
Changelog 0.8.0-rc1
thirtyinch
New: TiPresenter
lifecycle methods got renamed #26
The new naming is more convenient throughout most android MPV libraries.
onWakeUp()
is now deprecated and can be replaced withonAttachView(TiView)
which has theTiView
as argumentonSleep()
is now deprecated and can be replaced withonDetachView()
- @Override
- protected void onWakeUp() {
- super.onWakeUp();
- }
+ @Override
+ protected void onAttachView(@NonNull final HelloWorldView view) {
+ super.onAttachView(view);
+ }
- @Override
- protected void onSleep() {
- super.onSleep();
- }
+ @Override
+ protected void onDetachView() {
+ super.onDetachView();
+ }
New: TiPresenter#getView()
is now @Nullable
#26
getView()
is now annotated with @Nullable
and causes lint to hint a Nullable warning. This warning was missing and caused a lot of NPEs for Ti
beginners. On the other hand, the view
in onAttachView(TiView)
is @NonNull
. No unnecessary null
checks are required
New: wait for view before executing code TiPresenter#sendToView(ViewAction<TiView>)
#36
Sending events to the view although the view isn't attached is already possible with rx and .compose(rxUtils.deliverLatestCacheToView(this)) which caches all items until the view is attached and emits them in the same order. The same behavior is now back ported to pure java.
// TiPresenter
@Override
protected void onCreate() {
super.onCreate();
doNetworkCall(result -> {
// getView() could be null
// getView().showData(result);
sendToView(view -> {
// lambda will be executed when the view got attached (onAttachView(TiView))
// view is never null
view.showData(result);
});
});
}
New: TiLog
logging API #14, #15
Before this library logged everything automatically. ThirtyInch is now silent by default. If you are interested in the logs register your own logger.
// logcat example
TiLog.setLogger(TiLog.LOGCAT);
// Timber example
Timber.plant(new Timber.DebugTree());
TiLog.setLogger(new TiLog.Logger() {
@Override
public void log(final int level, final String tag, final String msg) {
Timber.tag(tag).log(level, msg);
}
});
New: @DistinctUntilChanged
uses now equals()
for comparison instead of hashCode()
(thx @fzymek) #19, #24
The new default implementation uses equals()
instead of hashcode()
. A DistinctComparator
can be set as argument of the annotation @DistinctUntilChanged(comparator = EqualsComparator.class)
. Three different implementations exist:
EqualsComparator
(default) - usesequals()
for comparison and holds a strong reference to the previous arguementsWeakEqualsComparator
- usesequals()
for comparison and holds a weak reference to the previous arguments. Could call a method twice whengc()
kicks in.HashComparator
- old implementation usinghashCode()
for comparison. Doesn't hold references to the arguments
New: The support library is now a provided
instead of a compile
dependency #23
Therefore it uses the AppCompat
version you are compiling in your app. It isn't required anymore to exclude the support library for all Ti
dependencies when your app is using an older AppCompat
version.
Fix: Activity#recreate()
(with useStaticSaviorToRetain=false
) destroys the Presenter #35
When changing the configuration of an TiActivity
without closing it (by calling recreate()
or changing the orientation) the Presenter was destroyed although the Activity
flag isChangingConfigurations
was true
resulting in a NPE when the TiActivity
runs in onCreate
. This only happened when useStaticSaviorToRetain
was set to false
.
thirtyinch-rx
Fix: view can be null
before unsubscribing from Subscriptions #27
When using the RxTiPresenterSubscriptionHandler
to automatically unsubscribe from views it can happen (multithreaded environment) that getView()
returns null
before Subscriptions#unsubscribe()
is called.
v0.7.1
0.7.0
ThirtyInch
- remove RxJava dependency and moved it in a separate module
TiLifecycleObserver
for the PresenterTiConfiguration
for disabling features can be passed into theTiPresenter
constructor- upgrade to support library
24.2.0
- moved
TiActivity
logic inTiActivityDelegate
to share most code between the plugin and the Activity implementation providePresenter()
removed theBundle
argument which made the Presenter not reusable between Fragment and Activity. TheBundle
is still available withgetIntent().getExtras()
but null checks are yours now.
Rx
is now a separate module
RxTiPresenterUtils
contains Transformers delaying emits until theTiView
is attachedRxTiPresenterSubscriptionHandler
added to theTiPresenter
manages subscriptions (see theHelloWorldPresenter
)
Plugin
- updated to CompositeAndroid 0.2.2
- bugfix recovering from nonConfigurationInstance
Test
is a new module helping moving the presenter to the correct state in tests (TiPresenterInstructor
)
0.6.0
ThirtyInch
- Add
Ti
prefix to API classes to reduce clashes withandroid.view.View
(TiView
,TiPresenter
,TiActivity
,TiFragment
) - statically typed Presenter
-public class HelloWorldActivity extends ThirtyInchActivity<HelloWorldView>
+public class HelloWorldActivity extends TiActivity<HelloWorldPresenter, HelloWorldView>
- interface instead of abstract method for
P providePresenter()
, makes it easy for Kotlin - minSdkVersion 14
- fragment presenter survives orientation change
- Tests by @jveerkamp
- NPE fix when calling
bindNewView(null)
Plugin
- compositeAndroid 0.2.1 fixed
onRetainNonConfigurationInstance
not called