This commit is contained in:
Mariotaku Lee 2016-02-04 21:43:35 +08:00
parent 4259be7c23
commit 4cd79dc78c
2 changed files with 11 additions and 4 deletions

View File

@ -351,4 +351,8 @@ public class TwitterContentUtils {
else
return "ipad_retina";
}
public static long getOriginalId(@NonNull ParcelableStatus status) {
return status.is_retweet ? status.retweet_id : status.id;
}
}

View File

@ -136,6 +136,7 @@ import org.mariotaku.twidere.util.TwidereLinkify;
import org.mariotaku.twidere.util.TwidereMathUtils;
import org.mariotaku.twidere.util.TwitterAPIFactory;
import org.mariotaku.twidere.util.TwitterCardUtils;
import org.mariotaku.twidere.util.TwitterContentUtils;
import org.mariotaku.twidere.util.UserColorNameManager;
import org.mariotaku.twidere.util.Utils;
import org.mariotaku.twidere.util.message.FavoriteCreatedEvent;
@ -1846,11 +1847,13 @@ public class StatusFragment extends BaseSupportFragment implements LoaderCallbac
return mTranslationResult;
}
public void setTranslationResult(TranslationResult translation) {
if (mStatus == null || (translation != null && mStatus.id != translation.getId())) {
return;
public void setTranslationResult(@Nullable TranslationResult translation) {
if (mStatus == null || translation == null || TwitterContentUtils.getOriginalId(mStatus)
!= translation.getId()) {
mTranslationResult = null;
} else {
mTranslationResult = translation;
}
mTranslationResult = translation;
notifyDataSetChanged();
}