mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 14:35:03 +01:00
Update to 7.1.1 (2096)
This commit is contained in:
parent
4992f231b3
commit
99f5637dda
20 changed files with 283 additions and 108 deletions
|
@ -284,7 +284,7 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig.versionCode = 2094
|
defaultConfig.versionCode = 2096
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
variant.outputs.all { output ->
|
variant.outputs.all { output ->
|
||||||
|
|
|
@ -18,7 +18,7 @@ public class BuildVars {
|
||||||
public static boolean LOGS_ENABLED = false;
|
public static boolean LOGS_ENABLED = false;
|
||||||
public static boolean USE_CLOUD_STRINGS = true;
|
public static boolean USE_CLOUD_STRINGS = true;
|
||||||
public static boolean CHECK_UPDATES = true;
|
public static boolean CHECK_UPDATES = true;
|
||||||
public static int BUILD_VERSION = 2094;
|
public static int BUILD_VERSION = 2096;
|
||||||
public static String BUILD_VERSION_STRING = "7.1.0";
|
public static String BUILD_VERSION_STRING = "7.1.0";
|
||||||
public static int APP_ID = 4;
|
public static int APP_ID = 4;
|
||||||
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
||||||
|
|
|
@ -853,12 +853,16 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
|
||||||
bitmapH = bitmapDrawable.getIntrinsicHeight();
|
bitmapH = bitmapDrawable.getIntrinsicHeight();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Bitmap bitmap = bitmapDrawable.getBitmap();
|
||||||
|
if (bitmap != null && bitmap.isRecycled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (orientation % 360 == 90 || orientation % 360 == 270) {
|
if (orientation % 360 == 90 || orientation % 360 == 270) {
|
||||||
bitmapW = bitmapDrawable.getBitmap().getHeight();
|
bitmapW = bitmap.getHeight();
|
||||||
bitmapH = bitmapDrawable.getBitmap().getWidth();
|
bitmapH = bitmap.getWidth();
|
||||||
} else {
|
} else {
|
||||||
bitmapW = bitmapDrawable.getBitmap().getWidth();
|
bitmapW = bitmap.getWidth();
|
||||||
bitmapH = bitmapDrawable.getBitmap().getHeight();
|
bitmapH = bitmap.getHeight();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
float realImageW = imageW - sideClip * 2;
|
float realImageW = imageW - sideClip * 2;
|
||||||
|
|
|
@ -4562,7 +4562,7 @@ public class MessagesController extends BaseController implements NotificationCe
|
||||||
if ((messageViews.flags & 2) != 0) {
|
if ((messageViews.flags & 2) != 0) {
|
||||||
if (forwards == null) {
|
if (forwards == null) {
|
||||||
forwards = new SparseIntArray();
|
forwards = new SparseIntArray();
|
||||||
channelViews.put(key, forwards);
|
channelForwards.put(key, forwards);
|
||||||
}
|
}
|
||||||
forwards.put(req.id.get(a1), messageViews.forwards);
|
forwards.put(req.id.get(a1), messageViews.forwards);
|
||||||
}
|
}
|
||||||
|
|
|
@ -910,7 +910,7 @@ public class ActionBarMenuItem extends FrameLayout {
|
||||||
ignoreRequestLayout = true;
|
ignoreRequestLayout = true;
|
||||||
measureChildWithMargins(searchFilterLayout, widthMeasureSpec, width, heightMeasureSpec, 0);
|
measureChildWithMargins(searchFilterLayout, widthMeasureSpec, width, heightMeasureSpec, 0);
|
||||||
int filterWidth = searchFilterLayout.getVisibility() == View.VISIBLE ? searchFilterLayout.getMeasuredWidth() : 0;
|
int filterWidth = searchFilterLayout.getVisibility() == View.VISIBLE ? searchFilterLayout.getMeasuredWidth() : 0;
|
||||||
measureChildWithMargins(searchField, widthMeasureSpec, width + filterWidth, heightMeasureSpec, 0);
|
measureChildWithMargins(searchField, MeasureSpec.makeMeasureSpec(minWidth - AndroidUtilities.dp(6), MeasureSpec.UNSPECIFIED), width + filterWidth, heightMeasureSpec, 0);
|
||||||
ignoreRequestLayout = false;
|
ignoreRequestLayout = false;
|
||||||
setMeasuredDimension(Math.max(filterWidth + searchField.getMeasuredWidth(), minWidth), MeasureSpec.getSize(heightMeasureSpec));
|
setMeasuredDimension(Math.max(filterWidth + searchField.getMeasuredWidth(), minWidth), MeasureSpec.getSize(heightMeasureSpec));
|
||||||
}
|
}
|
||||||
|
@ -1109,7 +1109,7 @@ public class ActionBarMenuItem extends FrameLayout {
|
||||||
searchContainer.addView(searchFilterLayout, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, 32, Gravity.CENTER_VERTICAL, 0, 0, 48, 0));
|
searchContainer.addView(searchFilterLayout, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, 32, Gravity.CENTER_VERTICAL, 0, 0, 48, 0));
|
||||||
} else {
|
} else {
|
||||||
searchContainer.addView(searchFilterLayout, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, 32, Gravity.CENTER_VERTICAL, 0, 0, 48, 0));
|
searchContainer.addView(searchFilterLayout, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, 32, Gravity.CENTER_VERTICAL, 0, 0, 48, 0));
|
||||||
searchContainer.addView(searchField, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, 36, Gravity.CENTER_VERTICAL, 0, 0, 0, 0));
|
searchContainer.addView(searchField, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, 36, Gravity.CENTER_VERTICAL, 0, 0, wrapInScrollView ? 0 : 48, 0));
|
||||||
searchContainer.addView(searchFieldCaption, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, 36, Gravity.CENTER_VERTICAL | Gravity.RIGHT, 0, 5.5f, 48, 0));
|
searchContainer.addView(searchFieldCaption, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, 36, Gravity.CENTER_VERTICAL | Gravity.RIGHT, 0, 5.5f, 48, 0));
|
||||||
}
|
}
|
||||||
searchFilterLayout.setClipChildren(false);
|
searchFilterLayout.setClipChildren(false);
|
||||||
|
|
|
@ -7428,7 +7428,7 @@ public class Theme {
|
||||||
color = defaultColors.get(key);
|
color = defaultColors.get(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (color != null && (key_windowBackgroundWhite.equals(key) || key_windowBackgroundGray.equals(key))) {
|
if (color != null && (key_windowBackgroundWhite.equals(key) || key_windowBackgroundGray.equals(key) || key_actionBarDefault.equals(key) || key_actionBarDefaultArchived.equals(key))) {
|
||||||
color |= 0xff000000;
|
color |= 0xff000000;
|
||||||
}
|
}
|
||||||
return color;
|
return color;
|
||||||
|
@ -7520,14 +7520,14 @@ public class Theme {
|
||||||
return getDefaultColor(key);
|
return getDefaultColor(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (key_windowBackgroundWhite.equals(key) || key_windowBackgroundGray.equals(key)) {
|
if (key_windowBackgroundWhite.equals(key) || key_windowBackgroundGray.equals(key) || key_actionBarDefault.equals(key) || key_actionBarDefaultArchived.equals(key)) {
|
||||||
color |= 0xff000000;
|
color |= 0xff000000;
|
||||||
}
|
}
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setColor(String key, int color, boolean useDefault) {
|
public static void setColor(String key, int color, boolean useDefault) {
|
||||||
if (key.equals(key_chat_wallpaper) || key.equals(key_chat_wallpaper_gradient_to) || key.equals(key_windowBackgroundWhite) || key.equals(key_windowBackgroundGray)) {
|
if (key.equals(key_chat_wallpaper) || key.equals(key_chat_wallpaper_gradient_to) || key.equals(key_windowBackgroundWhite) || key.equals(key_windowBackgroundGray) || key.equals(key_actionBarDefault) || key.equals(key_actionBarDefaultArchived)) {
|
||||||
color = 0xff000000 | color;
|
color = 0xff000000 | color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.google.android.exoplayer2.util.Log;
|
||||||
|
|
||||||
public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
@ -93,6 +95,10 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
private FilteredSearchView.Delegate filtersDelegate;
|
private FilteredSearchView.Delegate filtersDelegate;
|
||||||
private int folderId;
|
private int folderId;
|
||||||
|
|
||||||
|
public boolean isSearching() {
|
||||||
|
return waitingResponseCount > 0;
|
||||||
|
}
|
||||||
|
|
||||||
public static class DialogSearchResult {
|
public static class DialogSearchResult {
|
||||||
public TLObject object;
|
public TLObject object;
|
||||||
public int date;
|
public int date;
|
||||||
|
@ -106,10 +112,11 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface DialogsSearchAdapterDelegate {
|
public interface DialogsSearchAdapterDelegate {
|
||||||
void searchStateChanged(boolean searching);
|
void searchStateChanged(boolean searching, boolean animated);
|
||||||
void didPressedOnSubDialog(long did);
|
void didPressedOnSubDialog(long did);
|
||||||
void needRemoveHint(int did);
|
void needRemoveHint(int did);
|
||||||
void needClearList();
|
void needClearList();
|
||||||
|
void runResultsEnterAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class CategoryAdapterRecycler extends RecyclerListView.SelectionAdapter {
|
private class CategoryAdapterRecycler extends RecyclerListView.SelectionAdapter {
|
||||||
|
@ -171,6 +178,8 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
searchAdapterHelper.setDelegate(new SearchAdapterHelper.SearchAdapterHelperDelegate() {
|
searchAdapterHelper.setDelegate(new SearchAdapterHelper.SearchAdapterHelperDelegate() {
|
||||||
@Override
|
@Override
|
||||||
public void onDataSetChanged(int searchId) {
|
public void onDataSetChanged(int searchId) {
|
||||||
|
waitingResponseCount--;
|
||||||
|
Log.d("kek", "data set change " + waitingResponseCount);
|
||||||
lastGlobalSearchId = searchId;
|
lastGlobalSearchId = searchId;
|
||||||
if (lastLocalSearchId != searchId) {
|
if (lastLocalSearchId != searchId) {
|
||||||
searchResult.clear();
|
searchResult.clear();
|
||||||
|
@ -179,10 +188,13 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
searchResultMessages.clear();
|
searchResultMessages.clear();
|
||||||
}
|
}
|
||||||
searchWas = true;
|
searchWas = true;
|
||||||
if (!searchAdapterHelper.isSearchInProgress() && delegate != null && reqId == 0) {
|
if (delegate != null) {
|
||||||
delegate.searchStateChanged(false);
|
delegate.searchStateChanged(waitingResponseCount > 0, true);
|
||||||
}
|
}
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
|
if (delegate != null) {
|
||||||
|
delegate.runResultsEnterAnimation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -191,7 +203,7 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
searchResultHashtags.add(arrayList.get(a).hashtag);
|
searchResultHashtags.add(arrayList.get(a).hashtag);
|
||||||
}
|
}
|
||||||
if (delegate != null) {
|
if (delegate != null) {
|
||||||
delegate.searchStateChanged(false);
|
delegate.searchStateChanged(false, false);
|
||||||
}
|
}
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
@ -275,9 +287,6 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
}
|
}
|
||||||
lastMessagesSearchString = query;
|
lastMessagesSearchString = query;
|
||||||
final int currentReqId = ++lastReqId;
|
final int currentReqId = ++lastReqId;
|
||||||
/*if (delegate != null) {
|
|
||||||
delegate.searchStateChanged(true);
|
|
||||||
}*/
|
|
||||||
reqId = ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> {
|
reqId = ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> {
|
||||||
final ArrayList<MessageObject> messageObjects = new ArrayList<>();
|
final ArrayList<MessageObject> messageObjects = new ArrayList<>();
|
||||||
if (error == null) {
|
if (error == null) {
|
||||||
|
@ -291,6 +300,7 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
}
|
}
|
||||||
AndroidUtilities.runOnUIThread(() -> {
|
AndroidUtilities.runOnUIThread(() -> {
|
||||||
if (currentReqId == lastReqId && (searchId <= 0 || searchId == lastSearchId)) {
|
if (currentReqId == lastReqId && (searchId <= 0 || searchId == lastSearchId)) {
|
||||||
|
waitingResponseCount--;
|
||||||
if (error == null) {
|
if (error == null) {
|
||||||
currentMessagesQuery = query;
|
currentMessagesQuery = query;
|
||||||
TLRPC.messages_Messages res = (TLRPC.messages_Messages) response;
|
TLRPC.messages_Messages res = (TLRPC.messages_Messages) response;
|
||||||
|
@ -330,12 +340,13 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
|
if (delegate != null && req.offset_id == 0) {
|
||||||
|
delegate.searchStateChanged(waitingResponseCount > 0, true);
|
||||||
|
delegate.runResultsEnterAnimation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reqId = 0;
|
reqId = 0;
|
||||||
if (!searchAdapterHelper.isSearchInProgress() && delegate != null) {
|
|
||||||
delegate.searchStateChanged(false);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}, ConnectionsManager.RequestFlagFailOnServerErrors);
|
}, ConnectionsManager.RequestFlagFailOnServerErrors);
|
||||||
}
|
}
|
||||||
|
@ -555,6 +566,8 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
|
|
||||||
private void updateSearchResults(final ArrayList<TLObject> result, final ArrayList<CharSequence> names, final ArrayList<TLRPC.User> encUsers, final int searchId) {
|
private void updateSearchResults(final ArrayList<TLObject> result, final ArrayList<CharSequence> names, final ArrayList<TLRPC.User> encUsers, final int searchId) {
|
||||||
AndroidUtilities.runOnUIThread(() -> {
|
AndroidUtilities.runOnUIThread(() -> {
|
||||||
|
waitingResponseCount--;
|
||||||
|
Log.d("kek", "update local search " + waitingResponseCount);
|
||||||
if (searchId != lastSearchId) {
|
if (searchId != lastSearchId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -585,11 +598,8 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
searchAdapterHelper.mergeResults(searchResult);
|
searchAdapterHelper.mergeResults(searchResult);
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
if (delegate != null) {
|
if (delegate != null) {
|
||||||
if (getItemCount() == 0 && (searchRunnable2 != null || searchAdapterHelper.isSearchInProgress())) {
|
delegate.searchStateChanged(waitingResponseCount > 0, true);
|
||||||
delegate.searchStateChanged(true);
|
delegate.runResultsEnterAnimation();
|
||||||
} else {
|
|
||||||
delegate.searchStateChanged(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -604,6 +614,8 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int waitingResponseCount;
|
||||||
|
|
||||||
public void searchDialogs(String text) {
|
public void searchDialogs(String text) {
|
||||||
if (text != null && text.equals(lastSearchText)) {
|
if (text != null && text.equals(lastSearchText)) {
|
||||||
return;
|
return;
|
||||||
|
@ -634,6 +646,7 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
}
|
}
|
||||||
searchWas = false;
|
searchWas = false;
|
||||||
lastSearchId = 0;
|
lastSearchId = 0;
|
||||||
|
waitingResponseCount = 0;
|
||||||
searchMessagesInternal(null, 0);
|
searchMessagesInternal(null, 0);
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
localTipDates.clear();
|
localTipDates.clear();
|
||||||
|
@ -650,22 +663,23 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
for (int a = 0; a < hashtags.size(); a++) {
|
for (int a = 0; a < hashtags.size(); a++) {
|
||||||
searchResultHashtags.add(hashtags.get(a).hashtag);
|
searchResultHashtags.add(hashtags.get(a).hashtag);
|
||||||
}
|
}
|
||||||
|
waitingResponseCount = 0;
|
||||||
|
notifyDataSetChanged();
|
||||||
if (delegate != null) {
|
if (delegate != null) {
|
||||||
delegate.searchStateChanged(false);
|
delegate.searchStateChanged(false, false);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
/*if (delegate != null) {
|
|
||||||
delegate.searchStateChanged(true);
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
searchResultHashtags.clear();
|
searchResultHashtags.clear();
|
||||||
}
|
}
|
||||||
notifyDataSetChanged();
|
|
||||||
final int searchId = ++lastSearchId;
|
final int searchId = ++lastSearchId;
|
||||||
|
waitingResponseCount = 3;
|
||||||
|
notifyDataSetChanged();
|
||||||
if (needMessagesSearch != 2 && delegate != null) {
|
if (needMessagesSearch != 2 && delegate != null) {
|
||||||
delegate.searchStateChanged(true);
|
delegate.searchStateChanged(true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Utilities.searchQueue.postRunnable(searchRunnable = () -> {
|
Utilities.searchQueue.postRunnable(searchRunnable = () -> {
|
||||||
searchRunnable = null;
|
searchRunnable = null;
|
||||||
searchDialogsInternal(query, searchId);
|
searchDialogsInternal(query, searchId);
|
||||||
|
@ -676,8 +690,14 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
}
|
}
|
||||||
if (needMessagesSearch != 2) {
|
if (needMessagesSearch != 2) {
|
||||||
searchAdapterHelper.queryServerSearch(query, true, dialogsType != 4, true, dialogsType != 4, dialogsType == 2, 0, dialogsType == 0, 0, searchId);
|
searchAdapterHelper.queryServerSearch(query, true, dialogsType != 4, true, dialogsType != 4, dialogsType == 2, 0, dialogsType == 0, 0, searchId);
|
||||||
|
} else {
|
||||||
|
waitingResponseCount--;
|
||||||
}
|
}
|
||||||
|
if (needMessagesSearch == 0) {
|
||||||
|
waitingResponseCount--;
|
||||||
|
} else {
|
||||||
searchMessagesInternal(text, searchId);
|
searchMessagesInternal(text, searchId);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}, 300);
|
}, 300);
|
||||||
}
|
}
|
||||||
|
@ -685,6 +705,9 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
|
if (waitingResponseCount == 3) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (isRecentSearchDisplayed()) {
|
if (isRecentSearchDisplayed()) {
|
||||||
return (!recentSearchObjects.isEmpty() ? recentSearchObjects.size() + 1 : 0) + (!MediaDataController.getInstance(currentAccount).hints.isEmpty() ? 1 : 0);
|
return (!recentSearchObjects.isEmpty() ? recentSearchObjects.size() + 1 : 0) + (!MediaDataController.getInstance(currentAccount).hints.isEmpty() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2864,6 +2864,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||||
canStreamVideo = false;
|
canStreamVideo = false;
|
||||||
animatingNoSound = 0;
|
animatingNoSound = 0;
|
||||||
drawSideButton = !isRepliesChat && checkNeedDrawShareButton(messageObject) ? 1 : 0;
|
drawSideButton = !isRepliesChat && checkNeedDrawShareButton(messageObject) ? 1 : 0;
|
||||||
|
if (drawSideButton == 1 && messageObject.messageOwner.fwd_from != null && !messageObject.isOutOwner() && messageObject.messageOwner.fwd_from.saved_from_peer != null && messageObject.getDialogId() == UserConfig.getInstance(currentAccount).getClientUserId()) {
|
||||||
|
drawSideButton = 2;
|
||||||
|
}
|
||||||
replyNameLayout = null;
|
replyNameLayout = null;
|
||||||
adminLayout = null;
|
adminLayout = null;
|
||||||
checkOnlyButtonPressed = false;
|
checkOnlyButtonPressed = false;
|
||||||
|
@ -4401,7 +4404,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||||
} else {
|
} else {
|
||||||
drawForwardedName = messageObject.messageOwner.fwd_from != null && !messageObject.isAnyKindOfSticker();
|
drawForwardedName = messageObject.messageOwner.fwd_from != null && !messageObject.isAnyKindOfSticker();
|
||||||
if (!messageObject.isAnyKindOfSticker() && messageObject.type != MessageObject.TYPE_ROUND_VIDEO) {
|
if (!messageObject.isAnyKindOfSticker() && messageObject.type != MessageObject.TYPE_ROUND_VIDEO) {
|
||||||
drawName = messageObject.isFromGroup() && messageObject.isMegagroup();
|
drawName = messageObject.isFromGroup() && messageObject.isMegagroup() && (currentPosition == null || (currentPosition.flags & MessageObject.POSITION_FLAG_TOP) != 0);
|
||||||
}
|
}
|
||||||
mediaBackground = isMedia = messageObject.type != 9;
|
mediaBackground = isMedia = messageObject.type != 9;
|
||||||
drawImageButton = true;
|
drawImageButton = true;
|
||||||
|
@ -8725,8 +8728,6 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||||
private boolean checkNeedDrawShareButton(MessageObject messageObject) {
|
private boolean checkNeedDrawShareButton(MessageObject messageObject) {
|
||||||
if ((currentPosition != null && !currentPosition.last) || currentMessageObject.deleted) {
|
if ((currentPosition != null && !currentPosition.last) || currentMessageObject.deleted) {
|
||||||
return false;
|
return false;
|
||||||
} else if (messageObject.messageOwner.fwd_from != null && !messageObject.isOutOwner() && messageObject.messageOwner.fwd_from.saved_from_peer != null && messageObject.getDialogId() == UserConfig.getInstance(currentAccount).getClientUserId()) {
|
|
||||||
drawSideButton = 2;
|
|
||||||
}
|
}
|
||||||
return messageObject.needDrawShareButton();
|
return messageObject.needDrawShareButton();
|
||||||
}
|
}
|
||||||
|
@ -10048,11 +10049,33 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||||
Theme.chat_adminPaint.setColor(color);
|
Theme.chat_adminPaint.setColor(color);
|
||||||
canvas.save();
|
canvas.save();
|
||||||
float ax;
|
float ax;
|
||||||
|
if (currentMessagesGroup != null) {
|
||||||
|
int dWidth = getGroupPhotosWidth();
|
||||||
|
int firstLineWidth = 0;
|
||||||
|
for (int a = 0; a < currentMessagesGroup.posArray.size(); a++) {
|
||||||
|
MessageObject.GroupedMessagePosition position = currentMessagesGroup.posArray.get(a);
|
||||||
|
if (position.minY == 0) {
|
||||||
|
firstLineWidth += Math.ceil((position.pw + position.leftSpanOffset) / 1000.0f * dWidth);
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!mediaBackground && currentMessageObject.isOutOwner()) {
|
||||||
|
ax = backgroundDrawableLeft + firstLineWidth - AndroidUtilities.dp(17) - adminLayout.getLineWidth(0);
|
||||||
|
} else {
|
||||||
|
ax = backgroundDrawableLeft + firstLineWidth - AndroidUtilities.dp(11) - adminLayout.getLineWidth(0);
|
||||||
|
}
|
||||||
|
ax -= getExtraTextX() + AndroidUtilities.dp(8);
|
||||||
|
if (!currentMessageObject.isOutOwner()) {
|
||||||
|
ax -= AndroidUtilities.dp(48);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (!mediaBackground && currentMessageObject.isOutOwner()) {
|
if (!mediaBackground && currentMessageObject.isOutOwner()) {
|
||||||
ax = backgroundDrawableLeft + backgroundDrawableRight - AndroidUtilities.dp(17) - adminLayout.getLineWidth(0);
|
ax = backgroundDrawableLeft + backgroundDrawableRight - AndroidUtilities.dp(17) - adminLayout.getLineWidth(0);
|
||||||
} else {
|
} else {
|
||||||
ax = backgroundDrawableLeft + backgroundDrawableRight - AndroidUtilities.dp(11) - adminLayout.getLineWidth(0);
|
ax = backgroundDrawableLeft + backgroundDrawableRight - AndroidUtilities.dp(11) - adminLayout.getLineWidth(0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
canvas.translate(ax, nameY + AndroidUtilities.dp(0.5f));
|
canvas.translate(ax, nameY + AndroidUtilities.dp(0.5f));
|
||||||
if (transitionParams.animateSign) {
|
if (transitionParams.animateSign) {
|
||||||
Theme.chat_adminPaint.setAlpha((int) (Color.alpha(color) * transitionParams.animateChangeProgress));
|
Theme.chat_adminPaint.setAlpha((int) (Color.alpha(color) * transitionParams.animateChangeProgress));
|
||||||
|
@ -12372,9 +12395,13 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||||
}
|
}
|
||||||
} else if (virtualViewId == COMMENT) {
|
} else if (virtualViewId == COMMENT) {
|
||||||
if (delegate != null) {
|
if (delegate != null) {
|
||||||
|
if (isRepliesChat) {
|
||||||
|
delegate.didPressSideButton(ChatMessageCell.this);
|
||||||
|
} else {
|
||||||
delegate.didPressCommentButton(ChatMessageCell.this);
|
delegate.didPressCommentButton(ChatMessageCell.this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (action == AccessibilityNodeInfo.ACTION_LONG_CLICK) {
|
} else if (action == AccessibilityNodeInfo.ACTION_LONG_CLICK) {
|
||||||
ClickableSpan link = getLinkById(virtualViewId);
|
ClickableSpan link = getLinkById(virtualViewId);
|
||||||
if (link != null) {
|
if (link != null) {
|
||||||
|
|
|
@ -410,7 +410,7 @@ public class SharedAudioCell extends FrameLayout implements DownloadController.F
|
||||||
|
|
||||||
if (titleLayout != null) {
|
if (titleLayout != null) {
|
||||||
canvas.save();
|
canvas.save();
|
||||||
canvas.translate(AndroidUtilities.dp(LocaleController.isRTL ? 8 : AndroidUtilities.leftBaseline), titleY);
|
canvas.translate(AndroidUtilities.dp(LocaleController.isRTL ? 8 : AndroidUtilities.leftBaseline) + (LocaleController.isRTL && dateLayout != null ? dateLayout.getWidth() + AndroidUtilities.dp(4) : 0), titleY);
|
||||||
titleLayout.draw(canvas);
|
titleLayout.draw(canvas);
|
||||||
canvas.restore();
|
canvas.restore();
|
||||||
}
|
}
|
||||||
|
|
|
@ -309,7 +309,7 @@ public class SharedLinkCell extends FrameLayout {
|
||||||
titleFinal = titleH;
|
titleFinal = titleH;
|
||||||
}
|
}
|
||||||
|
|
||||||
titleLayout = ChatMessageCell.generateStaticLayout(titleFinal, titleTextPaint, maxWidth - dateWidth, maxWidth - dateWidth, 0, 3);
|
titleLayout = ChatMessageCell.generateStaticLayout(titleFinal, titleTextPaint, maxWidth - dateWidth - AndroidUtilities.dp(4), maxWidth - dateWidth - AndroidUtilities.dp(4), 0, 3);
|
||||||
if (titleLayout.getLineCount() > 0) {
|
if (titleLayout.getLineCount() > 0) {
|
||||||
descriptionY = titleY + titleLayout.getLineBottom(titleLayout.getLineCount() - 1) + AndroidUtilities.dp(4);
|
descriptionY = titleY + titleLayout.getLineBottom(titleLayout.getLineCount() - 1) + AndroidUtilities.dp(4);
|
||||||
}
|
}
|
||||||
|
@ -565,7 +565,11 @@ public class SharedLinkCell extends FrameLayout {
|
||||||
}
|
}
|
||||||
if (titleLayout != null) {
|
if (titleLayout != null) {
|
||||||
canvas.save();
|
canvas.save();
|
||||||
canvas.translate(AndroidUtilities.dp(LocaleController.isRTL ? 8 : AndroidUtilities.leftBaseline), titleY);
|
float x = AndroidUtilities.dp(LocaleController.isRTL ? 8 : AndroidUtilities.leftBaseline);
|
||||||
|
if (LocaleController.isRTL) {
|
||||||
|
x += dateLayout == null ? 0 : (dateLayout.getWidth() + AndroidUtilities.dp(4));
|
||||||
|
}
|
||||||
|
canvas.translate(x, titleY);
|
||||||
titleLayout.draw(canvas);
|
titleLayout.draw(canvas);
|
||||||
canvas.restore();
|
canvas.restore();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2508,23 +2508,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (child == chatListView) {
|
if (child == chatListView) {
|
||||||
/*globalIgnoreLayout = true;
|
|
||||||
int additionalPadding = inputFieldHeight - AndroidUtilities.dp(51);
|
|
||||||
if (pinnedMessageView != null && pinnedMessageView.getTag() == null || topChatPanelView != null && topChatPanelView.getTag() == null) {
|
|
||||||
chatListView.setPadding(0, AndroidUtilities.dp(52) + additionalPadding, 0, AndroidUtilities.dp(3));
|
|
||||||
} else {
|
|
||||||
chatListView.setPadding(0, AndroidUtilities.dp(4) + additionalPadding, 0, AndroidUtilities.dp(3));
|
|
||||||
}
|
|
||||||
globalIgnoreLayout = false;*/
|
|
||||||
// if (chatActivityEnterView.getAlpha() != 1.0f) {
|
|
||||||
// chatListView.setTranslationY(inputFieldHeight - AndroidUtilities.dp(51));
|
|
||||||
// }
|
|
||||||
chatListViewClipTop = inPreviewMode ? 0 : (inputFieldHeight - AndroidUtilities.dp(51));
|
chatListViewClipTop = inPreviewMode ? 0 : (inputFieldHeight - AndroidUtilities.dp(51));
|
||||||
int contentWidthSpec = MeasureSpec.makeMeasureSpec(widthSize, MeasureSpec.EXACTLY);
|
int contentWidthSpec = MeasureSpec.makeMeasureSpec(widthSize, MeasureSpec.EXACTLY);
|
||||||
int h = heightSize - listViewTopHeight - (inPreviewMode && Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0);
|
int h = heightSize - listViewTopHeight - (inPreviewMode && Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0);
|
||||||
// if (!chatActivityEnterView.pannelAniamationInProgress()) {
|
|
||||||
// h -= chatEmojiViewPadding;
|
|
||||||
// }
|
|
||||||
if (keyboardSize > AndroidUtilities.dp(20) && getLayoutParams().height < 0) {
|
if (keyboardSize > AndroidUtilities.dp(20) && getLayoutParams().height < 0) {
|
||||||
h += keyboardSize;
|
h += keyboardSize;
|
||||||
}
|
}
|
||||||
|
@ -2727,9 +2713,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
if (keyboardSize > AndroidUtilities.dp(20) && getLayoutParams().height < 0) {
|
if (keyboardSize > AndroidUtilities.dp(20) && getLayoutParams().height < 0) {
|
||||||
childTop -= keyboardSize;
|
childTop -= keyboardSize;
|
||||||
}
|
}
|
||||||
// if (!chatActivityEnterView.pannelAniamationInProgress()) {
|
|
||||||
// childTop += chatEmojiViewPadding;
|
|
||||||
// }
|
|
||||||
} else if (child == progressView) {
|
} else if (child == progressView) {
|
||||||
if (chatActivityEnterView.isTopViewVisible()) {
|
if (chatActivityEnterView.isTopViewVisible()) {
|
||||||
childTop -= AndroidUtilities.dp(48);
|
childTop -= AndroidUtilities.dp(48);
|
||||||
|
@ -14567,6 +14550,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
} else {
|
} else {
|
||||||
pinnedMessageEnterOffset = 0;
|
pinnedMessageEnterOffset = 0;
|
||||||
invalidateChatListViewTopPadding();
|
invalidateChatListViewTopPadding();
|
||||||
|
if (firstLoading) {
|
||||||
|
updateChatListViewTopPadding();
|
||||||
|
}
|
||||||
pinnedMessageView.setVisibility(View.VISIBLE);
|
pinnedMessageView.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14974,9 +14960,13 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
}
|
}
|
||||||
if (actionBar != null) {
|
if (actionBar != null) {
|
||||||
actionBar.setBackButtonDrawable(!value ? new BackDrawable(false) : null);
|
actionBar.setBackButtonDrawable(!value ? new BackDrawable(false) : null);
|
||||||
|
if (headerItem != null) {
|
||||||
headerItem.setAlpha(!value ? 1.0f : 0.0f);
|
headerItem.setAlpha(!value ? 1.0f : 0.0f);
|
||||||
|
}
|
||||||
|
if (attachItem != null) {
|
||||||
attachItem.setAlpha(!value ? 1.0f : 0.0f);
|
attachItem.setAlpha(!value ? 1.0f : 0.0f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (chatListView != null) {
|
if (chatListView != null) {
|
||||||
int count = chatListView.getChildCount();
|
int count = chatListView.getChildCount();
|
||||||
|
|
|
@ -6565,9 +6565,9 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||||
keyboardHeightLand = MessagesController.getGlobalEmojiSettings().getInt("kbd_height_land3", AndroidUtilities.dp(200));
|
keyboardHeightLand = MessagesController.getGlobalEmojiSettings().getInt("kbd_height_land3", AndroidUtilities.dp(200));
|
||||||
}
|
}
|
||||||
int currentHeight = AndroidUtilities.displaySize.x > AndroidUtilities.displaySize.y ? keyboardHeightLand : keyboardHeight;
|
int currentHeight = AndroidUtilities.displaySize.x > AndroidUtilities.displaySize.y ? keyboardHeightLand : keyboardHeight;
|
||||||
if (!samePannelWasVisible && !anotherPanelWasVisible) {
|
/*if (!samePannelWasVisible && !anotherPanelWasVisible) {
|
||||||
currentHeight = 0;
|
currentHeight = 0;
|
||||||
} else if (contentType == 1) {
|
} else */if (contentType == 1) {
|
||||||
currentHeight = Math.min(botKeyboardView.getKeyboardHeight(), currentHeight);
|
currentHeight = Math.min(botKeyboardView.getKeyboardHeight(), currentHeight);
|
||||||
}
|
}
|
||||||
if (botKeyboardView != null) {
|
if (botKeyboardView != null) {
|
||||||
|
|
|
@ -529,6 +529,7 @@ public class ChatAttachAlertAudioLayout extends ChatAttachAlert.AttachAlertLayou
|
||||||
message.out = true;
|
message.out = true;
|
||||||
message.id = id;
|
message.id = id;
|
||||||
message.peer_id = new TLRPC.TL_peerUser();
|
message.peer_id = new TLRPC.TL_peerUser();
|
||||||
|
message.from_id = new TLRPC.TL_peerUser();
|
||||||
message.peer_id.user_id = message.from_id.user_id = UserConfig.getInstance(parentAlert.currentAccount).getClientUserId();
|
message.peer_id.user_id = message.from_id.user_id = UserConfig.getInstance(parentAlert.currentAccount).getClientUserId();
|
||||||
message.date = (int) (System.currentTimeMillis() / 1000);
|
message.date = (int) (System.currentTimeMillis() / 1000);
|
||||||
message.message = "";
|
message.message = "";
|
||||||
|
|
|
@ -2500,6 +2500,7 @@ public class ChatAttachAlertPhotoLayout extends ChatAttachAlert.AttachAlertLayou
|
||||||
if (cameraIcon != null) {
|
if (cameraIcon != null) {
|
||||||
cameraIcon.setVisibility(VISIBLE);
|
cameraIcon.setVisibility(VISIBLE);
|
||||||
}
|
}
|
||||||
|
if (cameraView != null) {
|
||||||
int count = gridView.getChildCount();
|
int count = gridView.getChildCount();
|
||||||
for (int a = 0; a < count; a++) {
|
for (int a = 0; a < count; a++) {
|
||||||
View child = gridView.getChildAt(a);
|
View child = gridView.getChildAt(a);
|
||||||
|
@ -2509,6 +2510,7 @@ public class ChatAttachAlertPhotoLayout extends ChatAttachAlert.AttachAlertLayou
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void onHideShowProgress(float progress) {
|
void onHideShowProgress(float progress) {
|
||||||
|
|
|
@ -16,7 +16,6 @@ import android.animation.ValueAnimator;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.ColorFilter;
|
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.PorterDuffColorFilter;
|
import android.graphics.PorterDuffColorFilter;
|
||||||
|
@ -382,6 +381,9 @@ public class PhotoViewerCaptionEnterView extends FrameLayout implements Notifica
|
||||||
public void updateColors() {
|
public void updateColors() {
|
||||||
Theme.setDrawableColor(drawable, Theme.getColor(Theme.key_dialogFloatingButton));
|
Theme.setDrawableColor(drawable, Theme.getColor(Theme.key_dialogFloatingButton));
|
||||||
Theme.setDrawableColor(checkDrawable, Theme.getColor(Theme.key_dialogFloatingIcon));
|
Theme.setDrawableColor(checkDrawable, Theme.getColor(Theme.key_dialogFloatingIcon));
|
||||||
|
if (emojiView != null) {
|
||||||
|
emojiView.updateColors();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hideActionMode() {
|
public boolean hideActionMode() {
|
||||||
|
@ -522,11 +524,7 @@ public class PhotoViewerCaptionEnterView extends FrameLayout implements Notifica
|
||||||
Emoji.replaceEmoji(builder, messageEditText.getPaint().getFontMetricsInt(), AndroidUtilities.dp(20), false);
|
Emoji.replaceEmoji(builder, messageEditText.getPaint().getFontMetricsInt(), AndroidUtilities.dp(20), false);
|
||||||
}
|
}
|
||||||
messageEditText.setText(builder);
|
messageEditText.setText(builder);
|
||||||
if (start + text.length() <= messageEditText.length()) {
|
messageEditText.setSelection(Math.min(start + text.length(), messageEditText.length()));
|
||||||
messageEditText.setSelection(start + text.length());
|
|
||||||
} else {
|
|
||||||
messageEditText.setSelection(messageEditText.length());
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
FileLog.e(e);
|
FileLog.e(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,16 @@ package org.telegram.ui.Components;
|
||||||
|
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
|
import android.animation.AnimatorSet;
|
||||||
|
import android.animation.ObjectAnimator;
|
||||||
|
import android.animation.ValueAnimator;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.Canvas;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.SparseArray;
|
||||||
|
import android.util.SparseIntArray;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.ViewTreeObserver;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
@ -40,7 +47,9 @@ import org.telegram.ui.ViewPagerFixed;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class SearchViewPager extends ViewPagerFixed implements FilteredSearchView.UiCallback {
|
public class SearchViewPager extends ViewPagerFixed implements FilteredSearchView.UiCallback {
|
||||||
|
|
||||||
|
@ -80,6 +89,8 @@ public class SearchViewPager extends ViewPagerFixed implements FilteredSearchVie
|
||||||
|
|
||||||
private final int folderId;
|
private final int folderId;
|
||||||
|
|
||||||
|
ArrayList<SearchResultsEnterAnimator> currentAnimators = new ArrayList<>();
|
||||||
|
|
||||||
public SearchViewPager(Context context, BaseFragment fragment, int type, int initialDialogsType, int folderId, ChatPreviewDelegate chatPreviewDelegate) {
|
public SearchViewPager(Context context, BaseFragment fragment, int type, int initialDialogsType, int folderId, ChatPreviewDelegate chatPreviewDelegate) {
|
||||||
super(context);
|
super(context);
|
||||||
this.folderId = folderId;
|
this.folderId = folderId;
|
||||||
|
@ -96,14 +107,30 @@ public class SearchViewPager extends ViewPagerFixed implements FilteredSearchVie
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
searchListView = new RecyclerListView(context);
|
searchListView = new RecyclerListView(context) {
|
||||||
|
@Override
|
||||||
|
protected void dispatchDraw(Canvas canvas) {
|
||||||
|
int n = getChildCount();
|
||||||
|
loop: for (int i = 0; i < n; i++) {
|
||||||
|
View v = getChildAt(i);
|
||||||
|
int position = searchlayoutManager.getPosition(v);
|
||||||
|
for (int k = 0; k < currentAnimators.size(); k++) {
|
||||||
|
if (currentAnimators.get(k).setup(v, position)) {
|
||||||
|
continue loop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
v.setAlpha(1f);
|
||||||
|
}
|
||||||
|
super.dispatchDraw(canvas);
|
||||||
|
}
|
||||||
|
};
|
||||||
searchListView.setPivotY(0);
|
searchListView.setPivotY(0);
|
||||||
searchListView.setAdapter(dialogsSearchAdapter);
|
searchListView.setAdapter(dialogsSearchAdapter);
|
||||||
searchListView.setVerticalScrollBarEnabled(true);
|
searchListView.setVerticalScrollBarEnabled(true);
|
||||||
searchListView.setInstantClick(true);
|
searchListView.setInstantClick(true);
|
||||||
searchListView.setVerticalScrollbarPosition(LocaleController.isRTL ? RecyclerListView.SCROLLBAR_POSITION_LEFT : RecyclerListView.SCROLLBAR_POSITION_RIGHT);
|
searchListView.setVerticalScrollbarPosition(LocaleController.isRTL ? RecyclerListView.SCROLLBAR_POSITION_LEFT : RecyclerListView.SCROLLBAR_POSITION_RIGHT);
|
||||||
searchListView.setLayoutManager(searchlayoutManager = new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false));
|
searchListView.setLayoutManager(searchlayoutManager = new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false));
|
||||||
|
searchListView.setAnimateEmptyView(true, 0);
|
||||||
searchListView.setOnScrollListener(new RecyclerView.OnScrollListener() {
|
searchListView.setOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
|
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
|
||||||
|
@ -226,6 +253,8 @@ public class SearchViewPager extends ViewPagerFixed implements FilteredSearchVie
|
||||||
dialogsSearchAdapter.setFiltersDelegate(filteredSearchViewDelegate, false);
|
dialogsSearchAdapter.setFiltersDelegate(filteredSearchViewDelegate, false);
|
||||||
noMediaFiltersSearchView.animate().setListener(null).cancel();
|
noMediaFiltersSearchView.animate().setListener(null).cancel();
|
||||||
noMediaFiltersSearchView.setDelegate(null, false);
|
noMediaFiltersSearchView.setDelegate(null, false);
|
||||||
|
emptyView.showProgress(!dialogsSearchAdapter.isSearching(), false);
|
||||||
|
emptyView.showProgress(dialogsSearchAdapter.isSearching(), false);
|
||||||
if (reset) {
|
if (reset) {
|
||||||
noMediaFiltersSearchView.setVisibility(View.GONE);
|
noMediaFiltersSearchView.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
|
@ -629,6 +658,74 @@ public class SearchViewPager extends ViewPagerFixed implements FilteredSearchVie
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void runResultsEnterAnimation() {
|
||||||
|
Set<Integer> hasSet = new HashSet<>();
|
||||||
|
int n = searchListView.getChildCount();
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
hasSet.add(searchlayoutManager.getPosition(searchListView.getChildAt(i)));
|
||||||
|
}
|
||||||
|
searchListView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreDraw() {
|
||||||
|
searchListView.getViewTreeObserver().removeOnPreDrawListener(this);
|
||||||
|
int n = searchListView.getChildCount();
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
View child = searchListView.getChildAt(i);
|
||||||
|
int position = searchlayoutManager.getPosition(child);
|
||||||
|
if (!hasSet.contains(position)) {
|
||||||
|
SearchResultsEnterAnimator animator = new SearchResultsEnterAnimator();
|
||||||
|
child.setAlpha(0);
|
||||||
|
int s = Math.min(searchListView.getMeasuredHeight(), Math.max(0, child.getTop()));
|
||||||
|
int delay = (int) ((s / (float) searchListView.getMeasuredHeight()) * 100);
|
||||||
|
animator.position = position;
|
||||||
|
animator.valueAnimator.setStartDelay(delay);
|
||||||
|
animator.valueAnimator.setDuration(200);
|
||||||
|
animator.valueAnimator.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void cancelEnterAnimation() {
|
||||||
|
for (int i = 0; i < currentAnimators.size(); i++) {
|
||||||
|
SearchResultsEnterAnimator animator = currentAnimators.get(i);
|
||||||
|
animator.valueAnimator.cancel();
|
||||||
|
currentAnimators.remove(animator);
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private class SearchResultsEnterAnimator {
|
||||||
|
final ValueAnimator valueAnimator;
|
||||||
|
float progress;
|
||||||
|
int position;
|
||||||
|
|
||||||
|
private SearchResultsEnterAnimator() {
|
||||||
|
valueAnimator = ValueAnimator.ofFloat(0, 1f);
|
||||||
|
valueAnimator.addUpdateListener(valueAnimator -> {
|
||||||
|
progress = (float) valueAnimator.getAnimatedValue();
|
||||||
|
searchListView.invalidate();
|
||||||
|
});
|
||||||
|
valueAnimator.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
currentAnimators.remove(SearchResultsEnterAnimator.this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
currentAnimators.add(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean setup(View view, int position) {
|
||||||
|
if (this.position == position) {
|
||||||
|
view.setAlpha(progress);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public interface ChatPreviewDelegate {
|
public interface ChatPreviewDelegate {
|
||||||
void startChatPreview(DialogCell cell);
|
void startChatPreview(DialogCell cell);
|
||||||
|
|
|
@ -2608,14 +2608,20 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
|
|
||||||
searchViewPager.dialogsSearchAdapter.setDelegate(new DialogsSearchAdapter.DialogsSearchAdapterDelegate() {
|
searchViewPager.dialogsSearchAdapter.setDelegate(new DialogsSearchAdapter.DialogsSearchAdapterDelegate() {
|
||||||
@Override
|
@Override
|
||||||
public void searchStateChanged(boolean search) {
|
public void searchStateChanged(boolean search, boolean animated) {
|
||||||
|
if (searchViewPager.emptyView.getVisibility() == View.VISIBLE) {
|
||||||
|
animated = true;
|
||||||
|
}
|
||||||
if (searching && searchWas && searchViewPager.emptyView != null) {
|
if (searching && searchWas && searchViewPager.emptyView != null) {
|
||||||
if (search || searchViewPager.dialogsSearchAdapter.getItemCount() != 0) {
|
if (search || searchViewPager.dialogsSearchAdapter.getItemCount() != 0) {
|
||||||
searchViewPager.emptyView.showProgress(true);
|
searchViewPager.emptyView.showProgress(true, animated);
|
||||||
} else {
|
} else {
|
||||||
searchViewPager.emptyView.showProgress(false);
|
searchViewPager.emptyView.showProgress(false, animated);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (search && searchViewPager.dialogsSearchAdapter.getItemCount() == 0) {
|
||||||
|
searchViewPager.cancelEnterAnimation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2702,6 +2708,13 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
button.setTextColor(Theme.getColor(Theme.key_dialogTextRed2));
|
button.setTextColor(Theme.getColor(Theme.key_dialogTextRed2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runResultsEnterAnimation() {
|
||||||
|
if (searchViewPager != null) {
|
||||||
|
searchViewPager.runResultsEnterAnimation();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
searchViewPager.searchListView.setOnItemClickListener((view, position) -> onItemClick(view, position, searchViewPager.dialogsSearchAdapter));
|
searchViewPager.searchListView.setOnItemClickListener((view, position) -> onItemClick(view, position, searchViewPager.dialogsSearchAdapter));
|
||||||
|
@ -3753,7 +3766,6 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
}
|
}
|
||||||
searchWasFullyShowed = true;
|
searchWasFullyShowed = true;
|
||||||
AndroidUtilities.requestAdjustResize(getParentActivity(), classGuid);
|
AndroidUtilities.requestAdjustResize(getParentActivity(), classGuid);
|
||||||
fragmentView.requestLayout();
|
|
||||||
searchItem.setVisibility(View.GONE);
|
searchItem.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
whiteActionBar = false;
|
whiteActionBar = false;
|
||||||
|
@ -3769,9 +3781,11 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
hideFloatingButton(false);
|
hideFloatingButton(false);
|
||||||
}
|
}
|
||||||
searchWasFullyShowed = false;
|
searchWasFullyShowed = false;
|
||||||
fragmentView.requestLayout();
|
|
||||||
searchItem.getSearchContainer().setAlpha(1f);
|
searchItem.getSearchContainer().setAlpha(1f);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fragmentView != null) {
|
||||||
|
fragmentView.requestLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
viewPages[0].listView.setVerticalScrollBarEnabled(true);
|
viewPages[0].listView.setVerticalScrollBarEnabled(true);
|
||||||
|
@ -5931,6 +5945,9 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
if (doneItem != null) {
|
if (doneItem != null) {
|
||||||
doneItem.setIconColor(Theme.getColor(Theme.key_actionBarDefaultIcon));
|
doneItem.setIconColor(Theme.getColor(Theme.key_actionBarDefaultIcon));
|
||||||
}
|
}
|
||||||
|
if (commentView != null) {
|
||||||
|
commentView.updateColors();
|
||||||
|
}
|
||||||
|
|
||||||
if (filtersView != null) {
|
if (filtersView != null) {
|
||||||
filtersView.updateColors();
|
filtersView.updateColors();
|
||||||
|
@ -6304,6 +6321,15 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
arrayList.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_player_button));
|
arrayList.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_player_button));
|
||||||
arrayList.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_player_buttonActive));
|
arrayList.add(new ThemeDescription(null, 0, null, null, null, null, Theme.key_player_buttonActive));
|
||||||
|
|
||||||
|
if (commentView != null) {
|
||||||
|
arrayList.add(new ThemeDescription(commentView, 0, null, Theme.chat_composeBackgroundPaint, null, null, Theme.key_chat_messagePanelBackground));
|
||||||
|
arrayList.add(new ThemeDescription(commentView, 0, null, null, new Drawable[]{Theme.chat_composeShadowDrawable}, null, Theme.key_chat_messagePanelShadow));
|
||||||
|
arrayList.add(new ThemeDescription(commentView, ThemeDescription.FLAG_TEXTCOLOR, new Class[]{ChatActivityEnterView.class}, new String[]{"messageEditText"}, null, null, null, Theme.key_chat_messagePanelText));
|
||||||
|
arrayList.add(new ThemeDescription(commentView, ThemeDescription.FLAG_CURSORCOLOR, new Class[]{ChatActivityEnterView.class}, new String[]{"messageEditText"}, null, null, null, Theme.key_chat_messagePanelCursor));
|
||||||
|
arrayList.add(new ThemeDescription(commentView, ThemeDescription.FLAG_HINTTEXTCOLOR, new Class[]{ChatActivityEnterView.class}, new String[]{"messageEditText"}, null, null, null, Theme.key_chat_messagePanelHint));
|
||||||
|
arrayList.add(new ThemeDescription(commentView, ThemeDescription.FLAG_IMAGECOLOR, new Class[]{ChatActivityEnterView.class}, new String[]{"sendButton"}, null, null, null, Theme.key_chat_messagePanelSend));
|
||||||
|
}
|
||||||
|
|
||||||
arrayList.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_actionBarTipBackground));
|
arrayList.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_actionBarTipBackground));
|
||||||
arrayList.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_windowBackgroundWhiteBlackText));
|
arrayList.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_windowBackgroundWhiteBlackText));
|
||||||
arrayList.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_player_time));
|
arrayList.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_player_time));
|
||||||
|
|
|
@ -2250,7 +2250,6 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
||||||
FileLog.e(e);
|
FileLog.e(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//TODO error
|
|
||||||
try {
|
try {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -3163,6 +3162,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
||||||
});
|
});
|
||||||
mainFragmentsStack.get(mainFragmentsStack.size() - 1).showDialog(alert);
|
mainFragmentsStack.get(mainFragmentsStack.size() - 1).showDialog(alert);
|
||||||
} else {
|
} else {
|
||||||
|
String captionToSend = null;
|
||||||
for (int i = 0; i < dids.size(); i++) {
|
for (int i = 0; i < dids.size(); i++) {
|
||||||
final long did = dids.get(i);
|
final long did = dids.get(i);
|
||||||
int lower_part = (int) did;
|
int lower_part = (int) did;
|
||||||
|
@ -3177,14 +3177,13 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (videoPath != null) {
|
if (videoPath != null) {
|
||||||
String caption = null;
|
|
||||||
if (sendingText != null && sendingText.length() <= 1024) {
|
if (sendingText != null && sendingText.length() <= 1024) {
|
||||||
caption = sendingText;
|
captionToSend = sendingText;
|
||||||
sendingText = null;
|
sendingText = null;
|
||||||
}
|
}
|
||||||
ArrayList<String> arrayList = new ArrayList<>();
|
ArrayList<String> arrayList = new ArrayList<>();
|
||||||
arrayList.add(videoPath);
|
arrayList.add(videoPath);
|
||||||
SendMessagesHelper.prepareSendingDocuments(accountInstance, arrayList, arrayList, null, caption, null, did, null, null, null, null, true, 0);
|
SendMessagesHelper.prepareSendingDocuments(accountInstance, arrayList, arrayList, null, captionToSend, null, did, null, null, null, null, true, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (photoPathsArray != null) {
|
if (photoPathsArray != null) {
|
||||||
|
@ -3195,12 +3194,11 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
||||||
SendMessagesHelper.prepareSendingMedia(accountInstance, photoPathsArray, did, null, null, null, false, false, null, true, 0);
|
SendMessagesHelper.prepareSendingMedia(accountInstance, photoPathsArray, did, null, null, null, false, false, null, true, 0);
|
||||||
}
|
}
|
||||||
if (documentsPathsArray != null || documentsUrisArray != null) {
|
if (documentsPathsArray != null || documentsUrisArray != null) {
|
||||||
String caption = null;
|
|
||||||
if (sendingText != null && sendingText.length() <= 1024 && ((documentsPathsArray != null ? documentsPathsArray.size() : 0) + (documentsUrisArray != null ? documentsUrisArray.size() : 0)) == 1) {
|
if (sendingText != null && sendingText.length() <= 1024 && ((documentsPathsArray != null ? documentsPathsArray.size() : 0) + (documentsUrisArray != null ? documentsUrisArray.size() : 0)) == 1) {
|
||||||
caption = sendingText;
|
captionToSend = sendingText;
|
||||||
sendingText = null;
|
sendingText = null;
|
||||||
}
|
}
|
||||||
SendMessagesHelper.prepareSendingDocuments(accountInstance, documentsPathsArray, documentsOriginalPathsArray, documentsUrisArray, caption, documentsMimeType, did, null, null, null, null, true, 0);
|
SendMessagesHelper.prepareSendingDocuments(accountInstance, documentsPathsArray, documentsOriginalPathsArray, documentsUrisArray, captionToSend, documentsMimeType, did, null, null, null, null, true, 0);
|
||||||
}
|
}
|
||||||
if (sendingText != null) {
|
if (sendingText != null) {
|
||||||
SendMessagesHelper.prepareSendingText(accountInstance, sendingText, did, true, 0);
|
SendMessagesHelper.prepareSendingText(accountInstance, sendingText, did, true, 0);
|
||||||
|
|
|
@ -6935,7 +6935,9 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
||||||
}
|
}
|
||||||
File f = new File(FileLoader.getDirectory(FileLoader.MEDIA_DIR_CACHE), SharedConfig.getLastLocalId() + "_temp.jpg");
|
File f = new File(FileLoader.getDirectory(FileLoader.MEDIA_DIR_CACHE), SharedConfig.getLastLocalId() + "_temp.jpg");
|
||||||
mergeImages(entry.thumbPath = f.getAbsolutePath(), null, croppedPaintBitmap, croppedBitmap, thumbSize, true);
|
mergeImages(entry.thumbPath = f.getAbsolutePath(), null, croppedPaintBitmap, croppedBitmap, thumbSize, true);
|
||||||
|
if (croppedPaintBitmap != null) {
|
||||||
croppedPaintBitmap.recycle();
|
croppedPaintBitmap.recycle();
|
||||||
|
}
|
||||||
paintBitmap.recycle();
|
paintBitmap.recycle();
|
||||||
} else {
|
} else {
|
||||||
if (!isCurrentVideo) {
|
if (!isCurrentVideo) {
|
||||||
|
@ -9621,6 +9623,17 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
||||||
editState.mediaEntities = searchImage.mediaEntities;
|
editState.mediaEntities = searchImage.mediaEntities;
|
||||||
editState.cropState = searchImage.cropState;
|
editState.cropState = searchImage.cropState;
|
||||||
}
|
}
|
||||||
|
if (object instanceof MediaController.MediaEditState) {
|
||||||
|
MediaController.MediaEditState state = (MediaController.MediaEditState) object;
|
||||||
|
if (hasAnimatedMediaEntities()) {
|
||||||
|
currentImagePath = state.imagePath;
|
||||||
|
} else if (state.filterPath != null) {
|
||||||
|
currentImagePath = state.filterPath;
|
||||||
|
} else {
|
||||||
|
currentImagePath = currentPathObject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (editState.cropState != null) {
|
if (editState.cropState != null) {
|
||||||
previousHasTransform = true;
|
previousHasTransform = true;
|
||||||
previousCropPx = editState.cropState.cropPx;
|
previousCropPx = editState.cropState.cropPx;
|
||||||
|
@ -9636,17 +9649,6 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
||||||
previousHasTransform = false;
|
previousHasTransform = false;
|
||||||
cropTransform.setViewTransform(false, previousCropPx, previousCropPy, previousCropRotation, previousCropOrientation, previousCropScale, 1.0f, 1.0f, previousCropPw, previousCropPh, 0, 0, previousCropMirrored);
|
cropTransform.setViewTransform(false, previousCropPx, previousCropPy, previousCropRotation, previousCropOrientation, previousCropScale, 1.0f, 1.0f, previousCropPw, previousCropPh, 0, 0, previousCropMirrored);
|
||||||
}
|
}
|
||||||
if (object instanceof MediaController.MediaEditState) {
|
|
||||||
MediaController.MediaEditState state = (MediaController.MediaEditState) object;
|
|
||||||
if (hasAnimatedMediaEntities()) {
|
|
||||||
currentImagePath = state.imagePath;
|
|
||||||
} else if (state.filterPath != null) {
|
|
||||||
currentImagePath = state.filterPath;
|
|
||||||
} else {
|
|
||||||
currentImagePath = currentPathObject;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (pageBlocksAdapter != null) {
|
} else if (pageBlocksAdapter != null) {
|
||||||
if (currentIndex < 0 || currentIndex >= pageBlocksAdapter.getItemsCount()) {
|
if (currentIndex < 0 || currentIndex >= pageBlocksAdapter.getItemsCount()) {
|
||||||
closePhoto(false, false);
|
closePhoto(false, false);
|
||||||
|
|
|
@ -4862,6 +4862,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||||
}
|
}
|
||||||
} else if (chat_id != 0) {
|
} else if (chat_id != 0) {
|
||||||
if (chatInfo != null && (!TextUtils.isEmpty(chatInfo.about) || chatInfo.location instanceof TLRPC.TL_channelLocation) || !TextUtils.isEmpty(currentChat.username)) {
|
if (chatInfo != null && (!TextUtils.isEmpty(chatInfo.about) || chatInfo.location instanceof TLRPC.TL_channelLocation) || !TextUtils.isEmpty(currentChat.username)) {
|
||||||
|
if (LocaleController.isRTL && ChatObject.isChannel(currentChat) && !currentChat.megagroup && chatInfo.linked_chat_id != 0) {
|
||||||
|
emptyRow = rowCount++;
|
||||||
|
}
|
||||||
infoHeaderRow = rowCount++;
|
infoHeaderRow = rowCount++;
|
||||||
if (chatInfo != null) {
|
if (chatInfo != null) {
|
||||||
if (!TextUtils.isEmpty(chatInfo.about)) {
|
if (!TextUtils.isEmpty(chatInfo.about)) {
|
||||||
|
|
Loading…
Reference in a new issue