Skip to content

Commit d64a40a

Browse files
Merge pull request #1050 from session-foundation/feature/release-1.21.3-merge
Feature/release 1.21.3 merge
2 parents 9353204 + 131e214 commit d64a40a

21 files changed

+121
-109
lines changed

app/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ configurations.configureEach {
1515
exclude module: "commons-logging"
1616
}
1717

18-
def canonicalVersionCode = 397
19-
def canonicalVersionName = "1.21.1"
18+
def canonicalVersionCode = 399
19+
def canonicalVersionName = "1.21.3"
2020

2121
def postFixSize = 10
2222
def abiPostFix = ['armeabi-v7a' : 1,
@@ -350,7 +350,6 @@ dependencies {
350350
implementation "nl.komponents.kovenant:kovenant:$kovenantVersion"
351351
implementation "nl.komponents.kovenant:kovenant-android:$kovenantVersion"
352352
implementation "com.jakewharton.rxbinding3:rxbinding:3.1.0"
353-
implementation "com.github.ybq:Android-SpinKit:1.4.0"
354353
implementation "com.opencsv:opencsv:4.6"
355354
testImplementation "junit:junit:$junitVersion"
356355
testImplementation 'org.assertj:assertj-core:3.11.1'

app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,11 @@ class ConversationActivityV2 : ScreenLockActionBarActivity(), InputBarDelegate,
690690
if (author != null && messageTimestamp >= 0) {
691691
jumpToMessage(author, messageTimestamp, firstLoad.get(), null)
692692
} else {
693-
if (firstLoad.getAndSet(false)) scrollToFirstUnreadMessageIfNeeded(true)
693+
if (firstLoad.getAndSet(false)) {
694+
lifecycleScope.launch(Dispatchers.Main) {
695+
scrollToFirstUnreadMessageIfNeeded(true)
696+
}
697+
}
694698
handleRecyclerViewScrolled()
695699
}
696700
}
@@ -1041,9 +1045,13 @@ class ConversationActivityV2 : ScreenLockActionBarActivity(), InputBarDelegate,
10411045
}
10421046
}
10431047

