Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
030 committed Nov 22, 2023
1 parent 0a6b87f commit d1aa15d
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import tw.nekomimi.nekogram.utils.StrUtil;
import org.telegram.ui.Components.RadioButton;

public class LanguageCell extends FrameLayout {
Expand Down Expand Up @@ -88,13 +87,6 @@ public void setLanguage(LocaleController.LocaleInfo language, String desc, boole
needDivider = divider;
}

public void setLanguage(BaseFragment fragment,LocaleController.LocaleInfo language, String desc, boolean divider) {
StrUtil.setText(fragment, textView, desc != null ? desc : language.name);
StrUtil.setText(fragment, textView2, language.nameEnglish);
currentLocale = language;
needDivider = divider;
}


public void setValue(String name, String nameEnglish) {
textView.setText(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@
import tw.nekomimi.nekogram.utils.PrivacyUtil;
import tw.nekomimi.nekogram.utils.ProxyUtil;
import tw.nekomimi.nekogram.utils.UIUtil;
import tw.nekomimi.nekogram.utils.UpdateUtil;
import tw.nekomimi.nekogram.utils.VibrateUtil;

public class DialogsActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate, FloatingDebugProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ object PrivacyUtil {

runCatching {

(builder.show().getButton(DialogInterface.BUTTON_NEUTRAL) as TextView?)?.setTextColor(Theme.getColor(Theme.key_dialogTextRed))
(builder.show().getButton(DialogInterface.BUTTON_NEUTRAL) as TextView?)?.setTextColor(Theme.getColor(Theme.key_text_RedBold))

}

Expand Down Expand Up @@ -261,7 +261,7 @@ object PrivacyUtil {

runCatching {

(builder.show().getButton(DialogInterface.BUTTON_NEUTRAL) as TextView?)?.setTextColor(Theme.getColor(Theme.key_dialogTextRed))
(builder.show().getButton(DialogInterface.BUTTON_NEUTRAL) as TextView?)?.setTextColor(Theme.getColor(Theme.key_text_RedBold))

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.view.View
import android.widget.TextView
import org.telegram.messenger.AndroidUtilities
import org.telegram.messenger.FileLog
import org.telegram.messenger.MessagesController
import org.telegram.ui.ActionBar.BaseFragment
import org.telegram.ui.Components.URLSpanNoUnderline
import java.util.regex.Matcher
Expand All @@ -14,40 +15,6 @@ object StrUtil {

private val urlPattern = Pattern.compile("@[a-zA-Z\\d_]{1,32}")

@JvmStatic
fun setText(fragment: BaseFragment?, textView: TextView, text: String) {

var stringBuilder: SpannableStringBuilder? = null

if (fragment != null) {

try {
val matcher: Matcher = urlPattern.matcher(text)
while (matcher.find()) {
if (stringBuilder == null) {
stringBuilder = SpannableStringBuilder(text)
textView.movementMethod = AndroidUtilities.LinkMovementMethodMy()
}
var start = matcher.start()
val end = matcher.end()
if (text.get(start) != '@') {
start++
}
val url: URLSpanNoUnderline = object : URLSpanNoUnderline(text.subSequence(start + 1, end).toString()) {
override fun onClick(widget: View) {
fragment.messagesController.openByUserName(url, fragment, 1)
}
}
stringBuilder.setSpan(url, start, end, 0)
}
} catch (e: Exception) {
FileLog.e(e)
}
}

textView.text = stringBuilder ?: text
}

@JvmStatic
fun getSubString(text: String, left: String?, right: String?): String {
var llen: Int
Expand Down

This file was deleted.

0 comments on commit d1aa15d

Please sign in to comment.