Search in sources :

Example 61 with MainActivity

use of com.odysee.app.MainActivity in project odysee-android by OdyseeTeam.

the class SearchFragment method onPause.

public void onPause() {
    Context context = getContext();
    if (context != null) {
        MainActivity activity = (MainActivity) context;
        activity.removeDownloadActionListener(this);
        activity.updateMiniPlayerMargins(true);
        PreferenceManager.getDefaultSharedPreferences(context).unregisterOnSharedPreferenceChangeListener(this);
    }
    super.onPause();
}
Also used : Context(android.content.Context) MainActivity(com.odysee.app.MainActivity)

Example 62 with MainActivity

use of com.odysee.app.MainActivity in project odysee-android by OdyseeTeam.

the class SearchFragment method onStop.

@Override
public void onStop() {
    MainActivity activity = (MainActivity) getContext();
    if (activity != null) {
        activity.resetCurrentDisplayFragment();
        activity.showBottomNavigation();
        activity.cancelScheduledSearchFuture();
    }
    super.onStop();
}
Also used : MainActivity(com.odysee.app.MainActivity)

Example 63 with MainActivity

use of com.odysee.app.MainActivity in project odysee-android by OdyseeTeam.

the class SearchFragment method onResume.

public void onResume() {
    super.onResume();
    Context context = getContext();
    Helper.setWunderbarValue(currentQuery, context);
    if (context != null) {
        PreferenceManager.getDefaultSharedPreferences(context).registerOnSharedPreferenceChangeListener(this);
        if (context instanceof MainActivity) {
            MainActivity activity = (MainActivity) context;
            LbryAnalytics.setCurrentScreen(activity, "Search", "Search");
            activity.addDownloadActionListener(this);
            activity.updateCurrentDisplayFragment(this);
            activity.updateMiniPlayerMargins(false);
        }
    }
    if (!Helper.isNullOrEmpty(currentQuery)) {
        logSearch(currentQuery);
        search(currentQuery, currentFrom);
    } else {
        lassoSpacemanView.setVisibility(View.VISIBLE);
        explainerView.setText(getString(R.string.search_type_to_discover));
        explainerView.setVisibility(View.VISIBLE);
    }
    applyFilterForBlockedChannels(Lbryio.blockedChannels);
}
Also used : Context(android.content.Context) MainActivity(com.odysee.app.MainActivity)

Example 64 with MainActivity

use of com.odysee.app.MainActivity in project odysee-android by OdyseeTeam.

the class AllContentFragment method onResume.

public void onResume() {
    super.onResume();
    Helper.setWunderbarValue(null, getContext());
    checkParams(false);
    Context context = getContext();
    if (context instanceof MainActivity) {
        MainActivity activity = (MainActivity) context;
        if (singleTagView) {
            LbryAnalytics.setCurrentScreen(activity, "Tag", "Tag");
        } else {
            LbryAnalytics.setCurrentScreen(activity, "All Content", "AllContent");
        }
        activity.addDownloadActionListener(this);
        if (activity.isInitialCategoriesLoaded()) {
            buildAndDisplayContentCategories();
        }
        PreferenceManager.getDefaultSharedPreferences(context).registerOnSharedPreferenceChangeListener(this);
        updateContentFromLinkText();
        updateContentScopeLinkText();
        updateSortByLinkText();
    }
    applyFilterForBlockedChannels(Lbryio.blockedChannels);
}
Also used : Context(android.content.Context) MainActivity(com.odysee.app.MainActivity)

Example 65 with MainActivity

use of com.odysee.app.MainActivity in project odysee-android by OdyseeTeam.

the class AllContentFragment method onPause.

public void onPause() {
    Context context = getContext();
    if (context != null) {
        ((MainActivity) context).removeDownloadActionListener(this);
    }
    PreferenceManager.getDefaultSharedPreferences(context).unregisterOnSharedPreferenceChangeListener(this);
    contentCategoriesDisplayed = false;
    super.onPause();
}
Also used : Context(android.content.Context) MainActivity(com.odysee.app.MainActivity)

Aggregations

MainActivity (com.odysee.app.MainActivity)138 Context (android.content.Context)119 Claim (com.odysee.app.model.Claim)39 View (android.view.View)31 TextView (android.widget.TextView)30 RecyclerView (androidx.recyclerview.widget.RecyclerView)26 AttributeProviderContext (org.commonmark.renderer.html.AttributeProviderContext)25 ArrayList (java.util.ArrayList)21 TrackSelectionOverride (com.google.android.exoplayer2.trackselection.TrackSelectionOverrides.TrackSelectionOverride)19 ImageView (android.widget.ImageView)18 SuppressLint (android.annotation.SuppressLint)15 AdapterView (android.widget.AdapterView)14 NestedScrollView (androidx.core.widget.NestedScrollView)14 JSONException (org.json.JSONException)13 JSONObject (org.json.JSONObject)13 SolidIconView (com.odysee.app.ui.controls.SolidIconView)12 HashMap (java.util.HashMap)12 ClaimListAdapter (com.odysee.app.adapter.ClaimListAdapter)11 ApiCallException (com.odysee.app.exceptions.ApiCallException)11 WebView (android.webkit.WebView)10