mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-02-08 15:58:40 +01:00
code cleanup
This commit is contained in:
parent
4f13376e78
commit
76e0ff0281
@ -35,7 +35,6 @@ import android.widget.*
|
||||
import android.widget.AbsListView.MultiChoiceModeListener
|
||||
import android.widget.CompoundButton.OnCheckedChangeListener
|
||||
import kotlinx.android.synthetic.main.fragment_content_listview.*
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
import org.mariotaku.twidere.Constants
|
||||
import org.mariotaku.twidere.R
|
||||
import org.mariotaku.twidere.TwidereConstants.HOST_MAPPING_PREFERENCES_NAME
|
||||
@ -108,7 +107,7 @@ class HostMappingsListFragment : AbsContentListViewFragment<HostMappingsListFrag
|
||||
val args = Bundle()
|
||||
args.putString(EXTRA_HOST, host)
|
||||
args.putString(EXTRA_ADDRESS, address)
|
||||
args.putBoolean(EXTRA_EXCLUDED, StringUtils.equals(host, address))
|
||||
args.putBoolean(EXTRA_EXCLUDED, host == address)
|
||||
args.putBoolean(EXTRA_EDIT_MODE, true)
|
||||
val df = AddMappingDialogFragment()
|
||||
df.arguments = args
|
||||
|
@ -29,7 +29,6 @@ import android.os.Parcelable
|
||||
import android.provider.BaseColumns
|
||||
import android.support.annotation.WorkerThread
|
||||
import android.text.TextUtils
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
import org.mariotaku.kpreferences.get
|
||||
import org.mariotaku.ktextension.useCursor
|
||||
import org.mariotaku.library.objectcursor.ObjectCursor
|
||||
@ -518,7 +517,7 @@ object DataStoreUtils {
|
||||
val am = AccountManager.get(context)
|
||||
for (account in AccountUtils.getAccounts(am)) {
|
||||
val user = account.getAccountUser(am)
|
||||
if (StringUtils.equalsIgnoreCase(screenName, user.screen_name)) {
|
||||
if (screenName.equals(user.screen_name, ignoreCase = true)) {
|
||||
return user.key
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ import android.os.BadParcelableException
|
||||
import android.support.customtabs.CustomTabsIntent
|
||||
import edu.tsinghua.hotmobi.HotMobiLogger
|
||||
import edu.tsinghua.hotmobi.model.LinkEvent
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
import org.mariotaku.chameleon.Chameleon
|
||||
import org.mariotaku.chameleon.ChameleonUtils
|
||||
import org.mariotaku.kpreferences.get
|
||||
@ -103,7 +102,7 @@ open class OnLinkClickHandler(
|
||||
return true
|
||||
}
|
||||
TwidereLinkify.LINK_TYPE_LIST -> {
|
||||
val mentionList = StringUtils.split(link, "/")
|
||||
val mentionList = link.split("/")
|
||||
if (mentionList.size != 2) {
|
||||
return false
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ import android.content.SharedPreferences
|
||||
import android.util.Log
|
||||
import android.util.TimingLogger
|
||||
import okhttp3.Dns
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
import org.mariotaku.ktextension.toIntOr
|
||||
import org.mariotaku.twidere.BuildConfig
|
||||
import org.mariotaku.twidere.TwidereConstants.HOST_MAPPING_PREFERENCES_NAME
|
||||
@ -233,7 +232,7 @@ class TwidereDns(context: Context, private val preferences: SharedPreferences) :
|
||||
|
||||
private fun hostMatches(host: String?, rule: String?): Boolean {
|
||||
if (rule == null || host == null) return false
|
||||
if (rule.startsWith(".")) return StringUtils.endsWithIgnoreCase(host, rule)
|
||||
if (rule.startsWith(".")) return host.endsWith(rule, ignoreCase = true)
|
||||
return host.equals(rule, ignoreCase = true)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user