removed swipe to delete (#2589)

This commit is contained in:
Vanshika Arora 2019-08-05 16:55:33 +05:30 committed by neslihanturan
parent 67d9afe77e
commit ec8bbb2782
4 changed files with 46 additions and 104 deletions

View file

@ -227,6 +227,7 @@ public class NotificationActivity extends NavigationBaseActivity {
public void notificationClicked(Notification notification) {
Timber.d("Notification clicked %s", notification.link);
handleUrl(notification.link);
removeNotification(notification);
}
@Override

View file

@ -9,7 +9,6 @@ import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.daimajia.swipe.SwipeLayout;
import com.google.android.material.animation.ArgbEvaluatorCompat;
import com.pedrogomez.renderers.Renderer;
@ -32,12 +31,8 @@ public class NotificationRenderer extends Renderer<Notification> {
TextView time;
@BindView(R.id.icon)
ImageView icon;
@BindView(R.id.swipeLayout)
SwipeLayout swipeLayout;
@BindView(R.id.bottom)
LinearLayout bottomLayout;
@BindView(R.id.notification_view)
RelativeLayout notificationView;
/*@BindView(R.id.bottom)
LinearLayout bottomLayout;*/
private NotificationClicked listener;
private boolean isarchivedvisible = false;
@ -53,13 +48,6 @@ public class NotificationRenderer extends Renderer<Notification> {
listener.notificationClicked(getContent());
}
@OnClick(R.id.bottom)
void onBottomLayoutClicked(){
Notification notification = getContent();
Timber.d("NotificationID: %s", notification.notificationId);
listener.markNotificationAsRead(notification);
}
@Override
protected void setUpView(View rootView) {
@ -74,21 +62,6 @@ public class NotificationRenderer extends Renderer<Notification> {
protected View inflate(LayoutInflater layoutInflater, ViewGroup viewGroup) {
View inflatedView = layoutInflater.inflate(R.layout.item_notification, viewGroup, false);
ButterKnife.bind(this, inflatedView);
if (isarchivedvisible) {
swipeLayout.setSwipeEnabled(false);
}else {
swipeLayout.setSwipeEnabled(true);
}
swipeLayout.addDrag(SwipeLayout.DragEdge.Top, bottomLayout);
swipeLayout.addRevealListener(R.id.bottom_wrapper_child1, (child, edge, fraction, distance) -> {
View star = child.findViewById(R.id.star);
float d = child.getHeight() / 2 - star.getHeight() / 2;
star.setTranslationY(d * fraction);
star.setScaleX(fraction + 0.6f);
star.setScaleY(fraction + 0.6f);
int c = ArgbEvaluatorCompat.getInstance().evaluate(fraction, Color.parseColor("#dddddd"), Color.parseColor("#90960a0a"));
child.setBackgroundColor(c);
});
return inflatedView;
}