Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Releases: GCX-HCI/ThirtyInch

v0.8.0-rc1

09 Nov 10:44
Compare
Choose a tag to compare
v0.8.0-rc1 Pre-release
Pre-release

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 with onAttachView(TiView) which has the TiView as argument
  • onSleep() is now deprecated and can be replaced with onDetachView()
-    @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) - uses equals() for comparison and holds a strong reference to the previous arguements
  • WeakEqualsComparator - uses equals() for comparison and holds a weak reference to the previous arguments. Could call a method twice when gc() kicks in.
  • HashComparator - old implementation using hashCode() 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

07 Sep 12:36
Compare
Choose a tag to compare

ThirtyInch

  • fix class name type OnTimeRemovable -> OneTimeRemovable #2
  • add missing getPresenter() to TiActivity #3

0.7.0

04 Sep 22:17
Compare
Choose a tag to compare

ThirtyInch

  • remove RxJava dependency and moved it in a separate module
  • TiLifecycleObserver for the Presenter
  • TiConfiguration for disabling features can be passed into the TiPresenter constructor
  • upgrade to support library 24.2.0
  • moved TiActivity logic in TiActivityDelegate to share most code between the plugin and the Activity implementation
  • providePresenter() removed the Bundle argument which made the Presenter not reusable between Fragment and Activity. The Bundle is still available with getIntent().getExtras() but null checks are yours now.

Rx

is now a separate module

  • RxTiPresenterUtils contains Transformers delaying emits until the TiView is attached
  • RxTiPresenterSubscriptionHandler added to the TiPresenter manages subscriptions (see the HelloWorldPresenter)

Plugin

Test

is a new module helping moving the presenter to the correct state in tests (TiPresenterInstructor)

0.6.0

04 Sep 22:02
Compare
Choose a tag to compare
0.6.0 Pre-release
Pre-release

ThirtyInch

  • Add Ti prefix to API classes to reduce clashes with android.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

0.5.0

04 Sep 22:00
Compare
Choose a tag to compare
0.5.0 Pre-release
Pre-release
  • Rebranding to ThirtyInch
  • @CallOnMainThread Annotation
  • @DistinctUntilChanged Annotation
  • Documentation for public release
  • Sample project