fix black boxes in toasts

This commit is contained in:
caneleex 2021-04-22 21:13:39 +02:00
parent f4808a9778
commit c87b38330a

View File

@ -212,19 +212,21 @@ public abstract class SponsorBlockUtils {
.setItems(items, new DialogInterface.OnClickListener() { .setItems(items, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
Context con = context.getApplicationContext();
switch (voteOptions[which]) { switch (voteOptions[which]) {
case UPVOTE: case UPVOTE:
Toast.makeText(context, str("vote_started"), Toast.LENGTH_SHORT).show(); Toast.makeText(con, str("vote_started"), Toast.LENGTH_SHORT).show();
voteForSegment(segment, true, null); voteForSegment(segment, true, null);
break; break;
case DOWNVOTE: case DOWNVOTE:
Toast.makeText(context, str("vote_started"), Toast.LENGTH_SHORT).show(); Toast.makeText(con, str("vote_started"), Toast.LENGTH_SHORT).show();
voteForSegment(segment, false, null); voteForSegment(segment, false, null);
break; break;
case CATEGORY_CHANGE: case CATEGORY_CHANGE:
onNewCategorySelect(segment, context); onNewCategorySelect(segment, con);
break; break;
} }
appContext = new WeakReference<>(con);
} }
}) })
.show(); .show();
@ -370,7 +372,7 @@ public abstract class SponsorBlockUtils {
.setPositiveButton(android.R.string.yes, segmentReadyDialogButtonListener) .setPositiveButton(android.R.string.yes, segmentReadyDialogButtonListener)
.show(); .show();
} else { } else {
Toast.makeText(context, "Mark two locations on the time bar first", Toast.LENGTH_SHORT).show(); Toast.makeText(context, str("new_segment_mark_locations_first"), Toast.LENGTH_SHORT).show();
} }
} }