use of androidx.lifecycle.DefaultLifecycleObserver in project Signal-Android by WhisperSystems.
the class TextureViewRenderer method init.
public void init(@NonNull EglBase.Context sharedContext, @Nullable RendererCommon.RendererEvents rendererEvents, @NonNull int[] configAttributes, @NonNull RendererCommon.GlDrawer drawer) {
ThreadUtils.checkIsOnMainThread();
this.rendererEvents = rendererEvents;
this.rotatedFrameWidth = 0;
this.rotatedFrameHeight = 0;
this.eglRenderer.init(sharedContext, this, configAttributes, drawer);
this.lifecycle = ViewUtil.getActivityLifecycle(this);
if (lifecycle != null) {
lifecycle.addObserver(new DefaultLifecycleObserver() {
@Override
public void onDestroy(@NonNull LifecycleOwner owner) {
release();
}
});
}
}
use of androidx.lifecycle.DefaultLifecycleObserver in project Signal-Android by signalapp.
the class TextureViewRenderer method init.
public void init(@NonNull EglBase.Context sharedContext, @Nullable RendererCommon.RendererEvents rendererEvents, @NonNull int[] configAttributes, @NonNull RendererCommon.GlDrawer drawer) {
ThreadUtils.checkIsOnMainThread();
this.rendererEvents = rendererEvents;
this.rotatedFrameWidth = 0;
this.rotatedFrameHeight = 0;
this.eglRenderer.init(sharedContext, this, configAttributes, drawer);
this.lifecycle = ViewUtil.getActivityLifecycle(this);
if (lifecycle != null) {
lifecycle.addObserver(new DefaultLifecycleObserver() {
@Override
public void onDestroy(@NonNull LifecycleOwner owner) {
release();
}
});
}
}
use of androidx.lifecycle.DefaultLifecycleObserver in project Signal-Android by WhisperSystems.
the class AppForegroundObserver method begin.
@MainThread
public void begin() {
ThreadUtil.assertMainThread();
ProcessLifecycleOwner.get().getLifecycle().addObserver(new DefaultLifecycleObserver() {
@Override
public void onStart(@NonNull LifecycleOwner owner) {
onForeground();
}
@Override
public void onStop(@NonNull LifecycleOwner owner) {
onBackground();
}
});
}
use of androidx.lifecycle.DefaultLifecycleObserver in project Signal-Android by signalapp.
the class AppForegroundObserver method begin.
@MainThread
public void begin() {
ThreadUtil.assertMainThread();
ProcessLifecycleOwner.get().getLifecycle().addObserver(new DefaultLifecycleObserver() {
@Override
public void onStart(@NonNull LifecycleOwner owner) {
onForeground();
}
@Override
public void onStop(@NonNull LifecycleOwner owner) {
onBackground();
}
});
}
Aggregations