improved quote status style
This commit is contained in:
parent
5ea133b960
commit
21acf7aa5d
|
@ -48,6 +48,31 @@ public class Photo implements Parcelable {
|
|||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
Photo photo = (Photo) o;
|
||||
|
||||
if (url != null ? !url.equals(photo.url) : photo.url != null) return false;
|
||||
if (imageUrl != null ? !imageUrl.equals(photo.imageUrl) : photo.imageUrl != null)
|
||||
return false;
|
||||
if (thumbUrl != null ? !thumbUrl.equals(photo.thumbUrl) : photo.thumbUrl != null)
|
||||
return false;
|
||||
return largeUrl != null ? largeUrl.equals(photo.largeUrl) : photo.largeUrl == null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = url != null ? url.hashCode() : 0;
|
||||
result = 31 * result + (imageUrl != null ? imageUrl.hashCode() : 0);
|
||||
result = 31 * result + (thumbUrl != null ? thumbUrl.hashCode() : 0);
|
||||
result = 31 * result + (largeUrl != null ? largeUrl.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
|
|
|
@ -246,7 +246,7 @@ public class Activity extends TwitterResponseObject implements TwitterResponse,
|
|||
}
|
||||
}
|
||||
|
||||
public static Activity fromMention(String accountId, Status status) {
|
||||
public static Activity fromMention(@NonNull String accountId, @NonNull Status status) {
|
||||
final Activity activity = new Activity();
|
||||
|
||||
activity.maxPosition = activity.minPosition = status.getId();
|
||||
|
|
|
@ -532,6 +532,11 @@ public class Status extends TwitterResponseObject implements Comparable<Status>,
|
|||
quotedStatus = repostStatus;
|
||||
quotedStatusId = repostStatusId;
|
||||
isQuoteStatus = true;
|
||||
|
||||
// Set repost media to null if identical to original
|
||||
if (photo != null && photo.equals(repostStatus.photo)) {
|
||||
photo = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -275,14 +275,6 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
|
|||
@CursorField(Statuses.QUOTED_USER_PROFILE_IMAGE)
|
||||
public String quoted_user_profile_image;
|
||||
@ParcelableThisPlease
|
||||
@JsonField(name = "quoted_location")
|
||||
@CursorField(value = Statuses.QUOTED_LOCATION, converter = ParcelableLocation.Converter.class)
|
||||
public ParcelableLocation quoted_location;
|
||||
@ParcelableThisPlease
|
||||
@JsonField(name = "quoted_place_full_name")
|
||||
@CursorField(value = Statuses.QUOTED_PLACE_FULL_NAME, converter = LoganSquareCursorFieldConverter.class)
|
||||
public String quoted_place_full_name;
|
||||
@ParcelableThisPlease
|
||||
@JsonField(name = "location")
|
||||
@CursorField(value = Statuses.LOCATION, converter = ParcelableLocation.Converter.class)
|
||||
public ParcelableLocation location;
|
||||
|
@ -401,11 +393,12 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
|
|||
@Override
|
||||
public String toString() {
|
||||
return "ParcelableStatus{" +
|
||||
"id='" + id + '\'' +
|
||||
", sort_id=" + sort_id +
|
||||
"_id=" + _id +
|
||||
", id='" + id + '\'' +
|
||||
", account_key=" + account_key +
|
||||
", timestamp=" + timestamp +
|
||||
", sort_id=" + sort_id +
|
||||
", position_key=" + position_key +
|
||||
", timestamp=" + timestamp +
|
||||
", user_key=" + user_key +
|
||||
", retweet_id='" + retweet_id + '\'' +
|
||||
", retweeted_by_user_key=" + retweeted_by_user_key +
|
||||
|
@ -449,8 +442,6 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
|
|||
", quoted_user_name='" + quoted_user_name + '\'' +
|
||||
", quoted_user_screen_name='" + quoted_user_screen_name + '\'' +
|
||||
", quoted_user_profile_image='" + quoted_user_profile_image + '\'' +
|
||||
", quoted_location=" + quoted_location +
|
||||
", quoted_place_full_name='" + quoted_place_full_name + '\'' +
|
||||
", location=" + location +
|
||||
", place_full_name='" + place_full_name + '\'' +
|
||||
", mentions=" + Arrays.toString(mentions) +
|
||||
|
@ -469,7 +460,8 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
|
|||
", quoted_user_nickname='" + quoted_user_nickname + '\'' +
|
||||
", retweet_user_nickname='" + retweet_user_nickname + '\'' +
|
||||
", in_reply_to_user_nickname='" + in_reply_to_user_nickname + '\'' +
|
||||
", _id=" + _id +
|
||||
", inserted_date=" + inserted_date +
|
||||
", is_pinned_status=" + is_pinned_status +
|
||||
'}';
|
||||
}
|
||||
|
||||
|
@ -481,8 +473,6 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
|
|||
|
||||
@OnJsonParseComplete
|
||||
void onParseComplete() throws IOException {
|
||||
if (is_quote && TextUtils.isEmpty(quoted_text_unescaped))
|
||||
throw new IOException("Incompatible model");
|
||||
fixSortId();
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import static org.mariotaku.twidere.annotation.PreferenceType.STRING;
|
|||
public interface Constants extends TwidereConstants {
|
||||
|
||||
String DATABASES_NAME = "twidere.sqlite";
|
||||
int DATABASES_VERSION = 152;
|
||||
int DATABASES_VERSION = 153;
|
||||
|
||||
int MENU_GROUP_STATUS_EXTENSION = 10;
|
||||
int MENU_GROUP_COMPOSE_EXTENSION = 11;
|
||||
|
|
|
@ -91,13 +91,16 @@ public class CardMediaContainer extends ViewGroup implements Constants {
|
|||
public void displayMedia(@Nullable final ParcelableMedia[] mediaArray,
|
||||
@NonNull final MediaLoaderWrapper loader,
|
||||
final UserKey accountId, final long extraId,
|
||||
final OnMediaClickListener mediaClickListener,
|
||||
final MediaLoadingHandler loadingHandler) {
|
||||
displayMedia(loader, mediaClickListener, loadingHandler, mediaArray, accountId, extraId, false);
|
||||
@Nullable final OnMediaClickListener mediaClickListener,
|
||||
@Nullable final MediaLoadingHandler loadingHandler) {
|
||||
displayMedia(loader, mediaArray, accountId, mediaClickListener, loadingHandler, extraId, false);
|
||||
}
|
||||
|
||||
public void displayMedia(@NonNull final MediaLoaderWrapper loader, final OnMediaClickListener mediaClickListener, final MediaLoadingHandler loadingHandler, @Nullable final ParcelableMedia[] mediaArray,
|
||||
final UserKey accountId, final long extraId, boolean withCredentials) {
|
||||
public void displayMedia(@NonNull final MediaLoaderWrapper loader,
|
||||
@Nullable final ParcelableMedia[] mediaArray, final UserKey accountId,
|
||||
@Nullable final OnMediaClickListener mediaClickListener,
|
||||
@Nullable final MediaLoadingHandler loadingHandler,
|
||||
final long extraId, boolean withCredentials) {
|
||||
if (mediaArray == null || mMediaPreviewStyle == VALUE_MEDIA_PREVIEW_STYLE_CODE_NONE) {
|
||||
for (int i = 0, j = getChildCount(); i < j; i++) {
|
||||
final View child = getChildAt(i);
|
||||
|
@ -110,7 +113,9 @@ public class CardMediaContainer extends ViewGroup implements Constants {
|
|||
accountId, extraId);
|
||||
for (int i = 0, j = getChildCount(), k = mediaArray.length; i < j; i++) {
|
||||
final View child = getChildAt(i);
|
||||
child.setOnClickListener(clickListener);
|
||||
if (mediaClickListener != null) {
|
||||
child.setOnClickListener(clickListener);
|
||||
}
|
||||
final ImageView imageView = (ImageView) child.findViewById(R.id.mediaPreview);
|
||||
switch (mMediaPreviewStyle) {
|
||||
case VALUE_MEDIA_PREVIEW_STYLE_CODE_CROP: {
|
||||
|
@ -170,9 +175,9 @@ public class CardMediaContainer extends ViewGroup implements Constants {
|
|||
}
|
||||
}
|
||||
|
||||
private void measure1Media(int contentWidth, int[] childIndices) {
|
||||
private void measure1Media(int contentWidth, int[] childIndices, float ratioMultiplier) {
|
||||
final View child = getChildAt(childIndices[0]);
|
||||
final int childHeight = Math.round(contentWidth * WIDTH_HEIGHT_RATIO);
|
||||
final int childHeight = Math.round(contentWidth * WIDTH_HEIGHT_RATIO * ratioMultiplier);
|
||||
final int widthSpec = MeasureSpec.makeMeasureSpec(contentWidth, MeasureSpec.EXACTLY);
|
||||
final int heightSpec = MeasureSpec.makeMeasureSpec(childHeight, MeasureSpec.EXACTLY);
|
||||
child.measure(widthSpec, heightSpec);
|
||||
|
@ -219,16 +224,17 @@ public class CardMediaContainer extends ViewGroup implements Constants {
|
|||
}
|
||||
}
|
||||
|
||||
private void measure3Media(int contentWidth, int horizontalSpacing, int[] childIndices) {
|
||||
private void measure3Media(int contentWidth, int horizontalSpacing, int[] childIndices, float ratioMultiplier) {
|
||||
final View child0 = getChildAt(childIndices[0]), child1 = getChildAt(childIndices[1]),
|
||||
child2 = getChildAt(childIndices[2]);
|
||||
final int childWidth = (contentWidth - horizontalSpacing) / 2;
|
||||
final int sizeSpec = MeasureSpec.makeMeasureSpec(childWidth, MeasureSpec.EXACTLY);
|
||||
child0.measure(sizeSpec, sizeSpec);
|
||||
final int childRightHeight = Math.round(childWidth - horizontalSpacing) / 2;
|
||||
final int heightSpec = MeasureSpec.makeMeasureSpec(childRightHeight, MeasureSpec.EXACTLY);
|
||||
child1.measure(sizeSpec, heightSpec);
|
||||
child2.measure(sizeSpec, heightSpec);
|
||||
final int childLeftHeightSpec = MeasureSpec.makeMeasureSpec(Math.round(childWidth * ratioMultiplier), MeasureSpec.EXACTLY);
|
||||
final int widthSpec = MeasureSpec.makeMeasureSpec(childWidth, MeasureSpec.EXACTLY);
|
||||
child0.measure(widthSpec, childLeftHeightSpec);
|
||||
final int childRightHeight = Math.round((childWidth - horizontalSpacing) / 2 * ratioMultiplier);
|
||||
final int childRightHeightSpec = MeasureSpec.makeMeasureSpec(childRightHeight, MeasureSpec.EXACTLY);
|
||||
child1.measure(widthSpec, childRightHeightSpec);
|
||||
child2.measure(widthSpec, childRightHeightSpec);
|
||||
}
|
||||
|
||||
private void layout3Media(int horizontalSpacing, int verticalSpacing, int[] childIndices) {
|
||||
|
@ -248,23 +254,33 @@ public class CardMediaContainer extends ViewGroup implements Constants {
|
|||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
final int measuredWidth = resolveSize(getSuggestedMinimumWidth(), widthMeasureSpec);
|
||||
final int contentWidth = measuredWidth - getPaddingLeft() - getPaddingRight();
|
||||
float ratioMultiplier = 1;
|
||||
int contentHeight = -1;
|
||||
if (getLayoutParams().height != LayoutParams.WRAP_CONTENT) {
|
||||
final int measuredHeight = resolveSize(getSuggestedMinimumWidth(), widthMeasureSpec);
|
||||
ratioMultiplier = contentWidth > 0 ? measuredHeight / (contentWidth * WIDTH_HEIGHT_RATIO) : 1;
|
||||
contentHeight = contentWidth;
|
||||
}
|
||||
final int[] childIndices = createChildIndices();
|
||||
final int childCount = getChildIndicesInLayout(this, childIndices);
|
||||
int heightSum = 0;
|
||||
if (childCount > 0) {
|
||||
if (childCount == 1) {
|
||||
measure1Media(contentWidth, childIndices);
|
||||
heightSum = Math.round(contentWidth * WIDTH_HEIGHT_RATIO);
|
||||
measure1Media(contentWidth, childIndices, ratioMultiplier);
|
||||
heightSum = Math.round(contentWidth * WIDTH_HEIGHT_RATIO * ratioMultiplier);
|
||||
} else if (childCount == 2) {
|
||||
measureGridMedia(childCount, 2, contentWidth, 1, mHorizontalSpacing, mVerticalSpacing,
|
||||
childIndices);
|
||||
heightSum = Math.round(contentWidth * WIDTH_HEIGHT_RATIO);
|
||||
measureGridMedia(childCount, 2, contentWidth, ratioMultiplier, mHorizontalSpacing,
|
||||
mVerticalSpacing, childIndices);
|
||||
heightSum = Math.round(contentWidth * WIDTH_HEIGHT_RATIO * ratioMultiplier);
|
||||
} else if (childCount == 3) {
|
||||
measure3Media(contentWidth, mHorizontalSpacing, childIndices);
|
||||
heightSum = Math.round(contentWidth * WIDTH_HEIGHT_RATIO);
|
||||
measure3Media(contentWidth, mHorizontalSpacing, childIndices, ratioMultiplier);
|
||||
heightSum = Math.round(contentWidth * WIDTH_HEIGHT_RATIO * ratioMultiplier);
|
||||
} else {
|
||||
heightSum = measureGridMedia(childCount, 2, contentWidth, WIDTH_HEIGHT_RATIO,
|
||||
mHorizontalSpacing, mVerticalSpacing, childIndices);
|
||||
heightSum = measureGridMedia(childCount, 2, contentWidth,
|
||||
WIDTH_HEIGHT_RATIO * ratioMultiplier, mHorizontalSpacing, mVerticalSpacing, childIndices);
|
||||
}
|
||||
if (contentHeight > 0) {
|
||||
heightSum = contentHeight;
|
||||
}
|
||||
}
|
||||
final int height = heightSum + getPaddingTop() + getPaddingBottom();
|
||||
|
@ -298,7 +314,7 @@ public class CardMediaContainer extends ViewGroup implements Constants {
|
|||
private final UserKey mAccountKey;
|
||||
private final long mExtraId;
|
||||
|
||||
ImageGridClickListener(final OnMediaClickListener listener, final UserKey accountKey,
|
||||
ImageGridClickListener(@Nullable final OnMediaClickListener listener, final UserKey accountKey,
|
||||
final long extraId) {
|
||||
mListenerRef = new WeakReference<>(listener);
|
||||
mAccountKey = accountKey;
|
||||
|
|
|
@ -103,7 +103,7 @@ public class MessageViewHolder extends ViewHolder {
|
|||
textView.setText(text);
|
||||
time.setText(Utils.formatToLongTimeString(context, timestamp));
|
||||
mediaContainer.setVisibility(media != null && media.length > 0 ? View.VISIBLE : View.GONE);
|
||||
mediaContainer.displayMedia(loader, adapter.getOnMediaClickListener(), adapter.getMediaLoadingHandler(), media, accountKey, getLayoutPosition(), true
|
||||
mediaContainer.displayMedia(loader, media, accountKey, adapter.getOnMediaClickListener(), adapter.getMediaLoadingHandler(), getLayoutPosition(), true
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -366,12 +366,15 @@ class ParcelableActivitiesAdapter(
|
|||
init {
|
||||
text1 = itemView.findViewById(android.R.id.text1) as TextView
|
||||
text2 = itemView.findViewById(android.R.id.text2) as TextView
|
||||
|
||||
text2.setSingleLine(false)
|
||||
}
|
||||
|
||||
fun displayActivity(activity: ParcelableActivity) {
|
||||
text1.text = text1.resources.getString(R.string.unsupported_activity_action_title,
|
||||
activity.action)
|
||||
text2.setText(R.string.unsupported_activity_action_summary)
|
||||
text2.text = "host: ${activity.account_key.host}, id: ${activity.status_id}\n"
|
||||
text2.append(itemView.context.getString(R.string.unsupported_activity_action_summary))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ import org.mariotaku.twidere.TwidereConstants
|
|||
import org.mariotaku.twidere.adapter.ParcelableActivitiesAdapter
|
||||
import org.mariotaku.twidere.adapter.ParcelableActivitiesAdapter.Companion.ITEM_VIEW_TYPE_GAP
|
||||
import org.mariotaku.twidere.adapter.ParcelableActivitiesAdapter.Companion.ITEM_VIEW_TYPE_STATUS
|
||||
import org.mariotaku.twidere.adapter.ParcelableActivitiesAdapter.Companion.ITEM_VIEW_TYPE_STUB
|
||||
import org.mariotaku.twidere.adapter.ParcelableActivitiesAdapter.Companion.ITEM_VIEW_TYPE_TITLE_SUMMARY
|
||||
import org.mariotaku.twidere.adapter.decorator.DividerItemDecoration
|
||||
import org.mariotaku.twidere.adapter.iface.ILoadMoreSupportAdapter
|
||||
|
@ -553,7 +554,8 @@ abstract class AbsActivitiesFragment protected constructor() : AbsContentListRec
|
|||
(recyclerView.layoutManager as LinearLayoutManager).orientation) {
|
||||
override fun isDividerEnabled(childPos: Int): Boolean {
|
||||
when (adapter.getItemViewType(childPos)) {
|
||||
ITEM_VIEW_TYPE_STATUS, ITEM_VIEW_TYPE_TITLE_SUMMARY, ITEM_VIEW_TYPE_GAP -> {
|
||||
ITEM_VIEW_TYPE_STATUS, ITEM_VIEW_TYPE_TITLE_SUMMARY, ITEM_VIEW_TYPE_GAP,
|
||||
ITEM_VIEW_TYPE_STUB -> {
|
||||
return true
|
||||
}
|
||||
else -> {
|
||||
|
|
|
@ -776,13 +776,11 @@ class StatusFragment : BaseSupportFragment(), LoaderCallbacks<SingleResponse<Par
|
|||
val skipLinksInText = status.extras != null && status.extras.support_entities
|
||||
if (status.is_quote) {
|
||||
|
||||
itemView.quoteIndicator.visibility = View.VISIBLE
|
||||
itemView.quotedView.visibility = View.VISIBLE
|
||||
|
||||
val originalIdAvailable = !TextUtils.isEmpty(status.quoted_id)
|
||||
val quoteContentAvailable = status.quoted_text_plain != null && status.quoted_text_unescaped != null
|
||||
|
||||
itemView.quoteOriginalLink.visibility = if (originalIdAvailable) View.VISIBLE else View.GONE
|
||||
|
||||
if (quoteContentAvailable) {
|
||||
itemView.quotedName.visibility = View.VISIBLE
|
||||
itemView.quotedText.visibility = View.VISIBLE
|
||||
|
@ -815,9 +813,28 @@ class StatusFragment : BaseSupportFragment(), LoaderCallbacks<SingleResponse<Par
|
|||
}
|
||||
|
||||
itemView.quoteIndicator.color = status.quoted_user_color
|
||||
|
||||
val quotedMedia = status.quoted_media
|
||||
|
||||
if (quotedMedia?.isEmpty() ?: true) {
|
||||
itemView.quotedMediaPreviewContainer.visibility = View.GONE
|
||||
itemView.quotedMediaPreview.visibility = View.GONE
|
||||
itemView.quotedMediaPreviewPlaceholder.visibility = View.GONE
|
||||
} else if (adapter.isDetailMediaExpanded) {
|
||||
itemView.quotedMediaPreviewContainer.visibility = View.VISIBLE
|
||||
itemView.quotedMediaPreview.visibility = View.VISIBLE
|
||||
itemView.quotedMediaPreviewPlaceholder.visibility = View.GONE
|
||||
itemView.quotedMediaPreview.displayMedia(quotedMedia, loader, status.account_key, -1,
|
||||
adapter.fragment, null)
|
||||
} else {
|
||||
itemView.quotedMediaPreviewContainer.visibility = View.VISIBLE
|
||||
itemView.quotedMediaPreview.visibility = View.GONE
|
||||
itemView.quotedMediaPreviewPlaceholder.visibility = View.VISIBLE
|
||||
}
|
||||
} else {
|
||||
itemView.quotedName.visibility = View.GONE
|
||||
itemView.quotedText.visibility = View.VISIBLE
|
||||
itemView.quotedMediaPreviewContainer.visibility = View.GONE
|
||||
|
||||
// Not available
|
||||
val string = SpannableString.valueOf(context.getString(R.string.status_not_available_text))
|
||||
|
@ -829,10 +846,7 @@ class StatusFragment : BaseSupportFragment(), LoaderCallbacks<SingleResponse<Par
|
|||
itemView.quoteIndicator.color = 0
|
||||
}
|
||||
} else {
|
||||
itemView.quoteOriginalLink.visibility = View.GONE
|
||||
itemView.quotedName.visibility = View.GONE
|
||||
itemView.quotedText.visibility = View.GONE
|
||||
itemView.quoteIndicator.visibility = View.GONE
|
||||
itemView.quotedView.visibility = View.GONE
|
||||
}
|
||||
|
||||
itemView.profileContainer.drawStart(status.user_color)
|
||||
|
@ -949,26 +963,6 @@ class StatusFragment : BaseSupportFragment(), LoaderCallbacks<SingleResponse<Par
|
|||
itemView.mediaPreview.displayMedia()
|
||||
}
|
||||
|
||||
val quotedMedia = status.quoted_media
|
||||
|
||||
if (quotedMedia?.isEmpty() ?: true) {
|
||||
itemView.quotedMediaPreviewContainer.visibility = View.GONE
|
||||
itemView.quotedMediaPreview.visibility = View.GONE
|
||||
itemView.quotedMediaPreviewLoad.visibility = View.GONE
|
||||
itemView.quotedMediaPreview.displayMedia()
|
||||
} else if (adapter.isDetailMediaExpanded) {
|
||||
itemView.quotedMediaPreviewContainer.visibility = View.VISIBLE
|
||||
itemView.quotedMediaPreview.visibility = View.VISIBLE
|
||||
itemView.quotedMediaPreviewLoad.visibility = View.GONE
|
||||
itemView.quotedMediaPreview.displayMedia(media, loader, status.account_key, -1,
|
||||
adapter.fragment, adapter.mediaLoadingHandler)
|
||||
} else {
|
||||
itemView.quotedMediaPreviewContainer.visibility = View.VISIBLE
|
||||
itemView.quotedMediaPreview.visibility = View.GONE
|
||||
itemView.quotedMediaPreviewLoad.visibility = View.VISIBLE
|
||||
itemView.quotedMediaPreview.displayMedia()
|
||||
}
|
||||
|
||||
if (TwitterCardUtils.isCardSupported(status)) {
|
||||
val size = TwitterCardUtils.getCardSize(status.card!!)
|
||||
itemView.twitterCard.visibility = View.VISIBLE
|
||||
|
@ -1013,11 +1007,9 @@ class StatusFragment : BaseSupportFragment(), LoaderCallbacks<SingleResponse<Par
|
|||
}
|
||||
|
||||
itemView.text.setTextIsSelectable(true)
|
||||
itemView.quotedText.setTextIsSelectable(true)
|
||||
itemView.translateResult.setTextIsSelectable(true)
|
||||
|
||||
itemView.text.movementMethod = LinkMovementMethod.getInstance()
|
||||
itemView.quotedText.movementMethod = LinkMovementMethod.getInstance()
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
|
@ -1052,12 +1044,7 @@ class StatusFragment : BaseSupportFragment(), LoaderCallbacks<SingleResponse<Par
|
|||
if (!ParcelableLocationUtils.isValidLocation(location)) return
|
||||
IntentUtils.openMap(adapter.context, location.latitude, location.longitude)
|
||||
}
|
||||
itemView.quotedName -> {
|
||||
IntentUtils.openUserProfile(adapter.context, status.account_key,
|
||||
status.quoted_user_key, status.quoted_user_screen_name, null,
|
||||
preferences.getBoolean(KEY_NEW_DOCUMENT_API), Referral.STATUS)
|
||||
}
|
||||
itemView.quoteOriginalLink -> {
|
||||
itemView.quotedView -> {
|
||||
IntentUtils.openStatus(adapter.context, status.account_key, status.quoted_id)
|
||||
}
|
||||
itemView.translateLabel -> {
|
||||
|
@ -1107,10 +1094,9 @@ class StatusFragment : BaseSupportFragment(), LoaderCallbacks<SingleResponse<Par
|
|||
ThemeUtils.wrapMenuIcon(itemView.menuBar, MENU_GROUP_STATUS_SHARE)
|
||||
itemView.mediaPreviewLoad.setOnClickListener(this)
|
||||
itemView.profileContainer.setOnClickListener(this)
|
||||
itemView.quotedName.setOnClickListener(this)
|
||||
retweetedByView.setOnClickListener(this)
|
||||
locationView.setOnClickListener(this)
|
||||
itemView.quoteOriginalLink.setOnClickListener(this)
|
||||
itemView.quotedView.setOnClickListener(this)
|
||||
itemView.translateLabel.setOnClickListener(this)
|
||||
|
||||
val textSize = adapter.textSize
|
||||
|
@ -1122,7 +1108,6 @@ class StatusFragment : BaseSupportFragment(), LoaderCallbacks<SingleResponse<Par
|
|||
itemView.quotedName.setSecondaryTextSize(textSize * 0.85f)
|
||||
itemView.quotedText.textSize = textSize * 1.25f
|
||||
|
||||
itemView.quoteOriginalLink.textSize = textSize * 0.85f
|
||||
locationView.textSize = textSize * 0.85f
|
||||
itemView.timeSource.textSize = textSize * 0.85f
|
||||
itemView.translateLabel.textSize = textSize * 0.85f
|
||||
|
@ -1135,8 +1120,8 @@ class StatusFragment : BaseSupportFragment(), LoaderCallbacks<SingleResponse<Par
|
|||
itemView.quotedName.setNameFirst(adapter.nameFirst)
|
||||
|
||||
itemView.mediaPreview.setStyle(adapter.mediaPreviewStyle)
|
||||
itemView.quotedMediaPreview.setStyle(adapter.mediaPreviewStyle)
|
||||
|
||||
itemView.quotedText.customSelectionActionModeCallback = StatusActionModeCallback(itemView.quotedText, activity)
|
||||
itemView.text.customSelectionActionModeCallback = StatusActionModeCallback(itemView.text, activity)
|
||||
|
||||
val layoutManager = LinearLayoutManager(adapter.context)
|
||||
|
|
|
@ -90,8 +90,6 @@ object ParcelableStatusUtils {
|
|||
result.quoted_timestamp = quoted.createdAt.time
|
||||
result.quoted_source = quoted.source
|
||||
result.quoted_media = ParcelableMediaUtils.fromStatus(quoted)
|
||||
result.quoted_location = getLocation(quoted)
|
||||
result.quoted_place_full_name = getPlaceFullName(quoted)
|
||||
|
||||
result.quoted_user_key = UserKeyUtils.fromUser(quotedUser)
|
||||
result.quoted_user_name = quotedUser.name
|
||||
|
|
|
@ -257,143 +257,101 @@
|
|||
android:layout_below="@+id/mediaPreviewContainer"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<org.mariotaku.twidere.view.ForegroundColorView
|
||||
android:id="@+id/quoteIndicator"
|
||||
android:layout_width="@dimen/element_spacing_small"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/quoteIndicatorAnchorBottom"
|
||||
android:layout_alignTop="@+id/quoteIndicatorAnchorTop"
|
||||
android:layout_marginLeft="@dimen/element_spacing_normal"
|
||||
android:layout_marginStart="@dimen/element_spacing_normal"
|
||||
android:background="?quoteIndicatorBackgroundColor"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<android.support.v4.widget.Space
|
||||
android:id="@+id/quoteIndicatorAnchorTop"
|
||||
<LinearLayout
|
||||
android:id="@+id/quotedView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/twitterCard"
|
||||
android:layout_marginTop="@dimen/element_spacing_normal"
|
||||
android:visibility="visible"/>
|
||||
|
||||
<org.mariotaku.twidere.view.NameView
|
||||
android:id="@+id/quotedName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/quoteIndicatorAnchorTop"
|
||||
android:layout_toEndOf="@+id/quoteIndicator"
|
||||
android:layout_toRightOf="@+id/quoteIndicator"
|
||||
android:background="?selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/element_spacing_normal"
|
||||
android:paddingRight="@dimen/element_spacing_normal"
|
||||
android:tag="font_family|user"
|
||||
android:visibility="gone"
|
||||
app:nv_primaryTextColor="?android:textColorPrimary"
|
||||
app:nv_secondaryTextColor="?android:textColorSecondary"
|
||||
app:nv_twoLine="false"
|
||||
tools:visibility="visible"/>
|
||||
android:orientation="horizontal">
|
||||
|
||||
<org.mariotaku.twidere.view.TimelineContentTextView
|
||||
android:id="@+id/quotedText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/quotedName"
|
||||
android:layout_margin="@dimen/element_spacing_normal"
|
||||
android:layout_toEndOf="@+id/quoteIndicator"
|
||||
android:layout_toRightOf="@+id/quoteIndicator"
|
||||
android:singleLine="false"
|
||||
android:tag="font_family|user"
|
||||
android:textAppearance="?android:textAppearanceMedium"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:visibility="gone"
|
||||
tools:text="@string/sample_status_text"
|
||||
tools:visibility="visible"/>
|
||||
<org.mariotaku.twidere.view.ForegroundColorView
|
||||
android:id="@+id/quoteIndicator"
|
||||
android:layout_width="@dimen/element_spacing_small"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0"
|
||||
android:background="?quoteIndicatorBackgroundColor"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/quotedMediaPreviewContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/quotedText"
|
||||
android:layout_toEndOf="@+id/quoteIndicator"
|
||||
android:layout_toRightOf="@+id/quoteIndicator"
|
||||
tools:visibility="visible">
|
||||
|
||||
<org.mariotaku.twidere.view.CardMediaContainer
|
||||
android:id="@+id/quotedMediaPreview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:horizontalSpacing="@dimen/element_spacing_xsmall"
|
||||
android:verticalSpacing="@dimen/element_spacing_xsmall"
|
||||
android:visibility="gone">
|
||||
|
||||
<include
|
||||
layout="@layout/layout_card_media_preview"
|
||||
tools:ignore="DuplicateIncludedIds"/>
|
||||
|
||||
</org.mariotaku.twidere.view.CardMediaContainer>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/quotedMediaPreviewLoad"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/action_button_size"
|
||||
android:layout_gravity="center"
|
||||
android:background="?selectableItemBackground"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
<FrameLayout
|
||||
android:id="@+id/quotedMediaPreviewContainer"
|
||||
android:layout_width="128dp"
|
||||
android:layout_height="128dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginBottom="@dimen/element_spacing_normal"
|
||||
android:layout_marginLeft="@dimen/element_spacing_normal"
|
||||
android:layout_marginStart="@dimen/element_spacing_normal"
|
||||
android:layout_marginTop="@dimen/element_spacing_normal"
|
||||
android:layout_weight="0"
|
||||
tools:visibility="visible">
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
<org.mariotaku.twidere.view.CardMediaContainer
|
||||
android:id="@+id/quotedMediaPreview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:drawableLeft="@drawable/ic_action_gallery"
|
||||
android:drawableStart="@drawable/ic_action_gallery"
|
||||
android:horizontalSpacing="@dimen/element_spacing_xsmall"
|
||||
android:verticalSpacing="@dimen/element_spacing_xsmall"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<include
|
||||
layout="@layout/layout_card_media_preview"
|
||||
tools:ignore="DuplicateIncludedIds"/>
|
||||
|
||||
</org.mariotaku.twidere.view.CardMediaContainer>
|
||||
|
||||
<View
|
||||
android:id="@+id/quotedMediaPreviewPlaceholder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/element_spacing_normal"
|
||||
android:layout_marginLeft="@dimen/element_spacing_normal"
|
||||
android:layout_marginStart="@dimen/element_spacing_normal"
|
||||
android:layout_marginTop="@dimen/element_spacing_normal"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.mariotaku.twidere.view.NameView
|
||||
android:id="@+id/quotedName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/element_spacing_normal"
|
||||
android:paddingRight="@dimen/element_spacing_normal"
|
||||
android:tag="font_family|user"
|
||||
android:text="@string/load_media"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textStyle="bold"/>
|
||||
android:visibility="gone"
|
||||
app:nv_primaryTextColor="?android:textColorPrimary"
|
||||
app:nv_secondaryTextColor="?android:textColorSecondary"
|
||||
app:nv_twoLine="false"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<org.mariotaku.twidere.view.TimelineContentTextView
|
||||
android:id="@+id/quotedText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/element_spacing_normal"
|
||||
android:singleLine="false"
|
||||
android:tag="font_family|user"
|
||||
android:textAppearance="?android:textAppearanceMedium"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:visibility="gone"
|
||||
tools:text="@string/sample_status_text"
|
||||
tools:visibility="visible"/>
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/quoteOriginalLink"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/quotedMediaPreviewContainer"
|
||||
android:layout_toEndOf="@+id/quoteIndicator"
|
||||
android:layout_toRightOf="@+id/quoteIndicator"
|
||||
android:background="?selectableItemBackground"
|
||||
android:drawableLeft="@drawable/ic_indicator_twitter"
|
||||
android:drawablePadding="4dp"
|
||||
android:drawableStart="@drawable/ic_indicator_twitter"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="@dimen/element_spacing_normal"
|
||||
android:singleLine="true"
|
||||
android:tag="font_family|user"
|
||||
android:text="@string/original_status"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:textColorSecondary"/>
|
||||
|
||||
<android.support.v4.widget.Space
|
||||
android:id="@+id/quoteIndicatorAnchorBottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_below="@+id/quoteOriginalLink"
|
||||
android:visibility="visible"/>
|
||||
</LinearLayout>
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/locationView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/quoteIndicatorAnchorBottom"
|
||||
android:layout_below="@+id/quotedView"
|
||||
android:background="?selectableItemBackground"
|
||||
android:drawableLeft="@drawable/ic_indicator_location"
|
||||
android:drawablePadding="4dp"
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
<merge
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:showIn="@layout/list_item_status">
|
||||
|
||||
<com.commonsware.cwac.layouts.AspectLockedFrameLayout
|
||||
|
|
Loading…
Reference in New Issue