improved status quote

improved compose
fixed draft deletion
This commit is contained in:
Mariotaku Lee 2015-08-08 21:10:06 +08:00
parent 533d8ed0ae
commit d272a2785f
74 changed files with 370 additions and 138 deletions

View File

@ -39,8 +39,8 @@ android {
dependencies {
apt 'com.bluelinelabs:logansquare-compiler:1.1.0'
apt 'com.hannesdorfmann.parcelableplease:processor:1.0.1'
compile 'com.android.support:support-annotations:22.2.0'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:support-annotations:22.2.1'
compile 'com.android.support:support-v4:22.2.1'
compile 'com.bluelinelabs:logansquare:1.1.0'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.github.mariotaku:RestFu:0.9'

View File

@ -219,5 +219,6 @@ public interface IntentConstants {
String EXTRA_DESTINATION = "destination";
String EXTRA_ACTIVITY_OPTIONS = "activity_options";
String EXTRA_MAKE_GAP = "make_gap";
String EXTRA_QUOTE_ORIGINAL_STATUS = "quote_original_status";
}

View File

@ -208,15 +208,6 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
@JsonField(name = "quote_source")
public String quote_source;
@ParcelableThisPlease
@JsonField(name = "quote_retweet_count")
public long quote_retweet_count;
@ParcelableThisPlease
@JsonField(name = "quote_favorite_count")
public long quote_favorite_count;
@ParcelableThisPlease
@JsonField(name = "quote_reply_count")
public long quote_reply_count;
@ParcelableThisPlease
@JsonField(name = "quoted_by_user_name")
public String quoted_by_user_name;
@ParcelableThisPlease
@ -312,9 +303,6 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
quoted_by_user_is_protected = idx.quoted_by_user_is_protected != -1 && c.getShort(idx.quoted_by_user_is_protected) == 1;
quoted_by_user_is_verified = idx.quoted_by_user_is_verified != -1 && c.getShort(idx.quoted_by_user_is_verified) == 1;
quote_source = idx.quote_source != -1 ? c.getString(idx.quote_source) : null;
quote_retweet_count = idx.quote_retweet_count != -1 ? c.getLong(idx.quote_retweet_count) : -1;
quote_favorite_count = idx.quote_favorite_count != -1 ? c.getLong(idx.quote_favorite_count) : -1;
quote_reply_count = idx.quote_reply_count != -1 ? c.getLong(idx.quote_reply_count) : -1;
card_name = card != null ? card.name : null;
}
@ -372,9 +360,6 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
quote_text_plain = orig.quote_text_plain;
quote_text_unescaped = orig.quote_text_unescaped;
quote_source = orig.quote_source;
quote_retweet_count = orig.quote_retweet_count;
quote_favorite_count = orig.quote_favorite_count;
quote_reply_count = orig.quote_reply_count;
quoted_by_user_is_protected = orig.quoted_by_user_is_protected;
quoted_by_user_is_verified = orig.quoted_by_user_is_verified;
card_name = card != null ? card.name : null;
@ -405,9 +390,6 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
quote_text_unescaped = HtmlEscapeHelper.toPlainText(quote_text_html);
quote_timestamp = orig.getCreatedAt().getTime();
quote_source = orig.getSource();
quote_retweet_count = orig.getRetweetCount();
quote_favorite_count = orig.getFavoriteCount();
quote_reply_count = orig.getReplyCount();
quoted_by_user_id = quote_user != null ? quote_user.getId() : -1;
quoted_by_user_name = quote_user != null ? quote_user.getName() : null;
@ -424,6 +406,11 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
} else {
status = orig;
}
retweet_count = (retweeted != null ? retweeted : orig).getRetweetCount();
favorite_count = (retweeted != null ? retweeted : orig).getFavoriteCount();
reply_count = (retweeted != null ? retweeted : orig).getReplyCount();
final User user = status.getUser();
user_id = user.getId();
user_name = user.getName();
@ -436,9 +423,6 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
media = ParcelableMedia.fromStatus(status);
quote_media = quoted != null ? ParcelableMedia.fromStatus(orig) : null;
text_plain = TwitterContentUtils.unescapeTwitterStatusText(status.getText());
retweet_count = status.getRetweetCount();
favorite_count = status.getFavoriteCount();
reply_count = status.getReplyCount();
in_reply_to_name = TwitterContentUtils.getInReplyToName(retweeted != null ? retweeted : orig);
in_reply_to_screen_name = (retweeted != null ? retweeted : orig).getInReplyToScreenName();
in_reply_to_status_id = (retweeted != null ? retweeted : orig).getInReplyToStatusId();
@ -542,9 +526,6 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
", quote_text_plain='" + quote_text_plain + '\'' +
", quote_text_unescaped='" + quote_text_unescaped + '\'' +
", quote_source='" + quote_source + '\'' +
", quote_retweet_count=" + quote_retweet_count +
", quote_favorite_count=" + quote_favorite_count +
", quote_reply_count=" + quote_reply_count +
", quoted_by_user_name='" + quoted_by_user_name + '\'' +
", quoted_by_user_screen_name='" + quoted_by_user_screen_name + '\'' +
", quoted_by_user_profile_image='" + quoted_by_user_profile_image + '\'' +
@ -582,9 +563,8 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
retweeted_by_user_id, user_id, source, retweet_count, favorite_count, reply_count,
is_possibly_sensitive, is_following, media, mentions, quote_media, card_name, card,
place_full_name, is_quote, quote_id, quote_text_html, quote_text_plain, quote_text_unescaped,
quote_timestamp, quote_source, quote_retweet_count, quote_favorite_count, quote_reply_count,
quoted_by_user_id, quoted_by_user_name, quoted_by_user_screen_name, quoted_by_user_profile_image,
quoted_by_user_is_protected, quoted_by_user_is_verified;
quote_timestamp, quote_source, quoted_by_user_id, quoted_by_user_name, quoted_by_user_screen_name,
quoted_by_user_profile_image, quoted_by_user_is_protected, quoted_by_user_is_verified;
public CursorIndices(final Cursor cursor) {
super(cursor);
@ -622,9 +602,6 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
quote_text_unescaped = cursor.getColumnIndex(Statuses.QUOTE_TEXT_UNESCAPED);
quote_timestamp = cursor.getColumnIndex(Statuses.QUOTE_TIMESTAMP);
quote_source = cursor.getColumnIndex(Statuses.QUOTE_SOURCE);
quote_retweet_count = cursor.getColumnIndex(Statuses.QUOTE_RETWEET_COUNT);
quote_favorite_count = cursor.getColumnIndex(Statuses.QUOTE_FAVORITE_COUNT);
quote_reply_count = cursor.getColumnIndex(Statuses.QUOTE_REPLY_COUNT);
quoted_by_user_id = cursor.getColumnIndex(Statuses.QUOTED_BY_USER_ID);
quoted_by_user_name = cursor.getColumnIndex(Statuses.QUOTED_BY_USER_NAME);
quoted_by_user_screen_name = cursor.getColumnIndex(Statuses.QUOTED_BY_USER_SCREEN_NAME);
@ -706,9 +683,6 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
", quote_text_unescaped=" + quote_text_unescaped +
", quote_timestamp=" + quote_timestamp +
", quote_source=" + quote_source +
", quote_retweet_count=" + quote_retweet_count +
", quote_favorite_count=" + quote_favorite_count +
", quote_reply_count=" + quote_reply_count +
", quoted_by_user_id=" + quoted_by_user_id +
", quoted_by_user_name=" + quoted_by_user_name +
", quoted_by_user_screen_name=" + quoted_by_user_screen_name +

View File

@ -801,9 +801,6 @@ public interface TwidereDataStore {
String QUOTE_MEDIA_JSON = "quote_media_json";
String QUOTE_TIMESTAMP = "quote_timestamp";
String QUOTE_SOURCE = "quote_source";
String QUOTE_RETWEET_COUNT = "quote_retweet_count";
String QUOTE_FAVORITE_COUNT = "quote_favorite_count";
String QUOTE_REPLY_COUNT = "quote_reply_count";
String QUOTED_BY_USER_ID = "quoted_by_user_id";
String QUOTED_BY_USER_NAME = "quoted_by_user_name";
String QUOTED_BY_USER_SCREEN_NAME = "quoted_by_user_screen_name";
@ -817,21 +814,21 @@ public interface TwidereDataStore {
IN_REPLY_TO_USER_SCREEN_NAME, SOURCE, LOCATION, RETWEET_COUNT, FAVORITE_COUNT, REPLY_COUNT,
RETWEET_ID, RETWEET_TIMESTAMP, RETWEETED_BY_USER_ID, RETWEETED_BY_USER_NAME,
RETWEETED_BY_USER_SCREEN_NAME, RETWEETED_BY_USER_PROFILE_IMAGE, QUOTE_ID, QUOTE_TEXT_HTML,
QUOTE_TEXT_PLAIN, QUOTE_TEXT_UNESCAPED, QUOTE_TIMESTAMP, QUOTE_SOURCE, QUOTE_RETWEET_COUNT,
QUOTE_FAVORITE_COUNT, QUOTE_REPLY_COUNT, QUOTED_BY_USER_ID, QUOTED_BY_USER_NAME,
QUOTED_BY_USER_SCREEN_NAME, QUOTED_BY_USER_PROFILE_IMAGE, QUOTED_BY_USER_IS_VERIFIED,
QUOTED_BY_USER_IS_PROTECTED, MY_RETWEET_ID, IS_RETWEET, IS_QUOTE, IS_FAVORITE, IS_PROTECTED,
IS_VERIFIED, IS_FOLLOWING, IS_GAP, IS_POSSIBLY_SENSITIVE, MEDIA_JSON, MENTIONS_JSON,
QUOTE_MEDIA_JSON, CARD_NAME, CARD, PLACE_FULL_NAME};
QUOTE_TEXT_PLAIN, QUOTE_TEXT_UNESCAPED, QUOTE_TIMESTAMP, QUOTE_SOURCE, QUOTED_BY_USER_ID,
QUOTED_BY_USER_NAME, QUOTED_BY_USER_SCREEN_NAME, QUOTED_BY_USER_PROFILE_IMAGE,
QUOTED_BY_USER_IS_VERIFIED, QUOTED_BY_USER_IS_PROTECTED, MY_RETWEET_ID, IS_RETWEET,
IS_QUOTE, IS_FAVORITE, IS_PROTECTED, IS_VERIFIED, IS_FOLLOWING, IS_GAP,
IS_POSSIBLY_SENSITIVE, MEDIA_JSON, MENTIONS_JSON, QUOTE_MEDIA_JSON, CARD_NAME, CARD,
PLACE_FULL_NAME};
String[] TYPES = {TYPE_PRIMARY_KEY, TYPE_INT, TYPE_INT,
TYPE_INT, TYPE_INT, TYPE_TEXT, TYPE_TEXT, TYPE_TEXT, TYPE_TEXT, TYPE_TEXT, TYPE_TEXT,
TYPE_INT, TYPE_INT, TYPE_TEXT, TYPE_TEXT, TYPE_TEXT, TYPE_TEXT, TYPE_INT,
TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_TEXT, TYPE_TEXT,
TYPE_TEXT, TYPE_INT, TYPE_TEXT, TYPE_TEXT, TYPE_TEXT, TYPE_INT, TYPE_TEXT, TYPE_INT,
TYPE_INT, TYPE_INT, TYPE_INT, TYPE_TEXT, TYPE_TEXT, TYPE_TEXT, TYPE_BOOLEAN, TYPE_BOOLEAN,
TYPE_INT, TYPE_BOOLEAN, TYPE_BOOLEAN, TYPE_BOOLEAN, TYPE_BOOLEAN, TYPE_BOOLEAN,
TYPE_BOOLEAN, TYPE_BOOLEAN, TYPE_BOOLEAN, TYPE_TEXT, TYPE_TEXT, TYPE_TEXT, TYPE_TEXT,
TYPE_TEXT, TYPE_TEXT, TYPE_TEXT, TYPE_BOOLEAN, TYPE_BOOLEAN, TYPE_INT, TYPE_BOOLEAN,
TYPE_BOOLEAN, TYPE_BOOLEAN, TYPE_BOOLEAN, TYPE_BOOLEAN, TYPE_BOOLEAN, TYPE_BOOLEAN,
TYPE_BOOLEAN, TYPE_TEXT, TYPE_TEXT, TYPE_TEXT, TYPE_TEXT,
TYPE_TEXT, TYPE_TEXT};
}

