Search in sources :

Example 16 with MainActivity

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

the class PublishFragment method record.

private void record() {
    Context context = getContext();
    if (context instanceof MainActivity) {
        recordPending = false;
        ((MainActivity) context).requestVideoCapture();
    }
}
Also used : Context(android.content.Context) MainActivity(com.odysee.app.MainActivity)

Example 17 with MainActivity

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

the class PublishesFragment method onActionItemClicked.

@Override
public boolean onActionItemClicked(androidx.appcompat.view.ActionMode actionMode, MenuItem menuItem) {
    if (R.id.action_edit == menuItem.getItemId()) {
        if (adapter != null && adapter.getSelectedCount() > 0) {
            Claim claim = adapter.getSelectedItems().get(0);
            // start channel editor with the claim
            Context context = getContext();
            if (context instanceof MainActivity) {
                ((MainActivity) context).openPublishForm(claim);
            }
            actionMode.finish();
            return true;
        }
    }
    if (R.id.action_delete == menuItem.getItemId()) {
        if (adapter != null && adapter.getSelectedCount() > 0) {
            final List<Claim> selectedClaims = new ArrayList<>(adapter.getSelectedItems());
            String message = getResources().getQuantityString(R.plurals.confirm_delete_publishes, selectedClaims.size());
            AlertDialog.Builder builder = new AlertDialog.Builder(getContext()).setTitle(R.string.delete_selection).setMessage(message).setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    handleDeleteSelectedClaims(selectedClaims);
                }
            }).setNegativeButton(R.string.no, null);
            builder.show();
            return true;
        }
    }
    return false;
}
Also used : Context(android.content.Context) AlertDialog(androidx.appcompat.app.AlertDialog) DialogInterface(android.content.DialogInterface) ArrayList(java.util.ArrayList) MainActivity(com.odysee.app.MainActivity) Claim(com.odysee.app.model.Claim)

Example 18 with MainActivity

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

the class RewardsFragment method onStop.

public void onStop() {
    Context context = getContext();
    if (context instanceof MainActivity) {
        MainActivity activity = (MainActivity) context;
        activity.resetCurrentDisplayFragment();
    }
    super.onStop();
}
Also used : Context(android.content.Context) MainActivity(com.odysee.app.MainActivity)

Example 19 with MainActivity

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

the class RewardsFragment method onStart.

public void onStart() {
    super.onStart();
    Context context = getContext();
    if (context instanceof MainActivity) {
        MainActivity activity = (MainActivity) context;
        activity.setWunderbarValue(null);
    }
}
Also used : Context(android.content.Context) MainActivity(com.odysee.app.MainActivity)

Example 20 with MainActivity

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

the class RewardsFragment method onPause.

public void onPause() {
    Context context = getContext();
    if (context instanceof MainActivity) {
        MainActivity activity = (MainActivity) context;
        activity.updateMiniPlayerMargins(true);
    }
    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