1044-
private fun scrollToFirstUnreadMessageIfNeeded(isFirstLoad: Boolean = false, shouldHighlight: Boolean = false): Int {
1045-
val lastSeenTimestamp = threadDb.getLastSeenAndHasSent(viewModel.threadId).first()
1046-
val lastSeenItemPosition = adapter.findLastSeenItemPosition(lastSeenTimestamp) ?: return -1
1048+
private suspend fun scrollToFirstUnreadMessageIfNeeded(isFirstLoad: Boolean = false, shouldHighlight: Boolean = false): Int {
1049+
val lastSeenItemPosition = withContext(Dispatchers.Default) {
1050+
val lastSeenTimestamp = threadDb.getLastSeenAndHasSent(viewModel.threadId).first()
1051+
adapter.findLastSeenItemPosition(lastSeenTimestamp)
1052+
}
1053+
1054+
if(lastSeenItemPosition == null) return -1
10471055

10481056
// If this is triggered when first opening a conversation then we want to position the top
10491057
// of the first unread message in the middle of the screen

app/src/main/java/org/thoughtcrime/securesms/conversation/v2/search/SearchBottomBar.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ import android.util.AttributeSet
55
import android.view.LayoutInflater
66
import android.view.View
77
import android.widget.LinearLayout
8-
import com.squareup.phrase.Phrase
98
import network.loki.messenger.R
109
import network.loki.messenger.databinding.ViewSearchBottomBarBinding
11-
import org.session.libsession.utilities.StringSubstitutionConstants.COUNT_KEY
12-
import org.session.libsession.utilities.StringSubstitutionConstants.TOTAL_COUNT_KEY
1310

1411
class SearchBottomBar : LinearLayout {
1512
private lateinit var binding: ViewSearchBottomBarBinding

app/src/main/java/org/thoughtcrime/securesms/mediasend/MediaSendFragment.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public class MediaSendFragment extends Fragment implements ViewTreeObserver.OnGl
7979
private ViewGroup playbackControlsContainer;
8080
private TextView charactersLeft;
8181
private View closeButton;
82+
private View loader;
8283

8384
private ControllableViewPager fragmentPager;
8485
private MediaSendFragmentPagerAdapter fragmentPagerAdapter;
@@ -137,6 +138,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
137138
playbackControlsContainer = view.findViewById(R.id.mediasend_playback_controls_container);
138139
charactersLeft = view.findViewById(R.id.mediasend_characters_left);
139140
closeButton = view.findViewById(R.id.mediasend_close_button);
141+
loader = view.findViewById(R.id.loader);
140142

141143
View sendButtonBkg = view.findViewById(R.id.mediasend_send_button_bkg);
142144

@@ -342,18 +344,12 @@ private void processMedia(@NonNull List<Media> mediaList, @NonNull Map<Uri, Obje
342344

343345
private Stopwatch renderTimer;
344346
private Runnable progressTimer;
345-
private AlertDialog dialog;
346347

347348
@Override
348349
protected void onPreExecute() {
349350
renderTimer = new Stopwatch("ProcessMedia");
350351
progressTimer = () -> {
351-
dialog = new AlertDialog.Builder(new ContextThemeWrapper(requireContext(), R.style.Theme_TextSecure_Dialog_MediaSendProgress))
352-
.setView(R.layout.progress_dialog)
353-
.setCancelable(false)
354-
.create();
355-
dialog.show();
356-
dialog.getWindow().setLayout(getResources().getDimensionPixelSize(R.dimen.mediasend_progress_dialog_size), getResources().getDimensionPixelSize(R.dimen.mediasend_progress_dialog_size));
352+
loader.setVisibility(View.VISIBLE);
357353
};
358354
Util.runOnMainDelayed(progressTimer, 250);
359355
}
@@ -394,9 +390,7 @@ protected List<Media> doInBackground(Void... voids) {
394390
protected void onPostExecute(List<Media> media) {
395391
controller.onSendClicked(media, composeText.getTextTrimmed());
396392
Util.cancelRunnableOnMain(progressTimer);
397-
if (dialog != null) {
398-
dialog.dismiss();
399-
}
393+
loader.setVisibility(View.GONE);
400394
renderTimer.stop(TAG);
401395
}
402396
}.execute();

app/src/main/java/org/thoughtcrime/securesms/notifications/RemoteReplyReceiver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ protected Void doInBackground(Void... params) {
109109
case GroupMessage: {
110110
OutgoingMediaMessage reply = OutgoingMediaMessage.from(message, recipient, Collections.emptyList(), null, null, expiresInMillis, 0);
111111
try {
112-
mmsDatabase.insertMessageOutbox(reply, threadId, false, null, true);
112+
message.setId(mmsDatabase.insertMessageOutbox(reply, threadId, false, null, true));
113113
MessageSender.send(message, address);
114114
} catch (MmsException e) {
115115
Log.w(TAG, e);
@@ -118,7 +118,7 @@ protected Void doInBackground(Void... params) {
118118
}
119119
case SecureMessage: {
120120
OutgoingTextMessage reply = OutgoingTextMessage.from(message, recipient, expiresInMillis, expireStartedAt);
121-
smsDatabase.insertMessageOutbox(threadId, reply, false, System.currentTimeMillis(), null, true);
121+
message.setId(smsDatabase.insertMessageOutbox(threadId, reply, false, System.currentTimeMillis(), null, true));
122122
MessageSender.send(message, address);
123123
break;
124124
}

app/src/main/res/layout/activity_conversation_v2.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,13 @@
291291
android:clickable="true"
292292
android:visibility="gone">
293293

294-
<com.github.ybq.android.spinkit.SpinKitView
295-
style="@style/SpinKitView.Large.ThreeBounce"
296-
android:layout_width="wrap_content"
294+
<ProgressBar
295+
android:layout_width="match_parent"
297296
android:layout_height="wrap_content"
298-
android:layout_gravity="center"
299297
android:layout_marginTop="8dp"
300-
app:SpinKit_Color="@android:color/white" />
298+
android:layout_gravity="center"
299+
android:indeterminateTint="?colorAccent"
300+
android:indeterminate="true"/>
301301

302302
</FrameLayout>
303303

app/src/main/res/layout/activity_edit_closed_group.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@
165165
android:visibility="gone"
166166
android:alpha="0">
167167

168-
<com.github.ybq.android.spinkit.SpinKitView
169-
style="@style/SpinKitView.Large.ThreeBounce"
170-
android:layout_width="wrap_content"
168+
<ProgressBar
169+
android:layout_width="match_parent"
171170
android:layout_height="wrap_content"
172171
android:layout_marginTop="8dp"
173172
android:layout_centerInParent="true"
174-
app:SpinKit_Color="@android:color/white" />
173+
android:indeterminateTint="?colorAccent"
174+
android:indeterminate="true"/>
175175

176176
</RelativeLayout>
177177

app/src/main/res/layout/activity_path.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
android:orientation="vertical"
3535
android:layout_centerInParent="true" />
3636

37-
<com.github.ybq.android.spinkit.SpinKitView
38-
style="@style/SpinKitView.Large.ThreeBounce"
37+
<ProgressBar
3938
android:id="@+id/spinner"
40-
android:layout_width="wrap_content"
39+
android:layout_width="match_parent"
4140
android:layout_height="wrap_content"
4241
android:layout_centerInParent="true"
43-
app:SpinKit_Color="?android:textColorPrimary" />
42+
android:indeterminateTint="?colorAccent"
43+
android:indeterminate="true"/>
4444

4545
</RelativeLayout>
4646

app/src/main/res/layout/activity_settings.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@
127127
android:background="#A4000000"
128128
android:visibility="gone">
129129

130-
<com.github.ybq.android.spinkit.SpinKitView
131-
style="@style/SpinKitView.Large.ThreeBounce"
132-
android:layout_width="wrap_content"
130+
<ProgressBar
131+
android:layout_width="match_parent"
133132
android:layout_height="wrap_content"
134-
android:layout_centerInParent="true"
135133
android:layout_marginTop="8dp"
136-
app:SpinKit_Color="@android:color/white" />
134+
android:layout_centerInParent="true"
135+
android:indeterminateTint="?colorAccent"
136+
android:indeterminate="true"/>
137137

138138
</RelativeLayout>
139139

app/src/main/res/layout/activity_webrtc.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,14 @@
124124
android:layout_width="match_parent"
125125
android:layout_height="wrap_content"
126126
android:layout_gravity="center"/>
127-
<com.github.ybq.android.spinkit.SpinKitView
127+
128+
<ProgressBar
128129
android:id="@+id/local_loading_view"
129-
style="@style/SpinKitView.Large.ThreeBounce"
130-
android:layout_width="wrap_content"
131-
android:layout_height="wrap_content"
132-
app:SpinKit_Color="?android:textColorPrimary"
130+
android:layout_width="@dimen/large_spacing"
131+
android:layout_height="@dimen/large_spacing"
133132
android:layout_gravity="center"
133+
android:indeterminateTint="?android:textColorPrimary"
134+
android:indeterminate="true"
134135
tools:visibility="visible"
135136
android:visibility="gone" />
136137

0 commit comments

Comments
 (0)