mirror of
https://github.com/MGislv/NekoX.git
synced 2024-07-02 10:33:36 +00:00
Update to 7.7.1 (2291)
This commit is contained in:
parent
8bf056e27b
commit
c4ada53b0d
|
@ -25,7 +25,7 @@ dependencies {
|
||||||
|
|
||||||
compileOnly 'org.checkerframework:checker-qual:2.5.2'
|
compileOnly 'org.checkerframework:checker-qual:2.5.2'
|
||||||
compileOnly 'org.checkerframework:checker-compat-qual:2.5.0'
|
compileOnly 'org.checkerframework:checker-compat-qual:2.5.0'
|
||||||
implementation 'com.google.firebase:firebase-messaging:21.0.1'
|
implementation 'com.google.firebase:firebase-messaging:21.1.0'
|
||||||
implementation 'com.google.firebase:firebase-config:20.0.4'
|
implementation 'com.google.firebase:firebase-config:20.0.4'
|
||||||
implementation 'com.google.firebase:firebase-datatransport:17.0.11'
|
implementation 'com.google.firebase:firebase-datatransport:17.0.11'
|
||||||
implementation 'com.google.firebase:firebase-appindexing:19.2.0'
|
implementation 'com.google.firebase:firebase-appindexing:19.2.0'
|
||||||
|
@ -300,7 +300,7 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig.versionCode = 2284
|
defaultConfig.versionCode = 2291
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
variant.outputs.all { output ->
|
variant.outputs.all { output ->
|
||||||
|
@ -319,7 +319,7 @@ android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionName "7.7.0"
|
versionName "7.7.1"
|
||||||
|
|
||||||
vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']
|
vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -123,9 +123,9 @@ extern "C" {
|
||||||
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
||||||
** [sqlite_version()] and [sqlite_source_id()].
|
** [sqlite_version()] and [sqlite_source_id()].
|
||||||
*/
|
*/
|
||||||
#define SQLITE_VERSION "3.34.0"
|
#define SQLITE_VERSION "3.35.4"
|
||||||
#define SQLITE_VERSION_NUMBER 3034000
|
#define SQLITE_VERSION_NUMBER 3035004
|
||||||
#define SQLITE_SOURCE_ID "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b"
|
#define SQLITE_SOURCE_ID "2021-04-02 15:20:15 5d4c65779dab868b285519b19e4cf9d451d50c6048f06f653aa701ec212df45e"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** CAPI3REF: Run-Time Library Version Numbers
|
** CAPI3REF: Run-Time Library Version Numbers
|
||||||
|
@ -2115,7 +2115,13 @@ struct sqlite3_mem_methods {
|
||||||
** The second parameter is a pointer to an integer into which
|
** The second parameter is a pointer to an integer into which
|
||||||
** is written 0 or 1 to indicate whether triggers are disabled or enabled
|
** is written 0 or 1 to indicate whether triggers are disabled or enabled
|
||||||
** following this call. The second parameter may be a NULL pointer, in
|
** following this call. The second parameter may be a NULL pointer, in
|
||||||
** which case the trigger setting is not reported back. </dd>
|
** which case the trigger setting is not reported back.
|
||||||
|
**
|
||||||
|
** <p>Originally this option disabled all triggers. ^(However, since
|
||||||
|
** SQLite version 3.35.0, TEMP triggers are still allowed even if
|
||||||
|
** this option is off. So, in other words, this option now only disables
|
||||||
|
** triggers in the main database schema or in the schemas of ATTACH-ed
|
||||||
|
** databases.)^ </dd>
|
||||||
**
|
**
|
||||||
** [[SQLITE_DBCONFIG_ENABLE_VIEW]]
|
** [[SQLITE_DBCONFIG_ENABLE_VIEW]]
|
||||||
** <dt>SQLITE_DBCONFIG_ENABLE_VIEW</dt>
|
** <dt>SQLITE_DBCONFIG_ENABLE_VIEW</dt>
|
||||||
|
@ -2126,7 +2132,13 @@ struct sqlite3_mem_methods {
|
||||||
** The second parameter is a pointer to an integer into which
|
** The second parameter is a pointer to an integer into which
|
||||||
** is written 0 or 1 to indicate whether views are disabled or enabled
|
** is written 0 or 1 to indicate whether views are disabled or enabled
|
||||||
** following this call. The second parameter may be a NULL pointer, in
|
** following this call. The second parameter may be a NULL pointer, in
|
||||||
** which case the view setting is not reported back. </dd>
|
** which case the view setting is not reported back.
|
||||||
|
**
|
||||||
|
** <p>Originally this option disabled all views. ^(However, since
|
||||||
|
** SQLite version 3.35.0, TEMP views are still allowed even if
|
||||||
|
** this option is off. So, in other words, this option now only disables
|
||||||
|
** views in the main database schema or in the schemas of ATTACH-ed
|
||||||
|
** databases.)^ </dd>
|
||||||
**
|
**
|
||||||
** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]]
|
** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]]
|
||||||
** <dt>SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER</dt>
|
** <dt>SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER</dt>
|
||||||
|
@ -3499,6 +3511,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
||||||
** that uses dot-files in place of posix advisory locking.
|
** that uses dot-files in place of posix advisory locking.
|
||||||
** <tr><td> file:data.db?mode=readonly <td>
|
** <tr><td> file:data.db?mode=readonly <td>
|
||||||
** An error. "readonly" is not a valid option for the "mode" parameter.
|
** An error. "readonly" is not a valid option for the "mode" parameter.
|
||||||
|
** Use "ro" instead: "file:data.db?mode=ro".
|
||||||
** </table>
|
** </table>
|
||||||
**
|
**
|
||||||
** ^URI hexadecimal escape sequences (%HH) are supported within the path and
|
** ^URI hexadecimal escape sequences (%HH) are supported within the path and
|
||||||
|
@ -3697,7 +3710,7 @@ SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*);
|
||||||
** If the Y parameter to sqlite3_free_filename(Y) is anything other
|
** If the Y parameter to sqlite3_free_filename(Y) is anything other
|
||||||
** than a NULL pointer or a pointer previously acquired from
|
** than a NULL pointer or a pointer previously acquired from
|
||||||
** sqlite3_create_filename(), then bad things such as heap
|
** sqlite3_create_filename(), then bad things such as heap
|
||||||
** corruption or segfaults may occur. The value Y should be
|
** corruption or segfaults may occur. The value Y should not be
|
||||||
** used again after sqlite3_free_filename(Y) has been called. This means
|
** used again after sqlite3_free_filename(Y) has been called. This means
|
||||||
** that if the [sqlite3_vfs.xOpen()] method of a VFS has been called using Y,
|
** that if the [sqlite3_vfs.xOpen()] method of a VFS has been called using Y,
|
||||||
** then the corresponding [sqlite3_module.xClose() method should also be
|
** then the corresponding [sqlite3_module.xClose() method should also be
|
||||||
|
@ -7765,7 +7778,8 @@ SQLITE_API int sqlite3_test_control(int op, ...);
|
||||||
#define SQLITE_TESTCTRL_PRNG_SEED 28
|
#define SQLITE_TESTCTRL_PRNG_SEED 28
|
||||||
#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
|
#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
|
||||||
#define SQLITE_TESTCTRL_SEEK_COUNT 30
|
#define SQLITE_TESTCTRL_SEEK_COUNT 30
|
||||||
#define SQLITE_TESTCTRL_LAST 30 /* Largest TESTCTRL */
|
#define SQLITE_TESTCTRL_TRACEFLAGS 31
|
||||||
|
#define SQLITE_TESTCTRL_LAST 31 /* Largest TESTCTRL */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** CAPI3REF: SQL Keyword Checking
|
** CAPI3REF: SQL Keyword Checking
|
||||||
|
@ -10438,6 +10452,14 @@ SQLITE_API int sqlite3session_patchset(
|
||||||
*/
|
*/
|
||||||
SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession);
|
SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession);
|
||||||
|
|
||||||
|
/*
|
||||||
|
** CAPI3REF: Query for the amount of heap memory used by a session object.
|
||||||
|
**
|
||||||
|
** This API returns the total amount of heap memory in bytes currently
|
||||||
|
** used by the session object passed as the only argument.
|
||||||
|
*/
|
||||||
|
SQLITE_API sqlite3_int64 sqlite3session_memory_used(sqlite3_session *pSession);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** CAPI3REF: Create An Iterator To Traverse A Changeset
|
** CAPI3REF: Create An Iterator To Traverse A Changeset
|
||||||
** CONSTRUCTOR: sqlite3_changeset_iter
|
** CONSTRUCTOR: sqlite3_changeset_iter
|
||||||
|
@ -10540,18 +10562,23 @@ SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *pIter);
|
||||||
** call to [sqlite3changeset_next()] must have returned [SQLITE_ROW]. If this
|
** call to [sqlite3changeset_next()] must have returned [SQLITE_ROW]. If this
|
||||||
** is not the case, this function returns [SQLITE_MISUSE].
|
** is not the case, this function returns [SQLITE_MISUSE].
|
||||||
**
|
**
|
||||||
** If argument pzTab is not NULL, then *pzTab is set to point to a
|
** Arguments pOp, pnCol and pzTab may not be NULL. Upon return, three
|
||||||
** nul-terminated utf-8 encoded string containing the name of the table
|
** outputs are set through these pointers:
|
||||||
** affected by the current change. The buffer remains valid until either
|
**
|
||||||
** sqlite3changeset_next() is called on the iterator or until the
|
** *pOp is set to one of [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE],
|
||||||
** conflict-handler function returns. If pnCol is not NULL, then *pnCol is
|
** depending on the type of change that the iterator currently points to;
|
||||||
** set to the number of columns in the table affected by the change. If
|
**
|
||||||
** pbIndirect is not NULL, then *pbIndirect is set to true (1) if the change
|
** *pnCol is set to the number of columns in the table affected by the change; and
|
||||||
|
**
|
||||||
|
** *pzTab is set to point to a nul-terminated utf-8 encoded string containing
|
||||||
|
** the name of the table affected by the current change. The buffer remains
|
||||||
|
** valid until either sqlite3changeset_next() is called on the iterator
|
||||||
|
** or until the conflict-handler function returns.
|
||||||
|
**
|
||||||
|
** If pbIndirect is not NULL, then *pbIndirect is set to true (1) if the change
|
||||||
** is an indirect change, or false (0) otherwise. See the documentation for
|
** is an indirect change, or false (0) otherwise. See the documentation for
|
||||||
** [sqlite3session_indirect()] for a description of direct and indirect
|
** [sqlite3session_indirect()] for a description of direct and indirect
|
||||||
** changes. Finally, if pOp is not NULL, then *pOp is set to one of
|
** changes.
|
||||||
** [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE], depending on the
|
|
||||||
** type of change that the iterator currently points to.
|
|
||||||
**
|
**
|
||||||
** If no error occurs, SQLITE_OK is returned. If an error does occur, an
|
** If no error occurs, SQLITE_OK is returned. If an error does occur, an
|
||||||
** SQLite error code is returned. The values of the output variables may not
|
** SQLite error code is returned. The values of the output variables may not
|
||||||
|
|
|
@ -1185,6 +1185,9 @@ void ConnectionsManager::processServerResponse(TLObject *message, int64_t messag
|
||||||
} else if (typeInfo == typeid(TL_rpc_result)) {
|
} else if (typeInfo == typeid(TL_rpc_result)) {
|
||||||
TL_rpc_result *response = (TL_rpc_result *) message;
|
TL_rpc_result *response = (TL_rpc_result *) message;
|
||||||
int64_t resultMid = response->req_msg_id;
|
int64_t resultMid = response->req_msg_id;
|
||||||
|
if (resultMid == lastInvokeAfterMessageId) {
|
||||||
|
lastInvokeAfterMessageId = 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool hasResult = response->result.get() != nullptr;
|
bool hasResult = response->result.get() != nullptr;
|
||||||
bool ignoreResult = false;
|
bool ignoreResult = false;
|
||||||
|
@ -1270,13 +1273,21 @@ void ConnectionsManager::processServerResponse(TLObject *message, int64_t messag
|
||||||
}
|
}
|
||||||
} else if ((request->requestFlags & RequestFlagFailOnServerErrors) == 0 || processEvenFailed) {
|
} else if ((request->requestFlags & RequestFlagFailOnServerErrors) == 0 || processEvenFailed) {
|
||||||
if (error->error_code == 500 || error->error_code < 0) {
|
if (error->error_code == 500 || error->error_code < 0) {
|
||||||
discardResponse = true;
|
static std::string waitFailed = "MSG_WAIT_FAILED";
|
||||||
if (isWorkerBusy) {
|
if (error->error_message.find(waitFailed) != std::string::npos) {
|
||||||
request->minStartTime = 0;
|
request->minStartTime = (int32_t) (getCurrentTimeMonotonicMillis() / 1000 + 1);
|
||||||
|
request->startTime = 0;
|
||||||
|
request->startTimeMillis = 0;
|
||||||
|
request->requestFlags &=~ RequestFlagInvokeAfter;
|
||||||
} else {
|
} else {
|
||||||
request->minStartTime = request->startTime + (request->serverFailureCount > 10 ? 10 : request->serverFailureCount);
|
if (isWorkerBusy) {
|
||||||
|
request->minStartTime = 0;
|
||||||
|
} else {
|
||||||
|
request->minStartTime = request->startTime + (request->serverFailureCount > 10 ? 10 : request->serverFailureCount);
|
||||||
|
}
|
||||||
|
request->serverFailureCount++;
|
||||||
}
|
}
|
||||||
request->serverFailureCount++;
|
discardResponse = true;
|
||||||
} else if (error->error_code == 420) {
|
} else if (error->error_code == 420) {
|
||||||
int32_t waitTime = 2;
|
int32_t waitTime = 2;
|
||||||
static std::string floodWait = "FLOOD_WAIT_";
|
static std::string floodWait = "FLOOD_WAIT_";
|
||||||
|
@ -2618,7 +2629,7 @@ void ConnectionsManager::processRequestQueue(uint32_t connectionTypes, uint32_t
|
||||||
int64_t maxRequestId = 0;
|
int64_t maxRequestId = 0;
|
||||||
if (lastInvokeAfterMessageId != 0) {
|
if (lastInvokeAfterMessageId != 0) {
|
||||||
int64_t timeMessage = (int64_t) (lastInvokeAfterMessageId / 4294967296.0);
|
int64_t timeMessage = (int64_t) (lastInvokeAfterMessageId / 4294967296.0);
|
||||||
if (getCurrentTime() - timeMessage <= 30) {
|
if (getCurrentTime() - timeMessage <= 5) {
|
||||||
maxRequestId = lastInvokeAfterMessageId;
|
maxRequestId = lastInvokeAfterMessageId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 = 2284;
|
public static int BUILD_VERSION = 2291;
|
||||||
public static String BUILD_VERSION_STRING = "7.7.0";
|
public static String BUILD_VERSION_STRING = "7.7.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";
|
||||||
|
|
|
@ -23,6 +23,7 @@ import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import org.telegram.tgnet.TLObject;
|
||||||
import org.telegram.tgnet.TLRPC;
|
import org.telegram.tgnet.TLRPC;
|
||||||
import org.telegram.ui.Components.AnimatedFileDrawable;
|
import org.telegram.ui.Components.AnimatedFileDrawable;
|
||||||
import org.telegram.ui.Components.LoadingStickerDrawable;
|
import org.telegram.ui.Components.LoadingStickerDrawable;
|
||||||
|
@ -31,12 +32,11 @@ import org.telegram.ui.Components.RecyclableDrawable;
|
||||||
|
|
||||||
import androidx.annotation.Keep;
|
import androidx.annotation.Keep;
|
||||||
|
|
||||||
import com.google.android.exoplayer2.util.Log;
|
|
||||||
|
|
||||||
public class ImageReceiver implements NotificationCenter.NotificationCenterDelegate {
|
public class ImageReceiver implements NotificationCenter.NotificationCenterDelegate {
|
||||||
|
|
||||||
public interface ImageReceiverDelegate {
|
public interface ImageReceiverDelegate {
|
||||||
void didSetImage(ImageReceiver imageReceiver, boolean set, boolean thumb, boolean memCache);
|
void didSetImage(ImageReceiver imageReceiver, boolean set, boolean thumb, boolean memCache);
|
||||||
|
|
||||||
default void onAnimationReady(ImageReceiver imageReceiver) {
|
default void onAnimationReady(ImageReceiver imageReceiver) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -195,6 +195,8 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
|
||||||
private Drawable currentMediaDrawable;
|
private Drawable currentMediaDrawable;
|
||||||
private BitmapShader mediaShader;
|
private BitmapShader mediaShader;
|
||||||
|
|
||||||
|
private boolean useRoundForThumb;
|
||||||
|
|
||||||
private Drawable staticThumbDrawable;
|
private Drawable staticThumbDrawable;
|
||||||
|
|
||||||
private String currentExt;
|
private String currentExt;
|
||||||
|
@ -313,6 +315,39 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
|
||||||
setImage(imageLocation, imageFilter, thumbLocation, thumbFilter, null, size, ext, parentObject, cacheType);
|
setImage(imageLocation, imageFilter, thumbLocation, thumbFilter, null, size, ext, parentObject, cacheType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setForUserOrChat(TLObject object, Drawable avatarDrawable) {
|
||||||
|
setForUserOrChat(object, avatarDrawable, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setForUserOrChat(TLObject object, Drawable avatarDrawable, Object parentObject) {
|
||||||
|
if (parentObject == null) {
|
||||||
|
parentObject = object;
|
||||||
|
}
|
||||||
|
setUseRoundForThumbDrawable(true);
|
||||||
|
BitmapDrawable strippedBitmap = null;
|
||||||
|
boolean hasStripped = false;
|
||||||
|
if (object instanceof TLRPC.User) {
|
||||||
|
TLRPC.User user = (TLRPC.User) object;
|
||||||
|
if (user.photo != null) {
|
||||||
|
strippedBitmap = user.photo.strippedBitmap;
|
||||||
|
hasStripped = user.photo.stripped_thumb != null;
|
||||||
|
}
|
||||||
|
} else if (object instanceof TLRPC.Chat) {
|
||||||
|
TLRPC.Chat chat = (TLRPC.Chat) object;
|
||||||
|
if (chat.photo != null) {
|
||||||
|
strippedBitmap = chat.photo.strippedBitmap;
|
||||||
|
hasStripped = chat.photo.stripped_thumb != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (strippedBitmap != null) {
|
||||||
|
setImage(ImageLocation.getForUserOrChat(object, ImageLocation.TYPE_SMALL), "50_50", strippedBitmap, null, parentObject, 0);
|
||||||
|
} else if (hasStripped) {
|
||||||
|
setImage(ImageLocation.getForUserOrChat(object, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(object, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, parentObject, 0);
|
||||||
|
} else {
|
||||||
|
setImage(ImageLocation.getForUserOrChat(object, ImageLocation.TYPE_SMALL), "50_50", avatarDrawable, null, parentObject, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setImage(ImageLocation fileLocation, String fileFilter, ImageLocation thumbLocation, String thumbFilter, Drawable thumb, Object parentObject, int cacheType) {
|
public void setImage(ImageLocation fileLocation, String fileFilter, ImageLocation thumbLocation, String thumbFilter, Drawable thumb, Object parentObject, int cacheType) {
|
||||||
setImage(null, null, fileLocation, fileFilter, thumbLocation, thumbFilter, thumb, 0, null, parentObject, cacheType);
|
setImage(null, null, fileLocation, fileFilter, thumbLocation, thumbFilter, thumb, 0, null, parentObject, cacheType);
|
||||||
}
|
}
|
||||||
|
@ -503,6 +538,9 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
|
||||||
imageShader = null;
|
imageShader = null;
|
||||||
thumbShader = null;
|
thumbShader = null;
|
||||||
mediaShader = null;
|
mediaShader = null;
|
||||||
|
if (useRoundForThumb && staticThumbDrawable != null) {
|
||||||
|
updateDrawableRadius(staticThumbDrawable);
|
||||||
|
}
|
||||||
currentAlpha = 1.0f;
|
currentAlpha = 1.0f;
|
||||||
|
|
||||||
if (staticThumbDrawable instanceof SvgHelper.SvgDrawable) {
|
if (staticThumbDrawable instanceof SvgHelper.SvgDrawable) {
|
||||||
|
@ -518,7 +556,7 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
|
||||||
if (invalidateAll) {
|
if (invalidateAll) {
|
||||||
parentView.invalidate();
|
parentView.invalidate();
|
||||||
} else {
|
} else {
|
||||||
parentView.invalidate((int)imageX, (int) imageY, (int) (imageX + imageW), (int) (imageY + imageH));
|
parentView.invalidate((int) imageX, (int) imageY, (int) (imageX + imageW), (int) (imageY + imageH));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -677,7 +715,7 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
|
||||||
if (invalidateAll) {
|
if (invalidateAll) {
|
||||||
parentView.invalidate();
|
parentView.invalidate();
|
||||||
} else {
|
} else {
|
||||||
parentView.invalidate((int)imageX, (int) imageY, (int) (imageX + imageW), (int) (imageY + imageH));
|
parentView.invalidate((int) imageX, (int) imageY, (int) (imageX + imageW), (int) (imageY + imageH));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (forceCrossfade && crossfadeWithOldImage && crossfadeImage != null) {
|
if (forceCrossfade && crossfadeWithOldImage && crossfadeImage != null) {
|
||||||
|
@ -777,7 +815,7 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
|
||||||
|
|
||||||
public boolean onAttachedToWindow() {
|
public boolean onAttachedToWindow() {
|
||||||
currentOpenedLayerFlags = NotificationCenter.getGlobalInstance().getCurrentHeavyOperationFlags();
|
currentOpenedLayerFlags = NotificationCenter.getGlobalInstance().getCurrentHeavyOperationFlags();
|
||||||
currentOpenedLayerFlags &=~ currentLayerNum;
|
currentOpenedLayerFlags &= ~currentLayerNum;
|
||||||
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.didReplacedPhotoInMemCache);
|
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.didReplacedPhotoInMemCache);
|
||||||
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.stopAllHeavyOperations);
|
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.stopAllHeavyOperations);
|
||||||
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.startAllHeavyOperations);
|
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.startAllHeavyOperations);
|
||||||
|
@ -816,6 +854,10 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setUseRoundForThumbDrawable(boolean value) {
|
||||||
|
useRoundForThumb = value;
|
||||||
|
}
|
||||||
|
|
||||||
private void drawDrawable(Canvas canvas, Drawable drawable, int alpha, BitmapShader shader, int orientation, int isPressed) {
|
private void drawDrawable(Canvas canvas, Drawable drawable, int alpha, BitmapShader shader, int orientation, int isPressed) {
|
||||||
if (drawable instanceof BitmapDrawable) {
|
if (drawable instanceof BitmapDrawable) {
|
||||||
BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
|
BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
|
||||||
|
@ -902,7 +944,7 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
|
||||||
|
|
||||||
if (isRoundRect) {
|
if (isRoundRect) {
|
||||||
try {
|
try {
|
||||||
canvas.drawRoundRect(roundRect,roundRadius[0], roundRadius[0],roundPaint);
|
canvas.drawRoundRect(roundRect, roundRadius[0], roundRadius[0], roundPaint);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
onBitmapException(bitmapDrawable);
|
onBitmapException(bitmapDrawable);
|
||||||
FileLog.e(e);
|
FileLog.e(e);
|
||||||
|
@ -1142,7 +1184,7 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
|
||||||
if (invalidateAll) {
|
if (invalidateAll) {
|
||||||
parentView.invalidate();
|
parentView.invalidate();
|
||||||
} else {
|
} else {
|
||||||
parentView.invalidate((int)imageX, (int) imageY, (int) (imageX + imageW), (int) (imageY + imageH));
|
parentView.invalidate((int) imageX, (int) imageY, (int) (imageX + imageW), (int) (imageY + imageH));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2079,7 +2121,7 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
|
||||||
if (currentLayerNum >= layer || currentOpenedLayerFlags == 0) {
|
if (currentLayerNum >= layer || currentOpenedLayerFlags == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
currentOpenedLayerFlags &=~ layer;
|
currentOpenedLayerFlags &= ~layer;
|
||||||
if (currentOpenedLayerFlags == 0) {
|
if (currentOpenedLayerFlags == 0) {
|
||||||
RLottieDrawable lottieDrawable = getLottieAnimation();
|
RLottieDrawable lottieDrawable = getLottieAnimation();
|
||||||
if (allowStartLottieAnimation && lottieDrawable != null && lottieDrawable.isHeavyDrawable()) {
|
if (allowStartLottieAnimation && lottieDrawable != null && lottieDrawable.isHeavyDrawable()) {
|
||||||
|
|
|
@ -1130,10 +1130,10 @@ public class LocaleController {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String formatCurrencyString(long amount, String type) {
|
public String formatCurrencyString(long amount, String type) {
|
||||||
return formatCurrencyString(amount, true, type);
|
return formatCurrencyString(amount, true, true, false, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String formatCurrencyString(long amount, boolean fixAnything, String type) {
|
public String formatCurrencyString(long amount, boolean fixAnything, boolean withExp, boolean editText, String type) {
|
||||||
type = type.toUpperCase();
|
type = type.toUpperCase();
|
||||||
String customFormat;
|
String customFormat;
|
||||||
double doubleAmount;
|
double doubleAmount;
|
||||||
|
@ -1200,14 +1200,24 @@ public class LocaleController {
|
||||||
doubleAmount = amount / 100.0;
|
doubleAmount = amount / 100.0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String result;
|
if (!withExp) {
|
||||||
|
customFormat = " %.0f";
|
||||||
|
}
|
||||||
if (currency != null) {
|
if (currency != null) {
|
||||||
NumberFormat format = NumberFormat.getCurrencyInstance(currentLocale != null ? currentLocale : systemDefaultLocale);
|
NumberFormat format = NumberFormat.getCurrencyInstance(currentLocale != null ? currentLocale : systemDefaultLocale);
|
||||||
format.setCurrency(currency);
|
format.setCurrency(currency);
|
||||||
if (fixAnything && type.equals("IRR")) {
|
if (editText) {
|
||||||
|
format.setGroupingUsed(false);
|
||||||
|
}
|
||||||
|
if (!withExp || fixAnything && type.equals("IRR")) {
|
||||||
format.setMaximumFractionDigits(0);
|
format.setMaximumFractionDigits(0);
|
||||||
}
|
}
|
||||||
return (discount ? "-" : "") + format.format(doubleAmount);
|
String result = (discount ? "-" : "") + format.format(doubleAmount);
|
||||||
|
int idx = result.indexOf(type);
|
||||||
|
if (idx >= 0 && result.charAt(idx + type.length()) != ' ') {
|
||||||
|
result = result.substring(0, idx + type.length()) + " " + result.substring(idx + type.length());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
return (discount ? "-" : "") + String.format(Locale.US, type + customFormat, doubleAmount);
|
return (discount ? "-" : "") + String.format(Locale.US, type + customFormat, doubleAmount);
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,6 +273,7 @@ public class MessagesController extends BaseController implements NotificationCe
|
||||||
public int maxFolderPinnedDialogsCount;
|
public int maxFolderPinnedDialogsCount;
|
||||||
public int mapProvider;
|
public int mapProvider;
|
||||||
public int availableMapProviders;
|
public int availableMapProviders;
|
||||||
|
public int updateCheckDelay;
|
||||||
public String mapKey;
|
public String mapKey;
|
||||||
public int maxMessageLength;
|
public int maxMessageLength;
|
||||||
public int maxCaptionLength;
|
public int maxCaptionLength;
|
||||||
|
@ -716,6 +717,7 @@ public class MessagesController extends BaseController implements NotificationCe
|
||||||
callRingTimeout = mainPreferences.getInt("callRingTimeout", 90000);
|
callRingTimeout = mainPreferences.getInt("callRingTimeout", 90000);
|
||||||
callConnectTimeout = mainPreferences.getInt("callConnectTimeout", 30000);
|
callConnectTimeout = mainPreferences.getInt("callConnectTimeout", 30000);
|
||||||
callPacketTimeout = mainPreferences.getInt("callPacketTimeout", 10000);
|
callPacketTimeout = mainPreferences.getInt("callPacketTimeout", 10000);
|
||||||
|
updateCheckDelay = mainPreferences.getInt("updateCheckDelay", 24 * 60 * 60);
|
||||||
maxPinnedDialogsCount = mainPreferences.getInt("maxPinnedDialogsCount", 5);
|
maxPinnedDialogsCount = mainPreferences.getInt("maxPinnedDialogsCount", 5);
|
||||||
maxFolderPinnedDialogsCount = mainPreferences.getInt("maxFolderPinnedDialogsCount", 100);
|
maxFolderPinnedDialogsCount = mainPreferences.getInt("maxFolderPinnedDialogsCount", 100);
|
||||||
maxMessageLength = mainPreferences.getInt("maxMessageLength", 4096);
|
maxMessageLength = mainPreferences.getInt("maxMessageLength", 4096);
|
||||||
|
@ -1583,6 +1585,25 @@ public class MessagesController extends BaseController implements NotificationCe
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case "inapp_update_check_delay": {
|
||||||
|
if (value.value instanceof TLRPC.TL_jsonNumber) {
|
||||||
|
TLRPC.TL_jsonNumber number = (TLRPC.TL_jsonNumber) value.value;
|
||||||
|
if (number.value != updateCheckDelay) {
|
||||||
|
updateCheckDelay = (int) number.value;
|
||||||
|
editor.putInt("updateCheckDelay", updateCheckDelay);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
} else if (value.value instanceof TLRPC.TL_jsonString) {
|
||||||
|
TLRPC.TL_jsonString number = (TLRPC.TL_jsonString) value.value;
|
||||||
|
int delay = Utilities.parseInt(number.value);
|
||||||
|
if (delay != updateCheckDelay) {
|
||||||
|
updateCheckDelay = delay;
|
||||||
|
editor.putInt("updateCheckDelay", updateCheckDelay);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "stickers_emoji_suggest_only_api": {
|
case "stickers_emoji_suggest_only_api": {
|
||||||
if (value.value instanceof TLRPC.TL_jsonBool) {
|
if (value.value instanceof TLRPC.TL_jsonBool) {
|
||||||
TLRPC.TL_jsonBool bool = (TLRPC.TL_jsonBool) value.value;
|
TLRPC.TL_jsonBool bool = (TLRPC.TL_jsonBool) value.value;
|
||||||
|
@ -13702,7 +13723,7 @@ public class MessagesController extends BaseController implements NotificationCe
|
||||||
}
|
}
|
||||||
dialog = new TLRPC.TL_dialog();
|
dialog = new TLRPC.TL_dialog();
|
||||||
dialog.id = uid;
|
dialog.id = uid;
|
||||||
dialog.top_message = lastMessage.getId();
|
int mid = dialog.top_message = lastMessage.getId();
|
||||||
dialog.last_message_date = lastMessage.messageOwner.date;
|
dialog.last_message_date = lastMessage.messageOwner.date;
|
||||||
dialog.flags = ChatObject.isChannel(chat) ? 1 : 0;
|
dialog.flags = ChatObject.isChannel(chat) ? 1 : 0;
|
||||||
dialogs_dict.put(uid, dialog);
|
dialogs_dict.put(uid, dialog);
|
||||||
|
@ -13724,7 +13745,7 @@ public class MessagesController extends BaseController implements NotificationCe
|
||||||
sortDialogs(null);
|
sortDialogs(null);
|
||||||
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, true);
|
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else if (mid > 0) {
|
||||||
int lowerId = (int) uid;
|
int lowerId = (int) uid;
|
||||||
if (lowerId != 0) {
|
if (lowerId != 0) {
|
||||||
loadUnknownDialog(getInputPeer(lowerId), 0);
|
loadUnknownDialog(getInputPeer(lowerId), 0);
|
||||||
|
|
|
@ -405,7 +405,7 @@ public class NotificationCenter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void postNotificationName(int id, Object... args) {
|
public void postNotificationName(int id, Object... args) {
|
||||||
boolean allowDuringAnimation = id == startAllHeavyOperations || id == stopAllHeavyOperations || id == didReplacedPhotoInMemCache;
|
boolean allowDuringAnimation = id == startAllHeavyOperations || id == stopAllHeavyOperations || id == didReplacedPhotoInMemCache || id == closeChats;
|
||||||
ArrayList<Integer> expiredIndices = null;
|
ArrayList<Integer> expiredIndices = null;
|
||||||
if (!allowDuringAnimation && !allowedNotifications.isEmpty()) {
|
if (!allowDuringAnimation && !allowedNotifications.isEmpty()) {
|
||||||
int size = allowedNotifications.size();
|
int size = allowedNotifications.size();
|
||||||
|
|
|
@ -8,10 +8,13 @@
|
||||||
|
|
||||||
package org.telegram.tgnet;
|
package org.telegram.tgnet;
|
||||||
|
|
||||||
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.os.Build;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import org.telegram.messenger.FileLoader;
|
import org.telegram.messenger.FileLoader;
|
||||||
import org.telegram.messenger.FileLog;
|
import org.telegram.messenger.FileLog;
|
||||||
|
import org.telegram.messenger.ImageLoader;
|
||||||
import org.telegram.messenger.Utilities;
|
import org.telegram.messenger.Utilities;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -402,6 +405,7 @@ public class TLRPC {
|
||||||
public FileLocation photo_big;
|
public FileLocation photo_big;
|
||||||
public byte[] stripped_thumb;
|
public byte[] stripped_thumb;
|
||||||
public int dc_id;
|
public int dc_id;
|
||||||
|
public BitmapDrawable strippedBitmap;
|
||||||
|
|
||||||
public static ChatPhoto TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) {
|
public static ChatPhoto TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) {
|
||||||
ChatPhoto result = null;
|
ChatPhoto result = null;
|
||||||
|
@ -508,6 +512,13 @@ public class TLRPC {
|
||||||
photo_big = FileLocation.TLdeserialize(stream, stream.readInt32(exception), exception);
|
photo_big = FileLocation.TLdeserialize(stream, stream.readInt32(exception), exception);
|
||||||
if ((flags & 2) != 0) {
|
if ((flags & 2) != 0) {
|
||||||
stripped_thumb = stream.readByteArray(exception);
|
stripped_thumb = stream.readByteArray(exception);
|
||||||
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
|
try {
|
||||||
|
strippedBitmap = new BitmapDrawable(ImageLoader.getStrippedPhotoBitmap(stripped_thumb, "b"));
|
||||||
|
} catch (Throwable e) {
|
||||||
|
FileLog.e(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dc_id = stream.readInt32(exception);
|
dc_id = stream.readInt32(exception);
|
||||||
}
|
}
|
||||||
|
@ -26858,6 +26869,7 @@ public class TLRPC {
|
||||||
public FileLocation photo_big;
|
public FileLocation photo_big;
|
||||||
public byte[] stripped_thumb;
|
public byte[] stripped_thumb;
|
||||||
public int dc_id;
|
public int dc_id;
|
||||||
|
public BitmapDrawable strippedBitmap;
|
||||||
|
|
||||||
public static UserProfilePhoto TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) {
|
public static UserProfilePhoto TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) {
|
||||||
UserProfilePhoto result = null;
|
UserProfilePhoto result = null;
|
||||||
|
@ -26927,6 +26939,13 @@ public class TLRPC {
|
||||||
photo_big = FileLocation.TLdeserialize(stream, stream.readInt32(exception), exception);
|
photo_big = FileLocation.TLdeserialize(stream, stream.readInt32(exception), exception);
|
||||||
if ((flags & 2) != 0) {
|
if ((flags & 2) != 0) {
|
||||||
stripped_thumb = stream.readByteArray(exception);
|
stripped_thumb = stream.readByteArray(exception);
|
||||||
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
|
try {
|
||||||
|
strippedBitmap = new BitmapDrawable(ImageLoader.getStrippedPhotoBitmap(stripped_thumb, "b"));
|
||||||
|
} catch (Throwable e) {
|
||||||
|
FileLog.e(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dc_id = stream.readInt32(exception);
|
dc_id = stream.readInt32(exception);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1685,12 +1685,12 @@ public class ActionBarMenuItem extends FrameLayout {
|
||||||
avatarImageView.setImageDrawable(combinedDrawable);
|
avatarImageView.setImageDrawable(combinedDrawable);
|
||||||
} else {
|
} else {
|
||||||
avatarImageView.getImageReceiver().setRoundRadius(AndroidUtilities.dp(16));
|
avatarImageView.getImageReceiver().setRoundRadius(AndroidUtilities.dp(16));
|
||||||
avatarImageView.getImageReceiver().setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", thumbDrawable, user, 0);
|
avatarImageView.getImageReceiver().setForUserOrChat(user, thumbDrawable);
|
||||||
}
|
}
|
||||||
} else if (data.chat instanceof TLRPC.Chat) {
|
} else if (data.chat instanceof TLRPC.Chat) {
|
||||||
TLRPC.Chat chat = (TLRPC.Chat) data.chat;
|
TLRPC.Chat chat = (TLRPC.Chat) data.chat;
|
||||||
avatarImageView.getImageReceiver().setRoundRadius(AndroidUtilities.dp(16));
|
avatarImageView.getImageReceiver().setRoundRadius(AndroidUtilities.dp(16));
|
||||||
avatarImageView.getImageReceiver().setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", thumbDrawable, chat, 0);
|
avatarImageView.getImageReceiver().setForUserOrChat(chat, thumbDrawable);
|
||||||
}
|
}
|
||||||
} else if (data.filterType == FiltersView.FILTER_TYPE_ARCHIVE) {
|
} else if (data.filterType == FiltersView.FILTER_TYPE_ARCHIVE) {
|
||||||
CombinedDrawable combinedDrawable = Theme.createCircleDrawableWithIcon(AndroidUtilities.dp(32), R.drawable.chats_archive);
|
CombinedDrawable combinedDrawable = Theme.createCircleDrawableWithIcon(AndroidUtilities.dp(32), R.drawable.chats_archive);
|
||||||
|
|
|
@ -5357,6 +5357,7 @@ public class Theme {
|
||||||
if (isCurrentThemeNight()) {
|
if (isCurrentThemeNight()) {
|
||||||
switchNightThemeDelay = 2000;
|
switchNightThemeDelay = 2000;
|
||||||
lastDelayUpdateTime = SystemClock.elapsedRealtime();
|
lastDelayUpdateTime = SystemClock.elapsedRealtime();
|
||||||
|
AndroidUtilities.runOnUIThread(Theme::checkAutoNightThemeConditions, 2100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
currentTheme = themeInfo;
|
currentTheme = themeInfo;
|
||||||
|
|
|
@ -728,12 +728,12 @@ public class FiltersView extends RecyclerListView {
|
||||||
avatarImageView.setImageDrawable(combinedDrawable);
|
avatarImageView.setImageDrawable(combinedDrawable);
|
||||||
} else {
|
} else {
|
||||||
avatarImageView.getImageReceiver().setRoundRadius(AndroidUtilities.dp(16));
|
avatarImageView.getImageReceiver().setRoundRadius(AndroidUtilities.dp(16));
|
||||||
avatarImageView.getImageReceiver().setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", thumbDrawable, user, 0);
|
avatarImageView.getImageReceiver().setForUserOrChat(user, thumbDrawable);
|
||||||
}
|
}
|
||||||
} else if (data.chat instanceof TLRPC.Chat) {
|
} else if (data.chat instanceof TLRPC.Chat) {
|
||||||
TLRPC.Chat chat = (TLRPC.Chat) data.chat;
|
TLRPC.Chat chat = (TLRPC.Chat) data.chat;
|
||||||
avatarImageView.getImageReceiver().setRoundRadius(AndroidUtilities.dp(16));
|
avatarImageView.getImageReceiver().setRoundRadius(AndroidUtilities.dp(16));
|
||||||
avatarImageView.getImageReceiver().setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", thumbDrawable, chat, 0);
|
avatarImageView.getImageReceiver().setForUserOrChat(chat, thumbDrawable);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
avatarImageView.setImageDrawable(thumbDrawable);
|
avatarImageView.setImageDrawable(thumbDrawable);
|
||||||
|
|
|
@ -110,12 +110,12 @@ public class AccountSelectCell extends FrameLayout {
|
||||||
TLRPC.User user = (TLRPC.User) object;
|
TLRPC.User user = (TLRPC.User) object;
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
infoTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
infoTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
TLRPC.Chat chat = (TLRPC.Chat) object;
|
TLRPC.Chat chat = (TLRPC.Chat) object;
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
infoTextView.setText(chat.title);
|
infoTextView.setText(chat.title);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
imageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ public class AccountSelectCell extends FrameLayout {
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
textView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
textView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
||||||
imageView.getImageReceiver().setCurrentAccount(account);
|
imageView.getImageReceiver().setCurrentAccount(account);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user,ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
checkImageView.setVisibility(check && account == UserConfig.selectedAccount ? VISIBLE : INVISIBLE);
|
checkImageView.setVisibility(check && account == UserConfig.selectedAccount ? VISIBLE : INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class AdminedChannelCell extends FrameLayout {
|
||||||
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(url + channel.username);
|
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(url + channel.username);
|
||||||
stringBuilder.setSpan(new URLSpanNoUnderline(""), url.length(), stringBuilder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
stringBuilder.setSpan(new URLSpanNoUnderline(""), url.length(), stringBuilder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
statusTextView.setText(stringBuilder);
|
statusTextView.setText(stringBuilder);
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(channel, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(channel, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentChannel);
|
avatarImageView.setForUserOrChat(channel, avatarDrawable);
|
||||||
isLast = last;
|
isLast = last;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3165,10 +3165,10 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||||
}
|
}
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
commentAvatarDrawables[a].setInfo(user);
|
commentAvatarDrawables[a].setInfo(user);
|
||||||
commentAvatarImages[a].setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", commentAvatarDrawables[a], user, 0);
|
commentAvatarImages[a].setForUserOrChat(user, commentAvatarDrawables[a]);
|
||||||
} else if (chat != null) {
|
} else if (chat != null) {
|
||||||
commentAvatarDrawables[a].setInfo(chat);
|
commentAvatarDrawables[a].setInfo(chat);
|
||||||
commentAvatarImages[a].setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", commentAvatarDrawables[a], chat, 0);
|
commentAvatarImages[a].setForUserOrChat(chat, commentAvatarDrawables[a]);
|
||||||
} else {
|
} else {
|
||||||
commentAvatarDrawables[a].setInfo(id, "", "");
|
commentAvatarDrawables[a].setInfo(id, "", "");
|
||||||
}
|
}
|
||||||
|
@ -4236,7 +4236,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||||
} else {
|
} else {
|
||||||
hasName = false;
|
hasName = false;
|
||||||
}
|
}
|
||||||
photoImage.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", hasName ? contactAvatarDrawable : Theme.chat_contactDrawable[messageObject.isOutOwner() ? 1 : 0], messageObject, 0);
|
photoImage.setForUserOrChat(user, hasName ? contactAvatarDrawable : Theme.chat_contactDrawable[messageObject.isOutOwner() ? 1 : 0], messageObject);
|
||||||
|
|
||||||
CharSequence phone;
|
CharSequence phone;
|
||||||
if (!TextUtils.isEmpty(messageObject.vCardData)) {
|
if (!TextUtils.isEmpty(messageObject.vCardData)) {
|
||||||
|
@ -4428,7 +4428,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||||
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(id);
|
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(id);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
pollAvatarDrawables[a].setInfo(user);
|
pollAvatarDrawables[a].setInfo(user);
|
||||||
pollAvatarImages[a].setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", pollAvatarDrawables[a], user, 0);
|
pollAvatarImages[a].setForUserOrChat(user, pollAvatarDrawables[a]);
|
||||||
} else {
|
} else {
|
||||||
pollAvatarDrawables[a].setInfo(id, "", "");
|
pollAvatarDrawables[a].setInfo(id, "", "");
|
||||||
}
|
}
|
||||||
|
@ -4762,13 +4762,13 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||||
updateCurrentUserAndChat();
|
updateCurrentUserAndChat();
|
||||||
if (currentUser != null) {
|
if (currentUser != null) {
|
||||||
contactAvatarDrawable.setInfo(currentUser);
|
contactAvatarDrawable.setInfo(currentUser);
|
||||||
locationImageReceiver.setImage(ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_STRIPPED), "50_50", contactAvatarDrawable, currentUser, 0);
|
locationImageReceiver.setForUserOrChat(currentUser, contactAvatarDrawable);
|
||||||
} else if (currentChat != null) {
|
} else if (currentChat != null) {
|
||||||
if (currentChat.photo != null) {
|
if (currentChat.photo != null) {
|
||||||
currentPhoto = currentChat.photo.photo_small;
|
currentPhoto = currentChat.photo.photo_small;
|
||||||
}
|
}
|
||||||
contactAvatarDrawable.setInfo(currentChat);
|
contactAvatarDrawable.setInfo(currentChat);
|
||||||
locationImageReceiver.setImage(ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_STRIPPED), "50_50", contactAvatarDrawable, currentChat, 0);
|
locationImageReceiver.setForUserOrChat(currentChat, contactAvatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
locationImageReceiver.setImage(null, null, contactAvatarDrawable, null, null, 0);
|
locationImageReceiver.setImage(null, null, contactAvatarDrawable, null, null, 0);
|
||||||
}
|
}
|
||||||
|
@ -9198,7 +9198,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||||
currentPhoto = null;
|
currentPhoto = null;
|
||||||
}
|
}
|
||||||
avatarDrawable.setInfo(currentUser);
|
avatarDrawable.setInfo(currentUser);
|
||||||
avatarImage.setImage(ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentUser, 0);
|
avatarImage.setForUserOrChat(currentUser, avatarDrawable);
|
||||||
} else if (currentChat != null) {
|
} else if (currentChat != null) {
|
||||||
if (currentChat.photo != null) {
|
if (currentChat.photo != null) {
|
||||||
currentPhoto = currentChat.photo.photo_small;
|
currentPhoto = currentChat.photo.photo_small;
|
||||||
|
@ -9206,7 +9206,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||||
currentPhoto = null;
|
currentPhoto = null;
|
||||||
}
|
}
|
||||||
avatarDrawable.setInfo(currentChat);
|
avatarDrawable.setInfo(currentChat);
|
||||||
avatarImage.setImage(ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentChat, 0);
|
avatarImage.setForUserOrChat(currentChat, avatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
currentPhoto = null;
|
currentPhoto = null;
|
||||||
avatarDrawable.setInfo(messageObject.getFromChatId(), null, null);
|
avatarDrawable.setInfo(messageObject.getFromChatId(), null, null);
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class CheckBoxUserCell extends FrameLayout {
|
||||||
textView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
textView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
||||||
checkBox.setChecked(checked, false);
|
checkBox.setChecked(checked, false);
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
needDivider = divider;
|
needDivider = divider;
|
||||||
setWillNotDraw(!divider);
|
setWillNotDraw(!divider);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2113,11 +2113,11 @@ public class DialogCell extends BaseCell {
|
||||||
avatarDrawable.setAvatarType(AvatarDrawable.AVATAR_TYPE_SAVED);
|
avatarDrawable.setAvatarType(AvatarDrawable.AVATAR_TYPE_SAVED);
|
||||||
avatarImage.setImage(null, null, avatarDrawable, null, user, 0);
|
avatarImage.setImage(null, null, avatarDrawable, null, user, 0);
|
||||||
} else {
|
} else {
|
||||||
avatarImage.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user, 0);
|
avatarImage.setForUserOrChat(user, avatarDrawable);
|
||||||
}
|
}
|
||||||
} else if (chat != null) {
|
} else if (chat != null) {
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
avatarImage.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat, 0);
|
avatarImage.setForUserOrChat(chat, avatarDrawable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ public class DialogMeUrlCell extends BaseCell {
|
||||||
}
|
}
|
||||||
nameString = chat.title;
|
nameString = chat.title;
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
avatarImage.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, recentMeUrl, 0);
|
avatarImage.setForUserOrChat(chat, avatarDrawable, recentMeUrl);
|
||||||
} else if (recentMeUrl instanceof TLRPC.TL_recentMeUrlUser) {
|
} else if (recentMeUrl instanceof TLRPC.TL_recentMeUrlUser) {
|
||||||
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(recentMeUrl.user_id);
|
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(recentMeUrl.user_id);
|
||||||
if (!LocaleController.isRTL) {
|
if (!LocaleController.isRTL) {
|
||||||
|
@ -153,7 +153,7 @@ public class DialogMeUrlCell extends BaseCell {
|
||||||
}
|
}
|
||||||
nameString = UserObject.getUserName(user);
|
nameString = UserObject.getUserName(user);
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
avatarImage.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, recentMeUrl, 0);
|
avatarImage.setForUserOrChat(user, avatarDrawable, recentMeUrl);
|
||||||
} else if (recentMeUrl instanceof TLRPC.TL_recentMeUrlStickerSet) {
|
} else if (recentMeUrl instanceof TLRPC.TL_recentMeUrlStickerSet) {
|
||||||
if (!LocaleController.isRTL) {
|
if (!LocaleController.isRTL) {
|
||||||
nameLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
nameLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||||
|
@ -180,7 +180,7 @@ public class DialogMeUrlCell extends BaseCell {
|
||||||
nameLockTop = AndroidUtilities.dp(17.5f);
|
nameLockTop = AndroidUtilities.dp(17.5f);
|
||||||
}
|
}
|
||||||
drawVerified = recentMeUrl.chat_invite.chat.verified;
|
drawVerified = recentMeUrl.chat_invite.chat.verified;
|
||||||
avatarImage.setImage(ImageLocation.getForUserOrChat(recentMeUrl.chat_invite.chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(recentMeUrl.chat_invite.chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, recentMeUrl, 0);
|
avatarImage.setForUserOrChat(recentMeUrl.chat_invite.chat, avatarDrawable, recentMeUrl);
|
||||||
} else {
|
} else {
|
||||||
nameString = recentMeUrl.chat_invite.title;
|
nameString = recentMeUrl.chat_invite.title;
|
||||||
avatarDrawable.setInfo(5, recentMeUrl.chat_invite.title, null);
|
avatarDrawable.setInfo(5, recentMeUrl.chat_invite.title, null);
|
||||||
|
|
|
@ -351,7 +351,7 @@ public class DrawerProfileCell extends FrameLayout {
|
||||||
phoneTextView.setText(PhoneFormat.getInstance().format("+" + user.phone));
|
phoneTextView.setText(PhoneFormat.getInstance().format("+" + user.phone));
|
||||||
AvatarDrawable avatarDrawable = new AvatarDrawable(user);
|
AvatarDrawable avatarDrawable = new AvatarDrawable(user);
|
||||||
avatarDrawable.setColor(Theme.getColor(Theme.key_avatar_backgroundInProfileBlue));
|
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);
|
avatarImageView.setForUserOrChat(user, avatarDrawable);
|
||||||
|
|
||||||
applyBackground(true);
|
applyBackground(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class DrawerUserCell extends FrameLayout {
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
textView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
textView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
||||||
imageView.getImageReceiver().setCurrentAccount(account);
|
imageView.getImageReceiver().setCurrentAccount(account);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
checkBox.setVisibility(account == UserConfig.selectedAccount ? VISIBLE : INVISIBLE);
|
checkBox.setVisibility(account == UserConfig.selectedAccount ? VISIBLE : INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class GroupCallInvitedCell extends FrameLayout {
|
||||||
nameTextView.setText(lastName);
|
nameTextView.setText(lastName);
|
||||||
|
|
||||||
avatarImageView.getImageReceiver().setCurrentAccount(account);
|
avatarImageView.getImageReceiver().setCurrentAccount(account);
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentUser);
|
avatarImageView.setForUserOrChat(currentUser, avatarDrawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDrawDivider(boolean draw) {
|
public void setDrawDivider(boolean draw) {
|
||||||
|
|
|
@ -330,7 +330,7 @@ public class GroupCreateUserCell extends FrameLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentUser);
|
avatarImageView.setForUserOrChat(currentUser, avatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
TLRPC.Chat currentChat = (TLRPC.Chat) currentObject;
|
TLRPC.Chat currentChat = (TLRPC.Chat) currentObject;
|
||||||
if (currentChat.photo != null) {
|
if (currentChat.photo != null) {
|
||||||
|
@ -390,7 +390,7 @@ public class GroupCreateUserCell extends FrameLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentChat);
|
avatarImageView.setForUserOrChat(currentChat, avatarDrawable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ public class HintDialogCell extends FrameLayout {
|
||||||
nameTextView.setText("");
|
nameTextView.setText("");
|
||||||
}
|
}
|
||||||
avatarDrawable.setInfo(currentUser);
|
avatarDrawable.setInfo(currentUser);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentUser);
|
imageView.setForUserOrChat(currentUser, avatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(-uid);
|
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(-uid);
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
|
@ -140,7 +140,7 @@ public class HintDialogCell extends FrameLayout {
|
||||||
}
|
}
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
currentUser = null;
|
currentUser = null;
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
imageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
}
|
}
|
||||||
if (counter) {
|
if (counter) {
|
||||||
update(0);
|
update(0);
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class JoinSheetUserCell extends FrameLayout {
|
||||||
public void setUser(TLRPC.User user) {
|
public void setUser(TLRPC.User user) {
|
||||||
nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCount(int count) {
|
public void setCount(int count) {
|
||||||
|
|
|
@ -260,7 +260,7 @@ public class ManageChatUserCell extends FrameLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lastAvatar = photo;
|
lastAvatar = photo;
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentUser);
|
avatarImageView.setForUserOrChat(currentUser, avatarDrawable);
|
||||||
} else if (currentObject instanceof TLRPC.Chat) {
|
} else if (currentObject instanceof TLRPC.Chat) {
|
||||||
TLRPC.Chat currentChat = (TLRPC.Chat) currentObject;
|
TLRPC.Chat currentChat = (TLRPC.Chat) currentObject;
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ public class ManageChatUserCell extends FrameLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lastAvatar = photo;
|
lastAvatar = photo;
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentChat);
|
avatarImageView.setForUserOrChat(currentChat, avatarDrawable);
|
||||||
} else if (currentObject instanceof Integer) {
|
} else if (currentObject instanceof Integer) {
|
||||||
nameTextView.setText(currentName);
|
nameTextView.setText(currentName);
|
||||||
statusTextView.setTextColor(statusColor);
|
statusTextView.setTextColor(statusColor);
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class MentionCell extends LinearLayout {
|
||||||
}
|
}
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
if (user.photo != null && user.photo.photo_small != null) {
|
if (user.photo != null && user.photo.photo_small != null) {
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
imageView.setImageDrawable(avatarDrawable);
|
imageView.setImageDrawable(avatarDrawable);
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ public class MentionCell extends LinearLayout {
|
||||||
}
|
}
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
if (chat.photo != null && chat.photo.photo_small != null) {
|
if (chat.photo != null && chat.photo.photo_small != null) {
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
imageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
imageView.setImageDrawable(avatarDrawable);
|
imageView.setImageDrawable(avatarDrawable);
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@ public class MentionCell extends LinearLayout {
|
||||||
imageView.setVisibility(VISIBLE);
|
imageView.setVisibility(VISIBLE);
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
if (user.photo != null && user.photo.photo_small != null) {
|
if (user.photo != null && user.photo.photo_small != null) {
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
imageView.setImageDrawable(avatarDrawable);
|
imageView.setImageDrawable(avatarDrawable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -501,14 +501,14 @@ public class ProfileSearchCell extends BaseCell {
|
||||||
if (user.photo != null) {
|
if (user.photo != null) {
|
||||||
photo = user.photo.photo_small;
|
photo = user.photo.photo_small;
|
||||||
}
|
}
|
||||||
avatarImage.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user, 0);
|
avatarImage.setForUserOrChat(user, avatarDrawable);
|
||||||
}
|
}
|
||||||
} else if (chat != null) {
|
} else if (chat != null) {
|
||||||
if (chat.photo != null) {
|
if (chat.photo != null) {
|
||||||
photo = chat.photo.photo_small;
|
photo = chat.photo.photo_small;
|
||||||
}
|
}
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
avatarImage.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat, 0);
|
avatarImage.setForUserOrChat(chat, avatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
avatarDrawable.setInfo(0, null, null);
|
avatarDrawable.setInfo(0, null, null);
|
||||||
avatarImage.setImage(null, null, avatarDrawable, null, null, 0);
|
avatarImage.setImage(null, null, avatarDrawable, null, null, 0);
|
||||||
|
|
|
@ -183,7 +183,7 @@ public class SessionCell extends FrameLayout {
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
name = UserObject.getFirstName(user);
|
name = UserObject.getFirstName(user);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
name = "";
|
name = "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@ public class ShareDialogCell extends FrameLayout {
|
||||||
} else {
|
} else {
|
||||||
nameTextView.setText("");
|
nameTextView.setText("");
|
||||||
}
|
}
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
user = null;
|
user = null;
|
||||||
|
@ -127,7 +127,7 @@ public class ShareDialogCell extends FrameLayout {
|
||||||
nameTextView.setText("");
|
nameTextView.setText("");
|
||||||
}
|
}
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
imageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
}
|
}
|
||||||
currentDialog = uid;
|
currentDialog = uid;
|
||||||
checkBox.setChecked(checked, false);
|
checkBox.setChecked(checked, false);
|
||||||
|
@ -192,6 +192,6 @@ public class ShareDialogCell extends FrameLayout {
|
||||||
int cy = imageView.getTop() + imageView.getMeasuredHeight() / 2;
|
int cy = imageView.getTop() + imageView.getMeasuredHeight() / 2;
|
||||||
Theme.checkboxSquare_checkPaint.setColor(Theme.getColor(Theme.key_dialogRoundCheckBox));
|
Theme.checkboxSquare_checkPaint.setColor(Theme.getColor(Theme.key_dialogRoundCheckBox));
|
||||||
Theme.checkboxSquare_checkPaint.setAlpha((int) (checkBox.getProgress() * 255));
|
Theme.checkboxSquare_checkPaint.setAlpha((int) (checkBox.getProgress() * 255));
|
||||||
canvas.drawCircle(cx, cy, AndroidUtilities.dp(24), Theme.checkboxSquare_checkPaint);
|
canvas.drawCircle(cx, cy, AndroidUtilities.dp(currentType == TYPE_CREATE ? 24 : 28), Theme.checkboxSquare_checkPaint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,14 +124,14 @@ public class SharingLiveLocationCell extends FrameLayout {
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
avatarDrawable = new AvatarDrawable(user);
|
avatarDrawable = new AvatarDrawable(user);
|
||||||
name = UserObject.getUserName(user);
|
name = UserObject.getUserName(user);
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
avatarImageView.setForUserOrChat(user, avatarDrawable);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(-lowerId);
|
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(-lowerId);
|
||||||
if (chat != null) {
|
if (chat != null) {
|
||||||
avatarDrawable = new AvatarDrawable(chat);
|
avatarDrawable = new AvatarDrawable(chat);
|
||||||
name = chat.title;
|
name = chat.title;
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
avatarImageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nameTextView.setText(name);
|
nameTextView.setText(name);
|
||||||
|
@ -177,14 +177,14 @@ public class SharingLiveLocationCell extends FrameLayout {
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
avatarDrawable = new AvatarDrawable(user);
|
avatarDrawable = new AvatarDrawable(user);
|
||||||
name = UserObject.getUserName(user);
|
name = UserObject.getUserName(user);
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
avatarImageView.setForUserOrChat(user, avatarDrawable);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(-fromId);
|
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(-fromId);
|
||||||
if (chat != null) {
|
if (chat != null) {
|
||||||
avatarDrawable = new AvatarDrawable(chat);
|
avatarDrawable = new AvatarDrawable(chat);
|
||||||
name = chat.title;
|
name = chat.title;
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
avatarImageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -216,14 +216,14 @@ public class SharingLiveLocationCell extends FrameLayout {
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
avatarImageView.setForUserOrChat(user, avatarDrawable);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(-lower_id);
|
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(-lower_id);
|
||||||
if (chat != null) {
|
if (chat != null) {
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
nameTextView.setText(chat.title);
|
nameTextView.setText(chat.title);
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
avatarImageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,14 +249,14 @@ public class SharingLiveLocationCell extends FrameLayout {
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
avatarImageView.setForUserOrChat(user, avatarDrawable);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(-lower_id);
|
TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(-lower_id);
|
||||||
if (chat != null) {
|
if (chat != null) {
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
nameTextView.setText(chat.title);
|
nameTextView.setText(chat.title);
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
avatarImageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class StatisticPostInfoCell extends FrameLayout {
|
||||||
|
|
||||||
public void setData(StatisticActivity.MemberData memberData) {
|
public void setData(StatisticActivity.MemberData memberData) {
|
||||||
avatarDrawable.setInfo(memberData.user);
|
avatarDrawable.setInfo(memberData.user);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(memberData.user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(memberData.user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, memberData.user);
|
imageView.setForUserOrChat(memberData.user, avatarDrawable);
|
||||||
imageView.setRoundRadius(AndroidUtilities.dp(46) >> 1);
|
imageView.setRoundRadius(AndroidUtilities.dp(46) >> 1);
|
||||||
message.setText(memberData.user.first_name);
|
message.setText(memberData.user.first_name);
|
||||||
date.setText(memberData.description);
|
date.setText(memberData.description);
|
||||||
|
|
|
@ -493,9 +493,9 @@ public class UserCell extends FrameLayout {
|
||||||
|
|
||||||
lastAvatar = photo;
|
lastAvatar = photo;
|
||||||
if (currentUser != null) {
|
if (currentUser != null) {
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentUser);
|
avatarImageView.setForUserOrChat(currentUser, avatarDrawable);
|
||||||
} else if (currentChat != null) {
|
} else if (currentChat != null) {
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentChat);
|
avatarImageView.setForUserOrChat(currentChat, avatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
avatarImageView.setImageDrawable(avatarDrawable);
|
avatarImageView.setImageDrawable(avatarDrawable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,7 +260,7 @@ public class UserCell2 extends FrameLayout {
|
||||||
statusTextView.setText(LocaleController.formatUserStatus(currentAccount, currentUser));
|
statusTextView.setText(LocaleController.formatUserStatus(currentAccount, currentUser));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentUser);
|
avatarImageView.setForUserOrChat(currentUser, avatarDrawable);
|
||||||
} else if (currentChat != null) {
|
} else if (currentChat != null) {
|
||||||
statusTextView.setTextColor(statusColor);
|
statusTextView.setTextColor(statusColor);
|
||||||
if (ChatObject.isChannel(currentChat) && !currentChat.megagroup) {
|
if (ChatObject.isChannel(currentChat) && !currentChat.megagroup) {
|
||||||
|
@ -282,7 +282,7 @@ public class UserCell2 extends FrameLayout {
|
||||||
statusTextView.setText(LocaleController.getString("MegaPublic", R.string.MegaPublic));
|
statusTextView.setText(LocaleController.getString("MegaPublic", R.string.MegaPublic));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentObject);
|
avatarImageView.setForUserOrChat(currentChat, avatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
avatarImageView.setImageDrawable(avatarDrawable);
|
avatarImageView.setImageDrawable(avatarDrawable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1832,9 +1832,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
if (revoke && currentUser != null) {
|
if (revoke && currentUser != null) {
|
||||||
getMessagesStorage().getMessagesCount(currentUser.id, (count) -> {
|
getMessagesStorage().getMessagesCount(currentUser.id, (count) -> {
|
||||||
if (count >= 50) {
|
if (count >= 50) {
|
||||||
AlertsCreator.createClearOrDeleteDialogAlert(ChatActivity.this, true, false, true, null, currentUser, false, false, (param) -> {
|
AlertsCreator.createClearOrDeleteDialogAlert(ChatActivity.this, true, false, true, null, currentUser, false, false, (param) -> performHistoryClear(true));
|
||||||
performHistoryClear(true);
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
performHistoryClear(true);
|
performHistoryClear(true);
|
||||||
}
|
}
|
||||||
|
@ -5790,6 +5788,12 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||||
public void didPressUrl(CharacterStyle span) {
|
public void didPressUrl(CharacterStyle span) {
|
||||||
didPressMessageUrl(span, false, null, null);
|
didPressMessageUrl(span, false, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showWithAction(long did, int action, Object infoObject, Object infoObject2, Runnable actionRunnable, Runnable cancelRunnable) {
|
||||||
|
setAdditionalTranslationY(fragmentContextView != null && fragmentContextView.isCallTypeVisible() ? AndroidUtilities.dp(fragmentContextView.getStyleHeight()) : 0);
|
||||||
|
super.showWithAction(did, action, infoObject, infoObject2, actionRunnable, cancelRunnable);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
contentView.addView(topUndoView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.LEFT, 8, 8, 8, 0));
|
contentView.addView(topUndoView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.LEFT, 8, 8, 8, 0));
|
||||||
|
|
||||||
|
|
|
@ -938,7 +938,7 @@ public class ChatEditActivity extends BaseFragment implements ImageUpdater.Image
|
||||||
if (currentChat.photo != null) {
|
if (currentChat.photo != null) {
|
||||||
avatar = currentChat.photo.photo_small;
|
avatar = currentChat.photo.photo_small;
|
||||||
ImageLocation location = ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_SMALL);
|
ImageLocation location = ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_SMALL);
|
||||||
avatarImage.setImage(location, "50_50", ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentChat);
|
avatarImage.setForUserOrChat(currentChat, avatarDrawable);
|
||||||
hasPhoto = location != null;
|
hasPhoto = location != null;
|
||||||
} else {
|
} else {
|
||||||
avatarImage.setImageDrawable(avatarDrawable);
|
avatarImage.setImageDrawable(avatarDrawable);
|
||||||
|
|
|
@ -499,7 +499,7 @@ public class ChatLinkActivity extends BaseFragment implements NotificationCenter
|
||||||
frameLayout2.addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, (LocaleController.isRTL ? 21 : 76), 11, (LocaleController.isRTL ? 76 : 21), 0));
|
frameLayout2.addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, (LocaleController.isRTL ? 21 : 76), 11, (LocaleController.isRTL ? 76 : 21), 0));
|
||||||
frameLayout2.addView(messageTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 24, 57, 24, 9));
|
frameLayout2.addView(messageTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 24, 57, 24, 9));
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
imageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
builder.setPositiveButton(LocaleController.getString("DiscussionLinkGroup", R.string.DiscussionLinkGroup), (dialogInterface, i) -> {
|
builder.setPositiveButton(LocaleController.getString("DiscussionLinkGroup", R.string.DiscussionLinkGroup), (dialogInterface, i) -> {
|
||||||
if (chatFull.hidden_prehistory) {
|
if (chatFull.hidden_prehistory) {
|
||||||
MessagesController.getInstance(currentAccount).toogleChannelInvitesHistory(chat.id, false);
|
MessagesController.getInstance(currentAccount).toogleChannelInvitesHistory(chat.id, false);
|
||||||
|
|
|
@ -1762,7 +1762,7 @@ public class ChatUsersActivity extends BaseFragment implements NotificationCente
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!isChannel) {
|
if (!isChannel) {
|
||||||
if (ChatObject.isChannel(currentChat)) {
|
if (ChatObject.isChannel(currentChat) && !currentChat.gigagroup) {
|
||||||
items.add(LocaleController.getString("ChangePermissions", R.string.ChangePermissions));
|
items.add(LocaleController.getString("ChangePermissions", R.string.ChangePermissions));
|
||||||
icons.add(R.drawable.actions_permissions);
|
icons.add(R.drawable.actions_permissions);
|
||||||
actions.add(1);
|
actions.add(1);
|
||||||
|
|
|
@ -1161,11 +1161,11 @@ public class AlertsCreator {
|
||||||
} else {
|
} else {
|
||||||
avatarDrawable.setSmallSize(false);
|
avatarDrawable.setSmallSize(false);
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
imageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
messageTextView.setText(AndroidUtilities.replaceTags(message));
|
messageTextView.setText(AndroidUtilities.replaceTags(message));
|
||||||
|
@ -1329,11 +1329,11 @@ public class AlertsCreator {
|
||||||
} else {
|
} else {
|
||||||
avatarDrawable.setSmallSize(false);
|
avatarDrawable.setSmallSize(false);
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
imageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (second) {
|
if (second) {
|
||||||
|
@ -1499,7 +1499,7 @@ public class AlertsCreator {
|
||||||
|
|
||||||
BackupImageView imageView = new BackupImageView(context);
|
BackupImageView imageView = new BackupImageView(context);
|
||||||
imageView.setRoundRadius(AndroidUtilities.dp(20));
|
imageView.setRoundRadius(AndroidUtilities.dp(20));
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
frameLayout.addView(imageView, LayoutHelper.createFrame(40, 40, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 22, 5, 22, 0));
|
frameLayout.addView(imageView, LayoutHelper.createFrame(40, 40, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 22, 5, 22, 0));
|
||||||
|
|
||||||
TextView textView = new TextView(context);
|
TextView textView = new TextView(context);
|
||||||
|
@ -2032,9 +2032,9 @@ public class AlertsCreator {
|
||||||
t = LocaleController.formatPluralString("SecondsSchedule", diff);
|
t = LocaleController.formatPluralString("SecondsSchedule", diff);
|
||||||
}
|
}
|
||||||
if (infoText.getTag() != null) {
|
if (infoText.getTag() != null) {
|
||||||
infoText.setText(LocaleController.formatString("VoipGroupScheduleInfo", R.string.VoipGroupScheduleInfo, t));
|
|
||||||
} else {
|
|
||||||
infoText.setText(LocaleController.formatString("VoipChannelScheduleInfo", R.string.VoipChannelScheduleInfo, t));
|
infoText.setText(LocaleController.formatString("VoipChannelScheduleInfo", R.string.VoipChannelScheduleInfo, t));
|
||||||
|
} else {
|
||||||
|
infoText.setText(LocaleController.formatString("VoipGroupScheduleInfo", R.string.VoipGroupScheduleInfo, t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return currentTime - systemTime > 60000L;
|
return currentTime - systemTime > 60000L;
|
||||||
|
@ -3361,7 +3361,7 @@ public class AlertsCreator {
|
||||||
|
|
||||||
BackupImageView imageView = new BackupImageView(activity);
|
BackupImageView imageView = new BackupImageView(activity);
|
||||||
imageView.setRoundRadius(AndroidUtilities.dp(26));
|
imageView.setRoundRadius(AndroidUtilities.dp(26));
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(selfUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(selfUser, ImageLocation.TYPE_STRIPPED), "50_50", (Drawable) null, selfUser);
|
imageView.setForUserOrChat(selfUser, new AvatarDrawable(selfUser));
|
||||||
frameLayout.addView(imageView, LayoutHelper.createFrame(52, 52, Gravity.CENTER, 0, 0, 0, 11));
|
frameLayout.addView(imageView, LayoutHelper.createFrame(52, 52, Gravity.CENTER, 0, 0, 0, 11));
|
||||||
|
|
||||||
builder.setTopView(frameLayout);
|
builder.setTopView(frameLayout);
|
||||||
|
|
|
@ -17,7 +17,6 @@ import androidx.core.graphics.ColorUtils;
|
||||||
|
|
||||||
import org.telegram.messenger.AccountInstance;
|
import org.telegram.messenger.AccountInstance;
|
||||||
import org.telegram.messenger.AndroidUtilities;
|
import org.telegram.messenger.AndroidUtilities;
|
||||||
import org.telegram.messenger.ImageLocation;
|
|
||||||
import org.telegram.messenger.ImageReceiver;
|
import org.telegram.messenger.ImageReceiver;
|
||||||
import org.telegram.messenger.MessageObject;
|
import org.telegram.messenger.MessageObject;
|
||||||
import org.telegram.messenger.MessagesController;
|
import org.telegram.messenger.MessagesController;
|
||||||
|
@ -234,9 +233,9 @@ public class AvatarsImageView extends FrameLayout {
|
||||||
animatingStates[index].id = -currentChat.id;
|
animatingStates[index].id = -currentChat.id;
|
||||||
}
|
}
|
||||||
if (currentUser != null) {
|
if (currentUser != null) {
|
||||||
animatingStates[index].imageReceiver.setImage(ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_STRIPPED), "50_50", animatingStates[index].avatarDrawable, currentUser, 0);
|
animatingStates[index].imageReceiver.setForUserOrChat(currentUser, animatingStates[index].avatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
animatingStates[index].imageReceiver.setImage(ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentChat, ImageLocation.TYPE_STRIPPED), "50_50", animatingStates[index].avatarDrawable, currentChat, 0);
|
animatingStates[index].imageReceiver.setForUserOrChat(currentChat, animatingStates[index].avatarDrawable);
|
||||||
}
|
}
|
||||||
animatingStates[index].imageReceiver.setRoundRadius(AndroidUtilities.dp(currentStyle == 4 ? 16 : 12));
|
animatingStates[index].imageReceiver.setRoundRadius(AndroidUtilities.dp(currentStyle == 4 ? 16 : 12));
|
||||||
int size = AndroidUtilities.dp(currentStyle == 4 ? 32 : 24);
|
int size = AndroidUtilities.dp(currentStyle == 4 ? 32 : 24);
|
||||||
|
|
|
@ -20,6 +20,7 @@ import android.view.View;
|
||||||
import org.telegram.messenger.ImageLocation;
|
import org.telegram.messenger.ImageLocation;
|
||||||
import org.telegram.messenger.ImageReceiver;
|
import org.telegram.messenger.ImageReceiver;
|
||||||
import org.telegram.messenger.SecureDocument;
|
import org.telegram.messenger.SecureDocument;
|
||||||
|
import org.telegram.tgnet.TLObject;
|
||||||
|
|
||||||
public class BackupImageView extends View {
|
public class BackupImageView extends View {
|
||||||
|
|
||||||
|
@ -68,6 +69,14 @@ public class BackupImageView extends View {
|
||||||
imageReceiver.setImage(imageLocation, imageFilter, null, null, thumb, size, null, parentObject, cacheType);
|
imageReceiver.setImage(imageLocation, imageFilter, null, null, thumb, size, null, parentObject, cacheType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setForUserOrChat(TLObject object, AvatarDrawable avatarDrawable) {
|
||||||
|
imageReceiver.setForUserOrChat(object, avatarDrawable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setForUserOrChat(TLObject object, AvatarDrawable avatarDrawable, Object parent) {
|
||||||
|
imageReceiver.setForUserOrChat(object, avatarDrawable, parent);
|
||||||
|
}
|
||||||
|
|
||||||
public void setImageMedia(ImageLocation mediaLocation, String mediaFilter, ImageLocation imageLocation, String imageFilter, Bitmap thumbBitmap, int size, int cacheType, Object parentObject) {
|
public void setImageMedia(ImageLocation mediaLocation, String mediaFilter, ImageLocation imageLocation, String imageFilter, Bitmap thumbBitmap, int size, int cacheType, Object parentObject) {
|
||||||
Drawable thumb = null;
|
Drawable thumb = null;
|
||||||
if (thumbBitmap != null) {
|
if (thumbBitmap != null) {
|
||||||
|
|
|
@ -553,7 +553,7 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
|
||||||
currentUser = user;
|
currentUser = user;
|
||||||
nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name));
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
requestLayout();
|
requestLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,7 +208,7 @@ public class ChatAttachAlertContactsLayout extends ChatAttachAlert.AttachAlertLa
|
||||||
|
|
||||||
lastAvatar = photo;
|
lastAvatar = photo;
|
||||||
if (currentUser != null) {
|
if (currentUser != null) {
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentUser);
|
avatarImageView.setForUserOrChat(currentUser, avatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
avatarImageView.setImageDrawable(avatarDrawable);
|
avatarImageView.setImageDrawable(avatarDrawable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -589,7 +589,7 @@ public class ChatAvatarContainer extends FrameLayout implements NotificationCent
|
||||||
public void setChatAvatar(TLRPC.Chat chat) {
|
public void setChatAvatar(TLRPC.Chat chat) {
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
if (avatarImageView != null) {
|
if (avatarImageView != null) {
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
avatarImageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -615,7 +615,7 @@ public class ChatAvatarContainer extends FrameLayout implements NotificationCent
|
||||||
} else {
|
} else {
|
||||||
avatarDrawable.setSmallSize(false);
|
avatarDrawable.setSmallSize(false);
|
||||||
if (avatarImageView != null) {
|
if (avatarImageView != null) {
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
avatarImageView.setForUserOrChat(user, avatarDrawable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -643,13 +643,13 @@ public class ChatAvatarContainer extends FrameLayout implements NotificationCent
|
||||||
} else {
|
} else {
|
||||||
avatarDrawable.setSmallSize(false);
|
avatarDrawable.setSmallSize(false);
|
||||||
if (avatarImageView != null) {
|
if (avatarImageView != null) {
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
avatarImageView.setForUserOrChat(user, avatarDrawable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (chat != null) {
|
} else if (chat != null) {
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
if (avatarImageView != null) {
|
if (avatarImageView != null) {
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
avatarImageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,9 @@ public class ContactsEmptyView extends LinearLayout implements NotificationCente
|
||||||
stickerView = new BackupImageView(context);
|
stickerView = new BackupImageView(context);
|
||||||
drawable = new LoadingStickerDrawable(stickerView, svg, AndroidUtilities.dp(130), AndroidUtilities.dp(130));
|
drawable = new LoadingStickerDrawable(stickerView, svg, AndroidUtilities.dp(130), AndroidUtilities.dp(130));
|
||||||
stickerView.setImageDrawable(drawable);
|
stickerView.setImageDrawable(drawable);
|
||||||
addView(stickerView, LayoutHelper.createLinear(130, 130, Gravity.CENTER_HORIZONTAL | Gravity.TOP, 0, 2, 0, 0));
|
if (!AndroidUtilities.isTablet()) {
|
||||||
|
addView(stickerView, LayoutHelper.createLinear(130, 130, Gravity.CENTER_HORIZONTAL | Gravity.TOP, 0, 2, 0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
titleTextView = new TextView(context);
|
titleTextView = new TextView(context);
|
||||||
titleTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 20);
|
titleTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 20);
|
||||||
|
|
|
@ -1101,6 +1101,10 @@ public class FragmentContextView extends FrameLayout implements NotificationCent
|
||||||
return currentStyle == 4 ? 48 : 36;
|
return currentStyle == 4 ? 48 : 36;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isCallTypeVisible() {
|
||||||
|
return (currentStyle == 1 || currentStyle == 3) && visible;
|
||||||
|
}
|
||||||
|
|
||||||
private void checkLiveLocation(boolean create) {
|
private void checkLiveLocation(boolean create) {
|
||||||
View fragmentView = fragment.getFragmentView();
|
View fragmentView = fragment.getFragmentView();
|
||||||
if (!create && fragmentView != null) {
|
if (!create && fragmentView != null) {
|
||||||
|
@ -1765,7 +1769,7 @@ public class FragmentContextView extends FrameLayout implements NotificationCent
|
||||||
} else {
|
} else {
|
||||||
titleTextView.setText(LocaleController.getString("VoipGroupScheduledVoiceChat", R.string.VoipGroupScheduledVoiceChat), false);
|
titleTextView.setText(LocaleController.getString("VoipGroupScheduledVoiceChat", R.string.VoipGroupScheduledVoiceChat), false);
|
||||||
}
|
}
|
||||||
subtitleTextView.setText(LocaleController.formatStartsTime(call.call.schedule_date, 2), false);
|
subtitleTextView.setText(LocaleController.formatStartsTime(call.call.schedule_date, 4), false);
|
||||||
if (!scheduleRunnableScheduled) {
|
if (!scheduleRunnableScheduled) {
|
||||||
scheduleRunnableScheduled = true;
|
scheduleRunnableScheduled = true;
|
||||||
updateScheduleTimeRunnable.run();
|
updateScheduleTimeRunnable.run();
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class JoinCallByUrlAlert extends BottomSheet {
|
||||||
linearLayout.addView(avatarImageView, LayoutHelper.createLinear(90, 90, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 29, 0, 0));
|
linearLayout.addView(avatarImageView, LayoutHelper.createLinear(90, 90, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 29, 0, 0));
|
||||||
|
|
||||||
AvatarDrawable avatarDrawable = new AvatarDrawable(chat);
|
AvatarDrawable avatarDrawable = new AvatarDrawable(chat);
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
avatarImageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
|
|
||||||
TextView percentTextView = new TextView(context);
|
TextView percentTextView = new TextView(context);
|
||||||
percentTextView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
|
percentTextView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class JoinGroupAlert extends BottomSheet {
|
||||||
avatarDrawable = new AvatarDrawable(invite.chat);
|
avatarDrawable = new AvatarDrawable(invite.chat);
|
||||||
title = invite.chat.title;
|
title = invite.chat.title;
|
||||||
participants_count = invite.chat.participants_count;
|
participants_count = invite.chat.participants_count;
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(invite.chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(invite.chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, invite);
|
avatarImageView.setForUserOrChat(invite.chat, avatarDrawable, invite);
|
||||||
} else {
|
} else {
|
||||||
avatarDrawable = new AvatarDrawable();
|
avatarDrawable = new AvatarDrawable();
|
||||||
avatarDrawable.setInfo(0, invite.title, null);
|
avatarDrawable.setInfo(0, invite.title, null);
|
||||||
|
|
|
@ -117,7 +117,7 @@ public class PhonebookShareAlert extends BottomSheet {
|
||||||
|
|
||||||
BackupImageView avatarImageView = new BackupImageView(context);
|
BackupImageView avatarImageView = new BackupImageView(context);
|
||||||
avatarImageView.setRoundRadius(AndroidUtilities.dp(40));
|
avatarImageView.setRoundRadius(AndroidUtilities.dp(40));
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentUser);
|
avatarImageView.setForUserOrChat(currentUser, avatarDrawable);
|
||||||
addView(avatarImageView, LayoutHelper.createLinear(80, 80, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 32, 0, 0));
|
addView(avatarImageView, LayoutHelper.createLinear(80, 80, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 32, 0, 0));
|
||||||
|
|
||||||
TextView textView = new TextView(context);
|
TextView textView = new TextView(context);
|
||||||
|
|
|
@ -375,7 +375,7 @@ public class PollVotesAlert extends BottomSheet {
|
||||||
|
|
||||||
lastAvatar = photo;
|
lastAvatar = photo;
|
||||||
if (currentUser != null) {
|
if (currentUser != null) {
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(currentUser, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, currentUser);
|
avatarImageView.setForUserOrChat(currentUser, avatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
avatarImageView.setImageDrawable(avatarDrawable);
|
avatarImageView.setImageDrawable(avatarDrawable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,16 +134,24 @@ public class RecyclerItemsEnterAnimator {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDetached() {
|
public void onDetached() {
|
||||||
for (int i = 0; i < currentAnimations.size(); i++) {
|
cancel();
|
||||||
currentAnimations.get(i).cancel();
|
}
|
||||||
|
|
||||||
|
public void cancel() {
|
||||||
|
if (!currentAnimations.isEmpty()) {
|
||||||
|
ArrayList<AnimatorSet> animations = new ArrayList<>(currentAnimations);
|
||||||
|
for (int i = 0; i < animations.size(); i++) {
|
||||||
|
animations.get(i).end();
|
||||||
|
animations.get(i).cancel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
currentAnimations.clear();
|
currentAnimations.clear();
|
||||||
for (int i = 0; i < preDrawListeners.size(); i++) {
|
for (int i = 0; i < preDrawListeners.size(); i++) {
|
||||||
listView.getViewTreeObserver().removeOnPreDrawListener(preDrawListeners.get(i));
|
listView.getViewTreeObserver().removeOnPreDrawListener(preDrawListeners.get(i));
|
||||||
}
|
}
|
||||||
preDrawListeners.clear();
|
preDrawListeners.clear();
|
||||||
|
|
||||||
listAlphaItems.clear();
|
listAlphaItems.clear();
|
||||||
|
listView.invalidate();
|
||||||
invalidateAlpha = true;
|
invalidateAlpha = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -284,7 +284,7 @@ public class ScrollSlidingTabStrip extends HorizontalScrollView {
|
||||||
BackupImageView imageView = new BackupImageView(getContext());
|
BackupImageView imageView = new BackupImageView(getContext());
|
||||||
imageView.setLayerNum(1);
|
imageView.setLayerNum(1);
|
||||||
imageView.setRoundRadius(AndroidUtilities.dp(15));
|
imageView.setRoundRadius(AndroidUtilities.dp(15));
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
imageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
imageView.setAspectFit(true);
|
imageView.setAspectFit(true);
|
||||||
tab.addView(imageView, LayoutHelper.createFrame(30, 30, Gravity.CENTER));
|
tab.addView(imageView, LayoutHelper.createFrame(30, 30, Gravity.CENTER));
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,8 @@ public class SearchViewPager extends ViewPagerFixed implements FilteredSearchVie
|
||||||
public StickerEmptyView emptyView;
|
public StickerEmptyView emptyView;
|
||||||
public DialogsSearchAdapter dialogsSearchAdapter;
|
public DialogsSearchAdapter dialogsSearchAdapter;
|
||||||
private LinearLayoutManager searchlayoutManager;
|
private LinearLayoutManager searchlayoutManager;
|
||||||
|
private RecyclerItemsEnterAnimator itemsEnterAnimator;
|
||||||
|
private boolean attached;
|
||||||
|
|
||||||
private NumberTextView selectedMessagesCountTextView;
|
private NumberTextView selectedMessagesCountTextView;
|
||||||
private boolean isActionModeShowed;
|
private boolean isActionModeShowed;
|
||||||
|
@ -85,8 +87,7 @@ public class SearchViewPager extends ViewPagerFixed implements FilteredSearchVie
|
||||||
ChatPreviewDelegate chatPreviewDelegate;
|
ChatPreviewDelegate chatPreviewDelegate;
|
||||||
|
|
||||||
private final int folderId;
|
private final int folderId;
|
||||||
|
int animateFromCount = 0;
|
||||||
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);
|
||||||
|
@ -111,23 +112,15 @@ public class SearchViewPager extends ViewPagerFixed implements FilteredSearchVie
|
||||||
searchListView = new RecyclerListView(context) {
|
searchListView = new RecyclerListView(context) {
|
||||||
@Override
|
@Override
|
||||||
protected void dispatchDraw(Canvas canvas) {
|
protected void dispatchDraw(Canvas canvas) {
|
||||||
int n = getChildCount();
|
itemsEnterAnimator.dispatchDraw();
|
||||||
loop: for (int i = 0; i < n; i++) {
|
|
||||||
View v = getChildAt(i);
|
|
||||||
ViewHolder holder = searchListView.getChildViewHolder(v);
|
|
||||||
if (holder == null || holder.shouldIgnore()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
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);
|
super.dispatchDraw(canvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDetachedFromWindow() {
|
||||||
|
super.onDetachedFromWindow();
|
||||||
|
itemsEnterAnimator.onDetached();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
searchListView.setPivotY(0);
|
searchListView.setPivotY(0);
|
||||||
searchListView.setAdapter(dialogsSearchAdapter);
|
searchListView.setAdapter(dialogsSearchAdapter);
|
||||||
|
@ -185,6 +178,8 @@ public class SearchViewPager extends ViewPagerFixed implements FilteredSearchVie
|
||||||
searchContainer.addView(emptyView);
|
searchContainer.addView(emptyView);
|
||||||
searchListView.setEmptyView(emptyView);
|
searchListView.setEmptyView(emptyView);
|
||||||
|
|
||||||
|
itemsEnterAnimator = new RecyclerItemsEnterAnimator(searchListView);
|
||||||
|
|
||||||
setAdapter(new ViewPagerFixed.Adapter() {
|
setAdapter(new ViewPagerFixed.Adapter() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -688,109 +683,15 @@ public class SearchViewPager extends ViewPagerFixed implements FilteredSearchVie
|
||||||
}
|
}
|
||||||
|
|
||||||
public void runResultsEnterAnimation() {
|
public void runResultsEnterAnimation() {
|
||||||
Set<Integer> hasSet = new HashSet<>();
|
itemsEnterAnimator.showItemsAnimated(animateFromCount);
|
||||||
int n = searchListView.getChildCount();
|
animateFromCount = dialogsSearchAdapter.getItemCount();
|
||||||
View progressView = null;
|
|
||||||
for (int i = 0; i < n; i++) {
|
|
||||||
View child = searchListView.getChildAt(i);
|
|
||||||
int childPosition = searchlayoutManager.getPosition(child);
|
|
||||||
if (child instanceof FlickerLoadingView) {
|
|
||||||
progressView = child;
|
|
||||||
} else {
|
|
||||||
hasSet.add(childPosition);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
final View finalProgressView = progressView;
|
|
||||||
if (progressView != null) {
|
|
||||||
searchListView.removeView(progressView);
|
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (finalProgressView != null && finalProgressView.getParent() == null) {
|
|
||||||
searchListView.addView(finalProgressView);
|
|
||||||
RecyclerView.LayoutManager layoutManager = searchListView.getLayoutManager();
|
|
||||||
if (layoutManager != null) {
|
|
||||||
layoutManager.ignoreView(finalProgressView);
|
|
||||||
Animator animator = ObjectAnimator.ofFloat(finalProgressView, ALPHA, finalProgressView.getAlpha(), 0);
|
|
||||||
animator.addListener(new AnimatorListenerAdapter() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animator animation) {
|
|
||||||
finalProgressView.setAlpha(1f);
|
|
||||||
layoutManager.stopIgnoringView(finalProgressView);
|
|
||||||
searchListView.removeView(finalProgressView);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
animator.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--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public TabsView getTabsView() {
|
public TabsView getTabsView() {
|
||||||
return tabsView;
|
return tabsView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean attached;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onAttachedToWindow() {
|
protected void onAttachedToWindow() {
|
||||||
super.onAttachedToWindow();
|
super.onAttachedToWindow();
|
||||||
|
@ -803,6 +704,12 @@ public class SearchViewPager extends ViewPagerFixed implements FilteredSearchVie
|
||||||
attached = false;
|
attached = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void cancelEnterAnimation() {
|
||||||
|
itemsEnterAnimator.cancel();
|
||||||
|
searchListView.invalidate();
|
||||||
|
animateFromCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
public interface ChatPreviewDelegate {
|
public interface ChatPreviewDelegate {
|
||||||
void startChatPreview(DialogCell cell);
|
void startChatPreview(DialogCell cell);
|
||||||
void move(float dy);
|
void move(float dy);
|
||||||
|
|
|
@ -864,7 +864,7 @@ public class ShareAlert extends BottomSheet implements NotificationCenter.Notifi
|
||||||
gridView = new RecyclerListView(context) {
|
gridView = new RecyclerListView(context) {
|
||||||
@Override
|
@Override
|
||||||
protected boolean allowSelectChildAtPosition(float x, float y) {
|
protected boolean allowSelectChildAtPosition(float x, float y) {
|
||||||
return y >= scrollOffsetY + AndroidUtilities.dp(48) + (Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0);
|
return y >= AndroidUtilities.dp(darkTheme && linkToCopy[1] != null ? 111 : 58) + (Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -38,7 +38,6 @@ import org.telegram.messenger.ChatObject;
|
||||||
import org.telegram.messenger.ContactsController;
|
import org.telegram.messenger.ContactsController;
|
||||||
import org.telegram.messenger.Emoji;
|
import org.telegram.messenger.Emoji;
|
||||||
import org.telegram.messenger.FileLog;
|
import org.telegram.messenger.FileLog;
|
||||||
import org.telegram.messenger.ImageLocation;
|
|
||||||
import org.telegram.messenger.LocaleController;
|
import org.telegram.messenger.LocaleController;
|
||||||
import org.telegram.messenger.MessagesController;
|
import org.telegram.messenger.MessagesController;
|
||||||
import org.telegram.messenger.R;
|
import org.telegram.messenger.R;
|
||||||
|
@ -449,7 +448,7 @@ public class UndoView extends FrameLayout {
|
||||||
AvatarDrawable avatarDrawable = new AvatarDrawable();
|
AvatarDrawable avatarDrawable = new AvatarDrawable();
|
||||||
avatarDrawable.setTextSize(AndroidUtilities.dp(12));
|
avatarDrawable.setTextSize(AndroidUtilities.dp(12));
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
avatarImageView.setForUserOrChat(user, avatarDrawable);
|
||||||
avatarImageView.setVisibility(VISIBLE);
|
avatarImageView.setVisibility(VISIBLE);
|
||||||
timeLeft = 3000;
|
timeLeft = 3000;
|
||||||
} else if (action == ACTION_VOIP_USER_CHANGED) {
|
} else if (action == ACTION_VOIP_USER_CHANGED) {
|
||||||
|
@ -459,12 +458,12 @@ public class UndoView extends FrameLayout {
|
||||||
if (infoObject instanceof TLRPC.User) {
|
if (infoObject instanceof TLRPC.User) {
|
||||||
TLRPC.User user = (TLRPC.User) infoObject;
|
TLRPC.User user = (TLRPC.User) infoObject;
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
avatarImageView.setForUserOrChat(user, avatarDrawable);
|
||||||
name = ContactsController.formatName(user.first_name, user.last_name);
|
name = ContactsController.formatName(user.first_name, user.last_name);
|
||||||
} else {
|
} else {
|
||||||
TLRPC.Chat chat = (TLRPC.Chat) infoObject;
|
TLRPC.Chat chat = (TLRPC.Chat) infoObject;
|
||||||
avatarDrawable.setInfo(chat);
|
avatarDrawable.setInfo(chat);
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
avatarImageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
name = chat.title;
|
name = chat.title;
|
||||||
}
|
}
|
||||||
infoText = AndroidUtilities.replaceTags(LocaleController.formatString("VoipGroupUserChanged", R.string.VoipGroupUserChanged, name));
|
infoText = AndroidUtilities.replaceTags(LocaleController.formatString("VoipGroupUserChanged", R.string.VoipGroupUserChanged, name));
|
||||||
|
@ -700,9 +699,9 @@ public class UndoView extends FrameLayout {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (action == ACTION_ADDED_TO_FOLDER) {
|
if (action == ACTION_ADDED_TO_FOLDER) {
|
||||||
infoText = AndroidUtilities.replaceTags(LocaleController.formatString("FilterChatsAddedToExisting", R.string.FilterChatsAddedToExisting, LocaleController.formatPluralString("Chats", (Integer) infoObject), filter.name));
|
infoText = AndroidUtilities.replaceTags(LocaleController.formatString("FilterChatsAddedToExisting", R.string.FilterChatsAddedToExisting, LocaleController.formatPluralString("ChatsSelected", (Integer) infoObject), filter.name));
|
||||||
} else {
|
} else {
|
||||||
infoText = AndroidUtilities.replaceTags(LocaleController.formatString("FilterChatsRemovedFrom", R.string.FilterChatsRemovedFrom, LocaleController.formatPluralString("Chats", (Integer) infoObject), filter.name));
|
infoText = AndroidUtilities.replaceTags(LocaleController.formatString("FilterChatsRemovedFrom", R.string.FilterChatsRemovedFrom, LocaleController.formatPluralString("ChatsSelected", (Integer) infoObject), filter.name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
subInfoText = null;
|
subInfoText = null;
|
||||||
|
|
|
@ -118,7 +118,7 @@ public class UsersAlertBase extends BottomSheet {
|
||||||
listView = new RecyclerListView(context) {
|
listView = new RecyclerListView(context) {
|
||||||
@Override
|
@Override
|
||||||
protected boolean allowSelectChildAtPosition(float x, float y) {
|
protected boolean allowSelectChildAtPosition(float x, float y) {
|
||||||
return y >= scrollOffsetY + AndroidUtilities.dp(48) + (Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0);
|
return y >= AndroidUtilities.dp(58) + (Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -277,7 +277,7 @@ public class ContactAddActivity extends BaseFragment implements NotificationCent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onlineTextView.setText(LocaleController.formatUserStatus(currentAccount, user));
|
onlineTextView.setText(LocaleController.formatUserStatus(currentAccount, user));
|
||||||
avatarImage.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable = new AvatarDrawable(user), user);
|
avatarImage.setForUserOrChat(user, avatarDrawable = new AvatarDrawable(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void didReceivedNotification(int id, int account, Object... args) {
|
public void didReceivedNotification(int id, int account, Object... args) {
|
||||||
|
|
|
@ -2451,7 +2451,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
TLRPC.User user = getUserConfig().getCurrentUser();
|
TLRPC.User user = getUserConfig().getCurrentUser();
|
||||||
avatarDrawable.setInfo(user);
|
avatarDrawable.setInfo(user);
|
||||||
imageView.getImageReceiver().setCurrentAccount(currentAccount);
|
imageView.getImageReceiver().setCurrentAccount(currentAccount);
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
|
|
||||||
for (int a = 0; a < UserConfig.MAX_ACCOUNT_COUNT; a++) {
|
for (int a = 0; a < UserConfig.MAX_ACCOUNT_COUNT; a++) {
|
||||||
TLRPC.User u = AccountInstance.getInstance(a).getUserConfig().getCurrentUser();
|
TLRPC.User u = AccountInstance.getInstance(a).getUserConfig().getCurrentUser();
|
||||||
|
@ -7364,7 +7364,9 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||||
} else {
|
} else {
|
||||||
setFragmentIsSliding(false);
|
setFragmentIsSliding(false);
|
||||||
}
|
}
|
||||||
fragmentView.requestLayout();
|
if (fragmentView != null) {
|
||||||
|
fragmentView.requestLayout();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setSlideTransitionProgress(1f - progress);
|
setSlideTransitionProgress(1f - progress);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1319,11 +1319,11 @@ public class GroupCallActivity extends BottomSheet implements NotificationCenter
|
||||||
if (peerId > 0) {
|
if (peerId > 0) {
|
||||||
TLRPC.User user = accountInstance.getMessagesController().getUser(peerId);
|
TLRPC.User user = accountInstance.getMessagesController().getUser(peerId);
|
||||||
accountSwitchAvatarDrawable.setInfo(user);
|
accountSwitchAvatarDrawable.setInfo(user);
|
||||||
accountSwitchImageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", accountSwitchAvatarDrawable, user);
|
accountSwitchImageView.setForUserOrChat(user, accountSwitchAvatarDrawable);
|
||||||
} else {
|
} else {
|
||||||
TLRPC.Chat chat = accountInstance.getMessagesController().getChat(-peerId);
|
TLRPC.Chat chat = accountInstance.getMessagesController().getChat(-peerId);
|
||||||
accountSwitchAvatarDrawable.setInfo(chat);
|
accountSwitchAvatarDrawable.setInfo(chat);
|
||||||
accountSwitchImageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", accountSwitchAvatarDrawable, chat);
|
accountSwitchImageView.setForUserOrChat(chat, accountSwitchAvatarDrawable);
|
||||||
}
|
}
|
||||||
accountSelectCell.setVisibility(View.GONE);
|
accountSelectCell.setVisibility(View.GONE);
|
||||||
accountGap.setVisibility(View.GONE);
|
accountGap.setVisibility(View.GONE);
|
||||||
|
@ -3748,7 +3748,7 @@ public class GroupCallActivity extends BottomSheet implements NotificationCenter
|
||||||
invites[b] = null;
|
invites[b] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ChatObject.canManageCalls(currentChat) && !call.call.join_muted) {
|
if (!copy && ChatObject.canManageCalls(currentChat) && !call.call.join_muted) {
|
||||||
invites[0] = null;
|
invites[0] = null;
|
||||||
}
|
}
|
||||||
if (invites[0] == null && invites[1] == null && !TextUtils.isEmpty(currentChat.username)) {
|
if (invites[0] == null && invites[1] == null && !TextUtils.isEmpty(currentChat.username)) {
|
||||||
|
@ -3763,7 +3763,7 @@ public class GroupCallActivity extends BottomSheet implements NotificationCenter
|
||||||
|
|
||||||
private void openShareAlert(boolean withMessage, String urlMuted, String urlUnmuted, boolean copy) {
|
private void openShareAlert(boolean withMessage, String urlMuted, String urlUnmuted, boolean copy) {
|
||||||
if (copy) {
|
if (copy) {
|
||||||
AndroidUtilities.addToClipboard(invites[0]);
|
AndroidUtilities.addToClipboard(urlMuted != null ? urlMuted : urlUnmuted);
|
||||||
getUndoView().showWithAction(0, UndoView.ACTION_VOIP_LINK_COPIED, null, null, null, null);
|
getUndoView().showWithAction(0, UndoView.ACTION_VOIP_LINK_COPIED, null, null, null, null);
|
||||||
} else {
|
} else {
|
||||||
boolean keyboardIsOpen = false;
|
boolean keyboardIsOpen = false;
|
||||||
|
@ -4507,11 +4507,11 @@ public class GroupCallActivity extends BottomSheet implements NotificationCenter
|
||||||
String name;
|
String name;
|
||||||
if (object instanceof TLRPC.User) {
|
if (object instanceof TLRPC.User) {
|
||||||
TLRPC.User user = (TLRPC.User) object;
|
TLRPC.User user = (TLRPC.User) object;
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
imageView.setForUserOrChat(user, avatarDrawable);
|
||||||
name = UserObject.getFirstName(user);
|
name = UserObject.getFirstName(user);
|
||||||
} else {
|
} else {
|
||||||
TLRPC.Chat chat = (TLRPC.Chat) object;
|
TLRPC.Chat chat = (TLRPC.Chat) object;
|
||||||
imageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
imageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
name = chat.title;
|
name = chat.title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3380,7 +3380,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
||||||
if (!force && BuildVars.DEBUG_VERSION || !force && !BuildVars.CHECK_UPDATES) {
|
if (!force && BuildVars.DEBUG_VERSION || !force && !BuildVars.CHECK_UPDATES) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!force && Math.abs(System.currentTimeMillis() - UserConfig.getInstance(0).lastUpdateCheckTime) < 24 * 60 * 60 * 1000) {
|
if (!force && Math.abs(System.currentTimeMillis() - UserConfig.getInstance(0).lastUpdateCheckTime) < MessagesController.getInstance(0).updateCheckDelay * 1000) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TLRPC.TL_help_getAppUpdate req = new TLRPC.TL_help_getAppUpdate();
|
TLRPC.TL_help_getAppUpdate req = new TLRPC.TL_help_getAppUpdate();
|
||||||
|
|
|
@ -1208,7 +1208,7 @@ public class LocationActivity extends BaseFragment implements NotificationCenter
|
||||||
|
|
||||||
BackupImageView backupImageView = new BackupImageView(context);
|
BackupImageView backupImageView = new BackupImageView(context);
|
||||||
backupImageView.setRoundRadius(AndroidUtilities.dp(26));
|
backupImageView.setRoundRadius(AndroidUtilities.dp(26));
|
||||||
backupImageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", new AvatarDrawable(chat), chat);
|
backupImageView.setForUserOrChat(chat, new AvatarDrawable(chat));
|
||||||
frameLayout1.addView(backupImageView, LayoutHelper.createFrame(52, 52, Gravity.LEFT | Gravity.TOP, 5, 5, 0, 0));
|
frameLayout1.addView(backupImageView, LayoutHelper.createFrame(52, 52, Gravity.LEFT | Gravity.TOP, 5, 5, 0, 0));
|
||||||
|
|
||||||
markerImageView = frameLayout1;
|
markerImageView = frameLayout1;
|
||||||
|
|
|
@ -1526,7 +1526,7 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
|
||||||
passwordAvatarContainer.addView(avatarImageView, LayoutHelper.createFrame(64, 64, Gravity.CENTER, 0, 8, 0, 0));
|
passwordAvatarContainer.addView(avatarImageView, LayoutHelper.createFrame(64, 64, Gravity.CENTER, 0, 8, 0, 0));
|
||||||
|
|
||||||
AvatarDrawable avatarDrawable = new AvatarDrawable(botUser);
|
AvatarDrawable avatarDrawable = new AvatarDrawable(botUser);
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(botUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(botUser, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, botUser);
|
avatarImageView.setForUserOrChat(botUser, avatarDrawable);
|
||||||
|
|
||||||
passwordRequestTextView = new TextInfoPrivacyCell(context);
|
passwordRequestTextView = new TextInfoPrivacyCell(context);
|
||||||
passwordRequestTextView.getTextView().setGravity(Gravity.CENTER_HORIZONTAL);
|
passwordRequestTextView.getTextView().setGravity(Gravity.CENTER_HORIZONTAL);
|
||||||
|
@ -2001,7 +2001,7 @@ public class PassportActivity extends BaseFragment implements NotificationCenter
|
||||||
avatarContainer.addView(avatarImageView, LayoutHelper.createFrame(64, 64, Gravity.CENTER, 0, 8, 0, 0));
|
avatarContainer.addView(avatarImageView, LayoutHelper.createFrame(64, 64, Gravity.CENTER, 0, 8, 0, 0));
|
||||||
|
|
||||||
AvatarDrawable avatarDrawable = new AvatarDrawable(botUser);
|
AvatarDrawable avatarDrawable = new AvatarDrawable(botUser);
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(botUser, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(botUser, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, botUser);
|
avatarImageView.setForUserOrChat(botUser, avatarDrawable);
|
||||||
|
|
||||||
bottomCell = new TextInfoPrivacyCell(context);
|
bottomCell = new TextInfoPrivacyCell(context);
|
||||||
bottomCell.setBackgroundDrawable(Theme.getThemedDrawable(context, R.drawable.greydivider_top, Theme.key_windowBackgroundGrayShadow));
|
bottomCell.setBackgroundDrawable(Theme.getThemedDrawable(context, R.drawable.greydivider_top, Theme.key_windowBackgroundGrayShadow));
|
||||||
|
|
|
@ -204,6 +204,7 @@ public class PaymentFormActivity extends BaseFragment implements NotificationCen
|
||||||
private FrameLayout googlePayContainer;
|
private FrameLayout googlePayContainer;
|
||||||
private FrameLayout googlePayButton;
|
private FrameLayout googlePayButton;
|
||||||
private LinearLayout linearLayout2;
|
private LinearLayout linearLayout2;
|
||||||
|
private TextPriceCell totalCell;
|
||||||
|
|
||||||
private EditTextSettingsCell codeFieldCell;
|
private EditTextSettingsCell codeFieldCell;
|
||||||
|
|
||||||
|
@ -240,6 +241,8 @@ public class PaymentFormActivity extends BaseFragment implements NotificationCen
|
||||||
|
|
||||||
private LinearLayout tipLayout;
|
private LinearLayout tipLayout;
|
||||||
|
|
||||||
|
private ArrayList<TLRPC.TL_labeledPrice> prices;
|
||||||
|
|
||||||
private int currentStep;
|
private int currentStep;
|
||||||
private boolean passwordOk;
|
private boolean passwordOk;
|
||||||
private String paymentJson;
|
private String paymentJson;
|
||||||
|
@ -1684,14 +1687,14 @@ public class PaymentFormActivity extends BaseFragment implements NotificationCen
|
||||||
sectionCell[0] = new ShadowSectionCell(context);
|
sectionCell[0] = new ShadowSectionCell(context);
|
||||||
linearLayout2.addView(sectionCell[0], LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
|
linearLayout2.addView(sectionCell[0], LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
|
||||||
|
|
||||||
ArrayList<TLRPC.TL_labeledPrice> arrayList = new ArrayList<>(paymentForm.invoice.prices);
|
prices = new ArrayList<>(paymentForm.invoice.prices);
|
||||||
if (shippingOption != null) {
|
if (shippingOption != null) {
|
||||||
arrayList.addAll(shippingOption.prices);
|
prices.addAll(shippingOption.prices);
|
||||||
}
|
}
|
||||||
totalPrice = new String[1];
|
totalPrice = new String[1];
|
||||||
|
|
||||||
for (int a = 0; a < arrayList.size(); a++) {
|
for (int a = 0; a < prices.size(); a++) {
|
||||||
TLRPC.TL_labeledPrice price = arrayList.get(a);
|
TLRPC.TL_labeledPrice price = prices.get(a);
|
||||||
|
|
||||||
TextPriceCell priceCell = new TextPriceCell(context);
|
TextPriceCell priceCell = new TextPriceCell(context);
|
||||||
priceCell.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
priceCell.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
||||||
|
@ -1706,10 +1709,10 @@ public class PaymentFormActivity extends BaseFragment implements NotificationCen
|
||||||
linearLayout2.addView(priceCell);
|
linearLayout2.addView(priceCell);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextPriceCell priceCell = new TextPriceCell(context);
|
totalCell = new TextPriceCell(context);
|
||||||
priceCell.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
totalCell.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
||||||
totalPrice[0] = getTotalPriceString(arrayList);
|
totalPrice[0] = getTotalPriceString(prices);
|
||||||
priceCell.setTextAndValue(LocaleController.getString("PaymentTransactionTotal", R.string.PaymentTransactionTotal), totalPrice[0], true);
|
totalCell.setTextAndValue(LocaleController.getString("PaymentTransactionTotal", R.string.PaymentTransactionTotal), totalPrice[0], true);
|
||||||
|
|
||||||
if (currentStep == 4 && (paymentForm.invoice.flags & 256) != 0) {
|
if (currentStep == 4 && (paymentForm.invoice.flags & 256) != 0) {
|
||||||
ViewGroup container = new FrameLayout(context);
|
ViewGroup container = new FrameLayout(context);
|
||||||
|
@ -1746,7 +1749,22 @@ public class PaymentFormActivity extends BaseFragment implements NotificationCen
|
||||||
|
|
||||||
private boolean anyBefore;
|
private boolean anyBefore;
|
||||||
private String overrideText;
|
private String overrideText;
|
||||||
private boolean dotEntered;
|
private boolean isDeletedChar;
|
||||||
|
private int beforeTextLength;
|
||||||
|
private int enteredCharacterStart;
|
||||||
|
private boolean lastDotEntered;
|
||||||
|
|
||||||
|
char[] commas = new char[]{',', '.', '٫', '、', '\u2E41', '︐', '︑', '﹐', '﹑', ',', '、', 'ʻ'};
|
||||||
|
|
||||||
|
private int indexOfComma(String text) {
|
||||||
|
for (int a = 0; a < commas.length; a++) {
|
||||||
|
int idx = text.indexOf(commas[a]);
|
||||||
|
if (idx >= 0) {
|
||||||
|
return idx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
@ -1755,17 +1773,24 @@ public class PaymentFormActivity extends BaseFragment implements NotificationCen
|
||||||
}
|
}
|
||||||
anyBefore = !TextUtils.isEmpty(s);
|
anyBefore = !TextUtils.isEmpty(s);
|
||||||
overrideText = null;
|
overrideText = null;
|
||||||
if (count == 1 && after == 0) {
|
beforeTextLength = s == null ? 0 : s.length();
|
||||||
|
enteredCharacterStart = start;
|
||||||
|
if (isDeletedChar = (count == 1 && after == 0)) {
|
||||||
String fixed = LocaleController.fixNumbers(s);
|
String fixed = LocaleController.fixNumbers(s);
|
||||||
char actionCh = fixed.charAt(start);
|
char actionCh = fixed.charAt(start);
|
||||||
if (actionCh < '0' || actionCh > '9') {
|
int idx = indexOfComma(fixed);
|
||||||
while (--start > 0) {
|
String reminderStr = idx >= 0 ? fixed.substring(idx + 1) : "";
|
||||||
|
long reminder = Utilities.parseLong(PhoneFormat.stripExceptNumbers(reminderStr));
|
||||||
|
if ((actionCh < '0' || actionCh > '9') && (reminderStr.length() == 0 || reminder != 0)) {
|
||||||
|
while (--start >= 0) {
|
||||||
actionCh = fixed.charAt(start);
|
actionCh = fixed.charAt(start);
|
||||||
if (actionCh >= '0' && actionCh <= '9') {
|
if (actionCh >= '0' && actionCh <= '9') {
|
||||||
overrideText = fixed.substring(0, start) + fixed.substring(start + 1);
|
overrideText = fixed.substring(0, start) + fixed.substring(start + 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (idx > 0 && start > idx && reminder == 0) {
|
||||||
|
overrideText = fixed.substring(0, idx - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1788,42 +1813,54 @@ public class PaymentFormActivity extends BaseFragment implements NotificationCen
|
||||||
} else {
|
} else {
|
||||||
text = LocaleController.fixNumbers(s.toString());
|
text = LocaleController.fixNumbers(s.toString());
|
||||||
}
|
}
|
||||||
tipAmount = Utilities.parseLong(PhoneFormat.stripExceptNumbers(text));
|
int idx = indexOfComma(text);
|
||||||
/*if (!dotEntered) {
|
boolean dotEntered = idx >= 0;
|
||||||
|
int exp = LocaleController.getCurrencyExpDivider(paymentForm.invoice.currency);
|
||||||
|
String wholeStr = idx >= 0 ? text.substring(0, idx) : text;
|
||||||
|
String reminderStr = idx >= 0 ? text.substring(idx + 1) : "";
|
||||||
|
long whole = Utilities.parseLong(PhoneFormat.stripExceptNumbers(wholeStr)) * exp;
|
||||||
|
long reminder = Utilities.parseLong(PhoneFormat.stripExceptNumbers(reminderStr));
|
||||||
|
reminderStr = "" + reminder;
|
||||||
|
String expStr = "" + (exp - 1);
|
||||||
|
if (idx > 0 && reminderStr.length() > expStr.length()) {
|
||||||
|
if (enteredCharacterStart - idx < reminderStr.length()) {
|
||||||
|
reminderStr = reminderStr.substring(0, expStr.length());
|
||||||
|
} else {
|
||||||
|
reminderStr = reminderStr.substring(reminderStr.length() - expStr.length());
|
||||||
|
}
|
||||||
|
reminder = Utilities.parseLong(reminderStr);
|
||||||
}
|
}
|
||||||
if (text.endsWith(",") || text.endsWith(".")) {
|
tipAmount = whole + reminder;
|
||||||
dotEntered = true;
|
|
||||||
}
|
|
||||||
if (tipAmount == 0) {
|
|
||||||
dotEntered = false;
|
|
||||||
}*/
|
|
||||||
if (paymentForm.invoice.max_tip_amount != 0 && tipAmount > paymentForm.invoice.max_tip_amount) {
|
if (paymentForm.invoice.max_tip_amount != 0 && tipAmount > paymentForm.invoice.max_tip_amount) {
|
||||||
tipAmount = paymentForm.invoice.max_tip_amount;
|
tipAmount = paymentForm.invoice.max_tip_amount;
|
||||||
}
|
}
|
||||||
int start = inputFields[0].getSelectionStart();
|
int start = inputFields[0].getSelectionStart();
|
||||||
String phoneChars = "0123456789,.";
|
|
||||||
String str = inputFields[0].getText().toString();
|
|
||||||
StringBuilder builder = new StringBuilder(str.length());
|
|
||||||
for (int a = 0; a < str.length(); a++) {
|
|
||||||
String ch = str.substring(a, a + 1);
|
|
||||||
if (phoneChars.contains(ch)) {
|
|
||||||
builder.append(ch);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ignoreOnTextChange = true;
|
ignoreOnTextChange = true;
|
||||||
inputFields[0].setText(LocaleController.getInstance().formatCurrencyString(tipAmount, false, paymentForm.invoice.currency));
|
String newText;
|
||||||
|
if (tipAmount == 0) {
|
||||||
|
inputFields[0].setText(newText = "");
|
||||||
|
} else {
|
||||||
|
inputFields[0].setText(newText = LocaleController.getInstance().formatCurrencyString(tipAmount, false, dotEntered, true, paymentForm.invoice.currency));
|
||||||
|
}
|
||||||
if (oldAmount < tipAmount && oldAmount != 0 && anyBefore && start >= 0) {
|
if (oldAmount < tipAmount && oldAmount != 0 && anyBefore && start >= 0) {
|
||||||
inputFields[0].setSelection(Math.min(start, inputFields[0].length()));
|
inputFields[0].setSelection(Math.min(start, inputFields[0].length()));
|
||||||
|
} else if (!isDeletedChar || beforeTextLength == inputFields[0].length()) {
|
||||||
|
if (!lastDotEntered && dotEntered && idx >= 0) {
|
||||||
|
idx = indexOfComma(newText);
|
||||||
|
if (idx > 0) {
|
||||||
|
inputFields[0].setSelection(idx + 1);
|
||||||
|
} else {
|
||||||
|
inputFields[0].setSelection(inputFields[0].length());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
inputFields[0].setSelection(inputFields[0].length());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
inputFields[0].setSelection(inputFields[0].length());
|
inputFields[0].setSelection(Math.max(0, Math.min(start, inputFields[0].length())));
|
||||||
}
|
}
|
||||||
totalPrice[0] = getTotalPriceString(arrayList);
|
lastDotEntered = dotEntered;
|
||||||
priceCell.setTextAndValue(LocaleController.getString("PaymentTransactionTotal", R.string.PaymentTransactionTotal), totalPrice[0], true);
|
updateTotalPrice();
|
||||||
if (payTextView != null) {
|
overrideText = null;
|
||||||
payTextView.setText(LocaleController.formatString("PaymentCheckoutPay", R.string.PaymentCheckoutPay, totalPrice[0]));
|
|
||||||
}
|
|
||||||
checkSelectedTip();
|
|
||||||
ignoreOnTextChange = false;
|
ignoreOnTextChange = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1932,9 +1969,13 @@ public class PaymentFormActivity extends BaseFragment implements NotificationCen
|
||||||
valueTextView.setOnClickListener(v -> {
|
valueTextView.setOnClickListener(v -> {
|
||||||
long amoumt = (Long) valueTextView.getTag();
|
long amoumt = (Long) valueTextView.getTag();
|
||||||
if (tipAmount != null && amoumt == tipAmount) {
|
if (tipAmount != null && amoumt == tipAmount) {
|
||||||
inputFields[0].setText(LocaleController.getInstance().formatCurrencyString(0, false, paymentForm.invoice.currency));
|
ignoreOnTextChange = true;
|
||||||
|
inputFields[0].setText("");
|
||||||
|
ignoreOnTextChange = false;
|
||||||
|
tipAmount = 0L;
|
||||||
|
updateTotalPrice();
|
||||||
} else {
|
} else {
|
||||||
inputFields[0].setText(LocaleController.getInstance().formatCurrencyString(amount, false, paymentForm.invoice.currency));
|
inputFields[0].setText(LocaleController.getInstance().formatCurrencyString(amount, false, true, true, paymentForm.invoice.currency));
|
||||||
}
|
}
|
||||||
inputFields[0].setSelection(inputFields[0].length());
|
inputFields[0].setSelection(inputFields[0].length());
|
||||||
});
|
});
|
||||||
|
@ -1946,7 +1987,7 @@ public class PaymentFormActivity extends BaseFragment implements NotificationCen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
linearLayout2.addView(priceCell);
|
linearLayout2.addView(totalCell);
|
||||||
|
|
||||||
sectionCell[2] = new ShadowSectionCell(context);
|
sectionCell[2] = new ShadowSectionCell(context);
|
||||||
sectionCell[2].setBackgroundDrawable(Theme.getThemedDrawable(context, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow));
|
sectionCell[2].setBackgroundDrawable(Theme.getThemedDrawable(context, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow));
|
||||||
|
@ -2381,16 +2422,6 @@ public class PaymentFormActivity extends BaseFragment implements NotificationCen
|
||||||
return fragmentView;
|
return fragmentView;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkSelectedTip() {
|
|
||||||
int color = Theme.getColor(Theme.key_contacts_inviteBackground);
|
|
||||||
for (int b = 0, N2 = tipLayout.getChildCount(); b < N2; b++) {
|
|
||||||
View child = tipLayout.getChildAt(b);
|
|
||||||
int alpha = child.getTag().equals(tipAmount) ? 0x3fffffff : 0x1fffffff;
|
|
||||||
Theme.setDrawableColor(child.getBackground(), color & alpha);
|
|
||||||
child.invalidate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setAddressFields() {
|
private void setAddressFields() {
|
||||||
if (validateRequest.info.shipping_address != null) {
|
if (validateRequest.info.shipping_address != null) {
|
||||||
String address = String.format("%s %s, %s, %s, %s, %s", validateRequest.info.shipping_address.street_line1, validateRequest.info.shipping_address.street_line2, validateRequest.info.shipping_address.city, validateRequest.info.shipping_address.state, validateRequest.info.shipping_address.country_iso2, validateRequest.info.shipping_address.post_code);
|
String address = String.format("%s %s, %s, %s, %s, %s", validateRequest.info.shipping_address.street_line1, validateRequest.info.shipping_address.street_line2, validateRequest.info.shipping_address.city, validateRequest.info.shipping_address.state, validateRequest.info.shipping_address.country_iso2, validateRequest.info.shipping_address.post_code);
|
||||||
|
@ -2410,6 +2441,28 @@ public class PaymentFormActivity extends BaseFragment implements NotificationCen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateTotalPrice() {
|
||||||
|
totalPrice[0] = getTotalPriceString(prices);
|
||||||
|
totalCell.setTextAndValue(LocaleController.getString("PaymentTransactionTotal", R.string.PaymentTransactionTotal), totalPrice[0], true);
|
||||||
|
if (payTextView != null) {
|
||||||
|
payTextView.setText(LocaleController.formatString("PaymentCheckoutPay", R.string.PaymentCheckoutPay, totalPrice[0]));
|
||||||
|
}
|
||||||
|
if (tipLayout != null) {
|
||||||
|
int color = Theme.getColor(Theme.key_contacts_inviteBackground);
|
||||||
|
for (int b = 0, N2 = tipLayout.getChildCount(); b < N2; b++) {
|
||||||
|
TextView child = (TextView) tipLayout.getChildAt(b);
|
||||||
|
if (child.getTag().equals(tipAmount)) {
|
||||||
|
Theme.setDrawableColor(child.getBackground(), color);
|
||||||
|
child.setTextColor(Theme.getColor(Theme.key_contacts_inviteText));
|
||||||
|
} else {
|
||||||
|
Theme.setDrawableColor(child.getBackground(), color & 0x1fffffff);
|
||||||
|
child.setTextColor(Theme.getColor(Theme.key_chats_secretName));
|
||||||
|
}
|
||||||
|
child.invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void createGooglePayButton(Context context) {
|
private void createGooglePayButton(Context context) {
|
||||||
googlePayContainer = new FrameLayout(context);
|
googlePayContainer = new FrameLayout(context);
|
||||||
googlePayContainer.setBackgroundDrawable(Theme.getSelectorDrawable(true));
|
googlePayContainer.setBackgroundDrawable(Theme.getSelectorDrawable(true));
|
||||||
|
@ -2617,7 +2670,7 @@ public class PaymentFormActivity extends BaseFragment implements NotificationCen
|
||||||
private void showPayAlert(final String totalPrice) {
|
private void showPayAlert(final String totalPrice) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||||
builder.setTitle(LocaleController.getString("PaymentTransactionReview", R.string.PaymentTransactionReview));
|
builder.setTitle(LocaleController.getString("PaymentTransactionReview", R.string.PaymentTransactionReview));
|
||||||
builder.setMessage(LocaleController.formatString("PaymentTransactionMessage", R.string.PaymentTransactionMessage, totalPrice, currentBotName, currentItemName));
|
builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("PaymentTransactionMessage2", R.string.PaymentTransactionMessage2, totalPrice, currentBotName, currentItemName)));
|
||||||
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialogInterface, i) -> {
|
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialogInterface, i) -> {
|
||||||
setDonePressed(true);
|
setDonePressed(true);
|
||||||
sendData();
|
sendData();
|
||||||
|
|
|
@ -13611,8 +13611,10 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
||||||
textureImageView.setImageDrawable(null);
|
textureImageView.setImageDrawable(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pipVideoView.close();
|
if (pipVideoView != null) {
|
||||||
pipVideoView = null;
|
pipVideoView.close();
|
||||||
|
pipVideoView = null;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
containerView.invalidate();
|
containerView.invalidate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1372,7 +1372,7 @@ public class PopupNotificationActivity extends Activity implements NotificationC
|
||||||
currentChat = chat;
|
currentChat = chat;
|
||||||
if (avatarImageView != null) {
|
if (avatarImageView != null) {
|
||||||
AvatarDrawable avatarDrawable = new AvatarDrawable(currentChat);
|
AvatarDrawable avatarDrawable = new AvatarDrawable(currentChat);
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(chat, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, chat);
|
avatarImageView.setForUserOrChat(chat, avatarDrawable);
|
||||||
}
|
}
|
||||||
} else if (currentUser != null) {
|
} else if (currentUser != null) {
|
||||||
TLRPC.User user = MessagesController.getInstance(currentMessageObject.currentAccount).getUser(currentUser.id);
|
TLRPC.User user = MessagesController.getInstance(currentMessageObject.currentAccount).getUser(currentUser.id);
|
||||||
|
@ -1382,7 +1382,7 @@ public class PopupNotificationActivity extends Activity implements NotificationC
|
||||||
currentUser = user;
|
currentUser = user;
|
||||||
if (avatarImageView != null) {
|
if (avatarImageView != null) {
|
||||||
AvatarDrawable avatarDrawable = new AvatarDrawable(currentUser);
|
AvatarDrawable avatarDrawable = new AvatarDrawable(currentUser);
|
||||||
avatarImageView.setImage(ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_SMALL), "50_50", ImageLocation.getForUserOrChat(user, ImageLocation.TYPE_STRIPPED), "50_50", avatarDrawable, user);
|
avatarImageView.setForUserOrChat(user, avatarDrawable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3432,6 +3432,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||||
canEditAdmin = false;
|
canEditAdmin = false;
|
||||||
}
|
}
|
||||||
allowKick = canRestrict = ChatObject.canBlockUsers(currentChat) && (!(channelParticipant instanceof TLRPC.TL_channelParticipantAdmin || channelParticipant instanceof TLRPC.TL_channelParticipantCreator) || channelParticipant.can_edit);
|
allowKick = canRestrict = ChatObject.canBlockUsers(currentChat) && (!(channelParticipant instanceof TLRPC.TL_channelParticipantAdmin || channelParticipant instanceof TLRPC.TL_channelParticipantCreator) || channelParticipant.can_edit);
|
||||||
|
if (currentChat.gigagroup) {
|
||||||
|
canRestrict = false;
|
||||||
|
}
|
||||||
editingAdmin = channelParticipant instanceof TLRPC.TL_channelParticipantAdmin;
|
editingAdmin = channelParticipant instanceof TLRPC.TL_channelParticipantAdmin;
|
||||||
} else {
|
} else {
|
||||||
channelParticipant = null;
|
channelParticipant = null;
|
||||||
|
@ -3634,9 +3637,17 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
try {
|
try {
|
||||||
android.content.ClipboardManager clipboard = (android.content.ClipboardManager) ApplicationLoader.applicationContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
android.content.ClipboardManager clipboard = (android.content.ClipboardManager) ApplicationLoader.applicationContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
android.content.ClipData clip = android.content.ClipData.newPlainText("label", "https://" + MessagesController.getInstance(UserConfig.selectedAccount).linkPrefix + "/" + username);
|
String text;
|
||||||
|
if (user_id != 0) {
|
||||||
|
text = "@" + username;
|
||||||
|
BulletinFactory.of(this).createCopyBulletin(LocaleController.getString("UsernameCopied", R.string.UsernameCopied)).show();
|
||||||
|
} else {
|
||||||
|
text = "https://" + MessagesController.getInstance(UserConfig.selectedAccount).linkPrefix + "/" + username;
|
||||||
|
BulletinFactory.of(this).createCopyBulletin(LocaleController.getString("LinkCopied", R.string.LinkCopied)).show();
|
||||||
|
}
|
||||||
|
android.content.ClipData clip = android.content.ClipData.newPlainText("label", text);
|
||||||
clipboard.setPrimaryClip(clip);
|
clipboard.setPrimaryClip(clip);
|
||||||
BulletinFactory.of(this).createCopyBulletin(LocaleController.getString("LinkCopied", R.string.LinkCopied)).show();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
FileLog.e(e);
|
FileLog.e(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@
|
||||||
<string name="PaymentCardSavePaymentInformationInfoLine1">You can save your payment info for future use.</string>
|
<string name="PaymentCardSavePaymentInformationInfoLine1">You can save your payment info for future use.</string>
|
||||||
<string name="PaymentCardSavePaymentInformationInfoLine2">Please *turn on Two-Step Verification* to enable this.</string>
|
<string name="PaymentCardSavePaymentInformationInfoLine2">Please *turn on Two-Step Verification* to enable this.</string>
|
||||||
<string name="PaymentTransactionReview">Transaction Review</string>
|
<string name="PaymentTransactionReview">Transaction Review</string>
|
||||||
<string name="PaymentTransactionMessage">Do you really want to transfer %1$s to the %2$s bot for %3$s?</string>
|
<string name="PaymentTransactionMessage2">Transfer **%1$s** to the %2$s bot for **%3$s**?</string>
|
||||||
<string name="PaymentTransactionTotal">Total</string>
|
<string name="PaymentTransactionTotal">Total</string>
|
||||||
<string name="PaymentInvoice">INVOICE</string>
|
<string name="PaymentInvoice">INVOICE</string>
|
||||||
<string name="PaymentTestInvoice">TEST INVOICE</string>
|
<string name="PaymentTestInvoice">TEST INVOICE</string>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user