io.nextop.rx.RxActivity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of android Show documentation
Show all versions of android Show documentation
Nextop client for Android 10+
The newest version!
package io.nextop.rx;
import android.app.Activity;
import android.view.View;
import rx.Observable;
import rx.Subscription;
public class RxActivity extends Activity implements RxLifecycleBinder {
private final RxLifecycleBinder.Lifted liftedRxLifecycleBinder = new RxLifecycleBinder.Lifted();
@Override
public void reset() {
liftedRxLifecycleBinder.reset();
}
@Override
public boolean reset(Object id) {
return liftedRxLifecycleBinder.reset(id);
}
@Override
public Observable bind(Observable source) {
return liftedRxLifecycleBinder.bind(source);
}
@Override
public void bind(Subscription sub) {
liftedRxLifecycleBinder.bind(sub);
}
@Override
public void unsubscribe() {
liftedRxLifecycleBinder.unsubscribe();
}
@Override
public boolean isUnsubscribed() {
return liftedRxLifecycleBinder.isUnsubscribed();
}
@Override
public void onResume() {
super.onResume();
View contentView = findViewById(android.R.id.content);
liftedRxLifecycleBinder.connect(contentView);
}
@Override
public void onPause() {
super.onPause();
liftedRxLifecycleBinder.disconnect();
}
@Override
public void onDestroy() {
super.onDestroy();
liftedRxLifecycleBinder.close();
}
}