added visibility for mastodon

improved account color
This commit is contained in:
Mariotaku Lee 2017-04-22 14:25:42 +08:00
parent d86dd71294
commit ca382e499a
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
102 changed files with 462 additions and 238 deletions

View File

@ -36,6 +36,7 @@ import java.lang.annotation.RetentionPolicy;
CustomTabType.SEARCH_STATUSES,
CustomTabType.LIST_TIMELINE,
CustomTabType.PUBLIC_TIMELINE,
CustomTabType.NETWORK_PUBLIC_TIMELINE,
})
@Retention(RetentionPolicy.SOURCE)
public @interface CustomTabType {
@ -48,4 +49,5 @@ public @interface CustomTabType {
String SEARCH_STATUSES = "search_statuses";
String LIST_TIMELINE = "list_timeline";
String PUBLIC_TIMELINE = "public_timeline";
String NETWORK_PUBLIC_TIMELINE = "network_public_timeline";
}

View File

@ -222,6 +222,7 @@ public interface IntentConstants {
String EXTRA_PLACE = "place";
String EXTRA_PLACE_NAME = "place_name";
String EXTRA_SCHEDULE_INFO = "schedule_info";
String EXTRA_VISIBILITY = "visibility";
String EXTRA_SAVE_DRAFT = "save_draft";
String EXTRA_HOST = "host";
}

View File

@ -527,6 +527,10 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
@ParcelableThisPlease
@Nullable
public String summary_text;
@JsonField(name = "visibility")
@ParcelableThisPlease
@Nullable
public String visibility;
@Override
public int describeContents() {

View File

@ -79,6 +79,9 @@ public class ParcelableStatusUpdate implements Parcelable {
@JsonField(name = "summary")
@ParcelableThisPlease
public String summary;
@JsonField(name = "visibility")
@ParcelableThisPlease
public String visibility;
@JsonField(name = "draft_unique_id")
@ParcelableThisPlease
public String draft_unique_id;

View File

@ -60,6 +60,9 @@ public class UpdateStatusActionExtras implements ActionExtras {
@JsonField(name = "summary_text")
@ParcelableThisPlease
String summaryText;
@JsonField(name = "visibility")
@ParcelableThisPlease
String visibility;
public ParcelableStatus getInReplyToStatus() {
return inReplyToStatus;
@ -133,6 +136,14 @@ public class UpdateStatusActionExtras implements ActionExtras {
this.summaryText = summaryText;
}
public String getVisibility() {
return visibility;
}
public void setVisibility(String visibility) {
this.visibility = visibility;
}
@Override
public int describeContents() {
return 0;

View File

@ -118,7 +118,7 @@ class UserStreamDumperPlugin(val context: Context) : DumperPlugin {
if (verboseMode) {
dumpContext.stdout.println("Activity: @${activity.toString().trim('\n')}")
} else {
val pActivity = activity.toParcelable(account.key, account.type)
val pActivity = activity.toParcelable(account)
val message = ActivityTitleSummaryMessage.get(context, manager, pActivity,
pActivity.sources, 0, true, true)
if (message != null) {
@ -172,7 +172,7 @@ class UserStreamDumperPlugin(val context: Context) : DumperPlugin {
override fun onActivityAboutMe(activity: Activity): Boolean {
if (!includeInteractions && includeTimeline) return true
val pActivity = activity.toParcelable(account.key, account.type)
val pActivity = activity.toParcelable(account)
val message = ActivityTitleSummaryMessage.get(context, manager, pActivity, pActivity.sources, 0,
true, true)
if (message != null) {

View File

@ -64,6 +64,8 @@ public abstract class DrawableHolder {
// End of default built-in icons
case "favorite":
return Builtin.FAVORITE;
case "web":
return Builtin.WEB;
}
return null;
}
@ -118,6 +120,7 @@ public abstract class DrawableHolder {
"user",
// End of default built-in icons
"favorite",
"web",
};
List<DrawableHolder> list = new ArrayList<>();
for (String key : keys) {
@ -205,6 +208,8 @@ public abstract class DrawableHolder {
return ContextCompat.getDrawable(context, R.drawable.ic_action_heart);
}
};
@NonNull
public static final DrawableHolder WEB = new Builtin("web", R.drawable.ic_action_web);
private final String key;
private final int resId;

View File

@ -34,6 +34,7 @@ import android.location.*
import android.net.Uri
import android.os.Bundle
import android.support.v4.app.ActivityCompat
import android.support.v4.widget.TextViewCompat
import android.support.v7.app.AlertDialog
import android.support.v7.view.SupportMenuInflater
import android.support.v7.widget.ActionMenuView.OnMenuItemClickListener
@ -65,6 +66,7 @@ import org.mariotaku.kpreferences.get
import org.mariotaku.kpreferences.set
import org.mariotaku.ktextension.*
import org.mariotaku.library.objectcursor.ObjectCursor
import org.mariotaku.microblog.library.mastodon.annotation.StatusVisibility
import org.mariotaku.pickncrop.library.MediaPickerActivity
import org.mariotaku.twidere.Constants.*
import org.mariotaku.twidere.R
@ -139,25 +141,30 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
private lateinit var mediaPreviewAdapter: MediaPreviewAdapter
private lateinit var accountsAdapter: AccountIconsAdapter
// State fields
private var shouldSkipDraft: Boolean = false
private var hasEditSummary: Boolean = false
private var hasStatusVisibility: Boolean = false
private var hasLocationOption: Boolean = false
private var ignoreMentions: Boolean = false
private var shouldSaveAccounts: Boolean = false
private var statusShortenerUsed: Boolean = false
private var navigateBackPressed: Boolean = false
private var replyToSelf: Boolean = false
// Data fields
private var recentLocation: ParcelableLocation? = null
private var inReplyToStatus: ParcelableStatus? = null
private var mentionUser: ParcelableUser? = null
private var originalText: String? = null
private var possiblySensitive: Boolean = false
private var shouldSaveAccounts: Boolean = false
private var imageUploaderUsed: Boolean = false
private var statusShortenerUsed: Boolean = false
private var navigateBackPressed: Boolean = false
private var textChanged: Boolean = false
private var composeKeyMetaState: Int = 0
private var draft: Draft? = null
private var nameFirst: Boolean = false
private var draftUniqueId: String? = null
private var shouldSkipDraft: Boolean = false
private var hasEditSummary: Boolean = false
private var ignoreMentions: Boolean = false
private var replyToSelf: Boolean = false
private var statusVisibility: String? = StatusVisibility.PUBLIC
private var scheduleInfo: ScheduleInfo? = null
set(value) {
field = value
@ -457,6 +464,7 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
outState.putParcelable(EXTRA_USER, mentionUser)
outState.putParcelable(EXTRA_DRAFT, draft)
outState.putParcelable(EXTRA_SCHEDULE_INFO, scheduleInfo)
outState.putString(EXTRA_VISIBILITY, statusVisibility)
outState.putBoolean(EXTRA_SHOULD_SAVE_ACCOUNTS, shouldSaveAccounts)
outState.putString(EXTRA_ORIGINAL_TEXT, originalText)
outState.putString(EXTRA_DRAFT_UNIQUE_ID, draftUniqueId)
@ -480,6 +488,7 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
originalText = savedInstanceState.getString(EXTRA_ORIGINAL_TEXT)
draftUniqueId = savedInstanceState.getString(EXTRA_DRAFT_UNIQUE_ID)
scheduleInfo = savedInstanceState.getParcelable(EXTRA_SCHEDULE_INFO)
statusVisibility = savedInstanceState.getString(EXTRA_VISIBILITY)
showLabelAndHint(intent)
resetButtonsStates()
@ -568,6 +577,9 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
R.id.location_option -> {
locationMenuItemSelected(item)
}
R.id.visibility_option -> {
visibilityMenuItemSelected(item)
}
else -> {
extensionIntentItemSelected(item)
}
@ -772,6 +784,19 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
updateTextCount()
}
private fun visibilityMenuItemSelected(item: MenuItem) {
statusVisibility = when (item.itemId) {
R.id.visibility_public -> StatusVisibility.PUBLIC
R.id.visibility_unlisted -> StatusVisibility.UNLISTED
R.id.visibility_private -> StatusVisibility.PRIVATE
R.id.visibility_direct -> StatusVisibility.DIRECT
else -> null
}
updateVisibilityState()
setMenu()
updateTextCount()
}
private fun extensionIntentItemSelected(item: MenuItem) {
val intent = item.intent ?: return
try {
@ -866,6 +891,7 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
private fun resetButtonsStates() {
updateLocationState()
updateVisibilityState()
updateAccountSelectionState()
updateUpdateStatusIcon()
updateMediaState()
@ -994,19 +1020,21 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
recentLocation = draft.location
accountsAdapter.selectedAccountKeys = draft.account_keys ?: emptyArray()
editSummary.setText(extras?.summaryText)
editText.setText(extras?.editingText ?: draft.text)
editText.setSelection(editText.length())
if (media != null) {
addMedia(Arrays.asList(*media))
}
if (extras != null) {
editSummary.setText(extras.summaryText)
statusVisibility = extras.visibility
possiblySensitive = extras.isPossiblySensitive
inReplyToStatus = extras.inReplyToStatus
editText.setText(extras.editingText ?: draft.text)
} else {
editText.setText(draft.text)
}
editText.setSelection(editText.length())
val tag = Uri.withAppendedPath(Drafts.CONTENT_URI, draft._id.toString()).toString()
notificationManager.cancel(tag, NOTIFICATION_ID_DRAFTS)
@ -1160,7 +1188,10 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
editText.accountKey = accounts.firstOrNull()?.key ?: Utils.getDefaultAccountKey(this)
statusTextCount.maxLength = accounts.textLimit
val singleAccount = accounts.singleOrNull()
hasEditSummary = accounts.all { it.type == AccountType.MASTODON }
val allMastodon = accounts.all { it.type == AccountType.MASTODON }
hasEditSummary = allMastodon
hasStatusVisibility = allMastodon
hasLocationOption = !allMastodon
ignoreMentions = singleAccount?.type == AccountType.TWITTER
replyToSelf = singleAccount?.let { it.key == inReplyToStatus?.user_key } ?: false
}
@ -1250,6 +1281,28 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
menu.setMenuItemIcon(R.id.location_submenu, R.drawable.ic_action_location)
}
when (statusVisibility) {
StatusVisibility.UNLISTED -> {
menu.setItemChecked(R.id.visibility_unlisted, true)
menu.setMenuItemIcon(R.id.visibility_submenu, R.drawable.ic_action_web_lock)
}
StatusVisibility.PRIVATE -> {
menu.setItemChecked(R.id.visibility_private, true)
menu.setMenuItemIcon(R.id.visibility_submenu, R.drawable.ic_action_lock)
}
StatusVisibility.DIRECT -> {
menu.setItemChecked(R.id.visibility_direct, true)
menu.setMenuItemIcon(R.id.visibility_submenu, R.drawable.ic_action_message)
}
else -> { // Default to public
menu.setItemChecked(R.id.visibility_public, true)
menu.setMenuItemIcon(R.id.visibility_submenu, R.drawable.ic_action_web)
}
}
menu.setItemAvailability(R.id.visibility_submenu, hasStatusVisibility)
menu.setItemAvailability(R.id.location_submenu, hasLocationOption)
ThemeUtils.wrapMenuIcon(menuBar, excludeGroups = MENU_GROUP_IMAGE_EXTENSION)
ThemeUtils.resetCheatSheet(menuBar)
}
@ -1470,6 +1523,7 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
update.media = media
update.in_reply_to_status = inReplyTo
update.is_possibly_sensitive = possiblySensitive
update.visibility = statusVisibility
update.draft_extras = update.updateStatusActionExtras().also {
it.editingText = text
}
@ -1523,6 +1577,31 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
}
}
private fun updateVisibilityState() {
when (statusVisibility) {
StatusVisibility.UNLISTED -> {
visibilityLabel.setText(R.string.label_status_visibility_unlisted)
TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(visibilityLabel,
R.drawable.ic_action_web_lock, 0, 0, 0)
}
StatusVisibility.PRIVATE -> {
visibilityLabel.setText(R.string.label_status_visibility_private)
TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(visibilityLabel,
R.drawable.ic_action_lock, 0, 0, 0)
}
StatusVisibility.DIRECT -> {
visibilityLabel.setText(R.string.label_status_visibility_direct)
TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(visibilityLabel,
R.drawable.ic_action_message, 0, 0, 0)
}
else -> { // Default to public
visibilityLabel.setText(R.string.label_status_visibility_public)
TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(visibilityLabel,
R.drawable.ic_action_web, 0, 0, 0)
}
}
}
private fun getTwitterReplyTextAndMentions(text: String = editText.text?.toString().orEmpty(),
accounts: Array<AccountDetails> = accountsAdapter.selectedAccounts): ReplyTextAndMentions? {
val inReplyTo = inReplyToStatus ?: return null
@ -2084,6 +2163,7 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
it.excludedReplyUserIds = excluded_reply_user_ids
it.isExtendedReplyMode = extended_reply_mode
it.summaryText = summary
it.visibility = visibility
}
}

View File

@ -19,21 +19,24 @@
package org.mariotaku.twidere.extension.model
import org.mariotaku.ktextension.mapToArray
import org.mariotaku.ktextension.toIntOr
import org.mariotaku.ktextension.toLongOr
import org.mariotaku.microblog.library.twitter.model.CardEntity
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.model.ParcelableCardEntity
import org.mariotaku.twidere.model.UserKey
import org.mariotaku.twidere.model.util.ParcelableCardEntityUtils
import java.text.ParseException
import java.util.*
fun CardEntity.toParcelable(accountKey: UserKey, accountType: String): ParcelableCardEntity? {
val obj = ParcelableCardEntity()
obj.name = name
obj.url = url
obj.users = users?.toParcelables(accountKey, accountType)
obj.users = users?.mapToArray {
it.toParcelable(accountKey, accountType)
}
obj.account_key = accountKey
obj.values = bindingValues?.mapValues { entry ->
ParcelableCardEntity.ParcelableBindingValue(entry.value)

View File

@ -1,8 +1,6 @@
package org.mariotaku.twidere.extension.model
import org.mariotaku.ktextension.addAllTo
import org.mariotaku.microblog.library.twitter.model.Status
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.model.ParcelableStatus
import org.mariotaku.twidere.model.ParcelableUser
import org.mariotaku.twidere.model.ParcelableUserMention
@ -47,10 +45,6 @@ val ParcelableStatus.replyMentions: Array<ParcelableUserMention>
return result.toTypedArray()
}
fun Array<Status>.toParcelables(accountKey: UserKey, accountType: String, profileImageSize: String) = Array(size) { i ->
this[i].toParcelable(accountKey, accountType, profileImageSize)
}
private fun parcelableUserMention(key: UserKey, name: String, screenName: String) = ParcelableUserMention().also {
it.key = key
it.name = name

View File

@ -44,9 +44,4 @@ inline val ParcelableUser.originalProfileImage: String? get() {
?: Utils.getOriginalTwitterProfileImage(profile_image_url)
}
inline val ParcelableUser.urlPreferred: String? get() = url_expanded?.takeIf(String::isNotEmpty) ?: url
fun Array<User>.toParcelables(accountKey: UserKey, accountType: String, profileImageSize: String = "normal"): Array<ParcelableUser> {
return mapToArray { it.toParcelable(accountKey, accountType, profileImageSize = profileImageSize) }
}
inline val ParcelableUser.urlPreferred: String? get() = url_expanded?.takeIf(String::isNotEmpty) ?: url

View File

@ -24,10 +24,7 @@ import android.text.style.URLSpan
import org.mariotaku.ktextension.mapToArray
import org.mariotaku.microblog.library.twitter.model.Status
import org.mariotaku.twidere.extension.model.toParcelable
import org.mariotaku.twidere.model.ParcelableLocation
import org.mariotaku.twidere.model.ParcelableStatus
import org.mariotaku.twidere.model.SpanItem
import org.mariotaku.twidere.model.UserKey
import org.mariotaku.twidere.model.*
import org.mariotaku.twidere.model.util.ParcelableLocationUtils
import org.mariotaku.twidere.model.util.ParcelableMediaUtils
import org.mariotaku.twidere.model.util.ParcelableStatusUtils.addFilterFlag
@ -36,10 +33,11 @@ import org.mariotaku.twidere.model.util.UserKeyUtils
import org.mariotaku.twidere.util.HtmlSpanBuilder
import org.mariotaku.twidere.util.InternalTwitterContentUtils
/**
* Created by mariotaku on 2017/4/19.
*/
fun Status.toParcelable(details: AccountDetails, profileImageSize: String = "normal"): ParcelableStatus {
return toParcelable(details.key, details.type, profileImageSize).apply {
account_color = details.color
}
}
fun Status.toParcelable(accountKey: UserKey, accountType: String, profileImageSize: String = "normal"): ParcelableStatus {
val result = ParcelableStatus()

View File

@ -23,6 +23,7 @@ import android.text.TextUtils
import org.mariotaku.ktextension.isNotNullOrEmpty
import org.mariotaku.microblog.library.twitter.model.User
import org.mariotaku.twidere.annotation.AccountType
import org.mariotaku.twidere.model.AccountDetails
import org.mariotaku.twidere.model.ParcelableUser
import org.mariotaku.twidere.model.UserKey
import org.mariotaku.twidere.model.util.ParcelableUserUtils
@ -40,6 +41,12 @@ fun User.getProfileImageOfSize(size: String): String {
}
fun User.toParcelable(details: AccountDetails, position: Long = 0, profileImageSize: String = "normal"): ParcelableUser {
return this.toParcelableInternal(details.key, details.type, position, profileImageSize).apply {
account_color = details.color
}
}
fun User.toParcelable(accountKey: UserKey, accountType: String, position: Long = 0, profileImageSize: String = "normal"): ParcelableUser {
return this.toParcelableInternal(accountKey, accountType, position, profileImageSize)
}

View File

@ -23,6 +23,7 @@ import org.mariotaku.microblog.library.mastodon.model.Account
import org.mariotaku.twidere.annotation.AccountType
import org.mariotaku.twidere.extension.model.api.isHtml
import org.mariotaku.twidere.extension.model.api.spanItems
import org.mariotaku.twidere.model.AccountDetails
import org.mariotaku.twidere.model.ParcelableUser
import org.mariotaku.twidere.model.UserKey
import org.mariotaku.twidere.util.HtmlEscapeHelper
@ -32,6 +33,12 @@ import org.mariotaku.twidere.util.HtmlSpanBuilder
* Created by mariotaku on 2017/4/18.
*/
fun Account.toParcelable(details: AccountDetails, position: Long = 0): ParcelableUser {
return toParcelable(details.key, position).apply {
account_color = details.color
}
}
fun Account.toParcelable(accountKey: UserKey, position: Long = 0): ParcelableUser {
val obj = ParcelableUser()
obj.position = position

View File

@ -22,14 +22,14 @@ package org.mariotaku.twidere.extension.model.api.mastodon
import org.mariotaku.ktextension.mapToArray
import org.mariotaku.microblog.library.mastodon.model.Notification
import org.mariotaku.microblog.library.twitter.model.Activity
import org.mariotaku.twidere.model.ParcelableActivity
import org.mariotaku.twidere.model.ParcelableStatus
import org.mariotaku.twidere.model.ParcelableUser
import org.mariotaku.twidere.model.UserKey
import org.mariotaku.twidere.model.*
fun Notification.toParcelable(details: AccountDetails): ParcelableActivity {
return toParcelable(details.key).apply {
account_color = details.color
}
}
/**
* Created by mariotaku on 2017/4/22.
*/
fun Notification.toParcelable(accountKey: UserKey): ParcelableActivity {
val result = ParcelableActivity()
result.account_key = accountKey

View File

@ -22,16 +22,15 @@ package org.mariotaku.twidere.extension.model.api.mastodon
import org.mariotaku.ktextension.mapToArray
import org.mariotaku.microblog.library.mastodon.model.Status
import org.mariotaku.twidere.extension.model.api.spanItems
import org.mariotaku.twidere.model.ParcelableMedia
import org.mariotaku.twidere.model.ParcelableStatus
import org.mariotaku.twidere.model.SpanItem
import org.mariotaku.twidere.model.UserKey
import org.mariotaku.twidere.model.*
import org.mariotaku.twidere.model.util.ParcelableStatusUtils.addFilterFlag
import org.mariotaku.twidere.util.HtmlSpanBuilder
/**
* Created by mariotaku on 2017/4/19.
*/
fun Status.toParcelable(details: AccountDetails): ParcelableStatus {
return toParcelable(details.key).apply {
account_color = details.color
}
}
fun Status.toParcelable(accountKey: UserKey): ParcelableStatus {
val result = ParcelableStatus()
@ -42,6 +41,7 @@ fun Status.toParcelable(accountKey: UserKey): ParcelableStatus {
result.timestamp = createdAt?.time ?: 0
extras.summary_text = spoilerText
extras.visibility = visibility
extras.external_url = url
val retweetedStatus = reblog

View File

@ -21,7 +21,9 @@ package org.mariotaku.twidere.extension.model.api.microblog
import org.mariotaku.ktextension.mapToArray
import org.mariotaku.microblog.library.twitter.model.Activity
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.extension.model.toParcelables
import org.mariotaku.twidere.model.AccountDetails
import org.mariotaku.twidere.model.ParcelableActivity
import org.mariotaku.twidere.model.UserKey
@ -29,6 +31,13 @@ import org.mariotaku.twidere.model.UserKey
* Created by mariotaku on 2017/4/22.
*/
fun Activity.toParcelable(details: AccountDetails, isGap: Boolean = false,
profileImageSize: String = "normal"): ParcelableActivity {
return toParcelable(details.key, details.type, isGap, profileImageSize).apply {
account_color = details.color
}
}
fun Activity.toParcelable(accountKey: UserKey, accountType: String, isGap: Boolean = false,
profileImageSize: String = "normal"): ParcelableActivity {
val result = ParcelableActivity()
@ -39,20 +48,25 @@ fun Activity.toParcelable(accountKey: UserKey, accountType: String, isGap: Boole
result.min_sort_position = minSortPosition
result.max_position = maxPosition
result.min_position = minPosition
result.sources = sources?.toParcelables(accountKey, accountType,
profileImageSize)
result.target_users = targetUsers?.toParcelables(accountKey,
accountType, profileImageSize)
result.sources = sources?.mapToArray {
it.toParcelable(accountKey, accountType, profileImageSize = profileImageSize)
}
result.target_users = targetUsers?.mapToArray {
it.toParcelable(accountKey, accountType, profileImageSize = profileImageSize)
}
result.target_user_lists = targetUserLists?.toParcelables(accountKey,
profileImageSize)
result.target_statuses = targetStatuses?.toParcelables(accountKey,
accountType, profileImageSize)
result.target_object_statuses = targetObjectStatuses?.toParcelables(accountKey,
accountType, profileImageSize)
result.target_statuses = targetStatuses?.mapToArray {
it.toParcelable(accountKey, accountType, profileImageSize)
}
result.target_object_statuses = targetObjectStatuses?.mapToArray {
it.toParcelable(accountKey, accountType, profileImageSize)
}
result.target_object_user_lists = targetObjectUserLists?.toParcelables(accountKey,
profileImageSize)
result.target_object_users = targetObjectUsers?.toParcelables(accountKey, accountType,
profileImageSize)
result.target_object_users = targetObjectUsers?.mapToArray {
it.toParcelable(accountKey, accountType, profileImageSize = profileImageSize)
}
result.has_following_source = sources?.fold(false) { folded, item ->
if (item.isFollowing == true) {
return@fold true

View File

@ -2075,7 +2075,7 @@ class StatusFragment : BaseFragment(), LoaderCallbacks<SingleResponse<Parcelable
try {
activitySummary.retweeters = twitter.getRetweets(statusId, paging)
.filterNot { DataStoreUtils.isFilteringUser(context, UserKeyUtils.fromUser(it.user)) }
.map { it.user.toParcelable(accountKey, details.type) }
.map { it.user.toParcelable(details) }
val countValues = ContentValues()
val status = twitter.showStatus(statusId)
activitySummary.favoriteCount = status.favoriteCount
@ -2100,7 +2100,7 @@ class StatusFragment : BaseFragment(), LoaderCallbacks<SingleResponse<Parcelable
Expression.equalsArgs(Activities.STATUS_ID),
Expression.equalsArgs(Activities.STATUS_RETWEET_ID)))
val pStatus = status.toParcelable(accountKey, details.type)
val pStatus = status.toParcelable(details)
cr.insert(CachedStatuses.CONTENT_URI, ObjectCursor.valuesCreatorFrom(ParcelableStatus::class.java).create(pStatus))
val activityCursor = cr.query(Activities.AboutMe.CONTENT_URI,

View File

@ -376,7 +376,7 @@ class UserProfileEditorFragment : BaseFragment(), OnSizeChangedListener, TextWat
profileUpdate.backgroundColor(backgroundColor)
val user = microBlog.updateProfile(profileUpdate)
val profileImageSize = context.getString(R.string.profile_image_size)
return Pair(user.toParcelable(account.key, account.type, profileImageSize = profileImageSize), account)
return Pair(user.toParcelable(account, profileImageSize = profileImageSize), account)
}

View File

@ -137,10 +137,7 @@ abstract class AbsStatusDialogFragment : BaseDialogFragment() {
}
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
val profileImageSize = context.getString(R.string.profile_image_size)
return task {
microBlog.showStatus(statusId).toParcelable(details.key, details.type,
profileImageSize).also { it.account_color = details.color }
}
return task { microBlog.showStatus(statusId).toParcelable(details, profileImageSize) }
}
}

View File

@ -20,7 +20,6 @@
package org.mariotaku.twidere.fragment.content
import android.app.Dialog
import android.content.Context
import android.content.DialogInterface
import android.content.Intent
import android.net.Uri
@ -37,25 +36,19 @@ import android.widget.ImageButton
import android.widget.RelativeLayout
import android.widget.Toast
import com.twitter.Validator
import nl.komponents.kovenant.Promise
import nl.komponents.kovenant.task
import org.mariotaku.kpreferences.get
import org.mariotaku.ktextension.*
import org.mariotaku.library.objectcursor.ObjectCursor
import org.mariotaku.microblog.library.MicroBlog
import org.mariotaku.twidere.R
import org.mariotaku.twidere.activity.content.RetweetQuoteDialogActivity
import org.mariotaku.twidere.annotation.AccountType
import org.mariotaku.twidere.constant.IntentConstants.*
import org.mariotaku.twidere.constant.quickSendKey
import org.mariotaku.twidere.extension.applyTheme
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.extension.model.newMicroBlogInstance
import org.mariotaku.twidere.extension.model.textLimit
import org.mariotaku.twidere.fragment.BaseDialogFragment
import org.mariotaku.twidere.model.*
import org.mariotaku.twidere.model.draft.QuoteStatusActionExtras
import org.mariotaku.twidere.model.util.ParcelableStatusUtils
import org.mariotaku.twidere.provider.TwidereDataStore.Drafts
import org.mariotaku.twidere.service.LengthyOperationsService
import org.mariotaku.twidere.util.Analyzer
@ -373,24 +366,5 @@ class RetweetQuoteDialogFragment : AbsStatusDialogFragment() {
return f
}
fun showStatus(context: Context, details: AccountDetails, statusId: String,
status: ParcelableStatus?): Promise<ParcelableStatus, Exception> {
if (status != null) {
status.apply {
if (account_key != details.key) {
my_retweet_id = null
}
account_key = details.key
account_color = details.color
}
return Promise.ofSuccess(status)
}
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
val profileImageSize = context.getString(R.string.profile_image_size)
return task {
microBlog.showStatus(statusId).toParcelable(details.key, details.type, profileImageSize)
}
}
}
}

View File

@ -39,9 +39,8 @@ import org.mariotaku.twidere.TwidereConstants.*
import org.mariotaku.twidere.annotation.AccountType
import org.mariotaku.twidere.annotation.Referral
import org.mariotaku.twidere.extension.api.tryShowUser
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.extension.model.api.mastodon.toParcelable
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.extension.model.isMastodonPlaceholder
import org.mariotaku.twidere.extension.model.newMicroBlogInstance
import org.mariotaku.twidere.model.AccountDetails
@ -164,12 +163,12 @@ class ParcelableUserLoader(
val mastodon = details.newMicroBlogInstance(context, Mastodon::class.java)
if (userKey == null) throw MicroBlogException("Invalid user id")
if (!userKey.isMastodonPlaceholder) {
return mastodon.getAccount(userKey.id).toParcelable(details.key)
return mastodon.getAccount(userKey.id).toParcelable(details)
}
if (screenName == null) throw MicroBlogException("Screen name required")
val resultItem = mastodon.searchAccounts("$screenName@${userKey.host}", Paging().count(1))
.firstOrNull() ?: throw MicroBlogException("User not found")
return resultItem.toParcelable(details.key)
return resultItem.toParcelable(details)
}
private fun showMicroBlogUser(details: AccountDetails): ParcelableUser {
@ -183,7 +182,7 @@ class ParcelableUserLoader(
} else {
microBlog.tryShowUser(userKey?.id, screenName, details.type)
}
return response.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
return response.toParcelable(details, profileImageSize = profileImageSize)
}
override fun onStartLoading() {

View File

@ -43,7 +43,6 @@ import org.mariotaku.twidere.model.pagination.PaginatedList
import org.mariotaku.twidere.model.pagination.Pagination
import org.mariotaku.twidere.model.pagination.SinceMaxPagination
import org.mariotaku.twidere.model.util.AccountUtils
import org.mariotaku.twidere.model.util.ParcelableStatusUtils
import org.mariotaku.twidere.task.twitter.GetStatusesTask
import org.mariotaku.twidere.util.DebugLog
import org.mariotaku.twidere.util.UserColorNameManager
@ -167,7 +166,6 @@ abstract class AbsRequestStatusesLoader(
status.is_gap = insertGap && isGapEnabled && minIdx == i
status.position_key = GetStatusesTask.getPositionKey(status.timestamp, status.sort_id,
lastSortId, sortDiff, i, statuses.size)
ParcelableStatusUtils.updateExtraInformation(status, details)
}
data.addAll(statuses)
}

View File

@ -58,7 +58,7 @@ class ConversationLoader(
@Throws(MicroBlogException::class)
override fun getStatuses(account: AccountDetails, paging: Paging): PaginatedList<ParcelableStatus> {
return getMicroBlogStatuses(account, paging).mapMicroBlogToPaginated {
it.toParcelable(account.key, account.type, profileImageSize)
it.toParcelable(account, profileImageSize)
}
}

View File

@ -53,7 +53,7 @@ class GroupTimelineLoader(
override fun getStatuses(account: AccountDetails, paging: Paging): PaginatedList<ParcelableStatus> {
if (account.type != AccountType.STATUSNET) throw APINotSupportedException()
return getMicroBlogStatuses(account, paging).mapMicroBlogToPaginated {
it.toParcelable(account.key, account.type, profileImageSize)
it.toParcelable(account, profileImageSize)
}
}
@WorkerThread

View File

@ -54,7 +54,7 @@ open class MediaStatusesSearchLoader(
@Throws(MicroBlogException::class)
override fun getStatuses(account: AccountDetails, paging: Paging): PaginatedList<ParcelableStatus> {
return getMicroBlogStatuses(account, paging).mapMicroBlogToPaginated {
it.toParcelable(account.key, account.type, profileImageSize)
it.toParcelable(account, profileImageSize)
}
}

View File

@ -72,7 +72,7 @@ class MediaTimelineLoader(
when (account.type) {
AccountType.MASTODON -> return getMastodonStatuses(account, paging)
else -> return getMicroBlogStatuses(account, paging).mapMicroBlogToPaginated {
it.toParcelable(account.key, account.type, profileImageSize)
it.toParcelable(account, profileImageSize)
}
}
}
@ -136,6 +136,6 @@ class MediaTimelineLoader(
val option = MastodonTimelineOption()
option.onlyMedia(true)
return UserTimelineLoader.getMastodonStatuses(mastodon, userKey, screenName, paging,
option).mapToPaginated { it.toParcelable(account.key) }
option).mapToPaginated { it.toParcelable(account) }
}
}

View File

@ -54,13 +54,13 @@ class NetworkPublicTimelineLoader(
AccountType.MASTODON -> {
val mastodon = account.newMicroBlogInstance(context, Mastodon::class.java)
return mastodon.getPublicTimeline(paging, true).mapToPaginated {
it.toParcelable(account.key)
it.toParcelable(account)
}
}
AccountType.STATUSNET -> {
val microBlog = account.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getNetworkPublicTimeline(paging).mapMicroBlogToPaginated {
it.toParcelable(account.key, account.type, profileImageSize = profileImageSize)
it.toParcelable(account, profileImageSize = profileImageSize)
}
}
else -> throw APINotSupportedException(account.type)

View File

@ -53,13 +53,13 @@ class PublicTimelineLoader(
AccountType.MASTODON -> {
val mastodon = account.newMicroBlogInstance(context, Mastodon::class.java)
return mastodon.getPublicTimeline(paging, true).mapToPaginated {
it.toParcelable(account.key)
it.toParcelable(account)
}
}
else -> {
val microBlog = account.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getPublicTimeline(paging).mapMicroBlogToPaginated {
it.toParcelable(account.key, account.type, profileImageSize = profileImageSize)
it.toParcelable(account, profileImageSize = profileImageSize)
}
}
}

View File

@ -55,7 +55,7 @@ open class TweetSearchLoader(
@Throws(MicroBlogException::class)
override fun getStatuses(account: AccountDetails, paging: Paging): PaginatedList<ParcelableStatus> {
return getMicroBlogStatuses(account, paging).mapMicroBlogToPaginated {
it.toParcelable(account.key, account.type, profileImageSize)
it.toParcelable(account, profileImageSize)
}
}

View File

@ -59,7 +59,7 @@ class UserFavoritesLoader(
}
}
return getMicroBlogStatuses(account, paging).mapMicroBlogToPaginated {
it.toParcelable(account.key, account.type, profileImageSize)
it.toParcelable(account, profileImageSize)
}
}
@ -86,6 +86,6 @@ class UserFavoritesLoader(
throw MicroBlogException("Only current account favorites is supported")
}
val mastodon = account.newMicroBlogInstance(context, Mastodon::class.java)
return mastodon.getFavourites(paging).mapToPaginated { it.toParcelable(account.key) }
return mastodon.getFavourites(paging).mapToPaginated { it.toParcelable(account) }
}
}

View File

@ -52,7 +52,7 @@ class UserListTimelineLoader(
@Throws(MicroBlogException::class)
override fun getStatuses(account: AccountDetails, paging: Paging): PaginatedList<ParcelableStatus> {
return getMicroBlogStatuses(account, paging).mapMicroBlogToPaginated {
it.toParcelable(account.key, account.type, profileImageSize)
it.toParcelable(account, profileImageSize)
}
}

View File

@ -82,10 +82,10 @@ class UserTimelineLoader(
@Throws(MicroBlogException::class)
override fun getStatuses(account: AccountDetails, paging: Paging) = when (account.type) {
AccountType.MASTODON -> getMastodonStatuses(account, paging).mapToPaginated {
it.toParcelable(account.key)
it.toParcelable(account)
}
else -> getMicroBlogStatuses(account, paging).mapMicroBlogToPaginated {
it.toParcelable(account.key, account.type, profileImageSize = profileImageSize)
it.toParcelable(account, profileImageSize = profileImageSize)
}
}
@ -114,8 +114,7 @@ class UserTimelineLoader(
if (pinnedStatusIds != null) {
pinnedStatuses = try {
microBlog.lookupStatuses(pinnedStatusIds).mapIndexed { idx, status ->
val created = status.toParcelable(account.key, account.type,
profileImageSize = profileImageSize)
val created = status.toParcelable(account, profileImageSize = profileImageSize)
created.sort_id = idx.toLong()
return@mapIndexed created
}

View File

@ -45,7 +45,7 @@ class GroupMembersLoader(
@Throws(MicroBlogException::class)
override fun getUsers(details: AccountDetails, paging: Paging): PaginatedList<ParcelableUser> {
return getMicroBlogUsers(details, paging).mapToPaginated(pagination) {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}

View File

@ -49,19 +49,19 @@ class IncomingFriendshipsLoader(
AccountType.MASTODON -> {
val mastodon = details.newMicroBlogInstance(context, Mastodon::class.java)
return mastodon.getFollowRequests(paging).mapToPaginated {
it.toParcelable(details.key)
it.toParcelable(details)
}
}
AccountType.FANFOU -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getFriendshipsRequests(paging).mapToPaginated(pagination) {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
else -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.lookupUsersMapPaginated(microBlog.getIncomingFriendships(paging)) {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
}

View File

@ -51,13 +51,13 @@ class MutesUsersLoader(
AccountType.MASTODON -> {
val mastodon = details.newMicroBlogInstance(context, Mastodon::class.java)
return mastodon.getMutes(paging).mapToPaginated {
it.toParcelable(details.key)
it.toParcelable(details)
}
}
else -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getMutesUsersList(paging).mapToPaginated {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
}

View File

@ -58,7 +58,7 @@ class StatusFavoritersLoader(
AccountType.MASTODON -> {
val mastodon = details.newMicroBlogInstance(context, Mastodon::class.java)
return mastodon.getStatusFavouritedBy(statusId).mapToPaginated {
it.toParcelable(details.key)
it.toParcelable(details)
}
}
AccountType.TWITTER -> {
@ -71,7 +71,7 @@ class StatusFavoritersLoader(
IDsAccessor.setIds(IDs(), parseUserIds(htmlUsers))
}
return microBlog.lookupUsersMapPaginated(ids) {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
else -> {

View File

@ -51,7 +51,7 @@ class StatusRetweetersLoader(
val response = mastodon.getStatusFavouritedBy(statusId)
return PaginatedArrayList<ParcelableUser>(response.size).apply {
response.mapTo(this) { account ->
account.toParcelable(details.key)
account.toParcelable(details)
}
}
}
@ -61,7 +61,7 @@ class StatusRetweetersLoader(
val response = microBlog.lookupUsers(ids)
return PaginatedArrayList<ParcelableUser>(response.size).apply {
response.mapTo(this) { user ->
user.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
user.toParcelable(details, profileImageSize = profileImageSize)
}
}
}

View File

@ -51,19 +51,19 @@ class UserBlocksLoader(
AccountType.MASTODON -> {
val mastodon = details.newMicroBlogInstance(context, Mastodon::class.java)
return mastodon.getBlocks(paging).mapToPaginated {
it.toParcelable(details.key)
it.toParcelable(details)
}
}
AccountType.FANFOU -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getFanfouBlocking(paging).mapToPaginated(pagination) {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
else -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getBlocksList(paging).mapToPaginated {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
}

View File

@ -50,25 +50,25 @@ class UserFollowersLoader(
AccountType.MASTODON -> {
val mastodon = details.newMicroBlogInstance(context, Mastodon::class.java)
return mastodon.getFollowers(userKey.id, paging).mapToPaginated {
it.toParcelable(details.key)
it.toParcelable(details)
}
}
AccountType.STATUSNET -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getStatusesFollowersList(userKey.id, paging).mapToPaginated {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
AccountType.FANFOU -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getUsersFollowers(userKey.id, paging).mapToPaginated(pagination) {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
else -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getFollowersList(userKey.id, paging).mapToPaginated {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
}
@ -83,19 +83,19 @@ class UserFollowersLoader(
AccountType.STATUSNET -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getStatusesFollowersListByScreenName(screenName, paging).mapToPaginated {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
AccountType.FANFOU -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getUsersFollowers(screenName, paging).mapToPaginated(pagination) {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
else -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getFollowersListByScreenName(screenName, paging).mapToPaginated {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
}

View File

@ -50,25 +50,25 @@ class UserFriendsLoader(
AccountType.MASTODON -> {
val mastodon = details.newMicroBlogInstance(context, Mastodon::class.java)
return mastodon.getFollowing(userKey.id, paging).mapToPaginated {
it.toParcelable(details.key)
it.toParcelable(details)
}
}
AccountType.STATUSNET -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getStatusesFriendsList(userKey.id, paging).mapToPaginated {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
AccountType.FANFOU -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getUsersFriends(userKey.id, paging).mapToPaginated(pagination) {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
else -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getFriendsList(userKey.id, paging).mapToPaginated {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
}
@ -83,19 +83,19 @@ class UserFriendsLoader(
AccountType.STATUSNET -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getStatusesFriendsListByScreenName(screenName, paging).mapToPaginated {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
AccountType.FANFOU -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getUsersFriends(screenName, paging).mapToPaginated(pagination) {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
else -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getFriendsListByScreenName(screenName, paging).mapToPaginated {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
}

View File

@ -50,7 +50,7 @@ abstract class UserListRelatedUsersLoader(
override final fun getUsers(details: AccountDetails, paging: Paging): PaginatedList<ParcelableUser> {
when (details.type) {
AccountType.TWITTER -> return getTwitterUsers(details, paging).mapToPaginated {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
else -> {
throw APINotSupportedException(details.type)

View File

@ -47,19 +47,19 @@ open class UserSearchLoader(
AccountType.MASTODON -> {
val mastodon = details.newMicroBlogInstance(context, Mastodon::class.java)
return mastodon.searchAccounts(query, paging).mapToPaginated {
it.toParcelable(details.key)
it.toParcelable(details)
}
}
AccountType.FANFOU -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.searchFanfouUsers(query, paging).mapToPaginated(pagination) {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
else -> {
val microBlog = details.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.searchUsers(query, paging).mapToPaginated(pagination) {
it.toParcelable(details.key, details.type, profileImageSize = profileImageSize)
it.toParcelable(details, profileImageSize = profileImageSize)
}
}
}

View File

@ -154,7 +154,7 @@ abstract class TabConfiguration {
CustomTabType.TRENDS_SUGGESTIONS, CustomTabType.DIRECT_MESSAGES,
CustomTabType.FAVORITES, CustomTabType.USER_TIMELINE,
CustomTabType.SEARCH_STATUSES, CustomTabType.LIST_TIMELINE,
CustomTabType.PUBLIC_TIMELINE)
CustomTabType.PUBLIC_TIMELINE, CustomTabType.NETWORK_PUBLIC_TIMELINE)
}
fun ofType(@CustomTabType type: String): TabConfiguration? {
@ -168,6 +168,7 @@ abstract class TabConfiguration {
CustomTabType.TRENDS_SUGGESTIONS -> return TrendsTabConfiguration()
CustomTabType.SEARCH_STATUSES -> return SearchTabConfiguration()
CustomTabType.PUBLIC_TIMELINE -> return PublicTimelineTabConfiguration()
CustomTabType.NETWORK_PUBLIC_TIMELINE -> return NetworkPublicTimelineTabConfiguration()
}
return null
}

View File

@ -1,8 +1,10 @@
package org.mariotaku.twidere.model.tab.impl
import org.mariotaku.twidere.R
import org.mariotaku.twidere.annotation.AccountType
import org.mariotaku.twidere.annotation.TabAccountFlags
import org.mariotaku.twidere.fragment.message.MessagesEntriesFragment
import org.mariotaku.twidere.model.AccountDetails
import org.mariotaku.twidere.model.tab.DrawableHolder
import org.mariotaku.twidere.model.tab.StringHolder
import org.mariotaku.twidere.model.tab.TabConfiguration
@ -20,4 +22,9 @@ class MessagesTabConfiguration : TabConfiguration() {
TabAccountFlags.FLAG_ACCOUNT_MULTIPLE or TabAccountFlags.FLAG_ACCOUNT_MUTABLE
override val fragmentClass = MessagesEntriesFragment::class.java
override fun checkAccountAvailability(details: AccountDetails) = when (details.type) {
AccountType.TWITTER, AccountType.FANFOU, AccountType.STATUSNET -> true
else -> false
}
}

View File

@ -0,0 +1,50 @@
/*
* Twidere - Twitter client for Android
*
* Copyright (C) 2012-2017 Mariotaku Lee <mariotaku.lee@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.mariotaku.twidere.model.tab.impl
import org.mariotaku.twidere.R
import org.mariotaku.twidere.annotation.AccountType
import org.mariotaku.twidere.annotation.TabAccountFlags
import org.mariotaku.twidere.fragment.statuses.NetworkPublicTimelineFragment
import org.mariotaku.twidere.model.AccountDetails
import org.mariotaku.twidere.model.tab.DrawableHolder
import org.mariotaku.twidere.model.tab.StringHolder
import org.mariotaku.twidere.model.tab.TabConfiguration
/**
* Created by mariotaku on 2016/11/27.
*/
class NetworkPublicTimelineTabConfiguration : TabConfiguration() {
override val name = StringHolder.resource(R.string.title_network_public_timeline)
override val icon = DrawableHolder.Builtin.WEB
override val accountFlags = TabAccountFlags.FLAG_HAS_ACCOUNT or
TabAccountFlags.FLAG_ACCOUNT_REQUIRED or TabAccountFlags.FLAG_ACCOUNT_MUTABLE
override val fragmentClass = NetworkPublicTimelineFragment::class.java
override fun checkAccountAvailability(details: AccountDetails) = when (details.type) {
AccountType.MASTODON, AccountType.STATUSNET -> true
else -> false
}
}

View File

@ -43,7 +43,8 @@ class PublicTimelineTabConfiguration : TabConfiguration() {
override val fragmentClass = PublicTimelineFragment::class.java
override fun checkAccountAvailability(details: AccountDetails): Boolean {
return AccountType.FANFOU == details.type || AccountType.STATUSNET == details.type
override fun checkAccountAvailability(details: AccountDetails) = when (details.type) {
AccountType.MASTODON, AccountType.FANFOU, AccountType.STATUSNET -> true
else -> false
}
}

View File

@ -21,9 +21,11 @@ package org.mariotaku.twidere.model.tab.impl
import android.content.Context
import org.mariotaku.twidere.R
import org.mariotaku.twidere.annotation.AccountType
import org.mariotaku.twidere.annotation.TabAccountFlags
import org.mariotaku.twidere.constant.IntentConstants.EXTRA_USER_LIST
import org.mariotaku.twidere.fragment.statuses.UserListTimelineFragment
import org.mariotaku.twidere.model.AccountDetails
import org.mariotaku.twidere.model.Tab
import org.mariotaku.twidere.model.tab.DrawableHolder
import org.mariotaku.twidere.model.tab.StringHolder
@ -46,6 +48,11 @@ class UserListTimelineTabConfiguration : TabConfiguration() {
override val fragmentClass = UserListTimelineFragment::class.java
override fun checkAccountAvailability(details: AccountDetails) = when (details.type) {
AccountType.TWITTER -> true
else -> false
}
override fun getExtraConfigurations(context: Context) = arrayOf(
UserListExtraConfiguration(EXTRA_USER_LIST).headerTitle(R.string.title_user_list)
)

View File

@ -7,7 +7,6 @@ import org.mariotaku.microblog.library.twitter.model.DMResponse.Entry.Message.Da
import org.mariotaku.microblog.library.twitter.model.DirectMessage
import org.mariotaku.microblog.library.twitter.model.User
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.model.ParcelableMedia
import org.mariotaku.twidere.model.ParcelableMessage
import org.mariotaku.twidere.model.ParcelableMessage.MessageType
@ -124,9 +123,8 @@ object ParcelableMessageUtils {
this.extras = ConversationInfoUpdatedExtras().apply {
this.name = message.conversationName
this.avatar = message.conversationAvatarImageHttps
this.user = users[message.byUserId]?.let {
it.toParcelable(accountKey, accountType, profileImageSize = profileImageSize)
}
this.user = users[message.byUserId]?.toParcelable(accountKey, accountType,
profileImageSize = profileImageSize)
}
this.is_outgoing = false
}

View File

@ -35,6 +35,7 @@ object ParcelableStatusUpdateUtils {
statusUpdate.excluded_reply_user_ids = actionExtras.excludedReplyUserIds
statusUpdate.extended_reply_mode = actionExtras.isExtendedReplyMode
statusUpdate.summary = actionExtras.summaryText
statusUpdate.visibility = actionExtras.visibility
}
is QuoteStatusActionExtras -> {
val onlyAccount = statusUpdate.accounts.singleOrNull()

View File

@ -37,7 +37,6 @@ import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.model.*
import org.mariotaku.twidere.model.pagination.SinceMaxPagination
import org.mariotaku.twidere.model.util.AccountUtils
import org.mariotaku.twidere.model.util.ParcelableActivityUtils
import org.mariotaku.twidere.model.util.UserKeyUtils
import org.mariotaku.twidere.provider.TwidereDataStore.*
import org.mariotaku.twidere.task.twitter.GetActivitiesAboutMeTask
@ -272,10 +271,8 @@ class StreamingService : BaseService() {
homeInsertGap = true
return false
}
val parcelableStatus = status.toParcelable(account.key, account.type,
profileImageSize = profileImageSize)
val parcelableStatus = status.toParcelable(account, profileImageSize = profileImageSize)
parcelableStatus.is_gap = homeInsertGap
parcelableStatus.account_color = account.color
val currentTimeMillis = System.currentTimeMillis()
if (lastStatusTimestamps[0] >= parcelableStatus.timestamp) {
@ -316,8 +313,7 @@ class StreamingService : BaseService() {
} else {
insertGap = false
}
val curActivity = activity.toParcelable(account.key, account.type, insertGap,
profileImageSize)
val curActivity = activity.toParcelable(account, insertGap, profileImageSize)
curActivity.account_color = account.color
curActivity.position_key = curActivity.timestamp
var updateId = -1L

View File

@ -6,10 +6,10 @@ import android.widget.Toast
import org.mariotaku.microblog.library.MicroBlog
import org.mariotaku.microblog.library.MicroBlogException
import org.mariotaku.microblog.library.twitter.model.User
import org.mariotaku.twidere.R
import org.mariotaku.twidere.exception.AccountNotFoundException
import org.mariotaku.twidere.extension.getErrorMessage
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.extension.model.newMicroBlogInstance
import org.mariotaku.twidere.model.AccountDetails
import org.mariotaku.twidere.model.ParcelableUser
@ -26,6 +26,7 @@ abstract class AbsFriendshipOperationTask(
) : ExceptionHandlingAbstractTask<AbsFriendshipOperationTask.Arguments, ParcelableUser,
MicroBlogException, Any?>(context) {
private val profileImageSize = context.getString(R.string.profile_image_size)
override val exceptionClass = MicroBlogException::class.java
override fun beforeExecute() {
@ -58,7 +59,7 @@ abstract class AbsFriendshipOperationTask(
?: throw AccountNotFoundException()
val twitter = details.newMicroBlogInstance(context, cls = MicroBlog::class.java)
val user = perform(twitter, details, params)
val parcelableUser = user.toParcelable(params.accountKey, details.type)
val parcelableUser = user.toParcelable(details, profileImageSize = profileImageSize)
succeededWorker(twitter, details, params, parcelableUser)
return parcelableUser
}

View File

@ -46,14 +46,13 @@ class CreateFavoriteTask(context: Context, accountKey: UserKey, private val stat
val result = when (account.type) {
AccountType.FANFOU -> {
val microBlog = account.newMicroBlogInstance(context, cls = MicroBlog::class.java)
microBlog.createFanfouFavorite(statusId).toParcelable(account.key, account.type)
microBlog.createFanfouFavorite(statusId).toParcelable(account)
}
else -> {
val microBlog = account.newMicroBlogInstance(context, cls = MicroBlog::class.java)
microBlog.createFavorite(statusId).toParcelable(account.key, account.type)
microBlog.createFavorite(statusId).toParcelable(account)
}
}
ParcelableStatusUtils.updateExtraInformation(result, account)
Utils.setLastSeen(context, result.mentions, System.currentTimeMillis())
val values = ContentValues()
values.put(TwidereDataStore.Statuses.IS_FAVORITE, true)

View File

@ -37,12 +37,10 @@ class DestroyFavoriteTask(
val result: ParcelableStatus
when (account.type) {
AccountType.FANFOU -> {
result = microBlog.destroyFanfouFavorite(statusId).toParcelable(account.key,
account.type)
result = microBlog.destroyFanfouFavorite(statusId).toParcelable(account)
}
else -> {
result = microBlog.destroyFavorite(statusId).toParcelable(account.key,
account.type)
result = microBlog.destroyFavorite(statusId).toParcelable(account)
}
}
val values = ContentValues()

View File

@ -14,7 +14,6 @@ import org.mariotaku.twidere.model.ParcelableStatus
import org.mariotaku.twidere.model.UserKey
import org.mariotaku.twidere.model.event.StatusDestroyedEvent
import org.mariotaku.twidere.model.event.StatusListChangedEvent
import org.mariotaku.twidere.model.util.ParcelableStatusUtils
import org.mariotaku.twidere.util.AsyncTwitterWrapper
import org.mariotaku.twidere.util.DataStoreUtils
import org.mariotaku.twidere.util.deleteActivityStatus
@ -30,9 +29,7 @@ class DestroyStatusTask(
override fun onExecute(account: AccountDetails, params: Any?): ParcelableStatus {
val microBlog = account.newMicroBlogInstance(context, cls = MicroBlog::class.java)
val status = microBlog.destroyStatus(statusId).toParcelable(account.key, account.type)
ParcelableStatusUtils.updateExtraInformation(status, account)
return status
return microBlog.destroyStatus(statusId).toParcelable(account)
}
override fun onCleanup(account: AccountDetails, params: Any?, result: ParcelableStatus?, exception: MicroBlogException?) {

View File

@ -49,7 +49,7 @@ class RetweetStatusTask(
val resolver = context.contentResolver
val microBlog = account.newMicroBlogInstance(context, MicroBlog::class.java)
try {
val result = microBlog.retweetStatus(statusId).toParcelable(account.key, account.type)
val result = microBlog.retweetStatus(statusId).toParcelable(account)
ParcelableStatusUtils.updateExtraInformation(result, account)
Utils.setLastSeen(context, result.mentions, System.currentTimeMillis())
val values = ContentValues()

View File

@ -8,7 +8,6 @@ import org.mariotaku.microblog.library.MicroBlogException
import org.mariotaku.twidere.R
import org.mariotaku.twidere.TwidereConstants.LOGTAG
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.extension.model.newMicroBlogInstance
import org.mariotaku.twidere.model.AccountDetails
import org.mariotaku.twidere.model.ParcelableMedia
@ -50,7 +49,7 @@ open class UpdateProfileBackgroundImageTask<ResultHandler>(
DebugLog.w(LOGTAG, tr = e)
}
val user = microBlog.verifyCredentials()
return user.toParcelable(account.key, account.type, profileImageSize = profileImageSize)
return user.toParcelable(account, profileImageSize = profileImageSize)
}
override fun onSucceed(callback: ResultHandler?, result: ParcelableUser) {

View File

@ -49,7 +49,7 @@ open class UpdateProfileBannerImageTask<ResultHandler>(
DebugLog.w(LOGTAG, tr = e)
}
val user = microBlog.verifyCredentials()
return user.toParcelable(account.key, account.type, profileImageSize = profileImageSize)
return user.toParcelable(account, profileImageSize = profileImageSize)
}
override fun onSucceed(callback: ResultHandler?, result: ParcelableUser) {

View File

@ -8,7 +8,6 @@ import org.mariotaku.microblog.library.MicroBlogException
import org.mariotaku.twidere.R
import org.mariotaku.twidere.TwidereConstants
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.extension.model.newMicroBlogInstance
import org.mariotaku.twidere.model.AccountDetails
import org.mariotaku.twidere.model.ParcelableMedia
@ -49,11 +48,11 @@ open class UpdateProfileImageTask<ResultHandler>(
DebugLog.w(TwidereConstants.LOGTAG, tr = e)
}
val user = microBlog.verifyCredentials()
return user.toParcelable(account.key, account.type, profileImageSize = profileImageSize)
return user.toParcelable(account, profileImageSize = profileImageSize)
}
override fun onSucceed(callback: ResultHandler?, result: ParcelableUser) {
Toast.makeText(context, R.string.massage_toast_profile_image_updated, Toast.LENGTH_SHORT).show()
Toast.makeText(context, R.string.message_toast_profile_image_updated, Toast.LENGTH_SHORT).show()
bus.post(ProfileUpdatedEvent(result))
}

View File

@ -24,7 +24,8 @@ import android.net.Uri
import org.mariotaku.microblog.library.MicroBlog
import org.mariotaku.microblog.library.MicroBlogException
import org.mariotaku.microblog.library.mastodon.Mastodon
import org.mariotaku.microblog.library.twitter.model.*
import org.mariotaku.microblog.library.twitter.model.InternalActivityCreator
import org.mariotaku.microblog.library.twitter.model.Paging
import org.mariotaku.twidere.R
import org.mariotaku.twidere.annotation.AccountType
import org.mariotaku.twidere.annotation.ReadPositionTag
@ -60,26 +61,26 @@ class GetActivitiesAboutMeTask(context: Context) : GetActivitiesTask(context) {
AccountType.MASTODON -> {
val mastodon = account.newMicroBlogInstance(context, Mastodon::class.java)
return mastodon.getNotifications(paging).map {
it.toParcelable(account.key)
it.toParcelable(account)
}
}
AccountType.FANFOU -> {
val microBlog = account.newMicroBlogInstance(context, MicroBlog::class.java)
if (account.isOfficial(context)) {
return microBlog.getActivitiesAboutMe(paging).map {
it.toParcelable(account.key, account.type, profileImageSize = profileImageSize)
it.toParcelable(account, profileImageSize = profileImageSize)
}
}
return microBlog.getMentions(paging).map {
InternalActivityCreator.status(it, account.key.id).toParcelable(account.key,
account.type, profileImageSize = profileImageSize)
InternalActivityCreator.status(it, account.key.id).toParcelable(account,
profileImageSize = profileImageSize)
}
}
else -> {
val microBlog = account.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getHomeTimeline(paging).map {
InternalActivityCreator.status(it, account.key.id).toParcelable(account.key,
account.type, profileImageSize = profileImageSize)
InternalActivityCreator.status(it, account.key.id).toParcelable(account,
profileImageSize = profileImageSize)
}
}
}

View File

@ -58,13 +58,13 @@ class GetHomeTimelineTask(context: Context) : GetStatusesTask(context) {
AccountType.MASTODON -> {
val mastodon = account.newMicroBlogInstance(context, Mastodon::class.java)
return mastodon.getHomeTimeline(paging).map {
it.toParcelable(account.key)
it.toParcelable(account)
}
}
else -> {
val microBlog = account.newMicroBlogInstance(context, MicroBlog::class.java)
return microBlog.getHomeTimeline(paging).map {
it.toParcelable(account.key, account.type, profileImageSize)
it.toParcelable(account, profileImageSize)
}
}
}

View File

@ -27,7 +27,6 @@ import org.mariotaku.twidere.model.UserKey
import org.mariotaku.twidere.model.event.GetStatusesTaskEvent
import org.mariotaku.twidere.model.task.GetTimelineResult
import org.mariotaku.twidere.model.util.AccountUtils
import org.mariotaku.twidere.model.util.ParcelableStatusUtils
import org.mariotaku.twidere.provider.TwidereDataStore.AccountSupportColumns
import org.mariotaku.twidere.provider.TwidereDataStore.Statuses
import org.mariotaku.twidere.task.BaseAbstractTask
@ -143,7 +142,6 @@ abstract class GetStatusesTask(
val creator = ObjectCursor.valuesCreatorFrom(ParcelableStatus::class.java)
statuses.forEachIndexed { i, status ->
ParcelableStatusUtils.updateExtraInformation(status, account)
status.position_key = getPositionKey(status.timestamp, status.sort_id, lastSortId,
sortDiff, i, statuses.size)
status.inserted_date = System.currentTimeMillis()

View File

@ -340,7 +340,7 @@ class UpdateStatusTask(
}).use { (body) ->
val photoUpdate = PhotoStatusUpdate(body, pendingUpdate.overrideTexts[updateIndex])
return@use microBlog.uploadPhoto(photoUpdate)
}.toParcelable(details.key, details.type)
}.toParcelable(details)
} catch (e: IOException) {
throw UploadException(e)
}
@ -441,7 +441,7 @@ class UpdateStatusTask(
if (statusUpdate.is_possibly_sensitive) {
status.possiblySensitive(statusUpdate.is_possibly_sensitive)
}
return microBlog.updateStatus(status).toParcelable(details.key, details.type)
return microBlog.updateStatus(status).toParcelable(details)
}
@Throws(MicroBlogException::class)
@ -465,7 +465,10 @@ class UpdateStatusTask(
if (statusUpdate.summary != null) {
status.spoilerText(statusUpdate.summary)
}
return mastodon.postStatus(status).toParcelable(details.key)
if (statusUpdate.visibility != null) {
status.visibility(statusUpdate.visibility)
}
return mastodon.postStatus(status).toParcelable(details)
}
private fun statusShortenCallback(shortener: StatusShortenerInterface?,

View File

@ -408,7 +408,7 @@ class GetMessagesTask(
val participants = respUsers.filterKeys { userId ->
v.participants.any { it.userId == userId }
}.values.map {
it.toParcelable(accountKey, account.type, profileImageSize = profileImageSize)
it.toParcelable(account, profileImageSize = profileImageSize)
}
val conversationType = when (v.type?.toUpperCase(Locale.US)) {
DMResponse.Conversation.Type.ONE_TO_ONE -> ConversationType.ONE_TO_ONE

View File

@ -180,8 +180,8 @@ class SendMessageTask(
val conversations = hashMapOf<String, ParcelableMessageConversation>()
conversations.addLocalConversations(context, accountKey, conversationIds)
val message = ParcelableMessageUtils.fromMessage(accountKey, dm, true)
val sender = dm.sender.toParcelable(accountKey, details.type, profileImageSize = profileImageSize)
val recipient = dm.recipient.toParcelable(accountKey, details.type, profileImageSize = profileImageSize)
val sender = dm.sender.toParcelable(details, profileImageSize = profileImageSize)
val recipient = dm.recipient.toParcelable(details, profileImageSize = profileImageSize)
conversations.addConversation(message.conversation_id, details, message, setOf(sender, recipient), appendUsers = true)
return GetMessagesTask.DatabaseUpdateData(conversations.values, listOf(message))
}

View File

@ -159,7 +159,6 @@ class ContentNotificationManager(
}
}
fun showInteractions(pref: AccountPreferences, position: Long) {
val cr = context.contentResolver
val accountKey = pref.accountKey

View File

@ -26,7 +26,6 @@ import org.mariotaku.microblog.library.twitter.model.SavedSearch
import org.mariotaku.microblog.library.twitter.model.Status
import org.mariotaku.twidere.extension.model.api.toParcelable
import org.mariotaku.twidere.model.*
import org.mariotaku.twidere.model.util.ParcelableStatusUtils
import org.mariotaku.twidere.model.util.getActivityStatus
import org.mariotaku.twidere.provider.TwidereDataStore.Filters
import org.mariotaku.twidere.provider.TwidereDataStore.SavedSearches
@ -84,8 +83,6 @@ object ContentValuesCreator {
activity.account_color = details.color
if (status != null) {
ParcelableStatusUtils.updateExtraInformation(status, details)
activity.status_id = status.id
activity.status_retweet_id = status.retweet_id
activity.status_my_retweet_id = status.my_retweet_id

View File

@ -928,7 +928,7 @@ object DataStoreUtils {
Expression.equalsArgs(Statuses.STATUS_ID)).sql
val whereArgs = arrayOf(accountKey.toString(), statusId)
val resolver = context.contentResolver
val status = result.toParcelable(accountKey, details.type)
val status = result.toParcelable(details)
resolver.delete(CachedStatuses.CONTENT_URI, where, whereArgs)
resolver.insert(CachedStatuses.CONTENT_URI, ObjectCursor.valuesCreatorFrom(ParcelableStatus::class.java).create(status))
return status

View File

@ -463,7 +463,7 @@
<string name="profile_background_color">لون الخلفيّة</string>
<string name="profile_image">صورة الملف الشخصي</string>
<string name="profile_image_style">شكل صورة الملف الشخصي</string>
<string name="massage_toast_profile_image_updated">حُدّثت صورة الملف الشخصي.</string>
<string name="message_toast_profile_image_updated">حُدّثت صورة الملف الشخصي.</string>
<string name="profile_images">صورة الملف الشخصي</string>
<string name="profile_text_color">لون النص</string>
<string name="profile_updated">حُدّث الملف الشخصي.</string>

View File

@ -744,7 +744,7 @@ Convertilu a un tuit normal amiesta una caráuter estra.</string>
<string name="profile_banner">Pancarta de perfil</string>
<string name="profile_image">Imaxe de perfil</string>
<string name="profile_image_style">Estilu d\'imaxe de perfil</string>
<string name="massage_toast_profile_image_updated">Anovóse la imaxe de perfil.</string>
<string name="message_toast_profile_image_updated">Anovóse la imaxe de perfil.</string>
<string name="profile_images">Imáxenes de perfil</string>
<string name="profile_link_color_main_color">Color d\'enllaz (color principal)</string>
<string name="profile_text_color">Color de testu</string>

View File

@ -502,7 +502,7 @@
<string name="profile_banner">Bàner de perfil</string>
<string name="profile_image">Imatge de perfil</string>
<string name="profile_image_style">Estil de la imatge de perfil</string>
<string name="massage_toast_profile_image_updated">S\'ha actualitzat la imatge de perfil.</string>
<string name="message_toast_profile_image_updated">S\'ha actualitzat la imatge de perfil.</string>
<string name="profile_images">Imatges de perfil</string>
<string name="profile_link_color_main_color">Color dels enllaços (el principal)</string>
<string name="profile_text_color">Color de la lletra</string>

View File

@ -261,7 +261,7 @@
<string name="profile">Profil</string>
<string name="profile_background_color">Barva pozadí</string>
<string name="profile_image">Profilový obrázek</string>
<string name="massage_toast_profile_image_updated">Profilový obrázek aktualizován.</string>
<string name="message_toast_profile_image_updated">Profilový obrázek aktualizován.</string>
<string name="profile_images">Profilové obrázky</string>
<string name="profile_link_color_main_color">Barva odkazu (hlavní barva)</string>
<string name="profile_text_color">Barva textu</string>

View File

@ -749,7 +749,7 @@
<string name="profile_banner">Profil Banner</string>
<string name="profile_image">Profilbild</string>
<string name="profile_image_style">Profilbild-Stil</string>
<string name="massage_toast_profile_image_updated">Profilbild aktualisiert.</string>
<string name="message_toast_profile_image_updated">Profilbild aktualisiert.</string>
<string name="profile_images">Profil Bild</string>
<string name="profile_link_color_main_color">Linkfarbe (Hauptfarbe)</string>
<string name="profile_text_color">Textfarbe</string>

View File

@ -760,7 +760,7 @@
<string name="profile_banner">Encabezado</string>
<string name="profile_image">Imagen de perfil</string>
<string name="profile_image_style">Estilo imagen perfil</string>
<string name="massage_toast_profile_image_updated">Imagen del perfil actualizada.</string>
<string name="message_toast_profile_image_updated">Imagen del perfil actualizada.</string>
<string name="profile_images">Imágenes de perfil</string>
<string name="profile_link_color_main_color">Color de enlaces (color primario)</string>
<string name="profile_text_color">Color del texto</string>

View File

@ -637,7 +637,7 @@
<string name="profile_banner">بیرق نمایه</string>
<string name="profile_image">تصویر نمایه</string>
<string name="profile_image_style">نوع تصویر نمایه</string>
<string name="massage_toast_profile_image_updated">تصویر نمایه به‌روز شد.</string>
<string name="message_toast_profile_image_updated">تصویر نمایه به‌روز شد.</string>
<string name="profile_images">تصاویر نمایه</string>
<string name="profile_link_color_main_color">رنگ پیوند (رنگ اصلی)</string>
<string name="profile_text_color">رنگ متن</string>

View File

@ -497,7 +497,7 @@
<string name="profile_banner">Profiilin banneri</string>
<string name="profile_image">Profiilikuva</string>
<string name="profile_image_style">Profiilin kuvan tyyli</string>
<string name="massage_toast_profile_image_updated">Profiilikuva päivitetty.</string>
<string name="message_toast_profile_image_updated">Profiilikuva päivitetty.</string>
<string name="profile_images">Profiilin kuvat</string>
<string name="profile_link_color_main_color">Linkkitekstin väri (pääväri)</string>
<string name="profile_text_color">Tekstin väri</string>

View File

@ -745,7 +745,7 @@
<string name="profile_banner">Bannière de profil</string>
<string name="profile_image">Photo de profil</string>
<string name="profile_image_style">Style de l\'image de profil</string>
<string name="massage_toast_profile_image_updated">Image du profil mise à jour.</string>
<string name="message_toast_profile_image_updated">Image du profil mise à jour.</string>
<string name="profile_images">Photos de profil</string>
<string name="profile_link_color_main_color">Couleur des liens (couleur principale)</string>
<string name="profile_text_color">Couleur du texte</string>

View File

@ -761,7 +761,7 @@
<string name="profile_banner">Banner do perfil</string>
<string name="profile_image">Imaxe do perfil</string>
<string name="profile_image_style">Estilo da imaxe dos perfís</string>
<string name="massage_toast_profile_image_updated">Imaxe do perfil actualizada.</string>
<string name="message_toast_profile_image_updated">Imaxe do perfil actualizada.</string>
<string name="profile_images">Imaxes de perfil</string>
<string name="profile_link_color_main_color">Cor da ligazón (cor principal)</string>
<string name="profile_text_color">Cor do texto</string>

View File

@ -432,7 +432,7 @@
<string name="profile_banner">Banner profila</string>
<string name="profile_image">Slika profila</string>
<string name="profile_image_style">Stil slike profila</string>
<string name="massage_toast_profile_image_updated">Slika profila ažurirana.</string>
<string name="message_toast_profile_image_updated">Slika profila ažurirana.</string>
<string name="profile_images">Slike profila</string>
<string name="profile_link_color_main_color">Boja linka (glavna boja)</string>
<string name="profile_text_color">Boja teksta</string>

View File

@ -509,7 +509,7 @@
<string name="profile_banner">Fejléckép</string>
<string name="profile_image">Profilkép</string>
<string name="profile_image_style">Profilkép stílusa</string>
<string name="massage_toast_profile_image_updated">Profilkép frissítve.</string>
<string name="message_toast_profile_image_updated">Profilkép frissítve.</string>
<string name="profile_images">Profilképek</string>
<string name="profile_link_color_main_color">Hivatkozás színe (fő szín)</string>
<string name="profile_text_color">Szöveg színe</string>

View File

@ -565,7 +565,7 @@
<string name="profile_banner">Profil banner</string>
<string name="profile_image">Gambar Profil</string>
<string name="profile_image_style">Tampilan gaya profil</string>
<string name="massage_toast_profile_image_updated">Gambar profil diperbarui.</string>
<string name="message_toast_profile_image_updated">Gambar profil diperbarui.</string>
<string name="profile_images">Gambar Profil </string>
<string name="profile_link_color_main_color">Warna link (warna utama)</string>
<string name="profile_text_color">Warna Teks</string>

View File

@ -496,7 +496,7 @@
<string name="profile_banner">Banner Profilo</string>
<string name="profile_image">Immagine del profilo</string>
<string name="profile_image_style">Stile immagine profilo</string>
<string name="massage_toast_profile_image_updated">Immagine del profilo aggiornata.</string>
<string name="message_toast_profile_image_updated">Immagine del profilo aggiornata.</string>
<string name="profile_images">Immagini del profilo</string>
<string name="profile_link_color_main_color">Colore del link (colore principale)</string>
<string name="profile_text_color">Colore testo</string>

View File

@ -293,7 +293,7 @@
<string name="profile_background_color">צבע רקע</string>
<string name="profile_image">תמונת פרופיל</string>
<string name="profile_image_style">סגנון תמונת פרופיל</string>
<string name="massage_toast_profile_image_updated">תמונת הפרופיל עודכנה.</string>
<string name="message_toast_profile_image_updated">תמונת הפרופיל עודכנה.</string>
<string name="profile_images">תמונות פרופיל</string>
<string name="profile_text_color">צבע טקסט</string>
<string name="profile_updated">הפרופיל עודכן.</string>

View File

@ -770,7 +770,7 @@
<string name="profile_banner">ヘッダー画像</string>
<string name="profile_image">プロフィール画像</string>
<string name="profile_image_style">プロフィール画像のスタイル</string>
<string name="massage_toast_profile_image_updated">プロフィール画像を更新しました。</string>
<string name="message_toast_profile_image_updated">プロフィール画像を更新しました。</string>
<string name="profile_images">プロフィール画像</string>
<string name="profile_link_color_main_color">テーマカラー</string>
<string name="profile_text_color">テキストの色</string>

View File

@ -666,7 +666,7 @@
<string name="profile_banner">프로필 배너</string>
<string name="profile_image">프로필 이미지</string>
<string name="profile_image_style">프로필 이미지 형태</string>
<string name="massage_toast_profile_image_updated">프로필 이미지가 변경되었습니다.</string>
<string name="message_toast_profile_image_updated">프로필 이미지가 변경되었습니다.</string>
<string name="profile_images">프로필 이미지</string>
<string name="profile_link_color_main_color">링크 색상 (주 색상)</string>
<string name="profile_text_color">텍스트 색상</string>

View File

@ -509,7 +509,7 @@
<string name="profile_banner">Profielbanner</string>
<string name="profile_image">Profielfoto</string>
<string name="profile_image_style">Profielfoto stijl</string>
<string name="massage_toast_profile_image_updated">Profielfoto bijgewerkt.</string>
<string name="message_toast_profile_image_updated">Profielfoto bijgewerkt.</string>
<string name="profile_images">Profielfoto\'s</string>
<string name="profile_link_color_main_color">Linkkleur (hoofdkleur)</string>
<string name="profile_text_color">Tekstkleur</string>

View File

@ -451,7 +451,7 @@
<string name="profile_banner">Toppbilde</string>
<string name="profile_image">Profilbilde</string>
<string name="profile_image_style">Profilbildestil</string>
<string name="massage_toast_profile_image_updated">Profilbilde oppdatert.</string>
<string name="message_toast_profile_image_updated">Profilbilde oppdatert.</string>
<string name="profile_images">Profilbilder</string>
<string name="profile_link_color_main_color">Lenkefarge (hovedfarge)</string>
<string name="profile_text_color">Tekstfarge</string>

View File

@ -507,7 +507,7 @@
<string name="profile_background_color">Kolor tła</string>
<string name="profile_banner">Nagłówek profilu</string>
<string name="profile_image">Zdjęcie profilowe</string>
<string name="massage_toast_profile_image_updated">Zdjęcie profilowe zaktualizowane.</string>
<string name="message_toast_profile_image_updated">Zdjęcie profilowe zaktualizowane.</string>
<string name="profile_images">Zdjęcia profilowe</string>
<string name="profile_text_color">Kolor tekstu</string>
<string name="profile_updated">Profil zaktualizowany.</string>

View File

@ -548,7 +548,7 @@
<string name="profile_banner">Banner de perfil</string>
<string name="profile_image">Imagem do perfil</string>
<string name="profile_image_style">Estilo da imagem de perfil</string>
<string name="massage_toast_profile_image_updated">Imagem do perfil atualizada.</string>
<string name="message_toast_profile_image_updated">Imagem do perfil atualizada.</string>
<string name="profile_images">Imagens de perfil</string>
<string name="profile_link_color_main_color">Cor do link (cor principal)</string>
<string name="profile_text_color">Cor de texto</string>

View File

@ -579,7 +579,7 @@
<string name="profile_banner">Обложка профиля</string>
<string name="profile_image">Изображение пользователя</string>
<string name="profile_image_style">Стиль аватара</string>
<string name="massage_toast_profile_image_updated">Изображение профиля обновлено</string>
<string name="message_toast_profile_image_updated">Изображение профиля обновлено</string>
<string name="profile_images">Изображения профиля</string>
<string name="profile_link_color_main_color">Цвет ссылок (основной цвет)</string>
<string name="profile_text_color">Цвет текста</string>

View File

@ -752,7 +752,7 @@
<string name="profile_banner">Profilbanderoll</string>
<string name="profile_image">Profilbild</string>
<string name="profile_image_style">Profilbildsstil</string>
<string name="massage_toast_profile_image_updated">Profilbild uppdaterad.</string>
<string name="message_toast_profile_image_updated">Profilbild uppdaterad.</string>
<string name="profile_images">Profilbilder</string>
<string name="profile_link_color_main_color">Länkfärg (huvudfärg)</string>
<string name="profile_text_color">Textfärg</string>

View File

@ -756,7 +756,7 @@
<string name="profile_banner">รูปแบนเนอร์โปรไฟล์</string>
<string name="profile_image">ภาพโปรไฟล์</string>
<string name="profile_image_style">รูปแบบรูปโปรไฟล์</string>
<string name="massage_toast_profile_image_updated">ภาพโปรไฟล์คุณได้อัพเดทเรียบร้อยแล้ว</string>
<string name="message_toast_profile_image_updated">ภาพโปรไฟล์คุณได้อัพเดทเรียบร้อยแล้ว</string>
<string name="profile_images">ภาพแทนตัว</string>
<string name="profile_link_color_main_color">สีลิงค์ (สีหลัก)</string>
<string name="profile_text_color">สีข้อความ</string>

View File

@ -510,7 +510,7 @@
<string name="profile_banner">Profil afişi</string>
<string name="profile_image">Profil resmi</string>
<string name="profile_image_style">Profil resmi biçimi</string>
<string name="massage_toast_profile_image_updated">Profil resmi güncellendi.</string>
<string name="message_toast_profile_image_updated">Profil resmi güncellendi.</string>
<string name="profile_images">Profil resimleri</string>
<string name="profile_link_color_main_color">Bağlantı rengi (ana renk)</string>
<string name="profile_text_color">Metin rengi</string>

View File

@ -511,7 +511,7 @@
<string name="profile_banner">Обкладинка профілю</string>
<string name="profile_image">Зображення профілю</string>
<string name="profile_image_style">Стиль зображення профілю</string>
<string name="massage_toast_profile_image_updated">Оновлено зображення профілю.</string>
<string name="message_toast_profile_image_updated">Оновлено зображення профілю.</string>
<string name="profile_images">Зображення профілю</string>
<string name="profile_link_color_main_color">Колір посилань (головний колір)</string>
<string name="profile_text_color">Колір тексту</string>

View File

@ -761,7 +761,7 @@
<string name="profile_banner">横幅</string>
<string name="profile_image">个人资料图片</string>
<string name="profile_image_style">个人资料图片样式</string>
<string name="massage_toast_profile_image_updated">个人资料图片已更新</string>
<string name="message_toast_profile_image_updated">个人资料图片已更新</string>
<string name="profile_images">个人资料图片</string>
<string name="profile_link_color_main_color">链接颜色(主色调)</string>
<string name="profile_text_color">文字颜色</string>

View File

@ -764,7 +764,7 @@
<string name="profile_banner">橫幅</string>
<string name="profile_image">個人資料圖片</string>
<string name="profile_image_style">個人資料圖片樣式</string>
<string name="massage_toast_profile_image_updated">個人資料圖片已更新</string>
<string name="message_toast_profile_image_updated">個人資料圖片已更新</string>
<string name="profile_images">個人資料圖片</string>
<string name="profile_link_color_main_color">連結顏色(主色調)</string>
<string name="profile_text_color">文字顏色</string>

View File

@ -764,7 +764,7 @@
<string name="profile_banner">橫幅</string>
<string name="profile_image">個人資料圖片</string>
<string name="profile_image_style">個人資料圖片樣式</string>
<string name="massage_toast_profile_image_updated">個人資料圖片已更新</string>
<string name="message_toast_profile_image_updated">個人資料圖片已更新</string>
<string name="profile_images">個人資料圖片</string>
<string name="profile_link_color_main_color">連結顏色(主色調)</string>
<string name="profile_text_color">文字顏色</string>

View File

@ -35,7 +35,8 @@
<org.mariotaku.twidere.view.MaxHeightScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxHeight="240dp">
android:maxHeight="240dp"
tools:maxHeight="@null">
<LinearLayout
android:layout_width="match_parent"
@ -84,6 +85,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/element_spacing_normal"
android:visibility="gone"
android:textAppearance="?android:textAppearanceSmall"/>
<org.mariotaku.twidere.view.ExtendedRecyclerView
@ -99,7 +101,6 @@
android:id="@+id/locationLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/element_spacing_minus_normal"
android:drawableLeft="@drawable/ic_action_location"
android:drawableStart="@drawable/ic_action_location"
android:gravity="center_vertical"
@ -110,6 +111,20 @@
app:iabIconWidth="20dp"
tools:text="11.4, 51.4"/>
<org.mariotaku.twidere.view.ActionIconThemedTextView
android:id="@+id/visibilityLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_action_web"
android:drawableStart="@drawable/ic_action_web"
android:gravity="center_vertical"
android:maxLines="1"
android:textColor="?android:textColorSecondary"
app:iabColor="?android:textColorSecondary"
app:iabIconHeight="20dp"
app:iabIconWidth="20dp"
tools:text="@string/label_status_visibility_public"/>
</org.mariotaku.twidere.view.ExtendedLinearLayout>
</LinearLayout>
</org.mariotaku.twidere.view.MaxHeightScrollView>

View File

@ -64,6 +64,37 @@
</group>
</menu>
</item>
<item
android:id="@+id/visibility_submenu"
android:enabled="false"
android:icon="@drawable/ic_action_web"
android:title="@string/action_set_status_visibility"
android:visible="false"
app:showAsAction="always"
tools:ignore="AlwaysShowAction">
<menu>
<group
android:id="@+id/visibility_option"
android:checkableBehavior="single">
<item
android:id="@+id/visibility_public"
android:icon="@drawable/ic_action_web"
android:title="@string/label_status_visibility_public"/>
<item
android:id="@+id/visibility_unlisted"
android:icon="@drawable/ic_action_web_lock"
android:title="@string/label_status_visibility_unlisted"/>
<item
android:id="@+id/visibility_private"
android:icon="@drawable/ic_action_lock"
android:title="@string/label_status_visibility_private"/>
<item
android:id="@+id/visibility_direct"
android:icon="@drawable/ic_action_message"
android:title="@string/label_status_visibility_direct"/>
</group>
</menu>
</item>
<item
android:id="@id/drafts"
android:icon="@drawable/ic_action_draft"

View File

@ -121,6 +121,7 @@
<string name="action_sending_direct_message">sending direct message</string>
<string name="action_set_color">Set color</string>
<string name="action_set_nickname">Set nickname</string>
<string name="action_set_status_visibility">Set visibility</string>
<string name="action_share">Share</string>
<string name="action_sign_in">Sign in</string>
<string name="action_signing_in">signing in</string>
@ -540,6 +541,7 @@
<string name="label_content_rating_pg13">PG-13</string>
<!-- Restricted. Under 17 requires accompanying parent or adult guardian. http://www.mpaa.org/film-ratings/ -->
<string name="label_content_rating_r">R</string>
<string name="label_content_warning">Content warning</string>
<string name="label_data_provider">Twidere database provider</string>
<string name="label_filters_subscription">Subscription</string>
<string name="label_follow_request_sent">Follow request sent</string>
@ -570,6 +572,14 @@
<string name="label_status_not_available">Tweet not available</string>
<string name="label_status_show_more">Show more</string>
<string name="label_status_type_reply">Reply</string>
<!-- Mastodon feature, post to mentioned users only -->
<string name="label_status_visibility_direct">Direct</string>
<!-- Mastodon feature, post to followers only -->
<string name="label_status_visibility_private">Private</string>
<!-- Mastodon feature, post to public timelines -->
<string name="label_status_visibility_public">Public</string>
<!-- Mastodon feature, do not show in public timelines -->
<string name="label_status_visibility_unlisted">Unlisted</string>
<string name="label_statuses">Tweets</string>
<string name="label_statuses_replies">Tweets and replies</string>
<string name="label_statuses_retweets">Tweets and retweets</string>
@ -619,8 +629,6 @@
<string name="mark_as_sensitive">Mark as sensitive</string>
<string name="massage_toast_profile_image_updated">Profile image updated.</string>
<string name="media">Media</string>
<string name="media_preload">Media preload</string>
<string name="media_preview">Media preview</string>
@ -706,6 +714,7 @@
<string name="message_toast_press_again_to_close">Press again to close</string>
<string name="message_toast_profile_background_image_updated">Profile background image updated</string>
<string name="message_toast_profile_banner_image_updated">Profile banner image updated</string>
<string name="message_toast_profile_image_updated">Profile image updated</string>
<string name="message_toast_qr_scan_link_not_supported">Link not supported</string>
<string name="message_toast_qr_scanner_not_supported">QR scanner not supported</string>
<string name="message_toast_retweet_cancelled">Retweet cancelled</string>
@ -1215,6 +1224,7 @@
<string name="title_media_timeline">Media timeline</string>
<string name="title_mentions">Mentions</string>
<string name="title_message_conversation_info">Conversation info</string>
<string name="title_network_public_timeline">Network public timeline</string>
<string name="title_nicknames">Nicknames</string>
<string name="title_open_source_license">Open source license</string>
<string name="title_premium_features_name">Twidere ∞</string>
@ -1329,5 +1339,4 @@
<string name="users_blocked">Blocked these users.</string>
<string name="users_lists_with_name"><xliff:g id="name">%s</xliff:g>\'s lists</string>
<string name="users_statuses">User\'s tweets</string>
<string name="label_content_warning">Content warning</string>
</resources>

Some files were not shown because too many files have changed in this diff Show More