1
0
mirror of https://github.com/MGislv/NekoX.git synced 2024-07-04 11:13:36 +00:00

Resolve conflicts

This commit is contained in:
世界 2021-04-14 10:36:08 +08:00
parent aa21a87a10
commit e84cae9de1
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
10 changed files with 28 additions and 136 deletions

View File

@ -8925,7 +8925,7 @@ public class MessagesController extends BaseController implements NotificationCe
processUpdates(updates, false);
AndroidUtilities.runOnUIThread(() -> {
if (finalNekoxBot instanceof TLRPC.User) {
getMessagesController().deleteUserFromChat(updates.chats.get(0).id, (TLRPC.User) finalNekoxBot, null);
getMessagesController().deleteParticipantFromChat(updates.chats.get(0).id, (TLRPC.User) finalNekoxBot, null);
}
putUsers(updates.users, false);

View File

@ -356,18 +356,20 @@ public class AvatarPreviewPagerIndicator extends View implements ProfileGalleryV
return title;
}
@Override
public void onDown(boolean left) {
pressedOverlayVisible[left ? 0 : 1] = true;
postInvalidateOnAnimation();
}
@Override
public void onRelease() {
Arrays.fill(pressedOverlayVisible, false);
postInvalidateOnAnimation();
}
@Override
public void onClick() {
}
@Override
public void onPhotosLoaded() {
}

View File

@ -311,7 +311,7 @@ public class DrawerProfileCell extends FrameLayout {
avatarDrawable.setColor(Theme.getColor(Theme.key_avatar_backgroundInProfileBlue));
avatarImageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
if (NekoConfig.avatarAsDrawerBackground) {
ImageLocation imageLocation = ImageLocation.getForUser(user, true);
ImageLocation imageLocation = ImageLocation.getForUser(user, ImageLocation.TYPE_BIG);
allowInvalidate = !useAdb() || !(NekoConfig.avatarBackgroundDarken || NekoConfig.avatarBackgroundBlur);
imageReceiver.setImage(imageLocation, "512_512", null, null, new ColorDrawable(0x00000000), 0, null, user, 1);
avatarImageView.setVisibility(INVISIBLE);

View File

@ -285,7 +285,7 @@ public class UserCell2 extends FrameLayout {
}
}
if (currentUser != null) {
avatarImageView.setImage(ImageLocation.getForUser(currentUser, false), "50_50", avatarDrawable, currentUser);
avatarImageView.setImage(ImageLocation.getForUser(currentUser, ImageLocation.TYPE_SMALL), "50_50", avatarDrawable, currentUser);
} else if (currentChat != null) {
avatarImageView.setImage(ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentObject);
} else {

View File

@ -19,7 +19,7 @@ import android.app.Activity;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.app.PendingIntent;
]import android.content.ClipData;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.DialogInterface;
@ -2007,7 +2007,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
imageView.setRoundRadius(AndroidUtilities.dp(20));
frameLayout.addView(imageView, LayoutHelper.createFrame(40, 40, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 22, 5, 22, 0));
avatarDrawable.setInfo(currentChat);
imageView.setImage(ImageLocation.getForChat(currentChat, false), "50_50", avatarDrawable, currentChat);
imageView.setImage(ImageLocation.getForChat(currentChat, ImageLocation.TYPE_SMALL), "50_50", avatarDrawable, currentChat);
TextView textView = new TextView(context);
textView.setTextColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem));
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 20);
@ -18878,14 +18878,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
return;
}
} else if (message.messageOwner.action instanceof TLRPC.TL_messageActionPaymentSent && message.replyMessageObject != null && message.replyMessageObject.isInvoice()) {
TLRPC.TL_payments_getPaymentReceipt req = new TLRPC.TL_payments_getPaymentReceipt();
req.msg_id = message.getId();
req.peer = getMessagesController().getInputPeer(message.messageOwner.peer_id);
getConnectionsManager().sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
if (response instanceof TLRPC.TL_payments_paymentReceipt) {
presentFragment(new PaymentFormActivity((TLRPC.TL_payments_paymentReceipt) response));
}
}), ConnectionsManager.RequestFlagFailOnServerErrors);
// NekoX: payment deleted
return;
} else if (message.messageOwner.action instanceof TLRPC.TL_messageActionGroupCall || message.messageOwner.action instanceof TLRPC.TL_messageActionInviteToGroupCall || message.messageOwner.action instanceof TLRPC.TL_messageActionGroupCallScheduled) {
if (getParentActivity() == null) {
@ -24579,7 +24572,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
channelParticipant1.channelParticipant = new TLRPC.TL_channelParticipant();
}
channelParticipant1.channelParticipant.inviter_id = getUserConfig().getClientUserId();
channelParticipant1.channelParticipant.user_id = participant.user_id;
channelParticipant1.channelParticipant.peer = getMessagesController().getPeer(participant.user_id);
channelParticipant1.channelParticipant.date = participant.date;
channelParticipant1.channelParticipant.banned_rights = rightsBanned;
channelParticipant1.channelParticipant.admin_rights = rightsAdmin;
@ -24607,7 +24600,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if (currentChat.megagroup && chatInfo != null && chatInfo.participants != null) {
for (int a = 0; a < chatInfo.participants.participants.size(); a++) {
TLRPC.ChannelParticipant p = ((TLRPC.TL_chatChannelParticipant) chatInfo.participants.participants.get(a)).channelParticipant;
if (p.user_id == participant.user_id) {
if (MessageObject.getPeerId(p.peer) == participant.user_id) {
chatInfo.participants_count--;
chatInfo.participants.participants.remove(a);
break;

View File

@ -26,6 +26,7 @@ import android.graphics.drawable.GradientDrawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Vibrator;
import android.provider.Settings;
import android.text.Editable;
import android.text.Html;

View File

@ -89,6 +89,7 @@ public class ProfileGalleryView extends CircularViewPager implements Notificatio
public interface Callback {
void onClick();
void onPhotosLoaded();
void onVideoSet();
@ -293,112 +294,6 @@ public class ProfileGalleryView extends CircularViewPager implements Notificatio
drawable.setInvalidateParentViewWithSecond(true);
}
}
//
// @Override
// public boolean onTouchEvent(MotionEvent ev) {
// if (adapter == null) {
return false;
}
if (parentListView.getScrollState() != RecyclerView.SCROLL_STATE_IDLE && !isScrollingListView && isSwipingViewPager) {
// isSwipingViewPager = false;
// final MotionEvent cancelEvent = MotionEvent.obtain(ev);
// cancelEvent.setAction(MotionEvent.ACTION_CANCEL);
// super.onTouchEvent(cancelEvent);
// cancelEvent.recycle();
// return false;
// }
//
// final int action = ev.getAction();
if (pinchToZoomHelper != null) {
if (action != MotionEvent.ACTION_DOWN && isDownReleased && !pinchToZoomHelper.isInOverlayMode()) {
pinchToZoomHelper.checkPinchToZoom(MotionEvent.obtain(0, 0, MotionEvent.ACTION_CANCEL, 0, 0, 0), this, getCurrentItemView().getImageReceiver(), null);
} else if (pinchToZoomHelper.checkPinchToZoom(ev, this, getCurrentItemView().getImageReceiver(), null)) {
if (!isDownReleased) {
isDownReleased = true;
callback.onRelease();
}
return true;
}
}
// if (action == MotionEvent.ACTION_DOWN) {
//
// isScrollingListView = true;
// isSwipingViewPager = true;
// scrolledByUser = true;
// downPoint.set(ev.getX(), ev.getY());
// //if (adapter.getCount() > 1) {
// callback.onDown(ev.getX() < getWidth() / 3f);
// //}
// isDownReleased = false;
// } else if (action == MotionEvent.ACTION_UP) {
// if (!isDownReleased) {
// final int itemsCount = adapter.getCount();
// int currentItem = getCurrentItem();
// if (itemsCount > 1) {
// if (ev.getX() > getWidth() / 3f) {
// final int extraCount = adapter.getExtraCount();
// if (++currentItem >= itemsCount - extraCount) {
// currentItem = extraCount;
// }
// } else {
// final int extraCount = adapter.getExtraCount();
// if (--currentItem < extraCount) {
// currentItem = itemsCount - extraCount - 1;
// }
// }
// callback.onRelease();
// setCurrentItem(currentItem, false);
// }
// }
// } else if (action == MotionEvent.ACTION_MOVE) {
// final float dx = ev.getX() - downPoint.x;
// final float dy = ev.getY() - downPoint.y;
// boolean move = Math.abs(dy) >= touchSlop || Math.abs(dx) >= touchSlop;
// if (move) {
// isDownReleased = true;
// callback.onRelease();
// }
// if (isSwipingViewPager && isScrollingListView) {
// if (move) {
// if (Math.abs(dy) > Math.abs(dx)) {
// isSwipingViewPager = false;
// final MotionEvent cancelEvent = MotionEvent.obtain(ev);
// cancelEvent.setAction(MotionEvent.ACTION_CANCEL);
// super.onTouchEvent(cancelEvent);
// cancelEvent.recycle();
// } else {
// isScrollingListView = false;
// final MotionEvent cancelEvent = MotionEvent.obtain(ev);
// cancelEvent.setAction(MotionEvent.ACTION_CANCEL);
// parentListView.onTouchEvent(cancelEvent);
// cancelEvent.recycle();
// }
// }
// } else if (isSwipingViewPager && !canScrollHorizontally(-1) && dx > touchSlop) {
// return false;
// }
// }
//
// boolean result = false;
//
// if (isScrollingListView) {
// result = parentListView.onTouchEvent(ev);
// }
//
// if (isSwipingViewPager) {
// result |= super.onTouchEvent(ev);
// }
//
// if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
// isScrollingListView = false;
// isSwipingViewPager = false;
// }
//
// return result;
// }
public void setChatInfo(TLRPC.ChatFull chatFull) {
chatInfo = chatFull;

View File

@ -462,9 +462,9 @@ public class UndoView extends FrameLayout {
currentCancelRunnable = () -> ProcessPhoenix.triggerRebirth(getContext(), new Intent(getContext(), LaunchActivity.class));
} else if (isTooltipAction()) {
CharSequence infoText;
String subInfoText;
int icon;
CharSequence infoText = "";
String subInfoText = "";
int icon = 0;
int size = 36;
boolean iconIsDrawable = false;

View File

@ -1526,7 +1526,7 @@ public class GroupCallActivity extends BottomSheet implements NotificationCenter
if (call.isScheduled()) {
TLRPC.ChatFull chatFull = accountInstance.getMessagesController().getChatFull(currentChat.id);
if (chatFull != null) {
chatFull.flags &=~ 2097152;
chatFull.flags &= ~2097152;
chatFull.call = null;
accountInstance.getNotificationCenter().postNotificationName(NotificationCenter.groupCallUpdated, currentChat.id, call.call.id, false);
}
@ -3055,14 +3055,15 @@ public class GroupCallActivity extends BottomSheet implements NotificationCenter
} else if (muteButtonState == MUTE_BUTTON_STATE_UNMUTE) {
updateMuteButton(MUTE_BUTTON_STATE_MUTE, true);
VoIPService.getSharedInstance().setMicMute(false, false, true);
if (!NekoConfig.disableVibration) {
muteButton.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
}
if (!NekoConfig.disableVibration) {
muteButton.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
}
} else {
updateMuteButton(MUTE_BUTTON_STATE_UNMUTE, true);
VoIPService.getSharedInstance().setMicMute(true, false, true);
if (!NekoConfig.disableVibration) {
muteButton.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
if (!NekoConfig.disableVibration) {
muteButton.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
}
}
}
}
@ -3324,7 +3325,7 @@ public class GroupCallActivity extends BottomSheet implements NotificationCenter
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int size = Math.min(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.getSize(heightMeasureSpec));
super.onMeasure( MeasureSpec.makeMeasureSpec(size, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(size + getPaddingBottom(), MeasureSpec.EXACTLY));
super.onMeasure(MeasureSpec.makeMeasureSpec(size, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(size + getPaddingBottom(), MeasureSpec.EXACTLY));
}
@Override
@ -4815,7 +4816,7 @@ public class GroupCallActivity extends BottomSheet implements NotificationCenter
options.add(8);
} else {
items.add(LocaleController.getString("VoipGroupOpenProfile", R.string.VoipGroupOpenProfile));
icons.add(R.drawable.baseline_person_24);
icons.add(R.drawable.baseline_person_24);
options.add(6);
}
if (!isAdmin && ChatObject.canBlockUsers(currentChat)) {
@ -4868,7 +4869,7 @@ public class GroupCallActivity extends BottomSheet implements NotificationCenter
if (scrimPopupWindow != null) {
scrimPopupWindow.dismiss();
} else {
if (options.get(i) != 9 && options.get(i) != 10 && options.get(i) != 11) {
if (options.get(i) != 9 && options.get(i) != 10 && options.get(i) != 11) {
dismissAvatarPreview(true);
}
}

View File

@ -4563,7 +4563,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
if (!mainFragmentsStack.isEmpty()) {
int type = (int) args[0];
FrameLayout container = null;
LinearLayout container = null;
BaseFragment fragment = null;
if (GroupCallActivity.groupCallUiVisible && GroupCallActivity.groupCallInstance != null) {
container = GroupCallActivity.groupCallInstance.getContainer();