Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy video title #3772

Merged
merged 6 commits into from
Jun 13, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import us.shandian.giga.util.Utility;

import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.COMMENTS;
import static org.schabi.newpipe.extractor.stream.StreamExtractor.NO_AGE_LIMIT;
Expand Down Expand Up @@ -479,7 +480,6 @@ public boolean onLongClick(final View v) {
case R.id.detail_controls_download:
NavigationHelper.openDownloads(getActivity());
break;

case R.id.detail_uploader_root_layout:
if (TextUtils.isEmpty(currentInfo.getSubChannelUrl())) {
Log.w(TAG,
Expand All @@ -488,6 +488,9 @@ public boolean onLongClick(final View v) {
openChannel(currentInfo.getUploaderUrl(), currentInfo.getUploaderName());
}
break;
case R.id.detail_title_root_layout:
copyTitleText();
break;
}

return true;
Expand Down Expand Up @@ -583,6 +586,9 @@ protected void initViews(final View rootView, final Bundle savedInstanceState) {
protected void initListeners() {
super.initListeners();

videoTitleRoot.setLongClickable(true);
wb9688 marked this conversation as resolved.
Show resolved Hide resolved
videoTitleRoot.setOnLongClickListener(this);

uploaderRootLayout.setOnClickListener(this);
uploaderRootLayout.setOnLongClickListener(this);
videoTitleRoot.setOnClickListener(this);
Expand Down Expand Up @@ -1422,4 +1428,8 @@ private void updateProgressInfo(@NonNull final StreamInfo info) {
animateView(detailPositionView, false, 500);
});
}

private void copyTitleText() {
Utility.copyToClipboard(getContext(), videoTitleTextView.getText().toString());
adinilfeld marked this conversation as resolved.
Show resolved Hide resolved
}
}