little swipe improvement

This commit is contained in:
Arne 2023-10-04 13:31:13 +02:00
parent 97c5d8b729
commit 57da4b0de7
2 changed files with 21 additions and 5 deletions

View file

@ -126,10 +126,15 @@ dependencies {
implementation 'org.jxmpp:jxmpp-stringprep-libidn:1.0.3'
implementation 'com.tbuonomo:dotsindicator:4.2'
implementation 'me.xdrop:fuzzywuzzy:1.4.0'
implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
implementation "com.daimajia.swipelayout:library:1.2.0@aar"
implementation 'com.daimajia.androidanimations:library:1.1.2@aar'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'jp.wasabeef:recyclerview-animators:1.0.3@aar'
implementation "androidx.core:core-ktx:1.12.0"
implementation 'com.github.bumptech.glide:glide:4.16.0'
implementation "androidx.emoji2:emoji2-emojipicker:1.4.0"
implementation "androidx.compose.material3:material3:1.1.2"
//implementation "com.github.fredericojssilva:AndroidSwipeLayout:v1.2.2"
}
ext {
@ -150,13 +155,13 @@ android {
minSdkVersion 21
targetSdkVersion 32
//versionNameSuffix " beta_(2023-10-03)" // " beta_(XXXX-XX-XX)" // activate for beta versions
versionCode 137
versionName "1.7.5"
versionNameSuffix " beta_(2023-10-04)" // " beta_(XXXX-XX-XX)" // activate for beta versions
versionCode 138
versionName "1.8"
//resConfigs "en"
archivesBaseName += "-$versionName"
//archivesBaseName += "$versionNameSuffix" // activate for beta versions
archivesBaseName += "$versionNameSuffix" // activate for beta versions
applicationId "de.monocles.chat"
multiDexEnabled true
versionName grgit.describe(always: true)

View file

@ -76,6 +76,8 @@ import androidx.core.graphics.drawable.DrawableCompat;
import androidx.core.content.res.ResourcesCompat;
import com.daimajia.swipe.SwipeLayout;
import com.daimajia.androidanimations.library.Techniques;
import com.daimajia.androidanimations.library.YoYo;
import com.google.common.base.Strings;
import com.squareup.picasso.Picasso;
import com.lelloman.identicon.view.GithubIdenticonView;
@ -1582,32 +1584,41 @@ public class MessageAdapter extends ArrayAdapter<Message> {
swipeLayout.addSwipeListener(new SwipeLayout.SwipeListener() {
@Override
public void onClose(SwipeLayout layout) {
swipeLayout.refreshDrawableState();
swipeLayout.clearAnimation();
//when the SurfaceView totally cover the BottomView.
}
@Override
public void onUpdate(SwipeLayout layout, int leftOffset, int topOffset) {
swipeLayout.setClickToClose(true);
//you are swiping.
}
@Override
public void onStartOpen(SwipeLayout layout) {
swipeLayout.setClickToClose(true);
}
@Override
public void onOpen(SwipeLayout layout) {
swipeLayout.refreshDrawableState();
//when the BottomView totally show.
MessageAdapter.this.mOnMessageBoxSwipedListener.onContactPictureClicked(message);
swipeLayout.close(true);
swipeLayout.setClickToClose(true);
}
@Override
public void onStartClose(SwipeLayout layout) {
swipeLayout.close(true);
swipeLayout.setClickToClose(true);
}
@Override
public void onHandRelease(SwipeLayout layout, float xvel, float yvel) {
swipeLayout.refreshDrawableState();
swipeLayout.close(true);
}
});