code cleanup

This commit is contained in:
Mariotaku Lee 2016-12-16 23:27:00 +08:00
parent dbb61b7032
commit 569ea6f4e3
1 changed files with 2 additions and 6 deletions

View File

@ -45,9 +45,6 @@ class AccountSelectorActivity : BaseActivity(), OnClickListener, OnItemClickList
private lateinit var adapter: AccountDetailsAdapter
private var firstCreated: Boolean = false
private val keysWhiteList: Array<UserKey>?
get() {
return intent.getParcelableArrayExtra(EXTRA_ACCOUNT_KEYS)?.toTypedArray(UserKey.CREATOR)
@ -91,7 +88,6 @@ class AccountSelectorActivity : BaseActivity(), OnClickListener, OnItemClickList
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
firstCreated = savedInstanceState == null
setContentView(R.layout.activity_account_selector)
DataStoreUtils.prepareDatabase(this)
adapter = AccountDetailsAdapter(this).apply {
@ -101,13 +97,13 @@ class AccountSelectorActivity : BaseActivity(), OnClickListener, OnItemClickList
val am = AccountManager.get(context)
val allAccountDetails = AccountUtils.getAllAccountDetails(am, AccountUtils.getAccounts(am), false)
val extraKeys = keysWhiteList
val oAuthOnly = isOAuthOnly
val oauthOnly = isOAuthOnly
val accountHost = accountHost
addAll(allAccountDetails.filter {
if (extraKeys != null) {
return@filter extraKeys.contains(it.key)
}
if (oAuthOnly && !it.is_oauth) {
if (oauthOnly && !it.is_oauth) {
return@filter false
}
if (USER_TYPE_TWITTER_COM == accountHost) {