Skip to content

Feature/release 1.21.3 merge #1050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ configurations.configureEach {
exclude module: "commons-logging"
}

def canonicalVersionCode = 397
def canonicalVersionName = "1.21.1"
def canonicalVersionCode = 399
def canonicalVersionName = "1.21.3"

def postFixSize = 10
def abiPostFix = ['armeabi-v7a' : 1,
Expand Down Expand Up @@ -350,7 +350,6 @@ dependencies {
implementation "nl.komponents.kovenant:kovenant:$kovenantVersion"
implementation "nl.komponents.kovenant:kovenant-android:$kovenantVersion"
implementation "com.jakewharton.rxbinding3:rxbinding:3.1.0"
implementation "com.github.ybq:Android-SpinKit:1.4.0"
implementation "com.opencsv:opencsv:4.6"
testImplementation "junit:junit:$junitVersion"
testImplementation 'org.assertj:assertj-core:3.11.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,11 @@ class ConversationActivityV2 : ScreenLockActionBarActivity(), InputBarDelegate,
if (author != null && messageTimestamp >= 0) {
jumpToMessage(author, messageTimestamp, firstLoad.get(), null)
} else {
if (firstLoad.getAndSet(false)) scrollToFirstUnreadMessageIfNeeded(true)
if (firstLoad.getAndSet(false)) {
lifecycleScope.launch(Dispatchers.Main) {
scrollToFirstUnreadMessageIfNeeded(true)
}
}
handleRecyclerViewScrolled()
}
}
Expand Down Expand Up @@ -1041,9 +1045,13 @@ class ConversationActivityV2 : ScreenLockActionBarActivity(), InputBarDelegate,
}
}

