Skip to content

Commit a549118

Browse files
author
Yevhen Babiichuk (DustDFG)
committed
Convert newpipe/util/text/HashtagLongPressClickableSpan to kotlin
1 parent ba8c34f commit a549118

2 files changed

Lines changed: 25 additions & 36 deletions

File tree

app/src/main/java/org/schabi/newpipe/util/text/HashtagLongPressClickableSpan.java

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2023-2026 NewPipe contributors <https://newpipe.net>
3+
* SPDX-License-Identifier: GPL-3.0-or-later
4+
*/
5+
6+
package org.schabi.newpipe.util.text
7+
8+
import android.content.Context
9+
import android.view.View
10+
import org.schabi.newpipe.util.NavigationHelper
11+
import org.schabi.newpipe.util.external_communication.ShareUtils
12+
13+
internal class HashtagLongPressClickableSpan(
14+
private val context: Context,
15+
private val parsedHashtag: String,
16+
private val relatedInfoServiceId: Int
17+
) : LongPressClickableSpan() {
18+
override fun onClick(view: View) {
19+
NavigationHelper.openSearch(context, relatedInfoServiceId, parsedHashtag)
20+
}
21+
22+
override fun onLongClick(view: View) {
23+
ShareUtils.copyToClipboard(context, parsedHashtag)
24+
}
25+
}

0 commit comments

Comments
 (0)