use of com.odysee.app.adapter.InlineChannelSpinnerAdapter in project odysee-android by OdyseeTeam.
the class PublishFormFragment method initUi.
private void initUi() {
Context context = getContext();
languageSpinner.setAdapter(new LanguageSpinnerAdapter(context, R.layout.spinner_item_generic));
licenseSpinner.setAdapter(new LicenseSpinnerAdapter(context, R.layout.spinner_item_generic));
licenseSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long l) {
License license = (License) adapterView.getAdapter().getItem(position);
boolean otherLicense = Arrays.asList(Predefined.LICENSE_COPYRIGHTED.toLowerCase(), Predefined.LICENSE_OTHER.toLowerCase()).contains(license.getName().toLowerCase());
Helper.setViewVisibility(layoutOtherLicenseDescription, otherLicense ? View.VISIBLE : View.GONE);
if (!otherLicense) {
inputOtherLicenseDescription.setText(null);
}
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
linkGenerateAddress.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!editMode) {
inputAddress.setText(Helper.generateUrl());
}
}
});
switchPrice.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
Helper.setViewVisibility(textNoPrice, checked ? View.GONE : View.VISIBLE);
Helper.setViewVisibility(layoutPrice, checked ? View.VISIBLE : View.GONE);
}
});
inputAddress.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
String value = Helper.getValue(charSequence);
boolean invalid = !Helper.isNullOrEmpty(value) && !LbryUri.isNameValid(value);
Helper.setViewVisibility(textInlineAddressInvalid, invalid ? View.VISIBLE : View.INVISIBLE);
}
@Override
public void afterTextChanged(Editable editable) {
}
});
inputDeposit.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean hasFocus) {
Helper.setViewVisibility(inlineDepositBalanceContainer, hasFocus ? View.VISIBLE : View.GONE);
}
});
linkShowExtraFields.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (layoutExtraFields.getVisibility() != View.VISIBLE) {
layoutExtraFields.setVisibility(View.VISIBLE);
linkShowExtraFields.setText(R.string.hide_extra_fields);
scrollView.post(new Runnable() {
@Override
public void run() {
scrollView.fullScroll(NestedScrollView.FOCUS_DOWN);
}
});
} else {
layoutExtraFields.setVisibility(View.GONE);
linkShowExtraFields.setText(R.string.show_extra_fields);
}
}
});
mediaContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
checkStoragePermissionAndLaunchFilePicker();
}
});
channelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long l) {
Object item = adapterView.getItemAtPosition(position);
if (item instanceof Claim) {
Claim claim = (Claim) item;
if (claim.isPlaceholder() && !claim.isPlaceholderAnonymous()) {
if (!fetchingChannels) {
showChannelCreator();
}
}
}
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
inputTagFilter.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
String value = Helper.getValue(charSequence);
setFilter(value);
}
@Override
public void afterTextChanged(Editable editable) {
}
});
linkPublishCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (transcodeInProgress) {
// show alert confirming the user is sure, and then cancel
FFmpeg.cancel();
transcodeInProgress = false;
}
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).onBackPressed();
}
}
});
buttonPublish.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (uploading) {
Snackbar.make(view, R.string.publish_thumbnail_in_progress, Snackbar.LENGTH_LONG).show();
return;
} else if (Helper.isNullOrEmpty(uploadedThumbnailUrl)) {
showError(getString(R.string.publish_no_thumbnail));
return;
}
if (transcodeInProgress) {
Snackbar.make(view, R.string.optimization_in_progress, Snackbar.LENGTH_LONG).show();
return;
}
// check minimum deposit
String depositString = Helper.getValue(inputDeposit.getText());
double depositAmount = 0;
try {
depositAmount = Double.valueOf(depositString);
} catch (NumberFormatException ex) {
// pass
showError(getString(R.string.please_enter_valid_deposit));
return;
}
if (depositAmount < Helper.MIN_DEPOSIT) {
String error = getResources().getQuantityString(R.plurals.min_deposit_required, depositAmount == 1 ? 1 : 2, String.valueOf(Helper.MIN_DEPOSIT));
showError(error);
return;
}
if (Lbry.getAvailableBalance() < depositAmount) {
showError(getString(R.string.deposit_more_than_balance));
return;
}
String priceString = Helper.getValue(inputPrice.getText());
double priceAmount = Helper.parseDouble(priceString, 0);
if (switchPrice.isChecked() && priceAmount == 0) {
showError(getString(R.string.price_amount_not_set));
return;
}
Claim claim = buildPublishClaim();
if (validatePublishClaim(claim)) {
publishClaim(claim);
}
}
});
channelSpinnerAdapter = new InlineChannelSpinnerAdapter(getContext(), R.layout.spinner_item_channel, new ArrayList<>());
channelSpinnerAdapter.addPlaceholder(false);
}
use of com.odysee.app.adapter.InlineChannelSpinnerAdapter in project odysee-android by OdyseeTeam.
the class PublishFormFragment method updateChannelList.
private void updateChannelList(List<Claim> channels) {
if (channelSpinnerAdapter == null) {
Context context = getContext();
if (context != null) {
channelSpinnerAdapter = new InlineChannelSpinnerAdapter(context, R.layout.spinner_item_channel, new ArrayList<>(channels));
channelSpinnerAdapter.addPlaceholder(true);
channelSpinnerAdapter.notifyDataSetChanged();
}
} else {
channelSpinnerAdapter.clear();
channelSpinnerAdapter.addPlaceholder(true);
channelSpinnerAdapter.addAll(channels);
channelSpinnerAdapter.notifyDataSetChanged();
}
if (channelSpinner != null) {
channelSpinner.setAdapter(channelSpinnerAdapter);
}
if (channelSpinnerAdapter != null && channelSpinner != null) {
if (editMode) {
if (currentClaim.getSigningChannel() != null && !editChannelSpinnerLoaded) {
int position = channelSpinnerAdapter.getItemPosition(currentClaim.getSigningChannel());
if (position > -1) {
channelSpinner.setSelection(position);
}
editChannelSpinnerLoaded = true;
}
} else {
if (channelSpinnerAdapter.getCount() > 2) {
// if anonymous displayed, select first channel if available
channelSpinner.setSelection(2);
} else if (channelSpinnerAdapter.getCount() > 1) {
// select anonymous
channelSpinner.setSelection(1);
}
}
}
}
use of com.odysee.app.adapter.InlineChannelSpinnerAdapter in project odysee-android by OdyseeTeam.
the class InvitesFragment method updateChannelList.
private void updateChannelList(List<Claim> channels) {
if (channelSpinnerAdapter == null) {
Context context = getContext();
channelSpinnerAdapter = new InlineChannelSpinnerAdapter(context, R.layout.spinner_item_channel, new ArrayList<>(channels));
} else {
channelSpinnerAdapter.clear();
channelSpinnerAdapter.addAll(channels);
}
channelSpinnerAdapter.addPlaceholder(false);
channelSpinnerAdapter.notifyDataSetChanged();
if (channelSpinner != null) {
channelSpinner.setAdapter(channelSpinnerAdapter);
}
if (channelSpinnerAdapter.getCount() > 1) {
channelSpinner.setSelection(1);
}
}
use of com.odysee.app.adapter.InlineChannelSpinnerAdapter in project odysee-android by OdyseeTeam.
the class FileViewFragment method updateChannelList.
private void updateChannelList(List<Claim> channels) {
if (commentChannelSpinnerAdapter == null) {
Context context = getContext();
if (context != null) {
commentChannelSpinnerAdapter = new InlineChannelSpinnerAdapter(context, R.layout.spinner_item_channel, new ArrayList<>(channels));
commentChannelSpinnerAdapter.addPlaceholder(false);
commentChannelSpinnerAdapter.notifyDataSetChanged();
}
} else {
commentChannelSpinnerAdapter.clear();
commentChannelSpinnerAdapter.addAll(channels);
commentChannelSpinnerAdapter.addPlaceholder(false);
commentChannelSpinnerAdapter.notifyDataSetChanged();
}
if (commentChannelSpinner != null) {
commentChannelSpinner.setAdapter(commentChannelSpinnerAdapter);
}
if (commentChannelSpinnerAdapter != null && commentChannelSpinner != null) {
if (commentChannelSpinnerAdapter.getCount() > 1) {
commentChannelSpinner.setSelection(1);
}
}
}
use of com.odysee.app.adapter.InlineChannelSpinnerAdapter in project odysee-android by OdyseeTeam.
the class FileViewFragment method initUi.
@SuppressWarnings("ClickableViewAccessibility")
private void initUi(View root) {
buttonPublishSomething.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Context context = getContext();
if (!Helper.isNullOrEmpty(currentUrl) && context instanceof MainActivity) {
LbryUri uri = LbryUri.tryParse(currentUrl);
if (uri != null) {
Map<String, Object> params = new HashMap<>();
params.put("suggestedUrl", uri.getStreamName());
// ((MainActivity) context).openFragment(PublishFragment.class, true, NavMenuItem.ID_ITEM_NEW_PUBLISH, params);
}
}
}
});
root.findViewById(R.id.file_view_title_area).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ImageView descIndicator = root.findViewById(R.id.file_view_desc_toggle_arrow);
View descriptionArea = root.findViewById(R.id.file_view_description_area);
Claim actualClaim = collectionClaimItem != null ? collectionClaimItem : fileClaim;
boolean hasDescription = actualClaim != null && !Helper.isNullOrEmpty(actualClaim.getDescription());
boolean hasTags = actualClaim != null && actualClaim.getTags() != null && actualClaim.getTags().size() > 0;
if (descriptionArea.getVisibility() != View.VISIBLE) {
if (hasDescription || hasTags) {
descriptionArea.setVisibility(View.VISIBLE);
}
descIndicator.setImageResource(R.drawable.ic_arrow_dropup);
} else {
descriptionArea.setVisibility(View.GONE);
descIndicator.setImageResource(R.drawable.ic_arrow_dropdown);
}
}
});
root.findViewById(R.id.file_view_action_like).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AccountManager am = AccountManager.get(root.getContext());
Account odyseeAccount = Helper.getOdyseeAccount(am.getAccounts());
Claim actualClaim = collectionClaimItem != null ? collectionClaimItem : fileClaim;
if (actualClaim != null && odyseeAccount != null) {
react(actualClaim, true);
}
}
});
root.findViewById(R.id.file_view_action_dislike).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AccountManager am = AccountManager.get(root.getContext());
Account odyseeAccount = Helper.getOdyseeAccount(am.getAccounts());
Claim actualClaim = collectionClaimItem != null ? collectionClaimItem : fileClaim;
if (actualClaim != null && odyseeAccount != null) {
react(actualClaim, false);
}
}
});
root.findViewById(R.id.file_view_action_share).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Claim actualClaim = collectionClaimItem != null ? collectionClaimItem : fileClaim;
if (actualClaim != null) {
try {
String shareUrl = LbryUri.parse(!Helper.isNullOrEmpty(actualClaim.getCanonicalUrl()) ? actualClaim.getCanonicalUrl() : (!Helper.isNullOrEmpty(actualClaim.getShortUrl()) ? actualClaim.getShortUrl() : actualClaim.getPermanentUrl())).toOdyseeString();
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, shareUrl);
MainActivity.startingShareActivity = true;
Intent shareUrlIntent = Intent.createChooser(shareIntent, getString(R.string.share_lbry_content));
shareUrlIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(shareUrlIntent);
} catch (LbryUriException ex) {
// pass
}
}
}
});
root.findViewById(R.id.file_view_action_tip).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MainActivity activity = (MainActivity) getActivity();
if (activity != null && activity.isSignedIn()) {
Claim actualClaim = collectionClaimItem != null ? collectionClaimItem : fileClaim;
if (actualClaim != null) {
CreateSupportDialogFragment dialog = CreateSupportDialogFragment.newInstance(actualClaim, (amount, isTip) -> {
double sentAmount = amount.doubleValue();
String message = getResources().getQuantityString(isTip ? R.plurals.you_sent_a_tip : R.plurals.you_sent_a_support, sentAmount == 1.0 ? 1 : 2, new DecimalFormat("#,###.##").format(sentAmount));
Snackbar.make(root.findViewById(R.id.file_view_claim_display_area), message, Snackbar.LENGTH_LONG).show();
});
Context context = getContext();
if (context instanceof MainActivity) {
dialog.show(((MainActivity) context).getSupportFragmentManager(), CreateSupportDialogFragment.TAG);
}
}
} else {
if (activity != null) {
activity.simpleSignIn(0);
}
}
}
});
root.findViewById(R.id.file_view_action_repost).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Claim actualClaim = collectionClaimItem != null ? collectionClaimItem : fileClaim;
if (actualClaim != null) {
RepostClaimDialogFragment dialog = RepostClaimDialogFragment.newInstance(actualClaim, claim -> {
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).showMessage(R.string.content_successfully_reposted);
}
});
Context context = getContext();
if (context instanceof MainActivity) {
dialog.show(((MainActivity) context).getSupportFragmentManager(), RepostClaimDialogFragment.TAG);
}
}
}
});
root.findViewById(R.id.file_view_action_edit).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Context context = getContext();
Claim actualClaim = collectionClaimItem != null ? collectionClaimItem : fileClaim;
if (actualClaim != null && context instanceof MainActivity) {
((MainActivity) context).openPublishForm(actualClaim);
}
}
});
root.findViewById(R.id.file_view_action_delete).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Claim actualClaim = collectionClaimItem != null ? collectionClaimItem : fileClaim;
if (actualClaim != null) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext()).setTitle(R.string.delete_file).setMessage(R.string.confirm_delete_file_message).setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
deleteClaimFile();
}
}).setNegativeButton(R.string.no, null);
builder.show();
}
}
});
root.findViewById(R.id.file_view_action_unpublish).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Claim actualClaim = collectionClaimItem != null ? collectionClaimItem : fileClaim;
if (actualClaim != null) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext()).setTitle(R.string.delete_content).setMessage(R.string.confirm_delete_content_message).setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
deleteCurrentClaim();
}
}).setNegativeButton(R.string.no, null);
builder.show();
}
}
});
root.findViewById(R.id.file_view_action_download).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Claim actualClaim = collectionClaimItem != null ? collectionClaimItem : fileClaim;
if (actualClaim != null) {
if (downloadInProgress) {
onDownloadAborted();
} else {
checkStoragePermissionAndStartDownload();
}
}
}
});
root.findViewById(R.id.file_view_action_report).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Claim actualClaim = collectionClaimItem != null ? collectionClaimItem : fileClaim;
if (actualClaim != null) {
Context context = getContext();
CustomTabColorSchemeParams.Builder ctcspb = new CustomTabColorSchemeParams.Builder();
ctcspb.setToolbarColor(ContextCompat.getColor(context, R.color.colorPrimary));
CustomTabColorSchemeParams ctcsp = ctcspb.build();
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder().setDefaultColorSchemeParams(ctcsp);
CustomTabsIntent intent = builder.build();
intent.launchUrl(context, Uri.parse(String.format("https://odysee.com/$/report_content?claimId=%s", actualClaim.getClaimId())));
}
}
});
root.findViewById(R.id.player_toggle_cast).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
toggleCast();
}
});
PlayerView playerView = root.findViewById(R.id.file_view_exoplayer_view);
View playbackSpeedContainer = playerView.findViewById(R.id.player_playback_speed);
TextView textPlaybackSpeed = playerView.findViewById(R.id.player_playback_speed_label);
View qualityContainer = playerView.findViewById(R.id.player_quality);
TextView textQuality = playerView.findViewById(R.id.player_quality_label);
textPlaybackSpeed.setText(DEFAULT_PLAYBACK_SPEED);
textQuality.setText(AUTO_QUALITY_STRING);
playbackSpeedContainer.setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() {
@Override
public void onCreateContextMenu(ContextMenu contextMenu, View view, ContextMenu.ContextMenuInfo contextMenuInfo) {
Helper.buildPlaybackSpeedMenu(contextMenu);
}
});
playbackSpeedContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).openContextMenu(playbackSpeedContainer);
}
}
});
qualityContainer.setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() {
@Override
public void onCreateContextMenu(ContextMenu contextMenu, View view, ContextMenu.ContextMenuInfo contextMenuInfo) {
if (MainActivity.appPlayer != null) {
Helper.buildQualityMenu(contextMenu, MainActivity.appPlayer, MainActivity.videoIsTranscoded);
}
}
});
qualityContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).openContextMenu(qualityContainer);
}
}
});
playerView.findViewById(R.id.player_toggle_fullscreen).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// check full screen mode
if (isInFullscreenMode()) {
disableFullScreenMode();
} else {
enableFullScreenMode();
}
}
});
playerView.findViewById(R.id.player_skip_back_10).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (MainActivity.appPlayer != null) {
MainActivity.appPlayer.seekTo(Math.max(0, MainActivity.appPlayer.getCurrentPosition() - 10000));
}
}
});
playerView.findViewById(R.id.player_skip_forward_10).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (MainActivity.appPlayer != null) {
MainActivity.appPlayer.seekTo(MainActivity.appPlayer.getCurrentPosition() + 10000);
}
}
});
root.findViewById(R.id.file_view_publisher_info_area).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Claim actualClaim = collectionClaimItem != null ? collectionClaimItem : fileClaim;
if (actualClaim != null && actualClaim.getSigningChannel() != null) {
removeNotificationAsSource();
Claim publisher = actualClaim.getSigningChannel();
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).openChannelClaim(publisher);
}
}
}
});
View buttonFollow = root.findViewById(R.id.file_view_icon_follow);
View buttonUnfollow = root.findViewById(R.id.file_view_icon_unfollow);
View buttonBell = root.findViewById(R.id.file_view_icon_bell);
buttonFollow.setOnClickListener(followUnfollowListener);
buttonUnfollow.setOnClickListener(followUnfollowListener);
buttonBell.setOnClickListener(bellIconListener);
commentChannelSpinnerAdapter = new InlineChannelSpinnerAdapter(getContext(), R.layout.spinner_item_channel, new ArrayList<>());
commentChannelSpinnerAdapter.addPlaceholder(false);
initCommentForm(root);
expandButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Prevents crash for when comment list isn't loaded yet but user tries to expand.
if (commentListAdapter != null) {
switchCommentListVisibility(commentListAdapter.isCollapsed());
commentListAdapter.switchExpandedState();
}
}
});
singleCommentRoot.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
expandButton.performClick();
}
});
RecyclerView relatedContentList = root.findViewById(R.id.file_view_related_content_list);
RecyclerView commentsList = root.findViewById(R.id.file_view_comments_list);
relatedContentList.setNestedScrollingEnabled(false);
commentsList.setNestedScrollingEnabled(false);
LinearLayoutManager relatedContentListLLM = new LinearLayoutManager(getContext());
LinearLayoutManager commentsListLLM = new LinearLayoutManager(getContext());
relatedContentList.setLayoutManager(relatedContentListLLM);
commentsList.setLayoutManager(commentsListLLM);
GestureDetector.SimpleOnGestureListener gestureListener = new GestureDetector.SimpleOnGestureListener() {
@Override
public boolean onDoubleTap(MotionEvent e) {
ImageView seekOverlay = root.findViewById(R.id.seek_overlay);
int width = playerView.getWidth();
float eventX = e.getX();
if (eventX < width / 3.0) {
if (MainActivity.appPlayer != null) {
MainActivity.appPlayer.seekTo(Math.max(0, MainActivity.appPlayer.getCurrentPosition() - 10000));
seekOverlay.setVisibility(View.VISIBLE);
seekOverlay.setImageResource(R.drawable.ic_rewind);
}
} else if (eventX > width * 2.0 / 3.0) {
if (MainActivity.appPlayer != null) {
MainActivity.appPlayer.seekTo(MainActivity.appPlayer.getCurrentPosition() + 10000);
seekOverlay.setVisibility(View.VISIBLE);
seekOverlay.setImageResource(R.drawable.ic_forward);
}
} else {
return true;
}
if (seekOverlayHandler == null) {
seekOverlayHandler = new Handler();
} else {
// Clear pending messages
seekOverlayHandler.removeCallbacksAndMessages(null);
}
seekOverlayHandler.postDelayed(() -> {
seekOverlay.setVisibility(View.GONE);
}, 500);
return true;
}
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
if (playerView.isControllerVisible()) {
playerView.hideController();
} else {
playerView.showController();
}
return true;
}
};
GestureDetector detector = new GestureDetector(getContext(), gestureListener);
playerView.setOnTouchListener((view, motionEvent) -> {
detector.onTouchEvent(motionEvent);
return true;
});
}
Aggregations