mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
[android] enable image shared element transition for API 21+22
There's an Android framework bug (#224270) on these APIs that causes a NPE when the shared element is not visible anymore when returning. Since we know restore the list position, the shared element should be visible and thus not produce NPEs anymore.
This commit is contained in:
@@ -844,15 +844,11 @@ public class ConversationActivity extends BriarActivity
|
|||||||
i.putExtra(ATTACHMENT_POSITION, attachments.indexOf(item));
|
i.putExtra(ATTACHMENT_POSITION, attachments.indexOf(item));
|
||||||
i.putExtra(NAME, name);
|
i.putExtra(NAME, name);
|
||||||
i.putExtra(DATE, messageItem.getTime());
|
i.putExtra(DATE, messageItem.getTime());
|
||||||
if (SDK_INT >= 23) {
|
// restoring list position should not trigger android bug #224270
|
||||||
String transitionName = item.getTransitionName();
|
String transitionName = item.getTransitionName();
|
||||||
ActivityOptionsCompat options =
|
ActivityOptionsCompat options =
|
||||||
makeSceneTransitionAnimation(this, view, transitionName);
|
makeSceneTransitionAnimation(this, view, transitionName);
|
||||||
ActivityCompat.startActivity(this, i, options.toBundle());
|
ActivityCompat.startActivity(this, i, options.toBundle());
|
||||||
} else {
|
|
||||||
// work-around for android bug #224270
|
|
||||||
startActivity(i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@DatabaseExecutor
|
@DatabaseExecutor
|
||||||
|
|||||||
Reference in New Issue
Block a user