mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
Be more explicit with running on main thread
// FREEBIE
This commit is contained in:
parent
99b2149deb
commit
42f613e722
@ -1262,19 +1262,16 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
@Override
|
||||
public void onModified(final Recipient recipient) {
|
||||
titleView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
titleView.setTitle(recipient);
|
||||
titleView.setVerified(identityRecords.isVerified());
|
||||
setBlockedUserState(recipient, isSecureText, isDefaultSms);
|
||||
setActionBarColor(recipient.getColor());
|
||||
setGroupShareProfileReminder(recipient);
|
||||
updateInviteReminder(recipient.hasSeenInviteReminder());
|
||||
updateDefaultSubscriptionId(recipient.getDefaultSubscriptionId());
|
||||
initializeSecurity(isSecureText, isDefaultSms);
|
||||
invalidateOptionsMenu();
|
||||
}
|
||||
Util.runOnMain(() -> {
|
||||
titleView.setTitle(recipient);
|
||||
titleView.setVerified(identityRecords.isVerified());
|
||||
setBlockedUserState(recipient, isSecureText, isDefaultSms);
|
||||
setActionBarColor(recipient.getColor());
|
||||
setGroupShareProfileReminder(recipient);
|
||||
updateInviteReminder(recipient.hasSeenInviteReminder());
|
||||
updateDefaultSubscriptionId(recipient.getDefaultSubscriptionId());
|
||||
initializeSecurity(isSecureText, isDefaultSms);
|
||||
invalidateOptionsMenu();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -69,6 +69,7 @@ import org.thoughtcrime.securesms.sms.OutgoingTextMessage;
|
||||
import org.thoughtcrime.securesms.util.SaveAttachmentTask;
|
||||
import org.thoughtcrime.securesms.util.SaveAttachmentTask.Attachment;
|
||||
import org.thoughtcrime.securesms.util.StickyHeaderDecoration;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
import org.thoughtcrime.securesms.util.task.ProgressDialogAsyncTask;
|
||||
|
||||
@ -491,12 +492,7 @@ public class ConversationFragment extends Fragment
|
||||
|
||||
private void scrollToLastSeenPosition(final int lastSeenPosition) {
|
||||
if (lastSeenPosition > 0) {
|
||||
list.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
((LinearLayoutManager)list.getLayoutManager()).scrollToPositionWithOffset(lastSeenPosition, list.getHeight());
|
||||
}
|
||||
});
|
||||
Util.runOnMain(() -> ((LinearLayoutManager)list.getLayoutManager()).scrollToPositionWithOffset(lastSeenPosition, list.getHeight()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ public class MessageDetailsActivity extends PassphraseRequiredActionBarActivity
|
||||
}
|
||||
|
||||
expiresContainer.setVisibility(View.VISIBLE);
|
||||
expiresInText.post(new Runnable() {
|
||||
Util.runOnMain(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
long elapsed = System.currentTimeMillis() - messageRecord.getExpireStarted();
|
||||
@ -233,7 +233,7 @@ public class MessageDetailsActivity extends PassphraseRequiredActionBarActivity
|
||||
expiresInText.setText(duration);
|
||||
|
||||
if (running) {
|
||||
expiresInText.postDelayed(this, 500);
|
||||
Util.runOnMainDelayed(this, 500);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -29,6 +29,7 @@ import org.thoughtcrime.securesms.scribbles.widget.entity.ImageEntity;
|
||||
import org.thoughtcrime.securesms.scribbles.widget.entity.MotionEntity;
|
||||
import org.thoughtcrime.securesms.scribbles.widget.entity.TextEntity;
|
||||
import org.thoughtcrime.securesms.util.MediaUtil;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.util.concurrent.ListenableFuture;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@ -74,14 +75,11 @@ public class ScribbleActivity extends PassphraseRequiredActionBarActivity implem
|
||||
}
|
||||
|
||||
private void addSticker(final Bitmap pica) {
|
||||
scribbleView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Layer layer = new Layer();
|
||||
ImageEntity entity = new ImageEntity(layer, pica, scribbleView.getWidth(), scribbleView.getHeight());
|
||||
Util.runOnMain(() -> {
|
||||
Layer layer = new Layer();
|
||||
ImageEntity entity = new ImageEntity(layer, pica, scribbleView.getWidth(), scribbleView.getHeight());
|
||||
|
||||
scribbleView.addEntityAndPosition(entity);
|
||||
}
|
||||
scribbleView.addEntityAndPosition(entity);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user