code cleanup

This commit is contained in:
Mariotaku Lee 2017-04-07 12:31:30 +08:00
parent 4f13376e78
commit 76e0ff0281
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
4 changed files with 5 additions and 9 deletions

View File

@ -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
@ -126,7 +125,7 @@ class HostMappingsListFragment : AbsContentListViewFragment<HostMappingsListFrag
}
override fun onItemCheckedStateChanged(mode: ActionMode, position: Int, id: Long,
checked: Boolean) {
checked: Boolean) {
updateTitle(mode)
}

View File

@ -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
}
}

View File

@ -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
}

View File

@ -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)
}