2015-09-02 00:14:21 +02:00
|
|
|
/*
|
2019-01-23 18:03:33 +01:00
|
|
|
* This is the source code of Telegram for Android v. 5.x.x.
|
2015-09-02 00:14:21 +02:00
|
|
|
* It is licensed under GNU GPL v. 2 or later.
|
|
|
|
* You should have received a copy of the license in this archive (see LICENSE).
|
|
|
|
*
|
2019-01-23 18:03:33 +01:00
|
|
|
* Copyright Nikolai Kudashov, 2013-2018.
|
2015-09-02 00:14:21 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
package org.telegram.ui.Components;
|
|
|
|
|
2018-07-30 04:07:02 +02:00
|
|
|
import android.net.Uri;
|
2015-09-02 00:14:21 +02:00
|
|
|
import android.text.style.URLSpan;
|
2018-07-30 04:07:02 +02:00
|
|
|
import android.view.View;
|
|
|
|
|
|
|
|
import org.telegram.messenger.browser.Browser;
|
2015-09-02 00:14:21 +02:00
|
|
|
|
|
|
|
public class URLSpanReplacement extends URLSpan {
|
|
|
|
|
|
|
|
public URLSpanReplacement(String url) {
|
|
|
|
super(url);
|
|
|
|
}
|
2018-07-30 04:07:02 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClick(View widget) {
|
|
|
|
Uri uri = Uri.parse(getURL());
|
|
|
|
Browser.openUrl(widget.getContext(), uri);
|
|
|
|
}
|
2015-09-02 00:14:21 +02:00
|
|
|
}
|