Skip to content

Commit

Permalink
Remove currentActivity from TvApp
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen committed Feb 19, 2022
1 parent f3aa78c commit 0e37aea
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 43 deletions.
17 changes: 0 additions & 17 deletions app/src/main/java/org/jellyfin/androidtv/TvApp.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package org.jellyfin.androidtv;

import android.app.Activity;
import android.app.Application;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MediatorLiveData;
Expand All @@ -25,8 +23,6 @@ public class TvApp extends Application {
private BaseItemDto lastPlayedItem;
private PlaybackController playbackController;

private Activity currentActivity;

@Override
public void onCreate() {
super.onCreate();
Expand Down Expand Up @@ -56,19 +52,6 @@ public void setCurrentUser(UserDto currentUser) {
TvManager.clearCache();
}

/**
* @deprecated This function is causing a **lot** of issues because not all activities will set their self as "currentactivity". Try to receive a Context instance instead.
*/
@Deprecated
@Nullable
public Activity getCurrentActivity() {
return currentActivity;
}

public void setCurrentActivity(Activity activity) {
currentActivity = activity;
}

@Nullable
public PlaybackController getPlaybackController() {
return playbackController;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ package org.jellyfin.androidtv.di
import android.app.Application
import org.jellyfin.androidtv.ui.shared.AppThemeCallbacks
import org.jellyfin.androidtv.ui.shared.AuthenticatedUserCallbacks
import org.jellyfin.androidtv.ui.shared.CurrentActivityCallbacks
import org.koin.dsl.bind
import org.koin.dsl.module

val activityLifecycleCallbacksModule = module {
single { AuthenticatedUserCallbacks(get()) } bind Application.ActivityLifecycleCallbacks::class
single { AppThemeCallbacks(get()) } bind Application.ActivityLifecycleCallbacks::class
single { CurrentActivityCallbacks() } bind Application.ActivityLifecycleCallbacks::class
}

This file was deleted.

0 comments on commit 0e37aea

Please sign in to comment.