View File

@ -325,6 +325,8 @@ public final class ContentValuesCreator implements TwidereConstants {
values.put(Statuses.ACCOUNT_ID, accountId);
values.put(Statuses.STATUS_ID, orig.getId());
values.put(Statuses.STATUS_TIMESTAMP, orig.getCreatedAt().getTime());
final Status status;
if (orig.isRetweet()) {
final Status retweetedStatus = orig.getRetweetedStatus();
@ -354,9 +356,6 @@ public final class ContentValuesCreator implements TwidereConstants {
values.put(Statuses.QUOTE_TEXT_UNESCAPED, toPlainText(textHtml));
values.put(Statuses.QUOTE_TIMESTAMP, orig.getCreatedAt().getTime());
values.put(Statuses.QUOTE_SOURCE, orig.getSource());
values.put(Statuses.QUOTE_RETWEET_COUNT, orig.getRetweetCount());
values.put(Statuses.QUOTE_FAVORITE_COUNT, orig.getFavoriteCount());
values.put(Statuses.QUOTE_REPLY_COUNT, orig.getReplyCount());
final ParcelableMedia[] quoteMedia = ParcelableMedia.fromStatus(orig);
if (quoteMedia != null && quoteMedia.length > 0) {
try {
@ -381,11 +380,19 @@ public final class ContentValuesCreator implements TwidereConstants {
values.put(Statuses.IN_REPLY_TO_USER_ID, status.getInReplyToUserId());
values.put(Statuses.IN_REPLY_TO_USER_NAME, TwitterContentUtils.getInReplyToName(status));
values.put(Statuses.IN_REPLY_TO_USER_SCREEN_NAME, status.getInReplyToScreenName());
values.put(Statuses.RETWEET_COUNT, status.getRetweetCount());
values.put(Statuses.FAVORITE_COUNT, status.getFavoriteCount());
values.put(Statuses.REPLY_COUNT, status.getReplyCount());
} else {
values.put(Statuses.IN_REPLY_TO_STATUS_ID, orig.getInReplyToStatusId());
values.put(Statuses.IN_REPLY_TO_USER_ID, orig.getInReplyToUserId());
values.put(Statuses.IN_REPLY_TO_USER_NAME, TwitterContentUtils.getInReplyToName(orig));
values.put(Statuses.IN_REPLY_TO_USER_SCREEN_NAME, orig.getInReplyToScreenName());
values.put(Statuses.RETWEET_COUNT, orig.getRetweetCount());
values.put(Statuses.FAVORITE_COUNT, orig.getFavoriteCount());
values.put(Statuses.REPLY_COUNT, orig.getReplyCount());
}
final User user = status.getUser();
final long userId = user.getId();
@ -402,9 +409,6 @@ public final class ContentValuesCreator implements TwidereConstants {
values.put(Statuses.TEXT_HTML, textHtml);
values.put(Statuses.TEXT_PLAIN, TwitterContentUtils.unescapeTwitterStatusText(status.getText()));
values.put(Statuses.TEXT_UNESCAPED, toPlainText(textHtml));
values.put(Statuses.RETWEET_COUNT, status.getRetweetCount());
values.put(Statuses.REPLY_COUNT, status.getReplyCount());
values.put(Statuses.FAVORITE_COUNT, status.getFavoriteCount());
values.put(Statuses.SOURCE, status.getSource());
values.put(Statuses.IS_POSSIBLY_SENSITIVE, status.isPossiblySensitive());
final GeoLocation location = status.getGeoLocation();

View File

@ -59,10 +59,10 @@ dependencies {
apt 'com.bluelinelabs:logansquare-compiler:1.1.0'
apt 'com.hannesdorfmann.parcelableplease:processor:1.0.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v13:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.android.support:support-v13:22.2.1'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:cardview-v7:22.2.1'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.twitter:twitter-text:1.12.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
compile 'com.squareup:otto:1.3.7'

View File

@ -0,0 +1,40 @@
/*
* Twidere - Twitter client for Android
*
* Copyright (C) 2012-2015 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 edu.tsinghua.hotmobi.model;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.mariotaku.twidere.api.twitter.model.Location;
/**
* Created by mariotaku on 15/8/8.
*/
@JsonObject
public class BaseEvent {
@JsonField(name = "start_time")
long startTime;
@JsonField(name = "end_time")
long endTime;
@JsonField(name = "time_offset")
long timeOffset;
@JsonField(name = "location")
Location location;
}

View File

@ -0,0 +1,37 @@
/*
* Twidere - Twitter client for Android
*
* Copyright (C) 2012-2015 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 edu.tsinghua.hotmobi.model;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import java.util.Map;
/**
* Created by mariotaku on 15/8/8.
*/
@JsonObject
public class FirstLaunchEvent extends BaseEvent{
@JsonField(name = "device_id")
String deviceId;
@JsonField(name = "configuration")
Map<String, String> configuration;
}

View File

@ -0,0 +1,36 @@
/*
* Twidere - Twitter client for Android
*
* Copyright (C) 2012-2015 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 edu.tsinghua.hotmobi.model;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
/**
* Created by mariotaku on 15/8/8.
*/
@JsonObject
public class RefreshEvent extends BaseEvent {
@JsonField(name = "ids")
long[] ids;
@JsonField(name = "timeline_type")
int timelineType;
}

View File

@ -0,0 +1,34 @@
/*
* Twidere - Twitter client for Android
*
* Copyright (C) 2012-2015 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 edu.tsinghua.hotmobi.model;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
/**
* Created by mariotaku on 15/8/8.
*/
@JsonObject
public class ScrollRecord {
@JsonField(name = "count")
long count;
@JsonField(name = "total")
long total;
}

View File

@ -0,0 +1,32 @@
/*
* Twidere - Twitter client for Android
*
* Copyright (C) 2012-2015 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 edu.tsinghua.hotmobi.model;
import java.util.Map;
/**
* Created by mariotaku on 15/8/8.
*/
public class SessionEvent extends BaseEvent {
Map<String, ScrollRecord> scrollRecords;
}

View File

@ -0,0 +1,42 @@
/*
* Twidere - Twitter client for Android
*
* Copyright (C) 2012-2015 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 edu.tsinghua.hotmobi.model;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.mariotaku.twidere.api.twitter.model.Location;
/**
* Created by mariotaku on 15/8/7.
*/
@JsonObject
public class TweetEvent extends BaseEvent{
@JsonField(name = "id")
long id;
@JsonField(name = "user_id")
long userId;
@JsonField(name = "tweet_type")
int tweetType;
@JsonField(name = "timeline_type")
int timelineType;
}

View File

@ -33,7 +33,7 @@ import static org.mariotaku.twidere.annotation.Preference.Type.STRING;
public interface Constants extends TwidereConstants {
String DATABASES_NAME = "twidere.sqlite";
int DATABASES_VERSION = 104;
int DATABASES_VERSION = 105;
int MENU_GROUP_STATUS_EXTENSION = 10;
int MENU_GROUP_COMPOSE_EXTENSION = 11;

View File

@ -62,7 +62,10 @@ import android.text.Spannable;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.style.CharacterStyle;
import android.text.style.ImageSpan;
import android.text.style.MetricAffectingSpan;
import android.text.style.URLSpan;
import android.util.Log;
import android.view.ActionMode;
import android.view.ActionMode.Callback;
@ -752,6 +755,13 @@ public class ComposeActivity extends ThemedFragmentActivity implements LocationL
s.delete(s.getSpanStart(delete), s.getSpanEnd(delete));
s.removeSpan(delete);
}
for (Object span : s.getSpans(0, s.length(), CharacterStyle.class)) {
if (span instanceof URLSpan) {
s.removeSpan(span);
} else if (span instanceof MetricAffectingSpan) {
s.removeSpan(span);
}
}
}
});
mEditText.setCustomSelectionActionModeCallback(this);
@ -934,7 +944,12 @@ public class ComposeActivity extends ThemedFragmentActivity implements LocationL
private boolean handleQuoteIntent(final ParcelableStatus status) {
if (status == null || status.id <= 0) return false;
mEditText.setText(Utils.getQuoteStatus(this, status.id, status.user_screen_name, status.text_plain));
if (status.is_quote) {
mEditText.setText(Utils.getQuoteStatus(this, status.quote_id, status.quoted_by_user_screen_name,
status.quote_text_plain));
} else {
mEditText.setText(Utils.getQuoteStatus(this, status.id, status.user_screen_name, status.text_plain));
}
mEditText.setSelection(0);
mAccountsAdapter.setSelectedAccountIds(status.account_id);
return true;

View File

@ -417,13 +417,26 @@ public class AccountsDashboardFragment extends BaseSupportFragment implements Lo
mFloatingProfileImageSnapshotView = (ImageView) mAccountSelectorView.findViewById(R.id.floating_profile_image_snapshot);
mAccountProfileNameView = (TextView) mAccountSelectorView.findViewById(R.id.name);
mAccountProfileScreenNameView = (TextView) mAccountSelectorView.findViewById(R.id.screen_name);
mAccountsToggleMenu = (ActionMenuView) mAccountSelectorView.findViewById(R.id.toggle_menu);
mAccountsToggleMenu = (ActionMenuView) mAccountSelectorView.findViewById(R.id.account_dashboard_menu);
final SupportMenuInflater menuInflater = new SupportMenuInflater(context);
menuInflater.inflate(R.menu.action_dashboard_timeline_toggle, mAccountsToggleMenu.getMenu());
mAccountsToggleMenu.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if (item.getGroupId() != AccountToggleProvider.MENU_GROUP) return false;
if (item.getGroupId() != AccountToggleProvider.MENU_GROUP) {
switch (item.getItemId()) {
case R.id.compose: {
final ParcelableAccount account = mAccountsAdapter.getSelectedAccount();
if (account == null) return true;
final Intent composeIntent = new Intent(INTENT_ACTION_COMPOSE);
composeIntent.setClass(getActivity(), ComposeActivity.class);
composeIntent.putExtra(EXTRA_ACCOUNT_IDS, new long[]{account.account_id});
startActivity(composeIntent);
return true;
}
}
return false;
}
final ParcelableAccount[] accounts = mAccountActionProvider.getAccounts();
final ParcelableAccount account = accounts[item.getOrder()];
final ContentValues values = new ContentValues();
@ -480,9 +493,9 @@ public class AccountsDashboardFragment extends BaseSupportFragment implements Lo
void initAccountActionsAdapter(ParcelableAccount[] accounts) {
mAccountOptionsAdapter.clear();
mAccountOptionsAdapter.add(new OptionItem(android.R.string.search_go, R.drawable.ic_action_search, R.id.search));
if (accounts.length > 1) {
mAccountOptionsAdapter.add(new OptionItem(R.string.compose, R.drawable.ic_action_status_compose, R.id.compose));
}
// if (accounts.length > 1) {
// mAccountOptionsAdapter.add(new OptionItem(R.string.compose, R.drawable.ic_action_status_compose, R.id.compose));
// }
mAccountOptionsAdapter.add(new OptionItem(R.string.favorites, R.drawable.ic_action_star, R.id.favorites));
mAccountOptionsAdapter.add(new OptionItem(R.string.lists, R.drawable.ic_action_list, R.id.lists));
}

View File

@ -79,7 +79,10 @@ public class RetweetQuoteDialogFragment extends BaseSupportDialogFragment implem
}
case DialogInterface.BUTTON_NEUTRAL: {
final Intent intent = new Intent(INTENT_ACTION_QUOTE);
final Menu menu = mPopupMenu.getMenu();
final MenuItem quoteOriginalStatus = menu.findItem(R.id.quote_original_status);
intent.putExtra(EXTRA_STATUS, status);
intent.putExtra(EXTRA_QUOTE_ORIGINAL_STATUS, quoteOriginalStatus.isChecked());
startActivity(intent);
break;
}

View File

@ -610,9 +610,9 @@ public class StatusFragment extends BaseSupportFragment implements LoaderCallbac
private final TextView retweetedByView;
private final View repliesContainer, retweetsContainer, favoritesContainer;
private final TextView repliesCountView, retweetsCountView, favoritesCountView;
private final TextView quoteOriginalLink;
private final ColorLabelRelativeLayout profileContainer;
private final View retweetedByContainer;
private final View mediaPreviewContainer;
private final View mediaPreviewLoad;
private final CardMediaContainer mediaPreview;
@ -638,7 +638,6 @@ public class StatusFragment extends BaseSupportFragment implements LoaderCallbac
profileTypeView = (ImageView) itemView.findViewById(R.id.profile_type);
timeSourceView = (TextView) itemView.findViewById(R.id.time_source);
retweetedByView = (TextView) itemView.findViewById(R.id.retweeted_by);
retweetedByContainer = itemView.findViewById(R.id.retweeted_by_container);
repliesContainer = itemView.findViewById(R.id.replies_container);
retweetsContainer = itemView.findViewById(R.id.retweets_container);
favoritesContainer = itemView.findViewById(R.id.favorites_container);
@ -649,6 +648,7 @@ public class StatusFragment extends BaseSupportFragment implements LoaderCallbac
mediaPreviewLoad = itemView.findViewById(R.id.media_preview_load);
mediaPreview = (CardMediaContainer) itemView.findViewById(R.id.media_preview);
locationView = (TextView) itemView.findViewById(R.id.location_view);
quoteOriginalLink = (TextView) itemView.findViewById(R.id.quote_original_link);
profileContainer = (ColorLabelRelativeLayout) itemView.findViewById(R.id.profile_container);
twitterCard = (TwitterCardContainer) itemView.findViewById(R.id.twitter_card);
@ -676,10 +676,10 @@ public class StatusFragment extends BaseSupportFragment implements LoaderCallbac
final String retweetedBy = manager.getDisplayName(status.retweeted_by_user_id,
status.retweeted_by_user_name, status.retweeted_by_user_screen_name, nameFirst, false);
retweetedByView.setText(context.getString(R.string.name_retweeted, retweetedBy));
retweetedByContainer.setVisibility(View.VISIBLE);
retweetedByView.setVisibility(View.VISIBLE);
} else {
retweetedByView.setText(null);
retweetedByContainer.setVisibility(View.GONE);
retweetedByView.setVisibility(View.GONE);
}
profileContainer.drawEnd(Utils.getAccountColor(context, status.account_id));
@ -696,13 +696,13 @@ public class StatusFragment extends BaseSupportFragment implements LoaderCallbac
screenNameView.setText("@" + status.quoted_by_user_screen_name);
quoteTextView.setText(Html.fromHtml(status.quote_text_html));
Utils.applyOriginalTweetSpan(quoteTextView, status);
linkify.applyAllLinks(quoteTextView, status.account_id, layoutPosition, status.is_possibly_sensitive);
ThemeUtils.applyParagraphSpacing(quoteTextView, 1.1f);
loader.displayProfileImage(profileImageView, status.quoted_by_user_profile_image);
quoteOriginalLink.setVisibility(View.VISIBLE);
quotedNameContainer.setVisibility(View.VISIBLE);
quoteTextView.setVisibility(View.VISIBLE);
quoteIndicator.setVisibility(View.VISIBLE);
@ -723,6 +723,7 @@ public class StatusFragment extends BaseSupportFragment implements LoaderCallbac
loader.displayProfileImage(profileImageView, status.user_profile_image_url);
quoteOriginalLink.setVisibility(View.GONE);
quotedNameContainer.setVisibility(View.GONE);
quoteTextView.setVisibility(View.GONE);
quoteIndicator.setVisibility(View.GONE);
@ -732,7 +733,11 @@ public class StatusFragment extends BaseSupportFragment implements LoaderCallbac
typeIconRes = Utils.getUserTypeIconRes(status.user_is_verified, status.user_is_protected);
typeDescriptionRes = Utils.getUserTypeDescriptionRes(status.user_is_verified, status.user_is_protected);
timestamp = status.timestamp;
if (status.is_retweet) {
timestamp = status.retweet_timestamp;
} else {
timestamp = status.timestamp;
}
source = status.source;
}
@ -874,7 +879,7 @@ public class StatusFragment extends BaseSupportFragment implements LoaderCallbac
}
break;
}
case R.id.retweeted_by_container: {
case R.id.retweeted_by: {
if (status.retweet_id > 0) {
Utils.openUserProfile(adapter.getContext(), status.account_id, status.retweeted_by_user_id,
status.retweeted_by_user_screen_name, null);
@ -925,7 +930,7 @@ public class StatusFragment extends BaseSupportFragment implements LoaderCallbac
quotedNameContainer.setOnClickListener(this);
retweetsContainer.setOnClickListener(this);
favoritesContainer.setOnClickListener(this);
retweetedByContainer.setOnClickListener(this);
retweetedByView.setOnClickListener(this);
locationView.setOnClickListener(this);
final float defaultTextSize = adapter.getTextSize();

View File

@ -1391,10 +1391,12 @@ public class UserFragment extends BaseSupportFragment implements OnClickListener
mActionBarBackground.setColor(actionBarColor);
}
ActivitySupport.setTaskDescription(activity, new TaskDescriptionCompat(null, null, actionBarColor));
mDescriptionView.setLinkTextColor(color);
final int optimalLinkColor = ThemeUtils.getOptimalLinkColor(color,
mDescriptionView.getCurrentTextColor());
mDescriptionView.setLinkTextColor(optimalLinkColor);
mLocationView.setLinkTextColor(optimalLinkColor);
mURLView.setLinkTextColor(optimalLinkColor);
mProfileBannerView.setBackgroundColor(color);
mLocationView.setLinkTextColor(color);
mURLView.setLinkTextColor(color);
ViewSupport.setBackground(mPagerIndicator, ThemeUtils.getActionBarStackedBackground(activity,
themeRes, color, backgroundOption, true));

View File

@ -220,7 +220,8 @@ public class BackgroundOperationService extends IntentService implements Constan
final long draftId = ParseUtils.parseLong(uri.getLastPathSegment(), -1);
if (draftId == -1) return;
final Expression where = Expression.equals(Drafts._ID, draftId);
final Cursor c = getContentResolver().query(Drafts.CONTENT_URI, Drafts.COLUMNS, where.getSQL(), null, null);
final ContentResolver cr = getContentResolver();
final Cursor c = cr.query(Drafts.CONTENT_URI, Drafts.COLUMNS, where.getSQL(), null, null);
final DraftItem.CursorIndices i = new DraftItem.CursorIndices(c);
final DraftItem item;
try {
@ -229,6 +230,7 @@ public class BackgroundOperationService extends IntentService implements Constan
} finally {
c.close();
}
cr.delete(Drafts.CONTENT_URI, where.getSQL(), null);
if (item.action_type == Drafts.ACTION_UPDATE_STATUS || item.action_type <= 0) {
updateStatuses(new ParcelableStatusUpdate(this, item));
} else if (item.action_type == Drafts.ACTION_SEND_DIRECT_MESSAGE) {

View File

@ -351,7 +351,8 @@ public class ThemeUtils implements Constants {
}
public static int getDrawerThemeResource(final int themeRes) {
return R.style.Theme_Twidere_Drawer_Dark;
if (isDarkTheme(themeRes)) return R.style.Theme_Twidere_Drawer_Dark;
return R.style.Theme_Twidere_Drawer_Light;
}
public static Drawable getImageHighlightDrawable(final Context context) {
@ -370,9 +371,9 @@ public class ThemeUtils implements Constants {
return R.style.Theme_Twidere_Light_NoDisplay;
}
public static int getOptimalLinkColor(int linkColor, int color) {
public static int getOptimalLinkColor(int linkColor, int textColor) {
final int[] yiq = new int[3];
TwidereColorUtils.colorToYIQ(color, yiq);
TwidereColorUtils.colorToYIQ(textColor, yiq);
final int y = yiq[0];
TwidereColorUtils.colorToYIQ(linkColor, yiq);
if (y < 32 && yiq[0] <= ACCENT_COLOR_THRESHOLD) {

View File

@ -3903,27 +3903,6 @@ public final class Utils implements Constants {
return null;
}
public static void applyOriginalTweetSpan(final TextView textView, final ParcelableStatus status) {
if (!status.is_quote) return;
final SpannableStringBuilder text = SpannableStringBuilder.valueOf(textView.getText());
final URLSpan[] spans = text.getSpans(0, text.length(), URLSpan.class);
URLSpan found = null;
String findPattern = "twitter.com/" + status.user_screen_name + "/status/" + status.quote_id;
for (URLSpan span : spans) {
if (span.getURL().contains(findPattern)) {
found = span;
break;
}
}
if (found == null) return;
int start = text.getSpanStart(found), end = text.getSpanEnd(found);
text.replace(start, end, textView.getResources().getString(R.string.original_status));
start = text.getSpanStart(found);
end = text.getSpanEnd(found);
text.setSpan(new OriginalStatusSpan(textView.getContext()), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
textView.setText(text);
}
public static boolean isCustomConsumerKeySecret(String consumerKey, String consumerSecret) {
if (TextUtils.isEmpty(consumerKey) || TextUtils.isEmpty(consumerSecret)) return false;
return (!TWITTER_CONSUMER_KEY.equals(consumerKey) && !TWITTER_CONSUMER_SECRET.equals(consumerKey))

View File

@ -137,7 +137,7 @@ public class StatusViewHolder extends ViewHolder implements Constants, OnClickLi
final Context context = adapter.getContext();
final boolean nameFirst = adapter.isNameFirst();
final long reply_count = status.is_quote ? status.quote_reply_count : status.reply_count;
final long reply_count = status.reply_count;
final long retweet_count;
final long favorite_count;
@ -288,13 +288,12 @@ public class StatusViewHolder extends ViewHolder implements Constants, OnClickLi
if (twitter.isDestroyingStatus(status.account_id, status.my_retweet_id)) {
retweetCountView.setActivated(false);
retweet_count = Math.max(0, (status.is_quote ? status.quote_retweet_count : status.retweet_count) - 1);
retweet_count = Math.max(0, status.retweet_count - 1);
} else {
final boolean creatingRetweet = twitter.isCreatingRetweet(status.account_id, status.id);
retweetCountView.setActivated(creatingRetweet || Utils.isMyRetweet(status.account_id,
status.retweeted_by_user_id, status.my_retweet_id));
retweet_count = (status.is_quote ? status.quote_retweet_count : status.retweet_count)
+ (creatingRetweet ? 1 : 0);
retweet_count = status.retweet_count + (creatingRetweet ? 1 : 0);
}
if (retweet_count > 0) {
retweetCountView.setText(Utils.getLocalizedNumber(locale, retweet_count));
@ -303,12 +302,11 @@ public class StatusViewHolder extends ViewHolder implements Constants, OnClickLi
}
if (twitter.isDestroyingFavorite(status.account_id, status.id)) {
favoriteCountView.setActivated(false);
favorite_count = Math.max(0, (status.is_quote ? status.quote_favorite_count : status.favorite_count) - 1);
favorite_count = Math.max(0, status.favorite_count - 1);
} else {
final boolean creatingFavorite = twitter.isCreatingFavorite(status.account_id, status.id);
favoriteCountView.setActivated(creatingFavorite || status.is_favorite);
favorite_count = (status.is_quote ? status.quote_favorite_count : status.favorite_count)
+ (creatingFavorite ? 1 : 0);
favorite_count = status.favorite_count + (creatingFavorite ? 1 : 0);
}
if (favorite_count > 0) {
favoriteCountView.setText(Utils.getLocalizedNumber(locale, favorite_count));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 473 B

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 972 B

After

Width:  |  Height:  |  Size: 978 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 949 B

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 619 B

After

Width:  |  Height:  |  Size: 633 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 678 B

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 B

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 553 B

After

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 789 B

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 742 B

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 642 B

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 961 B

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 731 B

After

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -125,7 +125,7 @@
android:focusable="false">
<android.support.v7.widget.ActionMenuView
android:id="@+id/toggle_menu"
android:id="@+id/account_dashboard_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"

View File

@ -28,39 +28,27 @@
android:orientation="vertical"
android:splitMotionEvents="false">
<LinearLayout
android:id="@+id/retweeted_by_container"
<org.mariotaku.twidere.view.themed.ThemedTextView
android:id="@+id/retweeted_by"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/element_spacing_minus_normal"
android:background="?selectableItemBackground"
android:clickable="true"
android:paddingLeft="@dimen/element_spacing_small"
android:paddingRight="@dimen/element_spacing_small"
tools:visiblity="visible">
<Space
android:layout_width="@dimen/element_spacing_large"
android:layout_height="wrap_content"
android:layout_margin="@dimen/padding_profile_image_detail_page" />
<org.mariotaku.twidere.view.themed.ThemedTextView
android:id="@+id/retweeted_by"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="@dimen/element_size_small"
android:padding="@dimen/element_spacing_normal"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="Retweeted by Mariotaku" />
</LinearLayout>
android:drawableLeft="@drawable/ic_indicator_retweet"
android:drawablePadding="4dp"
android:drawableStart="@drawable/ic_indicator_retweet"
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:textColor="?android:textColorSecondary"
tools:text="Retweeted by Mariotaku" />
<org.mariotaku.twidere.view.ColorLabelRelativeLayout
android:id="@+id/profile_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/retweeted_by_container"
android:layout_below="@+id/retweeted_by"
android:background="?selectableItemBackground"
android:padding="@dimen/element_spacing_small"
app:ignorePadding="true">
@ -196,7 +184,7 @@
android:id="@+id/quote_indicator"
android:layout_width="@dimen/element_spacing_small"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/counts_container"
android:layout_alignBottom="@+id/quote_original_link"
android:layout_alignTop="@+id/quoted_name_container"
android:layout_marginLeft="@dimen/element_spacing_normal"
android:layout_marginStart="@dimen/element_spacing_normal"
@ -204,7 +192,6 @@
android:visibility="gone"
tools:visibility="visible" />
<LinearLayout
android:id="@+id/quoted_name_container"
android:layout_width="match_parent"
@ -331,15 +318,31 @@
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:textColorSecondary" />
<org.mariotaku.twidere.view.ActionIconThemedTextView
android:id="@+id/quote_original_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/location_view"
android:layout_toEndOf="@+id/quote_indicator"
android:layout_toRightOf="@+id/quote_indicator"
android:background="?selectableItemBackground"
android:drawableLeft="@drawable/ic_indicator_twitter"
android:drawablePadding="4dp"
android:drawableStart="@drawable/ic_indicator_twitter"
android:gravity="center_vertical"
android:padding="@dimen/element_spacing_normal"
android:singleLine="true"
android:text="@string/original_status"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:textColorSecondary" />
<LinearLayout
android:id="@+id/counts_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/location_view"
android:layout_below="@+id/quote_original_link"
android:layout_marginLeft="@dimen/element_spacing_small"
android:layout_marginRight="@dimen/element_spacing_small"
android:layout_toEndOf="@+id/quote_indicator"
android:layout_toRightOf="@+id/quote_indicator"
android:orientation="horizontal"
android:splitMotionEvents="false">

View File

@ -20,10 +20,18 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@id/compose"
android:icon="@drawable/ic_action_status_compose"
android:title="@string/compose"
app:showAsAction="always" />
<item
android:id="@id/select_account"
android:enabled="false"
android:icon="@drawable/ic_action_more_vertical"
android:title="@string/select_account"
android:visible="false"
app:actionProviderClass="org.mariotaku.twidere.menu.support.AccountToggleProvider"
app:showAsAction="always" />

View File

@ -13,6 +13,7 @@
<color name="bg_color_transparent_dark">#ff000000</color>
<color name="bg_color_transparent_light">#ffffffff</color>
<color name="bg_color_drawer_dark">#212121</color>
<color name="bg_color_drawer_light">#ffffff</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>

View File

@ -256,6 +256,11 @@
<item name="android:windowBackground">@color/bg_color_drawer_dark</item>
</style>
<style name="Theme.Twidere.Drawer.Light" parent="Theme.Twidere.Light.NoActionBar">
<!-- Window attributes -->
<item name="android:windowBackground">@color/bg_color_drawer_light</item>
</style>
<style name="Theme.Twidere.Dark.NoDisplay" parent="Theme.Twidere.Dark.NoActionBar">
<item name="android:windowBackground">@null</item>
<item name="android:windowContentOverlay">@null</item>