Skip to content

Commit

Permalink
Merge remote-tracking branch 'Upstream/develop' into Upstream_release
Browse files Browse the repository at this point in the history
  • Loading branch information
BlythMeister committed Sep 27, 2013
2 parents b94a07d + 37a616c commit 9337a78
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 12 deletions.
2 changes: 1 addition & 1 deletion android/clientbeta/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tweetlanes.android.beta"
android:versionCode="51"
android:versionName="1.2.1_b7">
android:versionName="1.2.1_b8">



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class AdnPost {
public boolean mIsRetweetedByMe;
public boolean mIsFavorited;
public AdnUser mOriginalAuthor;
public long mOriginalId;
public AdnMedia mEmbeddedMedia;
public URLEntity[] mUrls;

Expand All @@ -60,6 +61,7 @@ public AdnPost(String jsonAsString) {
AdnPost repost = new AdnPost(object.getJSONObject("repost_of")
.toString());
mOriginalAuthor = repost.mUser;
mOriginalId = repost.mId;
mText = repost.mText;
mEmbeddedMedia = repost.mEmbeddedMedia;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public TwitterStatus(AdnPost post) {
mAuthorName = post.mOriginalAuthor.mName;
mAuthorScreenName = post.mOriginalAuthor.mUserName;
SetProfileImagesFromUser(new TwitterUser(post.mOriginalAuthor));
mOriginalRetweetId = post.mOriginalAuthor.mId;
mOriginalRetweetId = post.mOriginalId;
} else {
SetProfileImagesFromUser(new TwitterUser(post.mUser));
}
Expand Down
7 changes: 7 additions & 0 deletions android/libraries/TweetLanesCore/res/layout/account_row.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,11 @@
android:text="ScreenName"
android:textSize="@dimen/account_row_size"
android:layout_marginLeft="10dp"/>

<TextView
android:id="@+id/filler"
android:layout_width="1px"
android:layout_height="48dp"
android:adjustViewBounds="true"
/>
</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
holder.AvatarImage = (ImageView) row.findViewById(R.id.accountAvatar);
holder.ServiceImage = (ImageView) row.findViewById(R.id.serviceImage);
holder.ScreenName = (TextView) row.findViewById(R.id.accountScreenName);
holder.Filler = (TextView) row.findViewById(R.id.filler);

row.setTag(holder);
} else {
Expand All @@ -833,9 +834,11 @@ public View getView(int position, View convertView, ViewGroup parent) {

if (mShowImages) {
setProfileImage(account.AvatarImageUrl, account.ServiceType, holder.AvatarImage, holder.ServiceImage);
holder.Filler.setVisibility(View.GONE);
} else {
holder.AvatarImage.setVisibility(View.GONE);
holder.ServiceImage.setVisibility(View.GONE);
holder.Filler.setVisibility(View.VISIBLE);
}

return row;
Expand All @@ -859,6 +862,7 @@ class AccountHolder {
public ImageView AvatarImage;
public ImageView ServiceImage;
public TextView ScreenName;
public TextView Filler;
}

private void setProfileImage(String profileImageUrl, SocialNetConstant.Type serviceType, ImageView avatar, ImageView service) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ public void UpdateTweetCache(TwitterStatus status, boolean deleteStatus) {
TwitterStatuses selectedStatuses = new TwitterStatuses(cachedStatus);
if (statusFeed != null) statusFeed.remove(selectedStatuses);
if (_mCachedStatusFeed != null) _mCachedStatusFeed.remove(selectedStatuses);

setStatusFeed(getStatusFeed(), true);
mTweetFeedListAdapter.notifyDataSetChanged();
mTweetFeedListView.onRefreshComplete();
updateViewVisibility(true);

} else {
cachedStatus.setFavorite(status.mIsFavorited);
cachedStatus.setRetweet(status.mIsRetweetedByMe);
Expand Down Expand Up @@ -1446,23 +1452,26 @@ public void finished(boolean successful, TwitterStatuses statuses, Integer value
mode.finish();

} else if (itemId == R.id.action_delete_status) {
TwitterStatuses selectedStatuses = getSelectedStatuses();
final TwitterStatuses selected = getSelectedStatuses();
TwitterModifyStatuses.FinishedDeleteCallback callback =
TwitterManager.get().getSetStatusesInstance().new FinishedDeleteCallback(selectedStatuses) {
TwitterManager.get().getSetStatusesInstance().new FinishedDeleteCallback(selected) {

@Override
public void finished(boolean successful, TwitterStatuses statuses, Integer value) {
if (successful) {

showToast(getString(R.string.deleted_successfully));
TwitterStatuses cachedStatuses = getStatusFeed();
TwitterStatuses selectedStatuses = getSelectedStatuses();
if (selectedStatuses != null && selectedStatuses.getStatusCount() > 0) {
if (cachedStatuses != null)
cachedStatuses.remove(selectedStatuses);
if (_mCachedStatusFeed != null)
_mCachedStatusFeed.remove(selectedStatuses);
if (getStatusFeed() != null) {
getStatusFeed().remove(selected);
}
if (_mCachedStatusFeed != null){
_mCachedStatusFeed.remove(selected);
}

setStatusFeed(getStatusFeed(), true);
mTweetFeedListAdapter.notifyDataSetChanged();
mTweetFeedListView.onRefreshComplete();
updateViewVisibility(true);
} else {
if (!mDetached) {
showToast(getString(R.string.deleted_un_successfully));
Expand All @@ -1471,7 +1480,7 @@ public void finished(boolean successful, TwitterStatuses statuses, Integer value
}
};

TwitterManager.get().deleteTweet(selectedStatuses, callback);
TwitterManager.get().deleteTweet(selected, callback);
mode.finish();
} else if (itemId == R.id.action_report_for_spam || itemId == R.id.action_block) {
AccountDescriptor account = getApp().getCurrentAccount();
Expand All @@ -1498,6 +1507,9 @@ public void finished(TwitterFetchResult result, TwitterUsers users) {
if (getStatusFeed() != null) {
getStatusFeed().remove(selected);
}
if (_mCachedStatusFeed != null){
_mCachedStatusFeed.remove(selected);
}

setStatusFeed(getStatusFeed(), true);
mTweetFeedListAdapter.notifyDataSetChanged();
Expand Down

0 comments on commit 9337a78

Please sign in to comment.