Inline variables
This commit is contained in:
parent
1ac1c58824
commit
fd62c19ba6
|
@ -196,12 +196,11 @@ abstract class ParcelableStatusesFragment : AbsStatusesFragment() {
|
||||||
val list = adapterData ?: return
|
val list = adapterData ?: return
|
||||||
val dataToRemove = HashSet<ParcelableStatus>()
|
val dataToRemove = HashSet<ParcelableStatus>()
|
||||||
for (element in list) {
|
for (element in list) {
|
||||||
val status = element
|
if (element.id == statusId || element.retweet_id == statusId) {
|
||||||
if (status.id == statusId || status.retweet_id == statusId) {
|
dataToRemove.add(element)
|
||||||
dataToRemove.add(status)
|
} else if (element.my_retweet_id == statusId) {
|
||||||
} else if (status.my_retweet_id == statusId) {
|
element.my_retweet_id = null
|
||||||
status.my_retweet_id = null
|
element.retweet_count = element.retweet_count - 1
|
||||||
status.retweet_count = status.retweet_count - 1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (list is MutableList) {
|
if (list is MutableList) {
|
||||||
|
|
|
@ -167,7 +167,7 @@ class CacheProvider : ContentProvider() {
|
||||||
* Copied from ContentResolver.java
|
* Copied from ContentResolver.java
|
||||||
*/
|
*/
|
||||||
private fun modeToMode(mode: String): Int {
|
private fun modeToMode(mode: String): Int {
|
||||||
val modeBits: Int = if ("r" == mode) {
|
return if ("r" == mode) {
|
||||||
ParcelFileDescriptor.MODE_READ_ONLY
|
ParcelFileDescriptor.MODE_READ_ONLY
|
||||||
} else if ("w" == mode || "wt" == mode) {
|
} else if ("w" == mode || "wt" == mode) {
|
||||||
ParcelFileDescriptor.MODE_WRITE_ONLY or ParcelFileDescriptor.MODE_CREATE or ParcelFileDescriptor.MODE_TRUNCATE
|
ParcelFileDescriptor.MODE_WRITE_ONLY or ParcelFileDescriptor.MODE_CREATE or ParcelFileDescriptor.MODE_TRUNCATE
|
||||||
|
@ -180,7 +180,6 @@ class CacheProvider : ContentProvider() {
|
||||||
} else {
|
} else {
|
||||||
throw IllegalArgumentException("Invalid mode: $mode")
|
throw IllegalArgumentException("Invalid mode: $mode")
|
||||||
}
|
}
|
||||||
return modeBits
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,6 @@ import org.mariotaku.twidere.model.tab.extra.HomeTabExtras
|
||||||
import org.mariotaku.twidere.model.tab.extra.InteractionsTabExtras
|
import org.mariotaku.twidere.model.tab.extra.InteractionsTabExtras
|
||||||
import org.mariotaku.twidere.model.tab.extra.TabExtras
|
import org.mariotaku.twidere.model.tab.extra.TabExtras
|
||||||
import org.mariotaku.twidere.model.util.AccountUtils
|
import org.mariotaku.twidere.model.util.AccountUtils
|
||||||
import org.mariotaku.twidere.provider.TwidereDataStore
|
|
||||||
import org.mariotaku.twidere.provider.TwidereDataStore.*
|
import org.mariotaku.twidere.provider.TwidereDataStore.*
|
||||||
import org.mariotaku.twidere.provider.TwidereDataStore.Messages.Conversations
|
import org.mariotaku.twidere.provider.TwidereDataStore.Messages.Conversations
|
||||||
import org.mariotaku.twidere.util.content.ContentResolverUtils
|
import org.mariotaku.twidere.util.content.ContentResolverUtils
|
||||||
|
@ -309,12 +308,11 @@ object DataStoreUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getAccountDisplayName(context: Context, accountKey: UserKey, nameFirst: Boolean): String? {
|
fun getAccountDisplayName(context: Context, accountKey: UserKey, nameFirst: Boolean): String? {
|
||||||
val name: String? = if (nameFirst) {
|
return if (nameFirst) {
|
||||||
getAccountName(context, accountKey)
|
getAccountName(context, accountKey)
|
||||||
} else {
|
} else {
|
||||||
"@${getAccountScreenName(context, accountKey)}"
|
"@${getAccountScreenName(context, accountKey)}"
|
||||||
}
|
}
|
||||||
return name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getAccountName(context: Context, accountKey: UserKey): String? {
|
fun getAccountName(context: Context, accountKey: UserKey): String? {
|
||||||
|
|
Loading…
Reference in New Issue