fixed more overflow icon color under L
improved FAB under L started to apply new profile type style added paragraph spacing
|
@ -519,6 +519,11 @@ public final class ImageViewerGLActivity extends BaseSupportActivity implements
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostShowMenu(Menu menu) {
|
||||
|
||||
}
|
||||
|
||||
private static class MyHandler extends SynchronizedHandler {
|
||||
ImageViewerGLActivity activity;
|
||||
|
||||
|
|
|
@ -94,6 +94,7 @@ import org.mariotaku.twidere.util.ParseUtils;
|
|||
import org.mariotaku.twidere.util.ThemeUtils;
|
||||
import org.mariotaku.twidere.util.TwidereLinkify;
|
||||
import org.mariotaku.twidere.util.Utils;
|
||||
import org.mariotaku.twidere.view.CircularImageView;
|
||||
import org.mariotaku.twidere.view.ColorLabelRelativeLayout;
|
||||
import org.mariotaku.twidere.view.ExtendedFrameLayout;
|
||||
import org.mariotaku.twidere.view.StatusTextView;
|
||||
|
@ -164,7 +165,8 @@ public class StatusFragment extends ParcelableStatusesListFragment implements On
|
|||
private TextView mRepliesCountView, mRetweetsCountView, mFavoritesCountView;
|
||||
private StatusTextView mTextView;
|
||||
|
||||
private ImageView mProfileImageView, mMapView;
|
||||
private CircularImageView mProfileImageView;
|
||||
private ImageView mProfileTypeView, mMapView;
|
||||
private Button mFollowButton;
|
||||
private Button mRetryButton;
|
||||
private View mMainContent, mFollowIndicator, mImagePreviewContainer, mLocationContainer, mLocationBackgroundView;
|
||||
|
@ -356,14 +358,22 @@ public class StatusFragment extends ParcelableStatusesListFragment implements On
|
|||
final String nick = getUserNickname(getActivity(), status.user_id, true);
|
||||
mNameView.setText(TextUtils.isEmpty(nick) ? status.user_name : nickname_only ? nick : getString(
|
||||
R.string.name_with_nickname, status.user_name, nick));
|
||||
mNameView.setCompoundDrawablesWithIntrinsicBounds(0, 0,
|
||||
getUserTypeIconRes(status.user_is_verified, status.user_is_protected), 0);
|
||||
final int typeIconRes = getUserTypeIconRes(status.user_is_verified, status.user_is_protected);
|
||||
if (typeIconRes != 0) {
|
||||
mProfileTypeView.setImageResource(typeIconRes);
|
||||
mProfileTypeView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mProfileTypeView.setImageDrawable(null);
|
||||
mProfileTypeView.setVisibility(View.GONE);
|
||||
}
|
||||
mScreenNameView.setText("@" + status.user_screen_name);
|
||||
mTextView.setText(Html.fromHtml(status.text_html));
|
||||
final TwidereLinkify linkify = new TwidereLinkify(
|
||||
new OnLinkClickHandler(getActivity(), getMultiSelectManager()));
|
||||
linkify.setLinkTextColor(ThemeUtils.getUserLinkTextColor(getActivity()));
|
||||
linkify.applyAllLinks(mTextView, status.account_id, status.is_possibly_sensitive);
|
||||
ThemeUtils.applyParagraphSpacing(mTextView, 1.1f);
|
||||
|
||||
mTextView.setMovementMethod(StatusContentMovementMethod.getInstance());
|
||||
mTextView.setCustomSelectionActionModeCallback(this);
|
||||
long timestamp = status.retweet_timestamp > 0 ? status.retweet_timestamp : status.timestamp;
|
||||
|
@ -581,12 +591,13 @@ public class StatusFragment extends ParcelableStatusesListFragment implements On
|
|||
@Override
|
||||
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
|
||||
final View view = inflater.inflate(R.layout.fragment_details_page, container, false);
|
||||
view.findViewById(R.id.menu_bar).setVisibility(View.GONE);
|
||||
mMainContent = view.findViewById(R.id.content);
|
||||
mDetailsLoadProgress = (ProgressBar) view.findViewById(R.id.details_load_progress);
|
||||
mMenuBar = (TwidereMenuBar) view.findViewById(R.id.menu_bar);
|
||||
mDetailsContainer = (ExtendedFrameLayout) view.findViewById(R.id.details_container);
|
||||
mDetailsContainer.addView(super.onCreateView(inflater, mDetailsContainer, savedInstanceState));
|
||||
mHeaderView = inflater.inflate(R.layout.header_status, null, false);
|
||||
mMenuBar = (TwidereMenuBar) mHeaderView.findViewById(R.id.menu_bar);
|
||||
mImagePreviewContainer = mHeaderView.findViewById(R.id.image_preview);
|
||||
mLocationContainer = mHeaderView.findViewById(R.id.location_container);
|
||||
mLocationView = (TextView) mHeaderView.findViewById(R.id.location_view);
|
||||
|
@ -595,7 +606,8 @@ public class StatusFragment extends ParcelableStatusesListFragment implements On
|
|||
mNameView = (TextView) mHeaderView.findViewById(R.id.name);
|
||||
mScreenNameView = (TextView) mHeaderView.findViewById(R.id.screen_name);
|
||||
mTextView = (StatusTextView) mHeaderView.findViewById(R.id.text);
|
||||
mProfileImageView = (ImageView) mHeaderView.findViewById(R.id.profile_image);
|
||||
mProfileImageView = (CircularImageView) mHeaderView.findViewById(R.id.profile_image);
|
||||
mProfileTypeView = (ImageView) mHeaderView.findViewById(R.id.profile_type);
|
||||
mTimeSourceView = (TextView) mHeaderView.findViewById(R.id.time_source);
|
||||
mInReplyToView = (TextView) mHeaderView.findViewById(R.id.in_reply_to);
|
||||
mFollowButton = (Button) mHeaderView.findViewById(R.id.follow);
|
||||
|
@ -986,7 +998,7 @@ public class StatusFragment extends ParcelableStatusesListFragment implements On
|
|||
|
||||
private void updateUserColor() {
|
||||
if (mStatus == null) return;
|
||||
mProfileView.drawStart(getUserColor(getActivity(), mStatus.user_id, true));
|
||||
mProfileImageView.setBorderColor(getUserColor(getActivity(), mStatus.user_id, true));
|
||||
}
|
||||
|
||||
public static final class LoadSensitiveImageConfirmDialogFragment extends BaseSupportDialogFragment implements
|
||||
|
|
|
@ -66,6 +66,7 @@ import android.widget.AdapterView;
|
|||
import android.widget.AdapterView.OnItemClickListener;
|
||||
import android.widget.AdapterView.OnItemLongClickListener;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
@ -90,7 +91,6 @@ import org.mariotaku.twidere.provider.TweetStore.CachedUsers;
|
|||
import org.mariotaku.twidere.provider.TweetStore.Filters;
|
||||
import org.mariotaku.twidere.util.AsyncTwitterWrapper;
|
||||
import org.mariotaku.twidere.util.ContentValuesCreator;
|
||||
import org.mariotaku.twidere.util.FlymeUtils;
|
||||
import org.mariotaku.twidere.util.ImageLoaderWrapper;
|
||||
import org.mariotaku.twidere.util.MathUtils;
|
||||
import org.mariotaku.twidere.util.ParseUtils;
|
||||
|
@ -128,6 +128,7 @@ import static org.mariotaku.twidere.util.Utils.getErrorMessage;
|
|||
import static org.mariotaku.twidere.util.Utils.getLocalizedNumber;
|
||||
import static org.mariotaku.twidere.util.Utils.getOriginalTwitterProfileImage;
|
||||
import static org.mariotaku.twidere.util.Utils.getTwitterInstance;
|
||||
import static org.mariotaku.twidere.util.Utils.getUserTypeIconRes;
|
||||
import static org.mariotaku.twidere.util.Utils.isMyAccount;
|
||||
import static org.mariotaku.twidere.util.Utils.openImage;
|
||||
import static org.mariotaku.twidere.util.Utils.openIncomingFriendships;
|
||||
|
@ -159,6 +160,7 @@ public class UserProfileFragmentOld extends BaseSupportListFragment implements O
|
|||
private SharedPreferences mPreferences;
|
||||
|
||||
private CircularImageView mProfileImageView;
|
||||
private ImageView mProfileTypeView;
|
||||
private ProfileBannerImageView mProfileBannerView;
|
||||
private TextView mNameView, mScreenNameView, mDescriptionView, mLocationView, mURLView, mCreatedAtView,
|
||||
mTweetCount, mFollowersCount, mFriendsCount, mErrorMessageView;
|
||||
|
@ -345,12 +347,19 @@ public class UserProfileFragmentOld extends BaseSupportListFragment implements O
|
|||
final boolean userIsMe = user.account_id == user.id;
|
||||
mErrorRetryContainer.setVisibility(View.GONE);
|
||||
mUser = user;
|
||||
mProfileNameContainer.drawStart(getUserColor(getActivity(), user.id, true));
|
||||
mProfileImageView.setBorderColor(getUserColor(getActivity(), user.id, true));
|
||||
mProfileNameContainer.drawEnd(getAccountColor(getActivity(), user.account_id));
|
||||
final String nick = getUserNickname(getActivity(), user.id, true);
|
||||
mNameView
|
||||
.setText(TextUtils.isEmpty(nick) ? user.name : getString(R.string.name_with_nickname, user.name, nick));
|
||||
// mProfileImageView.setUserType(user.is_verified, user.is_protected);
|
||||
final int typeIconRes = getUserTypeIconRes(user.is_verified, user.is_protected);
|
||||
if (typeIconRes != 0) {
|
||||
mProfileTypeView.setImageResource(typeIconRes);
|
||||
mProfileTypeView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mProfileTypeView.setImageDrawable(null);
|
||||
mProfileTypeView.setVisibility(View.GONE);
|
||||
}
|
||||
mScreenNameView.setText("@" + user.screen_name);
|
||||
mDescriptionContainer.setVisibility(userIsMe || !isEmpty(user.description_html) ? View.VISIBLE : View.GONE);
|
||||
mDescriptionView.setText(user.description_html != null ? Html.fromHtml(user.description_html) : null);
|
||||
|
@ -812,6 +821,7 @@ public class UserProfileFragmentOld extends BaseSupportListFragment implements O
|
|||
mFriendsCount = (TextView) mHeaderView.findViewById(R.id.friends_count);
|
||||
mProfileNameContainer = (ColorLabelLinearLayout) mHeaderView.findViewById(R.id.profile_name_container);
|
||||
mProfileImageView = (CircularImageView) mHeaderView.findViewById(R.id.profile_image);
|
||||
mProfileTypeView = (ImageView) mHeaderView.findViewById(R.id.profile_type);
|
||||
mDescriptionContainer = mHeaderView.findViewById(R.id.description_container);
|
||||
mLocationContainer = mHeaderView.findViewById(R.id.location_container);
|
||||
mURLContainer = mHeaderView.findViewById(R.id.url_container);
|
||||
|
@ -988,19 +998,20 @@ public class UserProfileFragmentOld extends BaseSupportListFragment implements O
|
|||
if (mentionItem != null) {
|
||||
mentionItem.setTitle(getString(R.string.mention_user_name, getDisplayName(getActivity(), user)));
|
||||
}
|
||||
final MenuItem followItem = menu.findItem(MENU_FOLLOW);
|
||||
followItem.setVisible(!isMyself);
|
||||
final boolean shouldShowFollowItem = !creatingFriendship && !destroyingFriendship && !isMyself
|
||||
&& relationship != null;
|
||||
followItem.setEnabled(shouldShowFollowItem);
|
||||
if (shouldShowFollowItem) {
|
||||
followItem.setTitle(isFollowing ? R.string.unfollow : isProtected ? R.string.send_follow_request
|
||||
: R.string.follow);
|
||||
followItem.setIcon(isFollowing ? R.drawable.ic_action_cancel : R.drawable.ic_action_add);
|
||||
} else {
|
||||
followItem.setTitle(null);
|
||||
followItem.setIcon(null);
|
||||
}
|
||||
Utils.setMenuItemAvailability(menu, MENU_MENTION, !isMyself);
|
||||
// final MenuItem followItem = menu.findItem(MENU_FOLLOW);
|
||||
// followItem.setVisible(!isMyself);
|
||||
// final boolean shouldShowFollowItem = !creatingFriendship && !destroyingFriendship && !isMyself
|
||||
// && relationship != null;
|
||||
// followItem.setEnabled(shouldShowFollowItem);
|
||||
// if (shouldShowFollowItem) {
|
||||
// followItem.setTitle(isFollowing ? R.string.unfollow : isProtected ? R.string.send_follow_request
|
||||
// : R.string.follow);
|
||||
// followItem.setIcon(isFollowing ? R.drawable.ic_action_cancel : R.drawable.ic_action_add);
|
||||
// } else {
|
||||
// followItem.setTitle(null);
|
||||
// followItem.setIcon(null);
|
||||
// }
|
||||
if (user.id != user.account_id && relationship != null) {
|
||||
setMenuItemAvailability(menu, MENU_SEND_DIRECT_MESSAGE, relationship.canSourceDMTarget());
|
||||
setMenuItemAvailability(menu, MENU_BLOCK, true);
|
||||
|
@ -1037,8 +1048,7 @@ public class UserProfileFragmentOld extends BaseSupportListFragment implements O
|
|||
}
|
||||
|
||||
private boolean shouldUseNativeMenu() {
|
||||
final boolean isInLinkHandler = getActivity() instanceof LinkHandlerActivity;
|
||||
return isInLinkHandler && FlymeUtils.hasSmartBar();
|
||||
return getActivity() instanceof LinkHandlerActivity;
|
||||
}
|
||||
|
||||
private final class MediaTimelineAction extends ListAction {
|
||||
|
|
|
@ -16,6 +16,7 @@ import android.support.v7.widget.RecyclerView.OnScrollListener;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import org.mariotaku.twidere.R;
|
||||
import org.mariotaku.twidere.adapter.ParcelableStatusesAdapter;
|
||||
|
@ -34,6 +35,7 @@ public class UserTimelineFragment extends BaseSupportFragment
|
|||
|
||||
private SwipeRefreshLayout mSwipeRefreshLayout;
|
||||
private RecyclerView mRecyclerView;
|
||||
private ProgressBar mProgressBar;
|
||||
|
||||
private ParcelableStatusesAdapter mAdapter;
|
||||
private OnScrollListener mOnScrollListener = new OnScrollListener() {
|
||||
|
@ -72,6 +74,12 @@ public class UserTimelineFragment extends BaseSupportFragment
|
|||
mRecyclerView.setAdapter(mAdapter);
|
||||
mRecyclerView.setOnScrollListener(mOnScrollListener);
|
||||
getLoaderManager().initLoader(0, getArguments(), this);
|
||||
setListShown(false);
|
||||
}
|
||||
|
||||
private void setListShown(boolean shown) {
|
||||
mProgressBar.setVisibility(shown ? View.GONE : View.VISIBLE);
|
||||
mSwipeRefreshLayout.setVisibility(shown ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -88,13 +96,14 @@ public class UserTimelineFragment extends BaseSupportFragment
|
|||
super.onViewCreated(view, savedInstanceState);
|
||||
mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipe_layout);
|
||||
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
|
||||
mProgressBar = (ProgressBar) view.findViewById(R.id.progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fitSystemWindows(Rect insets) {
|
||||
super.fitSystemWindows(insets);
|
||||
mRecyclerView.setClipToPadding(false);
|
||||
mRecyclerView.setPadding(insets.left, insets.top, insets.right, insets.bottom);
|
||||
// mRecyclerView.setClipToPadding(false);
|
||||
// mRecyclerView.setPadding(insets.left, insets.top, insets.right, insets.bottom);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -121,6 +130,7 @@ public class UserTimelineFragment extends BaseSupportFragment
|
|||
public void onLoadFinished(Loader<List<ParcelableStatus>> loader, List<ParcelableStatus> data) {
|
||||
mSwipeRefreshLayout.setRefreshing(false);
|
||||
mAdapter.setData(data);
|
||||
setListShown(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -37,7 +37,6 @@ import org.mariotaku.twidere.Constants;
|
|||
import org.mariotaku.twidere.R;
|
||||
import org.mariotaku.twidere.util.ThemeUtils;
|
||||
import org.mariotaku.twidere.util.accessor.ViewAccessor;
|
||||
import org.mariotaku.twidere.view.iface.ICardItemView;
|
||||
import org.mariotaku.twidere.view.iface.IExtendedView;
|
||||
import org.mariotaku.twidere.view.iface.IExtendedView.TouchInterceptor;
|
||||
|
||||
|
@ -106,7 +105,6 @@ public class ThemePreviewPreference extends Preference implements Constants, OnS
|
|||
if (statusContentView != null) {
|
||||
ViewAccessor.setBackground(statusContentView, ThemeUtils.getWindowBackground(context));
|
||||
|
||||
final ICardItemView cardView = (ICardItemView) statusContentView.findViewById(R.id.card);
|
||||
final View profileView = statusContentView.findViewById(R.id.profile);
|
||||
final ImageView profileImageView = (ImageView) statusContentView.findViewById(R.id.profile_image);
|
||||
final TextView nameView = (TextView) statusContentView.findViewById(R.id.name);
|
||||
|
@ -115,7 +113,6 @@ public class ThemePreviewPreference extends Preference implements Constants, OnS
|
|||
final TextView timeSourceView = (TextView) statusContentView.findViewById(R.id.time_source);
|
||||
// final TextView retweetView = (TextView)
|
||||
// statusContentView.findViewById(R.id.retweet_view);
|
||||
cardView.setItemSelector(null);
|
||||
|
||||
nameView.setTextSize(defaultTextSize * 1.25f);
|
||||
textView.setTextSize(defaultTextSize * 1.25f);
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Twidere - Twitter client for Android
|
||||
*
|
||||
* Copyright (C) 2012-2014 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.text;
|
||||
|
||||
import android.graphics.Paint.FontMetricsInt;
|
||||
import android.text.Spanned;
|
||||
import android.text.style.LineHeightSpan;
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 14/11/22.
|
||||
*/
|
||||
public class ParagraphSpacingSpan implements LineHeightSpan {
|
||||
|
||||
private final float spacingMultiplier;
|
||||
|
||||
public ParagraphSpacingSpan(float spacingMultiplier) {
|
||||
this.spacingMultiplier = spacingMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chooseHeight(CharSequence text, int start, int end,
|
||||
int spanstartv, int v, FontMetricsInt fm) {
|
||||
Spanned spanned = (Spanned) text;
|
||||
int en = spanned.getSpanEnd(this);
|
||||
if (end - 1 == en) {
|
||||
final int extra = Math.round((fm.bottom - fm.top) * (spacingMultiplier - 1));
|
||||
fm.descent += extra;
|
||||
fm.bottom += extra;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -33,6 +33,8 @@ import android.graphics.drawable.Drawable;
|
|||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.os.Build;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextPaint;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
|
@ -50,6 +52,7 @@ import org.mariotaku.refreshnow.widget.RefreshNowProgressIndicator.IndicatorConf
|
|||
import org.mariotaku.twidere.Constants;
|
||||
import org.mariotaku.twidere.R;
|
||||
import org.mariotaku.twidere.activity.iface.IThemedActivity;
|
||||
import org.mariotaku.twidere.text.ParagraphSpacingSpan;
|
||||
import org.mariotaku.twidere.util.menu.TwidereMenuInfo;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
|
@ -847,4 +850,21 @@ public class ThemeUtils implements Constants {
|
|||
view.setHighlightColor(ThemeUtils.getUserHighlightColor(context));
|
||||
view.setTypeface(ThemeUtils.getUserTypeface(context, view.getTypeface()));
|
||||
}
|
||||
|
||||
public static void applyParagraphSpacing(TextView textView, float multiplier) {
|
||||
final SpannableStringBuilder builder = SpannableStringBuilder.valueOf(textView.getText());
|
||||
int prevLineBreak, currLineBreak = 0;
|
||||
for (int i = 0, j = builder.length(); i < j; i++) {
|
||||
if (builder.charAt(i) == '\n') {
|
||||
prevLineBreak = currLineBreak;
|
||||
currLineBreak = i;
|
||||
if (currLineBreak > 0) {
|
||||
builder.setSpan(new ParagraphSpacingSpan(multiplier), prevLineBreak, currLineBreak,
|
||||
Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
textView.setText(builder);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2572,10 +2572,10 @@ public final class Utils implements Constants, TwitterConstants {
|
|||
return getDisplayName(context, user.getId(), user.getName(), user.getScreenName());
|
||||
}
|
||||
|
||||
public static int getUserTypeIconRes(final boolean is_verified, final boolean is_protected) {
|
||||
if (is_verified)
|
||||
return R.drawable.ic_indicator_verified;
|
||||
else if (is_protected) return R.drawable.ic_indicator_protected;
|
||||
public static int getUserTypeIconRes(final boolean isVerified, final boolean isProtected) {
|
||||
if (isVerified)
|
||||
return R.drawable.ic_user_type_verified;
|
||||
else if (isProtected) return R.drawable.ic_user_type_protected;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3930,6 +3930,10 @@ public final class Utils implements Constants, TwitterConstants {
|
|||
return getContrastYIQ(color, threshold, Color.BLACK, Color.WHITE);
|
||||
}
|
||||
|
||||
public static int getContrastYIQ(int color, int colorDark, int colorLight) {
|
||||
return getContrastYIQ(color, 128, colorDark, colorLight);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get most contrasting color
|
||||
*
|
||||
|
|
|
@ -27,6 +27,7 @@ import android.graphics.Bitmap.Config;
|
|||
import android.graphics.BitmapShader;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.Paint;
|
||||
|
@ -55,7 +56,7 @@ public class CircularImageView extends ImageView {
|
|||
|
||||
private static final int SHADOW_START_COLOR = 0x37000000;
|
||||
|
||||
private static final boolean USE_OUTLINE = false && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
|
||||
private static final boolean USE_OUTLINE = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
|
||||
|
||||
private final Matrix mMatrix;
|
||||
private final RectF mSource;
|
||||
|
@ -188,9 +189,6 @@ public class CircularImageView extends ImageView {
|
|||
|
||||
@Override
|
||||
protected void dispatchDraw(Canvas canvas) {
|
||||
if (mBackground != null) {
|
||||
mBackground.draw(canvas);
|
||||
}
|
||||
super.dispatchDraw(canvas);
|
||||
}
|
||||
|
||||
|
@ -245,6 +243,8 @@ public class CircularImageView extends ImageView {
|
|||
if (USE_OUTLINE) {
|
||||
super.onDraw(canvas);
|
||||
} else {
|
||||
|
||||
|
||||
final int contentLeft = getPaddingLeft(), contentTop = getPaddingTop(),
|
||||
contentRight = getWidth() - getPaddingRight(),
|
||||
contentBottom = getHeight() - getPaddingBottom();
|
||||
|
@ -276,6 +276,10 @@ public class CircularImageView extends ImageView {
|
|||
|
||||
mSource.set(0, 0, bitmap.getWidth(), bitmap.getHeight());
|
||||
|
||||
if (mBackground != null) {
|
||||
mBackground.draw(canvas);
|
||||
}
|
||||
|
||||
drawBitmapWithCircleOnCanvas(bitmap, canvas, mSource, mDestination);
|
||||
}
|
||||
|
||||
|
@ -286,6 +290,15 @@ public class CircularImageView extends ImageView {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setColorFilter(ColorFilter cf) {
|
||||
if (USE_OUTLINE) {
|
||||
super.setColorFilter(cf);
|
||||
return;
|
||||
}
|
||||
mBitmapPaint.setColorFilter(cf);
|
||||
}
|
||||
|
||||
/**
|
||||
* Given the source bitmap and a canvas, draws the bitmap through a circular
|
||||
* mask. Only draws a circle with diameter equal to the destination width.
|
||||
|
|
|
@ -20,9 +20,18 @@
|
|||
package org.mariotaku.twidere.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Bitmap.Config;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.PorterDuff.Mode;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.PorterDuffXfermode;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
@ -32,14 +41,15 @@ import android.widget.ProgressBar;
|
|||
|
||||
import org.mariotaku.twidere.R;
|
||||
import org.mariotaku.twidere.util.ThemeUtils;
|
||||
import org.mariotaku.twidere.util.Utils;
|
||||
import org.mariotaku.twidere.util.accessor.ViewAccessor;
|
||||
import org.mariotaku.twidere.view.iface.IHomeActionButton;
|
||||
|
||||
public class HomeActionButtonCompat extends FrameLayout implements IHomeActionButton {
|
||||
|
||||
private final ImageView mBackgroundView;
|
||||
private final ImageView mIconView;
|
||||
private final ProgressBar mProgressBar;
|
||||
private final FloatingActionDrawable mBackground;
|
||||
|
||||
public HomeActionButtonCompat(final Context context) {
|
||||
this(context, null);
|
||||
|
@ -51,31 +61,114 @@ public class HomeActionButtonCompat extends FrameLayout implements IHomeActionBu
|
|||
|
||||
public HomeActionButtonCompat(final Context context, final AttributeSet attrs, final int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
ViewAccessor.setBackground(this, null);
|
||||
inflate(ThemeUtils.getActionBarContext(context), R.layout.action_item_home_actions_compat, this);
|
||||
mBackgroundView = (ImageView) findViewById(R.id.background);
|
||||
mIconView = (ImageView) findViewById(android.R.id.icon);
|
||||
mProgressBar = (ProgressBar) findViewById(android.R.id.progress);
|
||||
final Resources resources = getResources();
|
||||
final int radius = resources.getDimensionPixelSize(R.dimen.element_spacing_small);
|
||||
mBackground = new FloatingActionDrawable(this, radius);
|
||||
ViewAccessor.setBackground(this, mBackground);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setButtonColor(int color) {
|
||||
mBackgroundView.setImageDrawable(new MyColorDrawable(color));
|
||||
mBackground.setColor(color);
|
||||
final View child = getChildAt(0);
|
||||
if (child instanceof FrameLayout) {
|
||||
final Drawable foreground = ((FrameLayout) child).getForeground();
|
||||
if (foreground != null) {
|
||||
foreground.setColorFilter(Utils.getContrastYIQ(color, 192), Mode.MULTIPLY);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class MyColorDrawable extends ColorDrawable {
|
||||
public MyColorDrawable(int color) {
|
||||
super(color);
|
||||
private static class FloatingActionDrawable extends Drawable {
|
||||
|
||||
|
||||
private static final int SHADOW_START_COLOR = 0x37000000;
|
||||
|
||||
private final View mView;
|
||||
private final float mRadius;
|
||||
|
||||
private Bitmap mBitmap;
|
||||
private Paint mColorPaint;
|
||||
private Rect mBounds;
|
||||
|
||||
@Override
|
||||
protected void onBoundsChange(Rect bounds) {
|
||||
super.onBoundsChange(bounds);
|
||||
mBounds.set(bounds);
|
||||
updateBitmap();
|
||||
}
|
||||
|
||||
public FloatingActionDrawable(View view, float radius) {
|
||||
mView = view;
|
||||
mRadius = radius;
|
||||
mColorPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
mBounds = new Rect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIntrinsicHeight() {
|
||||
return 16;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
if (mBitmap != null) {
|
||||
canvas.drawBitmap(mBitmap, 0, 0, null);
|
||||
}
|
||||
final Rect bounds = mBounds;
|
||||
if (!bounds.isEmpty()) {
|
||||
final RectF rect = new RectF(mView.getPaddingLeft(), mView.getPaddingTop(),
|
||||
bounds.width() - mView.getPaddingRight(), bounds.height() - mView.getPaddingBottom());
|
||||
canvas.drawOval(rect, mColorPaint);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateBitmap() {
|
||||
final Rect bounds = mBounds;
|
||||
if (bounds.isEmpty()) return;
|
||||
mBitmap = Bitmap.createBitmap(bounds.width(), bounds.height(), Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(mBitmap);
|
||||
final Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
paint.setColor(Color.WHITE);
|
||||
final float radius = mRadius;
|
||||
paint.setShadowLayer(radius, 0, radius * 1.5f / 2, SHADOW_START_COLOR);
|
||||
final RectF rect = new RectF(mView.getPaddingLeft(), mView.getPaddingTop(),
|
||||
bounds.width() - mView.getPaddingRight(), bounds.height() - mView.getPaddingBottom());
|
||||
canvas.drawOval(rect, paint);
|
||||
paint.setShadowLayer(0, 0, 0, 0);
|
||||
paint.setXfermode(new PorterDuffXfermode(Mode.CLEAR));
|
||||
canvas.drawOval(rect, paint);
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAlpha(int alpha) {
|
||||
// No-op
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setColorFilter(ColorFilter cf) {
|
||||
mColorPaint.setColorFilter(cf);
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOpacity() {
|
||||
return PixelFormat.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIntrinsicWidth() {
|
||||
return 16;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void setColor(int color) {
|
||||
mColorPaint.setColor(color);
|
||||
invalidateSelf();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import android.util.AttributeSet;
|
|||
import org.mariotaku.twidere.R;
|
||||
import org.mariotaku.twidere.graphic.DropShadowDrawable;
|
||||
|
||||
public class ProfileImageView extends HighlightImageView {
|
||||
public class ProfileImageView extends CircularImageView {
|
||||
|
||||
private final Drawable mVerifiedDrawable, mProtectedDrawable;
|
||||
|
||||
|
|
|
@ -1,29 +1,43 @@
|
|||
package org.mariotaku.twidere.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.PorterDuff.Mode;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MenuItem.OnMenuItemClickListener;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import org.mariotaku.menucomponent.widget.MenuBar;
|
||||
import org.mariotaku.menucomponent.widget.MenuBar.MenuBarListener;
|
||||
import org.mariotaku.twidere.Constants;
|
||||
import org.mariotaku.twidere.R;
|
||||
import org.mariotaku.twidere.util.ThemeUtils;
|
||||
import org.mariotaku.twidere.util.Utils;
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 14-7-29.
|
||||
*/
|
||||
public class TwidereMenuBar extends MenuBar implements MenuBarListener, Constants {
|
||||
private final int mItemColor, mPopupItemColor, mHighlightColor;
|
||||
private OnMenuItemClickListener mListener;
|
||||
|
||||
public TwidereMenuBar(Context context) {
|
||||
super(context);
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public TwidereMenuBar(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
final int itemBackgroundColor = ThemeUtils.getThemeBackgroundColor(getItemViewContext());
|
||||
final int popupItemBackgroundColor = ThemeUtils.getThemeBackgroundColor(getPopupContext());
|
||||
final Resources resources = getResources();
|
||||
final int colorDark = resources.getColor(R.color.action_icon_dark);
|
||||
final int colorLight = resources.getColor(R.color.action_icon_light);
|
||||
mItemColor = Utils.getContrastYIQ(itemBackgroundColor, colorDark, colorLight);
|
||||
mPopupItemColor = Utils.getContrastYIQ(popupItemBackgroundColor, colorDark, colorLight);
|
||||
mHighlightColor = ThemeUtils.getUserAccentColor(getContext());
|
||||
setMenuBarListener(this);
|
||||
}
|
||||
|
||||
|
@ -33,11 +47,16 @@ public class TwidereMenuBar extends MenuBar implements MenuBarListener, Constant
|
|||
|
||||
@Override
|
||||
public void onPreShowMenu(Menu menu) {
|
||||
final int color = ThemeUtils.getThemeForegroundColor(getItemViewContext());
|
||||
final int popupColor = ThemeUtils.getThemeForegroundColor(getPopupContext());
|
||||
final int highlightColor = ThemeUtils.getUserAccentColor(getContext());
|
||||
ThemeUtils.applyColorFilterToMenuIcon(menu, color, popupColor, highlightColor, Mode.SRC_ATOP,
|
||||
MENU_GROUP_STATUS_SHARE, MENU_GROUP_STATUS_EXTENSION);
|
||||
ThemeUtils.applyColorFilterToMenuIcon(menu, mItemColor, mPopupItemColor, mHighlightColor,
|
||||
Mode.SRC_ATOP, MENU_GROUP_STATUS_SHARE, MENU_GROUP_STATUS_EXTENSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostShowMenu(Menu menu) {
|
||||
final View overflowItemView = getOverflowItemView();
|
||||
if (overflowItemView instanceof ImageView) {
|
||||
((ImageView) overflowItemView).setColorFilter(mItemColor, Mode.SRC_ATOP);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,10 +19,6 @@
|
|||
|
||||
package org.mariotaku.twidere.view.holder;
|
||||
|
||||
import static org.mariotaku.twidere.util.Utils.getDisplayName;
|
||||
import static org.mariotaku.twidere.util.Utils.getStatusTypeIconRes;
|
||||
import static org.mariotaku.twidere.util.Utils.getUserTypeIconRes;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
|
@ -37,151 +33,155 @@ import org.mariotaku.twidere.util.Utils;
|
|||
import org.mariotaku.twidere.view.ProfileImageView;
|
||||
import org.mariotaku.twidere.view.ShortTimeView;
|
||||
|
||||
import static org.mariotaku.twidere.util.Utils.getDisplayName;
|
||||
import static org.mariotaku.twidere.util.Utils.getStatusTypeIconRes;
|
||||
import static org.mariotaku.twidere.util.Utils.getUserTypeIconRes;
|
||||
|
||||
public class StatusListViewHolder extends CardViewHolder {
|
||||
|
||||
public final ProfileImageView my_profile_image, profile_image;
|
||||
public final ImageView image_preview;
|
||||
public final ViewGroup image_preview_container;
|
||||
public final ProgressBar image_preview_progress;
|
||||
public final TextView name, screen_name, reply_retweet_status;
|
||||
public final ShortTimeView time;
|
||||
public final TextView text;
|
||||
public final TextView image_preview_count;
|
||||
public final ImageView my_profile_image, profile_image;
|
||||
public final ImageView image_preview;
|
||||
public final ViewGroup image_preview_container;
|
||||
public final ProgressBar image_preview_progress;
|
||||
public final TextView name, screen_name, reply_retweet_status;
|
||||
public final ShortTimeView time;
|
||||
public final TextView text;
|
||||
public final TextView image_preview_count;
|
||||
|
||||
private final float density;
|
||||
private final boolean is_rtl;
|
||||
public boolean show_as_gap;
|
||||
public int position;
|
||||
private boolean account_color_enabled;
|
||||
private float text_size;
|
||||
private boolean nickname_only, name_first;
|
||||
private boolean display_profile_image;
|
||||
private int card_highlight_option;
|
||||
private final float density;
|
||||
private final boolean is_rtl;
|
||||
public boolean show_as_gap;
|
||||
public int position;
|
||||
private boolean account_color_enabled;
|
||||
private float text_size;
|
||||
private boolean nickname_only, name_first;
|
||||
private boolean display_profile_image;
|
||||
private int card_highlight_option;
|
||||
|
||||
public StatusListViewHolder(final View view) {
|
||||
super(view);
|
||||
final Context context = getContext();
|
||||
profile_image = (ProfileImageView) findViewById(R.id.profile_image);
|
||||
my_profile_image = (ProfileImageView) findViewById(R.id.my_profile_image);
|
||||
image_preview = (ImageView) findViewById(R.id.image_preview);
|
||||
image_preview_progress = (ProgressBar) findViewById(R.id.image_preview_progress);
|
||||
image_preview_container = (ViewGroup) findViewById(R.id.image_preview_container);
|
||||
name = (TextView) findViewById(R.id.name);
|
||||
screen_name = (TextView) findViewById(R.id.screen_name);
|
||||
text = (TextView) findViewById(R.id.text);
|
||||
time = (ShortTimeView) findViewById(R.id.time);
|
||||
reply_retweet_status = (TextView) findViewById(R.id.reply_retweet_status);
|
||||
image_preview_count = (TextView) findViewById(R.id.image_preview_count);
|
||||
show_as_gap = content.isGap();
|
||||
is_rtl = Utils.isRTL(context);
|
||||
density = context.getResources().getDisplayMetrics().density;
|
||||
}
|
||||
public StatusListViewHolder(final View view) {
|
||||
super(view);
|
||||
final Context context = getContext();
|
||||
profile_image = (ImageView) findViewById(R.id.profile_image);
|
||||
my_profile_image = (ProfileImageView) findViewById(R.id.my_profile_image);
|
||||
image_preview = (ImageView) findViewById(R.id.image_preview);
|
||||
image_preview_progress = (ProgressBar) findViewById(R.id.image_preview_progress);
|
||||
image_preview_container = (ViewGroup) findViewById(R.id.image_preview_container);
|
||||
name = (TextView) findViewById(R.id.name);
|
||||
screen_name = (TextView) findViewById(R.id.screen_name);
|
||||
text = (TextView) findViewById(R.id.text);
|
||||
time = (ShortTimeView) findViewById(R.id.time);
|
||||
reply_retweet_status = (TextView) findViewById(R.id.reply_retweet_status);
|
||||
image_preview_count = (TextView) findViewById(R.id.image_preview_count);
|
||||
show_as_gap = content.isGap();
|
||||
is_rtl = Utils.isRTL(context);
|
||||
density = context.getResources().getDisplayMetrics().density;
|
||||
}
|
||||
|
||||
public void setAccountColor(final int color) {
|
||||
content.drawEnd(account_color_enabled && !show_as_gap ? color : Color.TRANSPARENT);
|
||||
}
|
||||
public void setAccountColor(final int color) {
|
||||
content.drawEnd(account_color_enabled && !show_as_gap ? color : Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
public void setAccountColorEnabled(final boolean enabled) {
|
||||
account_color_enabled = enabled && !show_as_gap;
|
||||
if (!account_color_enabled) {
|
||||
content.drawEnd(Color.TRANSPARENT);
|
||||
}
|
||||
}
|
||||
public void setAccountColorEnabled(final boolean enabled) {
|
||||
account_color_enabled = enabled && !show_as_gap;
|
||||
if (!account_color_enabled) {
|
||||
content.drawEnd(Color.TRANSPARENT);
|
||||
}
|
||||
}
|
||||
|
||||
public void setCardHighlightOption(final int option) {
|
||||
card_highlight_option = option;
|
||||
}
|
||||
public void setCardHighlightOption(final int option) {
|
||||
card_highlight_option = option;
|
||||
}
|
||||
|
||||
public void setDisplayNameFirst(final boolean name_first) {
|
||||
this.name_first = name_first;
|
||||
}
|
||||
public void setDisplayNameFirst(final boolean name_first) {
|
||||
this.name_first = name_first;
|
||||
}
|
||||
|
||||
public void setDisplayProfileImage(final boolean display) {
|
||||
display_profile_image = display;
|
||||
}
|
||||
public void setDisplayProfileImage(final boolean display) {
|
||||
display_profile_image = display;
|
||||
}
|
||||
|
||||
public void setHighlightColor(final int color) {
|
||||
final boolean line = (card_highlight_option & VALUE_CARD_HIGHLIGHT_OPTION_CODE_LINE) != 0;
|
||||
final boolean bg = (card_highlight_option & VALUE_CARD_HIGHLIGHT_OPTION_CODE_BACKGROUND) != 0;
|
||||
content.drawTop(!show_as_gap && line ? color : Color.TRANSPARENT);
|
||||
content.drawBackground(!show_as_gap && bg && color != 0 ? 0x1A000000 | 0x00FFFFFF & color : Color.TRANSPARENT);
|
||||
}
|
||||
public void setHighlightColor(final int color) {
|
||||
final boolean line = (card_highlight_option & VALUE_CARD_HIGHLIGHT_OPTION_CODE_LINE) != 0;
|
||||
final boolean bg = (card_highlight_option & VALUE_CARD_HIGHLIGHT_OPTION_CODE_BACKGROUND) != 0;
|
||||
content.drawTop(!show_as_gap && line ? color : Color.TRANSPARENT);
|
||||
content.drawBackground(!show_as_gap && bg && color != 0 ? 0x1A000000 | 0x00FFFFFF & color : Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
public void setIsMyStatus(final boolean my_status) {
|
||||
profile_image.setVisibility(my_status ? View.GONE : View.VISIBLE);
|
||||
my_profile_image.setVisibility(my_status ? View.VISIBLE : View.GONE);
|
||||
final MarginLayoutParams lp = (MarginLayoutParams) time.getLayoutParams();
|
||||
if (is_rtl) {
|
||||
lp.leftMargin = (int) (my_status ? 6 * density : 0);
|
||||
} else {
|
||||
lp.rightMargin = (int) (my_status ? 6 * density : 0);
|
||||
}
|
||||
}
|
||||
public void setIsMyStatus(final boolean my_status) {
|
||||
profile_image.setVisibility(my_status ? View.GONE : View.VISIBLE);
|
||||
my_profile_image.setVisibility(my_status ? View.VISIBLE : View.GONE);
|
||||
final MarginLayoutParams lp = (MarginLayoutParams) time.getLayoutParams();
|
||||
if (is_rtl) {
|
||||
lp.leftMargin = (int) (my_status ? 6 * density : 0);
|
||||
} else {
|
||||
lp.rightMargin = (int) (my_status ? 6 * density : 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void setIsReplyRetweet(final boolean is_reply, final boolean is_retweet) {
|
||||
reply_retweet_status.setVisibility(is_retweet || is_reply ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
public void setIsReplyRetweet(final boolean is_reply, final boolean is_retweet) {
|
||||
reply_retweet_status.setVisibility(is_retweet || is_reply ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
public void setNicknameOnly(final boolean nickname_only) {
|
||||
this.nickname_only = nickname_only;
|
||||
}
|
||||
public void setNicknameOnly(final boolean nickname_only) {
|
||||
this.nickname_only = nickname_only;
|
||||
}
|
||||
|
||||
public void setReplyTo(final long user_id, final String name, final String screen_name) {
|
||||
final String display_name = getDisplayName(getContext(), user_id, name, screen_name, name_first, nickname_only,
|
||||
false);
|
||||
reply_retweet_status.setText(getString(R.string.in_reply_to, display_name));
|
||||
reply_retweet_status.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_indicator_conversation, 0, 0, 0);
|
||||
}
|
||||
public void setReplyTo(final long user_id, final String name, final String screen_name) {
|
||||
final String display_name = getDisplayName(getContext(), user_id, name, screen_name, name_first, nickname_only,
|
||||
false);
|
||||
reply_retweet_status.setText(getString(R.string.in_reply_to, display_name));
|
||||
reply_retweet_status.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_indicator_conversation, 0, 0, 0);
|
||||
}
|
||||
|
||||
public void setRetweetedBy(final long count, final long user_id, final String name, final String screen_name) {
|
||||
final String display_name = getDisplayName(getContext(), user_id, name, screen_name, name_first, nickname_only,
|
||||
false);
|
||||
reply_retweet_status.setText(count > 1 ? getString(R.string.retweeted_by_with_count, display_name, count - 1)
|
||||
: getString(R.string.retweeted_by, display_name));
|
||||
reply_retweet_status.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_indicator_retweet, 0, 0, 0);
|
||||
}
|
||||
public void setRetweetedBy(final long count, final long user_id, final String name, final String screen_name) {
|
||||
final String display_name = getDisplayName(getContext(), user_id, name, screen_name, name_first, nickname_only,
|
||||
false);
|
||||
reply_retweet_status.setText(count > 1 ? getString(R.string.retweeted_by_with_count, display_name, count - 1)
|
||||
: getString(R.string.retweeted_by, display_name));
|
||||
reply_retweet_status.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_indicator_retweet, 0, 0, 0);
|
||||
}
|
||||
|
||||
public void setShowAsGap(final boolean show_gap) {
|
||||
show_as_gap = show_gap;
|
||||
if (content != null) {
|
||||
content.setIsGap(show_gap);
|
||||
}
|
||||
// if (item_menu != null) {
|
||||
// item_menu.setVisibility(show_gap ? View.GONE : View.VISIBLE);
|
||||
// }
|
||||
}
|
||||
public void setShowAsGap(final boolean show_gap) {
|
||||
show_as_gap = show_gap;
|
||||
if (content != null) {
|
||||
content.setIsGap(show_gap);
|
||||
}
|
||||
// if (item_menu != null) {
|
||||
// item_menu.setVisibility(show_gap ? View.GONE : View.VISIBLE);
|
||||
// }
|
||||
}
|
||||
|
||||
public void setStatusType(final boolean is_favorite, final boolean has_location, final boolean has_media,
|
||||
final boolean is_possibly_sensitive) {
|
||||
final int res = getStatusTypeIconRes(is_favorite, has_location, has_media, is_possibly_sensitive);
|
||||
time.setCompoundDrawablesWithIntrinsicBounds(0, 0, res, 0);
|
||||
}
|
||||
public void setStatusType(final boolean is_favorite, final boolean has_location, final boolean has_media,
|
||||
final boolean is_possibly_sensitive) {
|
||||
final int res = getStatusTypeIconRes(is_favorite, has_location, has_media, is_possibly_sensitive);
|
||||
time.setCompoundDrawablesWithIntrinsicBounds(0, 0, res, 0);
|
||||
}
|
||||
|
||||
public boolean setTextSize(final float text_size) {
|
||||
if (this.text_size == text_size) return false;
|
||||
this.text_size = text_size;
|
||||
text.setTextSize(text_size);
|
||||
name.setTextSize(text_size);
|
||||
screen_name.setTextSize(text_size * 0.75f);
|
||||
time.setTextSize(text_size * 0.65f);
|
||||
reply_retweet_status.setTextSize(text_size * 0.65f);
|
||||
image_preview_count.setTextSize(text_size * 1.25f);
|
||||
return true;
|
||||
}
|
||||
public boolean setTextSize(final float text_size) {
|
||||
if (this.text_size == text_size) return false;
|
||||
this.text_size = text_size;
|
||||
text.setTextSize(text_size);
|
||||
name.setTextSize(text_size);
|
||||
screen_name.setTextSize(text_size * 0.75f);
|
||||
time.setTextSize(text_size * 0.65f);
|
||||
reply_retweet_status.setTextSize(text_size * 0.65f);
|
||||
image_preview_count.setTextSize(text_size * 1.25f);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setUserColor(final int... colors) {
|
||||
content.drawStart(show_as_gap ? null : colors);
|
||||
}
|
||||
public void setUserColor(final int... colors) {
|
||||
content.drawStart(show_as_gap ? null : colors);
|
||||
}
|
||||
|
||||
public void setUserType(final boolean isVerified, final boolean isProtected) {
|
||||
// if (display_profile_image) {
|
||||
// profile_image.setUserType(isVerified, isProtected);
|
||||
// my_profile_image.setUserType(isVerified, isProtected);
|
||||
// name.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
// } else {
|
||||
// profile_image.setUserType(false, false);
|
||||
// my_profile_image.setUserType(false, false);
|
||||
name.setCompoundDrawablesWithIntrinsicBounds(0, 0, getUserTypeIconRes(isVerified, isProtected), 0);
|
||||
// }
|
||||
}
|
||||
public void setUserType(final boolean isVerified, final boolean isProtected) {
|
||||
// if (display_profile_image) {
|
||||
// profile_image.setUserType(isVerified, isProtected);
|
||||
// my_profile_image.setUserType(isVerified, isProtected);
|
||||
// name.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
// } else {
|
||||
// profile_image.setUserType(false, false);
|
||||
// my_profile_image.setUserType(false, false);
|
||||
name.setCompoundDrawablesWithIntrinsicBounds(0, 0, getUserTypeIconRes(isVerified, isProtected), 0);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ import org.mariotaku.twidere.view.ShortTimeView;
|
|||
|
||||
import java.util.Locale;
|
||||
|
||||
import static org.mariotaku.twidere.util.Utils.getUserTypeIconRes;
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 14/11/19.
|
||||
*/
|
||||
|
@ -78,31 +80,37 @@ public class StatusViewHolder extends RecyclerView.ViewHolder implements OnClick
|
|||
final ParcelableMedia[] media = status.media;
|
||||
|
||||
if (status.retweet_id > 0) {
|
||||
replyRetweetView.setText(context.getString(R.string.retweeted_by_name, status.retweeted_by_name));
|
||||
if (status.retweet_count == 2) {
|
||||
replyRetweetView.setText(context.getString(R.string.name_and_another_retweeted,
|
||||
status.retweeted_by_name));
|
||||
} else if (status.retweet_count > 2) {
|
||||
replyRetweetView.setText(context.getString(R.string.name_and_count_retweeted,
|
||||
status.retweeted_by_name, status.retweet_count - 1));
|
||||
} else {
|
||||
replyRetweetView.setText(context.getString(R.string.name_retweeted, status.retweeted_by_name));
|
||||
}
|
||||
replyRetweetView.setVisibility(View.VISIBLE);
|
||||
replyRetweetView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
retweetProfileImageView.setVisibility(View.VISIBLE);
|
||||
loader.displayProfileImage(retweetProfileImageView, status.retweeted_by_profile_image);
|
||||
} else if (status.in_reply_to_user_id > 0) {
|
||||
// replyRetweetView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_action_retweet, 0, 0, 0);
|
||||
retweetProfileImageView.setVisibility(View.GONE);
|
||||
} else if (status.in_reply_to_status_id > 0 && status.in_reply_to_user_id > 0) {
|
||||
replyRetweetView.setText(context.getString(R.string.in_reply_to_name, status.in_reply_to_name));
|
||||
replyRetweetView.setVisibility(View.VISIBLE);
|
||||
replyRetweetView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_action_reply, 0, 0, 0);
|
||||
// replyRetweetView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_action_reply, 0, 0, 0);
|
||||
retweetProfileImageView.setVisibility(View.GONE);
|
||||
loader.cancelDisplayTask(retweetProfileImageView);
|
||||
} else {
|
||||
replyRetweetView.setText(null);
|
||||
replyRetweetView.setVisibility(View.GONE);
|
||||
replyRetweetView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
retweetProfileImageView.setVisibility(View.GONE);
|
||||
loader.cancelDisplayTask(retweetProfileImageView);
|
||||
}
|
||||
|
||||
if (status.user_is_protected) {
|
||||
profileTypeView.setImageResource(R.drawable.ic_user_type_protected);
|
||||
} else if (status.user_is_verified) {
|
||||
profileTypeView.setImageResource(R.drawable.ic_user_type_verified);
|
||||
final int typeIconRes = getUserTypeIconRes(status.user_is_verified, status.user_is_protected);
|
||||
if (typeIconRes != 0) {
|
||||
profileTypeView.setImageResource(typeIconRes);
|
||||
profileTypeView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
profileTypeView.setImageDrawable(null);
|
||||
profileTypeView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
nameView.setText(status.user_name);
|
||||
|
|
|
@ -1286,8 +1286,10 @@ final class TwitterImpl extends TwitterBaseImpl implements Twitter {
|
|||
@Override
|
||||
public Status retweetStatus(final long statusId) throws TwitterException {
|
||||
ensureAuthorizationEnabled();
|
||||
return factory.createStatus(post(conf.getRestBaseURL() + "statuses/retweet/" + statusId + ".json",
|
||||
conf.getSigningRestBaseURL() + "statuses/retweet/" + statusId + ".json", INCLUDE_ENTITIES));
|
||||
final String url = conf.getRestBaseURL() + "statuses/retweet/" + statusId + ".json";
|
||||
final String signUrl = conf.getSigningRestBaseURL() + "statuses/retweet/" + statusId + ".json";
|
||||
return factory.createStatus(post(url, signUrl, INCLUDE_ENTITIES, INCLUDE_REPLY_COUNT,
|
||||
INCLUDE_DESCENDENT_REPLY_COUNT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1307,7 +1309,8 @@ final class TwitterImpl extends TwitterBaseImpl implements Twitter {
|
|||
public QueryResult search(final Query query) throws TwitterException {
|
||||
return factory.createQueryResult(
|
||||
get(conf.getRestBaseURL() + ENDPOINT_SEARCH_TWEETS, conf.getSigningRestBaseURL()
|
||||
+ ENDPOINT_SEARCH_TWEETS, query.asHttpParameterArray(INCLUDE_ENTITIES, INCLUDE_RTS)), query);
|
||||
+ ENDPOINT_SEARCH_TWEETS, query.asHttpParameterArray(INCLUDE_ENTITIES,
|
||||
INCLUDE_RTS, INCLUDE_REPLY_COUNT, INCLUDE_DESCENDENT_REPLY_COUNT)), query);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Before Width: | Height: | Size: 494 B After Width: | Height: | Size: 786 B |
Before Width: | Height: | Size: 739 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 465 B After Width: | Height: | Size: 520 B |
Before Width: | Height: | Size: 640 B After Width: | Height: | Size: 851 B |
Before Width: | Height: | Size: 735 B After Width: | Height: | Size: 1020 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 3.4 KiB |
|
@ -1,38 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape
|
||||
android:shape="oval" >
|
||||
<gradient
|
||||
android:endColor="#00000000"
|
||||
android:gradientRadius="50%p"
|
||||
android:startColor="#A0000000"
|
||||
android:type="radial"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:id="@+id/color_layer"
|
||||
android:bottom="@dimen/element_spacing_small"
|
||||
android:left="@dimen/element_spacing_small"
|
||||
android:right="@dimen/element_spacing_small"
|
||||
android:top="@dimen/element_spacing_small">
|
||||
<!--
|
||||
~ Twidere - Twitter client for Android
|
||||
~
|
||||
~ Copyright (C) 2012-2014 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/>.
|
||||
-->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="#ffffff"/>
|
||||
<solid android:color="#20FFFFFF"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:bottom="@dimen/element_spacing_small"
|
||||
android:left="@dimen/element_spacing_small"
|
||||
android:right="@dimen/element_spacing_small"
|
||||
android:top="@dimen/element_spacing_small">
|
||||
|
||||
<selector>
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="#20FFFFFF"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
</item>
|
||||
</layer-list>
|
||||
</selector>
|
|
@ -1,12 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
>
|
||||
|
||||
<org.mariotaku.twidere.view.CircularImageView
|
||||
android:id="@+id/background"
|
||||
android:layout_width="@dimen/float_action_button_size"
|
||||
android:layout_height="@dimen/float_action_button_size"
|
||||
android:layout_gravity="center"/>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/float_action_button_size"
|
||||
android:layout_height="@dimen/float_action_button_size"
|
||||
android:layout_gravity="center"
|
||||
android:foreground="@drawable/btn_home_actions_compat">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@android:id/progress"
|
||||
|
@ -25,4 +23,4 @@
|
|||
android:contentDescription="@string/compose"
|
||||
android:scaleType="centerInside"/>
|
||||
|
||||
</merge>
|
||||
</FrameLayout>
|
|
@ -6,7 +6,8 @@
|
|||
android:layout_height="?android:actionBarSize"
|
||||
android:baselineAligned="false"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/bottom_menu_container"
|
||||
|
@ -21,7 +22,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:background="@null"
|
||||
android:max="@integer/max_action_buttons_bottom"/>
|
||||
app:maxActionItems="@integer/max_action_buttons_bottom"/>
|
||||
</HorizontalScrollView>
|
||||
|
||||
<View
|
||||
|
|
|
@ -28,16 +28,15 @@
|
|||
android:layout_marginTop="@dimen/element_spacing_small"
|
||||
android:scaleType="centerCrop"/>
|
||||
|
||||
<TextView
|
||||
<org.mariotaku.twidere.view.CardActionTextView
|
||||
android:id="@+id/reply_retweet_status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/element_spacing_minus_small"
|
||||
android:layout_height="@dimen/element_size_small"
|
||||
android:layout_marginBottom="@dimen/element_spacing_minus_normal"
|
||||
android:layout_marginLeft="@dimen/element_spacing_normal"
|
||||
android:layout_marginRight="@dimen/element_spacing_normal"
|
||||
android:layout_marginTop="@dimen/element_spacing_small"
|
||||
android:layout_toRightOf="@id/retweet_profile_image"
|
||||
android:drawablePadding="@dimen/element_spacing_small"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/element_size_small"
|
||||
|
@ -52,14 +51,15 @@
|
|||
android:layout_alignLeft="@id/retweet_profile_image"
|
||||
android:layout_below="@id/reply_retweet_status"
|
||||
android:layout_marginTop="@dimen/element_spacing_normal"
|
||||
android:paddingLeft="@dimen/element_spacing_normal">
|
||||
android:paddingLeft="@dimen/element_spacing_mlarge">
|
||||
|
||||
<org.mariotaku.twidere.view.CircularImageView
|
||||
android:id="@+id/profile_image"
|
||||
android:layout_width="@dimen/icon_size_status_profile_image"
|
||||
android:layout_height="@dimen/icon_size_status_profile_image"
|
||||
android:layout_width="@dimen/element_size_normal"
|
||||
android:layout_height="@dimen/element_size_normal"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@string/profile_image"
|
||||
android:padding="@dimen/padding_profile_image_list_item"
|
||||
android:scaleType="centerCrop"/>
|
||||
|
||||
<ImageView
|
||||
|
@ -68,9 +68,7 @@
|
|||
android:layout_height="@dimen/icon_size_profile_type"
|
||||
android:layout_alignBottom="@+id/profile_image"
|
||||
android:layout_alignRight="@+id/profile_image"
|
||||
android:layout_marginBottom="@dimen/element_spacing_minus_small"
|
||||
android:layout_marginRight="@dimen/element_spacing_minus_normal"
|
||||
android:scaleType="centerInside"/>
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -166,6 +164,7 @@
|
|||
android:layout_alignLeft="@+id/profile_container"
|
||||
android:layout_below="@id/media_preview_container"
|
||||
android:layout_marginTop="@dimen/element_spacing_normal"
|
||||
android:layout_marginBottom="@dimen/element_spacing_normal"
|
||||
android:paddingLeft="@dimen/element_spacing_normal"
|
||||
android:paddingRight="@dimen/element_spacing_normal"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
|
@ -176,7 +175,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/profile_container"
|
||||
android:layout_below="@+id/text"
|
||||
android:layout_marginTop="@dimen/element_spacing_small"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none">
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
android:layout_height="@dimen/element_size_small"
|
||||
android:layout_marginLeft="@dimen/element_spacing_normal"/>
|
||||
|
||||
<TextView
|
||||
<org.mariotaku.twidere.view.CardActionTextView
|
||||
android:id="@+id/reply_retweet_status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<org.mariotaku.twidere.view.TwidereMenuBar xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/menu_bar"
|
||||
style="?android:actionBarSplitStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:actionBarSize"
|
||||
android:max="@integer/max_action_buttons_bottom"/>
|
||||
<org.mariotaku.twidere.view.TwidereMenuBar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/menu_bar"
|
||||
style="?android:actionBarSplitStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:actionBarSize"
|
||||
android:max="@integer/max_action_buttons_bottom"/>
|
||||
|
|
|
@ -3,21 +3,29 @@
|
|||
android:id="@+id/fragment_content"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:layout_height="match_parent">
|
||||
android:animateLayoutChanges="true"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<android.support.v4.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipe_layout"
|
||||
android:clipToPadding="false"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:scrollbars="vertical"
|
||||
android:clipToPadding="false"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:scrollbars="vertical"/>
|
||||
|
||||
</android.support.v4.widget.SwipeRefreshLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress"
|
||||
android:layout_width="wrap_content"
|
||||
style="?android:progressBarStyleLarge"
|
||||
android:layout_gravity="center"
|
||||
android:layout_height="wrap_content"/>
|
||||
</FrameLayout>
|
|
@ -1,259 +1,290 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.mariotaku.twidere.view.CardItemLinearLayout
|
||||
android:id="@+id/card"
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/element_spacing_normal">
|
||||
|
||||
<org.mariotaku.twidere.view.ColorLabelRelativeLayout
|
||||
android:id="@+id/profile"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:padding="@dimen/element_spacing_normal"
|
||||
app:ignorePadding="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/profile_image"
|
||||
android:layout_width="@dimen/icon_size_card_details"
|
||||
android:layout_height="@dimen/icon_size_card_details"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@string/profile_image"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@+id/follow_indicator"
|
||||
android:layout_toRightOf="@+id/profile_image"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="4dp">
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/screen_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"/>
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/follow_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:visibility="gone">
|
||||
|
||||
<Button
|
||||
android:id="@+id/follow"
|
||||
style="?android:attr/buttonStyleSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/follow"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/follow_info_progress"
|
||||
style="?android:attr/progressBarStyleSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"/>
|
||||
</FrameLayout>
|
||||
</org.mariotaku.twidere.view.ColorLabelRelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.2dp"
|
||||
android:background="#40808080"/>
|
||||
|
||||
<include
|
||||
layout="@layout/image_preview_grid"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<org.mariotaku.twidere.view.StatusTextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:singleLine="false"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textIsSelectable="true"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/location_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
|
||||
<org.mariotaku.twidere.view.MapImageView
|
||||
android:id="@+id/map_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_map"
|
||||
android:contentDescription="@string/location"
|
||||
android:duplicateParentState="true"
|
||||
android:foreground="?android:selectableItemBackground"
|
||||
android:scaleType="centerCrop"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/location_background_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/location_view"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignTop="@+id/location_view"
|
||||
android:alpha="0.5"
|
||||
android:background="?cardItemBackgroundColor"/>
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/location_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:drawableLeft="@drawable/ic_indicator_location"
|
||||
android:drawablePadding="4dp"
|
||||
android:duplicateParentState="true"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="@dimen/element_spacing_normal"
|
||||
android:singleLine="true"
|
||||
android:text="@string/view_map"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/time_source"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/ic_indicator_twitter"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="@dimen/element_spacing_normal"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
android:layout_margin="@dimen/element_spacing_normal"
|
||||
app:cardBackgroundColor="?cardItemBackgroundColor"
|
||||
app:cardCornerRadius="@dimen/corner_radius_card"
|
||||
app:cardElevation="@dimen/elevation_card">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/button_bar_height"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/replies_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:gravity="center"
|
||||
android:minWidth="@dimen/button_width_content_min"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/element_spacing_small">
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/replies_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:textAppearanceMedium"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="@string/replies"
|
||||
android:textAppearance="?android:textAppearanceSmall"
|
||||
android:textColor="?android:textColorSecondary"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/favorites_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:gravity="center"
|
||||
android:minWidth="@dimen/button_width_content_min"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/element_spacing_small">
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/favorites_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:textAppearanceMedium"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="@string/favorites"
|
||||
android:textAppearance="?android:textAppearanceSmall"
|
||||
android:textColor="?android:textColorSecondary"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/retweets_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:gravity="center"
|
||||
android:minWidth="@dimen/button_width_content_min"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/element_spacing_small">
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/retweets_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:textAppearanceMedium"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="@string/retweets"
|
||||
android:textAppearance="?android:textAppearanceSmall"
|
||||
android:textColor="?android:textColorSecondary"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/in_reply_to"
|
||||
android:id="@+id/card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:drawableLeft="@drawable/ic_indicator_conversation"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="@dimen/element_spacing_normal"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:visibility="gone"/>
|
||||
</org.mariotaku.twidere.view.CardItemLinearLayout>
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/in_reply_to"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/element_size_small"
|
||||
android:padding="@dimen/element_spacing_normal"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:visibility="gone"/>
|
||||
|
||||
|
||||
<org.mariotaku.twidere.view.ColorLabelRelativeLayout
|
||||
android:id="@+id/profile"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:padding="@dimen/element_spacing_small"
|
||||
app:ignorePadding="true">
|
||||
|
||||
<org.mariotaku.twidere.view.CircularImageView
|
||||
android:id="@+id/profile_image"
|
||||
android:layout_width="@dimen/element_size_mlarge"
|
||||
android:layout_height="@dimen/element_size_mlarge"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@string/profile_image"
|
||||
android:padding="@dimen/padding_profile_image_detail_page"
|
||||
android:scaleType="centerCrop"
|
||||
app:border="true"
|
||||
app:borderWidth="1dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/profile_type"
|
||||
android:layout_width="@dimen/icon_size_profile_type_detail"
|
||||
android:layout_height="@dimen/icon_size_profile_type_detail"
|
||||
android:layout_alignBottom="@+id/profile_image"
|
||||
android:layout_alignRight="@+id/profile_image"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/profile_image"
|
||||
android:layout_alignTop="@+id/profile_image"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@+id/follow_indicator"
|
||||
android:layout_toRightOf="@+id/profile_image"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="4dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/screen_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/element_spacing_small"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"/>
|
||||
</LinearLayout>
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/time_source"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/follow_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:visibility="gone">
|
||||
|
||||
<Button
|
||||
android:id="@+id/follow"
|
||||
style="?android:attr/buttonStyleSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/follow"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/follow_info_progress"
|
||||
style="?android:attr/progressBarStyleSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"/>
|
||||
</FrameLayout>
|
||||
</org.mariotaku.twidere.view.ColorLabelRelativeLayout>
|
||||
|
||||
<include
|
||||
layout="@layout/image_preview_grid"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<org.mariotaku.twidere.view.StatusTextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:singleLine="false"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textIsSelectable="true"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/location_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
|
||||
<org.mariotaku.twidere.view.MapImageView
|
||||
android:id="@+id/map_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_map"
|
||||
android:contentDescription="@string/location"
|
||||
android:duplicateParentState="true"
|
||||
android:foreground="?android:selectableItemBackground"
|
||||
android:scaleType="centerCrop"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/location_background_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/location_view"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignTop="@+id/location_view"
|
||||
android:alpha="0.5"
|
||||
android:background="?cardItemBackgroundColor"/>
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/location_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:drawableLeft="@drawable/ic_indicator_location"
|
||||
android:drawablePadding="4dp"
|
||||
android:duplicateParentState="true"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="@dimen/element_spacing_normal"
|
||||
android:singleLine="true"
|
||||
android:text="@string/view_map"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/button_bar_height"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/replies_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:gravity="center"
|
||||
android:minWidth="@dimen/button_width_content_min"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/element_spacing_small">
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/replies_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:textAppearanceMedium"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="@string/replies"
|
||||
android:textAppearance="?android:textAppearanceSmall"
|
||||
android:textColor="?android:textColorSecondary"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/retweets_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:gravity="center"
|
||||
android:minWidth="@dimen/button_width_content_min"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/element_spacing_small">
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/retweets_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:textAppearanceMedium"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="@string/retweets"
|
||||
android:textAppearance="?android:textAppearanceSmall"
|
||||
android:textColor="?android:textColorSecondary"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/favorites_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:gravity="center"
|
||||
android:minWidth="@dimen/button_width_content_min"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/element_spacing_small">
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:id="@+id/favorites_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:textAppearanceMedium"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
|
||||
<org.mariotaku.twidere.view.themed.ThemedTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="@string/favorites"
|
||||
android:textAppearance="?android:textAppearanceSmall"
|
||||
android:textColor="?android:textColorSecondary"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<org.mariotaku.twidere.view.TwidereMenuBar
|
||||
android:id="@+id/menu_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:actionBarSize"
|
||||
app:maxActionItems="@integer/max_action_buttons_bottom"/>
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
</FrameLayout>
|
|
@ -45,7 +45,6 @@
|
|||
<org.mariotaku.twidere.view.CircularImageView
|
||||
android:id="@+id/profile_image"
|
||||
style="?profileImageStyleLarge"
|
||||
android:elevation="0dp"
|
||||
android:layout_width="@dimen/icon_size_user_profile"
|
||||
android:layout_height="@dimen/icon_size_user_profile"
|
||||
android:layout_alignBottom="@+id/profile_name_container"
|
||||
|
@ -53,6 +52,15 @@
|
|||
android:contentDescription="@string/profile_image"
|
||||
android:src="@drawable/ic_profile_image_default"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/profile_type"
|
||||
style="@style/Widget.ProfileType"
|
||||
android:layout_width="@dimen/icon_size_profile_type_user_profile"
|
||||
android:layout_height="@dimen/icon_size_profile_type_user_profile"
|
||||
android:layout_alignBottom="@+id/profile_image"
|
||||
android:layout_alignRight="@+id/profile_image"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
<org.mariotaku.twidere.view.ColorLabelLinearLayout
|
||||
android:id="@+id/profile_name_container"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.mariotaku.twidere.view.HomeActionButtonCompat
|
||||
android:id="@+id/actions_button"
|
||||
style="?android:buttonStyle"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|right"
|
||||
android:layout_marginBottom="@dimen/element_spacing_normal"
|
||||
android:padding="@dimen/element_spacing_large"
|
||||
android:visibility="visible"/>
|
|
@ -10,6 +10,7 @@
|
|||
<item
|
||||
android:id="@id/follow"
|
||||
android:enabled="false"
|
||||
android:visible="false"
|
||||
android:icon="@android:color/transparent"
|
||||
android:showAsAction="always"
|
||||
android:title="@string/follow"/>
|
||||
|
|
|
@ -11,23 +11,18 @@
|
|||
|
||||
<style name="Widget.ProfileImage.Large">
|
||||
<item name="android:background">@drawable/bg_oval_white</item>
|
||||
<!--<item name="android:background">@android:color/transparent</item>-->
|
||||
<item name="android:paddingTop">1dp</item>
|
||||
<item name="android:paddingLeft">2dp</item>
|
||||
<item name="android:paddingRight">2dp</item>
|
||||
<item name="android:paddingBottom">3dp</item>
|
||||
<item name="elevation">@dimen/elevation_card</item>
|
||||
<item name="borderWidth">2dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Light.ProfileImage.Large">
|
||||
<item name="android:background">@drawable/bg_oval_white</item>
|
||||
<!--<item name="android:background">@android:color/transparent</item>-->
|
||||
<item name="android:paddingTop">1dp</item>
|
||||
<item name="android:paddingLeft">2dp</item>
|
||||
<item name="android:paddingRight">2dp</item>
|
||||
<item name="android:paddingBottom">3dp</item>
|
||||
<item name="elevation">@dimen/elevation_card</item>
|
||||
<item name="borderWidth">2dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.ProfileType" parent="android:Widget.DeviceDefault">
|
||||
<item name="android:elevation">@dimen/elevation_card</item>
|
||||
<item name="android:outlineProvider">none</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -3,7 +3,10 @@
|
|||
|
||||
<declare-styleable name="Twidere">
|
||||
<attr name="cardActionButtonStyle" format="reference"/>
|
||||
<attr name="profileImageStyle" format="reference"/>
|
||||
<attr name="profileImageStyleLarge" format="reference"/>
|
||||
<attr name="menuIconColor" format="color"/>
|
||||
<attr name="menuIconColorActionBar" format="color"/>
|
||||
<attr name="cardItemBackground" format="reference"/>
|
||||
<attr name="cardItemBackgroundColor" format="color"/>
|
||||
<attr name="cardItemMessageIncomingBackground" format="reference"/>
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<color name="nyan_background">#003366</color>
|
||||
<color name="bg_color_light">#e5e5e5</color>
|
||||
<color name="bg_color_dark">#101010</color>
|
||||
<color name="bg_color_transparent_dark">#ff000000</color>
|
||||
<color name="bg_color_transparent_light">#ffffffff</color>
|
||||
<color name="bg_color_drawer_dark">#1a1a1a</color>
|
||||
<color name="bg_color_drawer_transparent_dark">#c01a1a1a</color>
|
||||
<color name="highlighted_text_holo_dark">#66b0b0b0</color>
|
||||
<color name="highlighted_text_holo_light">#66b0b0b0</color>
|
||||
<color name="text_link_holo_dark">#909090</color>
|
||||
<color name="text_link_holo_light">#707070</color>
|
||||
<color name="accent_white">#ffffff</color>
|
||||
<color name="divider_color">#40808080</color>
|
||||
<color name="nyan_background">#003366</color>
|
||||
<color name="bg_color_light">#e5e5e5</color>
|
||||
<color name="bg_color_dark">#101010</color>
|
||||
<color name="bg_color_transparent_dark">#ff000000</color>
|
||||
<color name="bg_color_transparent_light">#ffffffff</color>
|
||||
<color name="bg_color_drawer_dark">#1a1a1a</color>
|
||||
<color name="bg_color_drawer_transparent_dark">#c01a1a1a</color>
|
||||
<color name="highlighted_text_holo_dark">#66b0b0b0</color>
|
||||
<color name="highlighted_text_holo_light">#66b0b0b0</color>
|
||||
<color name="text_link_holo_dark">#909090</color>
|
||||
<color name="text_link_holo_light">#707070</color>
|
||||
<color name="accent_white">#ffffff</color>
|
||||
<color name="divider_color">#40808080</color>
|
||||
<color name="action_icon_dark">#99333333</color>
|
||||
<color name="action_icon_dark_disabled">#4D333333</color>
|
||||
<color name="action_icon_light">#CCFFFFFF</color>
|
||||
<color name="action_icon_light_disabled">#4DFFFFFF</color>
|
||||
|
||||
</resources>
|
|
@ -1,9 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<dimen name="element_size_normal">48dp</dimen>
|
||||
<dimen name="button_size_content_card">42dp</dimen>
|
||||
<dimen name="element_size_small">24dp</dimen>
|
||||
<dimen name="element_size_normal">48dp</dimen>
|
||||
<dimen name="element_size_mlarge">64dp</dimen>
|
||||
|
||||
|
||||
<dimen name="button_size_content_card">42dp</dimen>
|
||||
<dimen name="element_spacing_xsmall">2dp</dimen>
|
||||
<dimen name="element_spacing_small">4dp</dimen>
|
||||
<dimen name="element_spacing_msmall">6dp</dimen>
|
||||
|
@ -74,11 +77,17 @@
|
|||
<dimen name="action_icon_size">32dp</dimen>
|
||||
<dimen name="unread_indicator_size">16dp</dimen>
|
||||
<dimen name="account_selector_popup_width">180dp</dimen>
|
||||
<dimen name="icon_size_status_profile_image">48dp</dimen>
|
||||
<dimen name="icon_size_profile_type">24dp</dimen>
|
||||
<dimen name="icon_size_status_profile_image">40dp</dimen>
|
||||
<dimen name="icon_size_profile_type">18dp</dimen>
|
||||
<dimen name="icon_size_profile_type_detail">24dp</dimen>
|
||||
<dimen name="icon_size_profile_type_user_profile">32dp</dimen>
|
||||
|
||||
<!-- Elevation values -->
|
||||
<dimen name="elevation_card">2dp</dimen>
|
||||
<dimen name="corner_radius_card">2dp</dimen>
|
||||
|
||||
|
||||
<dimen name="padding_profile_image_detail_page">@dimen/element_spacing_small</dimen>
|
||||
<dimen name="padding_profile_image_list_item">@dimen/element_spacing_small</dimen>
|
||||
|
||||
</resources>
|
|
@ -38,5 +38,9 @@
|
|||
<item quantity="one">@string/created_at_with_N_tweets_per_day_quantity_one</item>
|
||||
<item quantity="other">@string/created_at_with_N_tweets_per_day_quantity_other</item>
|
||||
</plurals>
|
||||
<plurals name="N_retweeted">
|
||||
<item quantity="one">@string/N_retweeted_quantity_one</item>
|
||||
<item quantity="other">@string/N_retweeted_quantity_other</item>
|
||||
</plurals>
|
||||
|
||||
</resources>
|
|
@ -88,6 +88,11 @@
|
|||
<string name="display_profile_image">Display profile image</string>
|
||||
<string name="image_load_summary">Disabling this will increase list scroll speed and reduce data usage.</string>
|
||||
<string name="in_reply_to_name">In reply to <xliff:g id="user_name">%s</xliff:g></string>
|
||||
<string name="name_retweeted"><xliff:g id="user_name">%s</xliff:g> retweeted</string>
|
||||
<string name="name_and_another_retweeted"><xliff:g id="user_name">%1$s</xliff:g> and another retweeted</string>
|
||||
<string name="name_and_count_retweeted"><xliff:g id="user_name">%1$s</xliff:g> and <xliff:g id="retweet_count">%2$d</xliff:g> others retweeted</string>
|
||||
<string name="N_retweeted_quantity_one"><xliff:g id="retweet_count">%d</xliff:g> retweet</string>
|
||||
<string name="N_retweeted_quantity_other"><xliff:g id="retweet_count">%d</xliff:g> retweets</string>
|
||||
<string name="retweeted_by_name">Retweeted by <xliff:g id="user_name">%s</xliff:g></string>
|
||||
<string name="retweeted_by_name_with_count">Retweeted by <xliff:g id="user_name">%1$s</xliff:g> and <xliff:g id="retweet_count">%2$d</xliff:g> others</string>
|
||||
<string name="retweeted_by_count">Retweeted by <xliff:g id="retweet_count">%d</xliff:g> users</string>
|
||||
|
|
|
@ -168,11 +168,24 @@
|
|||
|
||||
<style name="Widget.ProfileImage.Large">
|
||||
<item name="android:background">@drawable/bg_oval_black</item>
|
||||
<item name="android:paddingTop">1dp</item>
|
||||
<item name="android:paddingLeft">2dp</item>
|
||||
<item name="android:paddingRight">2dp</item>
|
||||
<item name="android:paddingBottom">3dp</item>
|
||||
<item name="elevation">@dimen/elevation_card</item>
|
||||
<item name="borderWidth">2dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Light.ProfileImage.Large">
|
||||
<item name="android:background">@drawable/bg_oval_white</item>
|
||||
<item name="android:paddingTop">1dp</item>
|
||||
<item name="android:paddingLeft">2dp</item>
|
||||
<item name="android:paddingRight">2dp</item>
|
||||
<item name="android:paddingBottom">3dp</item>
|
||||
<item name="elevation">@dimen/elevation_card</item>
|
||||
<item name="borderWidth">2dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.ProfileType" parent="android:Widget.DeviceDefault">
|
||||
</style>
|
||||
</resources>
|
|
@ -57,6 +57,10 @@
|
|||
<item name="listMenuOverflowButton">@drawable/ic_list_menu_moreoverflow_normal_holo_dark
|
||||
</item>
|
||||
<item name="cardItemViewStyle">@style/Widget.CardItemView</item>
|
||||
|
||||
<!-- Twidere specific styles -->
|
||||
<item name="menuIconColor">@color/action_icon_light</item>
|
||||
<item name="menuIconColorActionBar">?menuIconColor</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Twidere.Light" parent="android:Theme.DeviceDefault.Light.DarkActionBar">
|
||||
|
@ -102,6 +106,10 @@
|
|||
<item name="listMenuOverflowButton">@drawable/ic_list_menu_moreoverflow_normal_holo_light
|
||||
</item>
|
||||
<item name="cardItemViewStyle">@style/Widget.CardItemView.Light</item>
|
||||
|
||||
<!-- Twidere specific styles -->
|
||||
<item name="menuIconColor">@color/action_icon_dark</item>
|
||||
<item name="menuIconColorActionBar">@color/action_icon_light</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Twidere.Dark.Transparent">
|
||||
|
@ -173,6 +181,10 @@
|
|||
<item name="listMenuOverflowButton">@drawable/ic_list_menu_moreoverflow_normal_holo_dark
|
||||
</item>
|
||||
<item name="cardItemViewStyle">@style/Widget.CardItemView</item>
|
||||
|
||||
<!-- Twidere specific styles -->
|
||||
<item name="menuIconColor">@color/action_icon_light</item>
|
||||
<item name="menuIconColorActionBar">?menuIconColor</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Twidere.Light.Dialog" parent="android:Theme.DeviceDefault.Light.Dialog">
|
||||
|
@ -203,6 +215,10 @@
|
|||
<item name="listMenuOverflowButton">@drawable/ic_list_menu_moreoverflow_normal_holo_light
|
||||
</item>
|
||||
<item name="cardItemViewStyle">@style/Widget.CardItemView.Light</item>
|
||||
|
||||
<!-- Twidere specific styles -->
|
||||
<item name="menuIconColor">@color/action_icon_dark</item>
|
||||
<item name="menuIconColorActionBar">?menuIconColor</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Twidere.Dark.Compose">
|
||||
|
@ -262,6 +278,10 @@
|
|||
<item name="listMenuOverflowButton">@drawable/ic_list_menu_moreoverflow_normal_holo_dark
|
||||
</item>
|
||||
<item name="cardItemViewStyle">@style/Widget.CardItemView</item>
|
||||
|
||||
<!-- Twidere specific styles -->
|
||||
<item name="menuIconColor">@color/action_icon_light</item>
|
||||
<item name="menuIconColorActionBar">?menuIconColor</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Twidere.Viewer.Transparent">
|
||||
|
@ -361,6 +381,10 @@
|
|||
<item name="listMenuOverflowButton">@drawable/ic_list_menu_moreoverflow_normal_holo_dark
|
||||
</item>
|
||||
<item name="cardItemViewStyle">@style/Widget.CardItemView</item>
|
||||
|
||||
<!-- Twidere specific styles -->
|
||||
<item name="menuIconColor">@color/action_icon_light</item>
|
||||
<item name="menuIconColorActionBar">?menuIconColor</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Twidere.Settings.Light" parent="android:Theme.DeviceDefault.Light">
|
||||
|
@ -397,6 +421,10 @@
|
|||
<item name="listMenuOverflowButton">@drawable/ic_list_menu_moreoverflow_normal_holo_light
|
||||
</item>
|
||||
<item name="cardItemViewStyle">@style/Widget.CardItemView.Light</item>
|
||||
|
||||
<!-- Twidere specific styles -->
|
||||
<item name="menuIconColor">@color/action_icon_dark</item>
|
||||
<item name="menuIconColorActionBar">?menuIconColor</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Twidere.Settings.Light.DarkActionBar" parent="android:Theme.DeviceDefault.Light.DarkActionBar">
|
||||
|
@ -433,6 +461,10 @@
|
|||
<item name="listMenuOverflowButton">@drawable/ic_list_menu_moreoverflow_normal_holo_light
|
||||
</item>
|
||||
<item name="cardItemViewStyle">@style/Widget.CardItemView.Light</item>
|
||||
|
||||
<!-- Twidere specific styles -->
|
||||
<item name="menuIconColor">@color/action_icon_dark</item>
|
||||
<item name="menuIconColorActionBar">@color/action_icon_light</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Twidere.Settings.Light.DarkActionBar.DarkIcon"/>
|
||||
|
|