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