private fun scrollToFirstUnreadMessageIfNeeded(isFirstLoad: Boolean = false, shouldHighlight: Boolean = false): Int {
val lastSeenTimestamp = threadDb.getLastSeenAndHasSent(viewModel.threadId).first()
val lastSeenItemPosition = adapter.findLastSeenItemPosition(lastSeenTimestamp) ?: return -1
private suspend fun scrollToFirstUnreadMessageIfNeeded(isFirstLoad: Boolean = false, shouldHighlight: Boolean = false): Int {
val lastSeenItemPosition = withContext(Dispatchers.Default) {
val lastSeenTimestamp = threadDb.getLastSeenAndHasSent(viewModel.threadId).first()
adapter.findLastSeenItemPosition(lastSeenTimestamp)
}

if(lastSeenItemPosition == null) return -1

// If this is triggered when first opening a conversation then we want to position the top
// of the first unread message in the middle of the screen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout
import com.squareup.phrase.Phrase
import network.loki.messenger.R
import network.loki.messenger.databinding.ViewSearchBottomBarBinding
import org.session.libsession.utilities.StringSubstitutionConstants.COUNT_KEY
import org.session.libsession.utilities.StringSubstitutionConstants.TOTAL_COUNT_KEY

class SearchBottomBar : LinearLayout {
private lateinit var binding: ViewSearchBottomBarBinding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public class MediaSendFragment extends Fragment implements ViewTreeObserver.OnGl
private ViewGroup playbackControlsContainer;
private TextView charactersLeft;
private View closeButton;
private View loader;

private ControllableViewPager fragmentPager;
private MediaSendFragmentPagerAdapter fragmentPagerAdapter;
Expand Down Expand Up @@ -137,6 +138,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
playbackControlsContainer = view.findViewById(R.id.mediasend_playback_controls_container);
charactersLeft = view.findViewById(R.id.mediasend_characters_left);
closeButton = view.findViewById(R.id.mediasend_close_button);
loader = view.findViewById(R.id.loader);

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

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

private Stopwatch renderTimer;
private Runnable progressTimer;
private AlertDialog dialog;

@Override
protected void onPreExecute() {
renderTimer = new Stopwatch("ProcessMedia");
progressTimer = () -> {
dialog = new AlertDialog.Builder(new ContextThemeWrapper(requireContext(), R.style.Theme_TextSecure_Dialog_MediaSendProgress))
.setView(R.layout.progress_dialog)
.setCancelable(false)
.create();
dialog.show();
dialog.getWindow().setLayout(getResources().getDimensionPixelSize(R.dimen.mediasend_progress_dialog_size), getResources().getDimensionPixelSize(R.dimen.mediasend_progress_dialog_size));
loader.setVisibility(View.VISIBLE);
};
Util.runOnMainDelayed(progressTimer, 250);
}
Expand Down Expand Up @@ -394,9 +390,7 @@ protected List<Media> doInBackground(Void... voids) {
protected void onPostExecute(List<Media> media) {
controller.onSendClicked(media, composeText.getTextTrimmed());
Util.cancelRunnableOnMain(progressTimer);
if (dialog != null) {
dialog.dismiss();
}
loader.setVisibility(View.GONE);
renderTimer.stop(TAG);
}
}.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected Void doInBackground(Void... params) {
case GroupMessage: {
OutgoingMediaMessage reply = OutgoingMediaMessage.from(message, recipient, Collections.emptyList(), null, null, expiresInMillis, 0);
try {
mmsDatabase.insertMessageOutbox(reply, threadId, false, null, true);
message.setId(mmsDatabase.insertMessageOutbox(reply, threadId, false, null, true));
MessageSender.send(message, address);
} catch (MmsException e) {
Log.w(TAG, e);
Expand All @@ -118,7 +118,7 @@ protected Void doInBackground(Void... params) {
}
case SecureMessage: {
OutgoingTextMessage reply = OutgoingTextMessage.from(message, recipient, expiresInMillis, expireStartedAt);
smsDatabase.insertMessageOutbox(threadId, reply, false, System.currentTimeMillis(), null, true);
message.setId(smsDatabase.insertMessageOutbox(threadId, reply, false, System.currentTimeMillis(), null, true));
MessageSender.send(message, address);
break;
}
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/layout/activity_conversation_v2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,13 @@
android:clickable="true"
android:visibility="gone">

<com.github.ybq.android.spinkit.SpinKitView
style="@style/SpinKitView.Large.ThreeBounce"
android:layout_width="wrap_content"
<ProgressBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="8dp"
app:SpinKit_Color="@android:color/white" />
android:layout_gravity="center"
android:indeterminateTint="?colorAccent"
android:indeterminate="true"/>

</FrameLayout>

Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_edit_closed_group.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@
android:visibility="gone"
android:alpha="0">

<com.github.ybq.android.spinkit.SpinKitView
style="@style/SpinKitView.Large.ThreeBounce"
android:layout_width="wrap_content"
<ProgressBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_centerInParent="true"
app:SpinKit_Color="@android:color/white" />
android:indeterminateTint="?colorAccent"
android:indeterminate="true"/>

</RelativeLayout>

Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_path.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
android:orientation="vertical"
android:layout_centerInParent="true" />

<com.github.ybq.android.spinkit.SpinKitView
style="@style/SpinKitView.Large.ThreeBounce"
<ProgressBar
android:id="@+id/spinner"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:SpinKit_Color="?android:textColorPrimary" />
android:indeterminateTint="?colorAccent"
android:indeterminate="true"/>

</RelativeLayout>

Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@
android:background="#A4000000"
android:visibility="gone">

<com.github.ybq.android.spinkit.SpinKitView
style="@style/SpinKitView.Large.ThreeBounce"
android:layout_width="wrap_content"
<ProgressBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="8dp"
app:SpinKit_Color="@android:color/white" />
android:layout_centerInParent="true"
android:indeterminateTint="?colorAccent"
android:indeterminate="true"/>

</RelativeLayout>

Expand Down
11 changes: 6 additions & 5 deletions app/src/main/res/layout/activity_webrtc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
<com.github.ybq.android.spinkit.SpinKitView

<ProgressBar
android:id="@+id/local_loading_view"
style="@style/SpinKitView.Large.ThreeBounce"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:SpinKit_Color="?android:textColorPrimary"
android:layout_width="@dimen/large_spacing"
android:layout_height="@dimen/large_spacing"
android:layout_gravity="center"
android:indeterminateTint="?android:textColorPrimary"
android:indeterminate="true"
tools:visibility="visible"
android:visibility="gone" />

Expand Down
9 changes: 4 additions & 5 deletions app/src/main/res/layout/contact_selection_list_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@
tools:visibility="visible"
tools:listitem="@layout/view_user"/>

<com.github.ybq.android.spinkit.SpinKitView
style="@style/SpinKitView.Large.ThreeBounce"
<ProgressBar
android:id="@+id/loader"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:SpinKit_Color="?android:textColorPrimary" />

android:indeterminateTint="?colorAccent"
android:indeterminate="true"/>

</FrameLayout>
15 changes: 9 additions & 6 deletions app/src/main/res/layout/dialog_clear_all_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/dialog_button_height"
android:orientation="horizontal">

<Button
Expand All @@ -58,14 +58,17 @@
android:layout_weight="1"
android:text="@string/cancel" />

<com.github.ybq.android.spinkit.SpinKitView
style="@style/SpinKitView.Small.ThreeBounce"
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="0dp"
android:layout_height="@dimen/small_button_height"
android:layout_height="@dimen/large_spacing"
android:layout_gravity="center_vertical"
android:layout_weight="1"
app:SpinKit_Color="?colorAccent"
android:visibility="gone" />
android:indeterminateTint="?colorAccent"
android:indeterminate="true"
android:visibility="gone"
tools:visibility="visible"/>


</LinearLayout>

Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/layout/fragment_create_group.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<com.github.ybq.android.spinkit.SpinKitView
style="@style/SpinKitView.Large.ThreeBounce"
android:layout_width="wrap_content"
<ProgressBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="8dp"
app:SpinKit_Color="@android:color/white" />
android:layout_centerInParent="true"
android:indeterminateTint="?colorAccent"
android:indeterminate="true"/>

</RelativeLayout>

Expand Down
15 changes: 8 additions & 7 deletions app/src/main/res/layout/fragment_enter_community_url.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,20 @@
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="56dp"
android:visibility="gone"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/communityUrlEditText">

<com.github.ybq.android.spinkit.SpinKitView
<ProgressBar
android:id="@+id/defaultRoomsLoader"
style="@style/SpinKitView.Large.ThreeBounce"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_width="@dimen/large_spacing"
android:layout_height="@dimen/large_spacing"
android:visibility="gone"
app:SpinKit_Color="?android:textColorPrimary" />
tools:visibility="visible"
android:layout_centerInParent="true"
android:indeterminateTint="?colorAccent"
android:indeterminate="true"/>

</RelativeLayout>

Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/layout/fragment_join_community.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent">

<com.github.ybq.android.spinkit.SpinKitView
style="@style/SpinKitView.Large.ThreeBounce"
android:layout_width="wrap_content"
<ProgressBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="8dp"
app:SpinKit_Color="@android:color/white" />
android:layout_centerInParent="true"
android:indeterminateTint="?colorAccent"
android:indeterminate="true"/>

</RelativeLayout>

Expand Down
9 changes: 4 additions & 5 deletions app/src/main/res/layout/giphy_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
android:layout_height="match_parent"
android:scrollbars="vertical"/>

<com.github.ybq.android.spinkit.SpinKitView
style="@style/SpinKitView.Large.ThreeBounce"
<ProgressBar
android:id="@+id/loading_progress"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_gravity="center"
android:visibility="visible"
app:SpinKit_Color="?android:textColorPrimary" />
android:indeterminateTint="?colorAccent"
android:indeterminate="true"/>

<TextView
android:id="@+id/no_results"
Expand Down
20 changes: 20 additions & 0 deletions app/src/main/res/layout/mediasend_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,24 @@

</FrameLayout>

<FrameLayout
android:id="@+id/loader"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#A4000000"
android:focusable="true"
android:clickable="true"
android:visibility="gone"
tools:visibility="visible">

<ProgressBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_gravity="center"
android:indeterminateTint="?colorAccent"
android:indeterminate="true"/>

</FrameLayout>

</FrameLayout>
16 changes: 0 additions & 16 deletions app/src/main/res/layout/progress_dialog.xml

This file was deleted.

Loading