Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
apk
Commits
a38e46cd
Commit
a38e46cd
authored
Nov 20, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixes
parent
dd61bbaa
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
178 additions
and
114 deletions
+178
-114
build.gradle
TMessagesProj/build.gradle
+2
-2
ContactsController.java
...rc/main/java/org/telegram/android/ContactsController.java
+3
-0
MessagesController.java
...rc/main/java/org/telegram/android/MessagesController.java
+62
-62
NotificationsController.java
...in/java/org/telegram/android/NotificationsController.java
+4
-0
ConnectionsManager.java
.../main/java/org/telegram/messenger/ConnectionsManager.java
+11
-0
ActionBarLayout.java
.../main/java/org/telegram/ui/ActionBar/ActionBarLayout.java
+3
-4
ActionBarMenu.java
...rc/main/java/org/telegram/ui/ActionBar/ActionBarMenu.java
+2
-1
BaseFragment.java
...src/main/java/org/telegram/ui/ActionBar/BaseFragment.java
+13
-9
ContactsAdapter.java
...c/main/java/org/telegram/ui/Adapters/ContactsAdapter.java
+3
-1
ChangeUsernameActivity.java
...src/main/java/org/telegram/ui/ChangeUsernameActivity.java
+5
-0
ChatActivity.java
...sagesProj/src/main/java/org/telegram/ui/ChatActivity.java
+9
-3
LaunchActivity.java
...gesProj/src/main/java/org/telegram/ui/LaunchActivity.java
+10
-1
MessagesActivity.java
...sProj/src/main/java/org/telegram/ui/MessagesActivity.java
+6
-19
PrivacySettingsActivity.java
...rc/main/java/org/telegram/ui/PrivacySettingsActivity.java
+1
-1
ProfileActivity.java
...esProj/src/main/java/org/telegram/ui/ProfileActivity.java
+22
-3
VideoEditorActivity.java
...oj/src/main/java/org/telegram/ui/VideoEditorActivity.java
+3
-1
ChatActivityEnterView.java
...ain/java/org/telegram/ui/Views/ChatActivityEnterView.java
+10
-6
SectionsListView.java
...src/main/java/org/telegram/ui/Views/SectionsListView.java
+2
-0
strings.xml
TMessagesProj/src/main/res/values/strings.xml
+7
-1
No files found.
TMessagesProj/build.gradle
View file @
a38e46cd
...
@@ -80,7 +80,7 @@ android {
...
@@ -80,7 +80,7 @@ android {
defaultConfig
{
defaultConfig
{
minSdkVersion
8
minSdkVersion
8
targetSdkVersion
21
targetSdkVersion
21
versionCode
39
1
versionCode
39
2
versionName
"2.0.
2
"
versionName
"2.0.
3
"
}
}
}
}
TMessagesProj/src/main/java/org/telegram/android/ContactsController.java
View file @
a38e46cd
...
@@ -1636,6 +1636,9 @@ public class ContactsController {
...
@@ -1636,6 +1636,9 @@ public class ContactsController {
TLRPC
.
User
toDbUser
=
new
TLRPC
.
User
();
TLRPC
.
User
toDbUser
=
new
TLRPC
.
User
();
TLRPC
.
TL_contactStatus
status
=
(
TLRPC
.
TL_contactStatus
)
object
;
TLRPC
.
TL_contactStatus
status
=
(
TLRPC
.
TL_contactStatus
)
object
;
if
(
status
==
null
)
{
continue
;
}
if
(
status
.
status
instanceof
TLRPC
.
TL_userStatusRecently
)
{
if
(
status
.
status
instanceof
TLRPC
.
TL_userStatusRecently
)
{
status
.
status
.
expires
=
-
100
;
status
.
status
.
expires
=
-
100
;
}
else
if
(
status
.
status
instanceof
TLRPC
.
TL_userStatusLastWeek
)
{
}
else
if
(
status
.
status
instanceof
TLRPC
.
TL_userStatusLastWeek
)
{
...
...
TMessagesProj/src/main/java/org/telegram/android/MessagesController.java
View file @
a38e46cd
...
@@ -1062,77 +1062,76 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -1062,77 +1062,76 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if
(
offset
==
0
)
{
if
(
offset
==
0
)
{
MessagesStorage
.
getInstance
().
deleteDialog
(
did
,
onlyHistory
);
MessagesStorage
.
getInstance
().
deleteDialog
(
did
,
onlyHistory
);
}
}
TLRPC
.
TL_dialog
dialog
=
dialogs_dict
.
get
(
did
);
if
(
dialog
!=
null
)
{
int
lower_part
=
(
int
)
did
;
int
high_id
=
(
int
)(
did
>>
32
);
if
(
offset
==
0
)
{
int
lower_part
=
(
int
)
did
;
if
(!
onlyHistory
)
{
int
high_id
=
(
int
)(
did
>>
32
);
dialogs
.
remove
(
dialog
);
dialogsServerOnly
.
remove
(
dialog
);
dialogs_dict
.
remove
(
did
);
totalDialogsCount
--;
}
else
{
dialog
.
unread_count
=
0
;
}
dialogMessage
.
remove
(
dialog
.
top_message
);
MessagesStorage
.
getInstance
().
getStorageQueue
().
postRunnable
(
new
Runnable
()
{
@Override
public
void
run
()
{
AndroidUtilities
.
runOnUIThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
NotificationsController
.
getInstance
().
processReadMessages
(
null
,
did
,
0
,
Integer
.
MAX_VALUE
,
false
);
HashMap
<
Long
,
Integer
>
dialogsToUpdate
=
new
HashMap
<
Long
,
Integer
>();
dialogsToUpdate
.
put
(
did
,
0
);
NotificationsController
.
getInstance
().
processDialogsUpdateRead
(
dialogsToUpdate
);
}
});
}
});
NotificationCenter
.
getInstance
().
postNotificationName
(
NotificationCenter
.
removeAllMessagesFromDialog
,
did
);
NotificationCenter
.
getInstance
().
postNotificationName
(
NotificationCenter
.
dialogsNeedReload
);
}
if
(
high_id
==
1
)
{
if
(
offset
==
0
)
{
return
;
TLRPC
.
TL_dialog
dialog
=
dialogs_dict
.
get
(
did
);
if
(!
onlyHistory
)
{
dialogs
.
remove
(
dialog
);
dialogsServerOnly
.
remove
(
dialog
);
dialogs_dict
.
remove
(
did
);
totalDialogsCount
--;
}
else
{
dialog
.
unread_count
=
0
;
}
}
dialogMessage
.
remove
(
dialog
.
top_message
);
MessagesStorage
.
getInstance
().
getStorageQueue
().
postRunnable
(
new
Runnable
()
{
@Override
public
void
run
()
{
AndroidUtilities
.
runOnUIThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
NotificationsController
.
getInstance
().
processReadMessages
(
null
,
did
,
0
,
Integer
.
MAX_VALUE
,
false
);
HashMap
<
Long
,
Integer
>
dialogsToUpdate
=
new
HashMap
<
Long
,
Integer
>();
dialogsToUpdate
.
put
(
did
,
0
);
NotificationsController
.
getInstance
().
processDialogsUpdateRead
(
dialogsToUpdate
);
}
});
}
});
NotificationCenter
.
getInstance
().
postNotificationName
(
NotificationCenter
.
removeAllMessagesFromDialog
,
did
);
NotificationCenter
.
getInstance
().
postNotificationName
(
NotificationCenter
.
dialogsNeedReload
);
}
if
(
lower_part
!=
0
)
{
if
(
high_id
==
1
)
{
TLRPC
.
TL_messages_deleteHistory
req
=
new
TLRPC
.
TL_messages_deleteHistory
();
return
;
req
.
offset
=
offset
;
}
if
(
did
<
0
)
{
req
.
peer
=
new
TLRPC
.
TL_inputPeerChat
();
if
(
lower_part
!=
0
)
{
req
.
peer
.
chat_id
=
-
lower_part
;
TLRPC
.
TL_messages_deleteHistory
req
=
new
TLRPC
.
TL_messages_deleteHistory
();
req
.
offset
=
offset
;
if
(
did
<
0
)
{
req
.
peer
=
new
TLRPC
.
TL_inputPeerChat
();
req
.
peer
.
chat_id
=
-
lower_part
;
}
else
{
TLRPC
.
User
user
=
getUser
(
lower_part
);
if
(
user
instanceof
TLRPC
.
TL_userForeign
||
user
instanceof
TLRPC
.
TL_userRequest
)
{
req
.
peer
=
new
TLRPC
.
TL_inputPeerForeign
();
req
.
peer
.
access_hash
=
user
.
access_hash
;
}
else
{
}
else
{
TLRPC
.
User
user
=
getUser
(
lower_part
);
req
.
peer
=
new
TLRPC
.
TL_inputPeerContact
();
if
(
user
instanceof
TLRPC
.
TL_userForeign
||
user
instanceof
TLRPC
.
TL_userRequest
)
{
req
.
peer
=
new
TLRPC
.
TL_inputPeerForeign
();
req
.
peer
.
access_hash
=
user
.
access_hash
;
}
else
{
req
.
peer
=
new
TLRPC
.
TL_inputPeerContact
();
}
req
.
peer
.
user_id
=
lower_part
;
}
}
ConnectionsManager
.
getInstance
().
performRpc
(
req
,
new
RPCRequest
.
RPCRequestDelegate
()
{
req
.
peer
.
user_id
=
lower_part
;
@Override
}
public
void
run
(
TLObject
response
,
TLRPC
.
TL_error
error
)
{
ConnectionsManager
.
getInstance
().
performRpc
(
req
,
new
RPCRequest
.
RPCRequestDelegate
(
)
{
if
(
error
==
null
)
{
@Override
TLRPC
.
TL_messages_affectedHistory
res
=
(
TLRPC
.
TL_messages_affectedHistory
)
response
;
public
void
run
(
TLObject
response
,
TLRPC
.
TL_error
error
)
{
if
(
res
.
offset
>
0
)
{
if
(
error
==
null
)
{
deleteDialog
(
did
,
res
.
offset
,
onlyHistory
)
;
TLRPC
.
TL_messages_affectedHistory
res
=
(
TLRPC
.
TL_messages_affectedHistory
)
response
;
}
if
(
res
.
offset
>
0
)
{
processNewDifferenceParams
(
res
.
seq
,
res
.
pts
,
-
1
);
deleteDialog
(
did
,
res
.
offset
,
onlyHistory
);
}
}
processNewDifferenceParams
(
res
.
seq
,
res
.
pts
,
-
1
);
}
}
});
}
else
{
if
(
onlyHistory
)
{
SendMessagesHelper
.
getInstance
().
sendClearHistoryMessage
(
getEncryptedChat
(
high_id
),
null
);
}
else
{
declineSecretChat
(
high_id
);
}
}
});
}
else
{
if
(
onlyHistory
)
{
SendMessagesHelper
.
getInstance
().
sendClearHistoryMessage
(
getEncryptedChat
(
high_id
),
null
);
}
else
{
declineSecretChat
(
high_id
);
}
}
}
}
}
}
...
@@ -1455,6 +1454,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -1455,6 +1454,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
return
;
return
;
}
}
loadingDialogs
=
true
;
loadingDialogs
=
true
;
NotificationCenter
.
getInstance
().
postNotificationName
(
NotificationCenter
.
dialogsNeedReload
);
if
(
fromCache
)
{
if
(
fromCache
)
{
MessagesStorage
.
getInstance
().
getDialogs
(
offset
,
serverOffset
,
count
);
MessagesStorage
.
getInstance
().
getDialogs
(
offset
,
serverOffset
,
count
);
...
...
TMessagesProj/src/main/java/org/telegram/android/NotificationsController.java
View file @
a38e46cd
...
@@ -397,6 +397,10 @@ public class NotificationsController {
...
@@ -397,6 +397,10 @@ public class NotificationsController {
.
setGroup
(
"messages"
)
.
setGroup
(
"messages"
)
.
setGroupSummary
(
true
);
.
setGroupSummary
(
true
);
//if (ApplicationLoader.mainInterfacePaused) {
// mBuilder.setPriority(NotificationCompat.PRIORITY_HIGH);
//}
String
lastMessage
=
null
;
String
lastMessage
=
null
;
String
lastMessageFull
=
null
;
String
lastMessageFull
=
null
;
if
(
pushMessages
.
size
()
==
1
)
{
if
(
pushMessages
.
size
()
==
1
)
{
...
...
TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java
View file @
a38e46cd
...
@@ -2236,6 +2236,17 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
...
@@ -2236,6 +2236,17 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
lastOutgoingMessageId
=
Math
.
max
(
messageId
,
lastOutgoingMessageId
);
lastOutgoingMessageId
=
Math
.
max
(
messageId
,
lastOutgoingMessageId
);
}
}
long
resultMid
=
((
TLRPC
.
TL_bad_server_salt
)
message
).
bad_msg_id
;
if
(
resultMid
!=
0
)
{
for
(
RPCRequest
request
:
runningRequests
)
{
if
((
request
.
flags
&
RPCRequest
.
RPCRequestClassDownloadMedia
)
==
0
)
{
continue
;
}
if
(
request
.
respondsToMessageId
(
resultMid
))
{
request
.
retryCount
=
0
;
}
}
}
datacenter
.
clearServerSalts
();
datacenter
.
clearServerSalts
();
...
...
TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java
View file @
a38e46cd
...
@@ -628,8 +628,7 @@ public class ActionBarLayout extends FrameLayout {
...
@@ -628,8 +628,7 @@ public class ActionBarLayout extends FrameLayout {
currentAnimation
=
new
AnimatorSetProxy
();
currentAnimation
=
new
AnimatorSetProxy
();
currentAnimation
.
playTogether
(
currentAnimation
.
playTogether
(
ObjectAnimatorProxy
.
ofFloat
(
containerView
,
"alpha"
,
0.0f
,
1.0f
),
ObjectAnimatorProxy
.
ofFloat
(
containerView
,
"alpha"
,
0.0f
,
1.0f
),
ObjectAnimatorProxy
.
ofFloat
(
containerView
,
"scaleX"
,
0.8f
,
1.0f
),
ObjectAnimatorProxy
.
ofFloat
(
containerView
,
"translationY"
,
AndroidUtilities
.
dp
(
48
),
0
));
ObjectAnimatorProxy
.
ofFloat
(
containerView
,
"scaleY"
,
0.8f
,
1.0f
));
currentAnimation
.
setInterpolator
(
new
DecelerateInterpolator
(
1.5f
));
currentAnimation
.
setInterpolator
(
new
DecelerateInterpolator
(
1.5f
));
currentAnimation
.
setDuration
(
200
);
currentAnimation
.
setDuration
(
200
);
currentAnimation
.
addListener
(
new
AnimatorListenerAdapterProxy
()
{
currentAnimation
.
addListener
(
new
AnimatorListenerAdapterProxy
()
{
...
@@ -731,14 +730,14 @@ public class ActionBarLayout extends FrameLayout {
...
@@ -731,14 +730,14 @@ public class ActionBarLayout extends FrameLayout {
@Override
@Override
public
void
run
()
{
public
void
run
()
{
closeLastFragmentInternalRemoveOld
(
currentFragment
);
closeLastFragmentInternalRemoveOld
(
currentFragment
);
ViewProxy
.
setTranslationY
(
containerViewBack
,
0
);
}
}
};
};
currentAnimation
=
new
AnimatorSetProxy
();
currentAnimation
=
new
AnimatorSetProxy
();
currentAnimation
.
playTogether
(
currentAnimation
.
playTogether
(
ObjectAnimatorProxy
.
ofFloat
(
containerViewBack
,
"alpha"
,
1.0f
,
0.0f
),
ObjectAnimatorProxy
.
ofFloat
(
containerViewBack
,
"alpha"
,
1.0f
,
0.0f
),
ObjectAnimatorProxy
.
ofFloat
(
containerViewBack
,
"scaleX"
,
1.0f
,
0.8f
),
ObjectAnimatorProxy
.
ofFloat
(
containerViewBack
,
"translationY"
,
0
,
AndroidUtilities
.
dp
(
48
)));
ObjectAnimatorProxy
.
ofFloat
(
containerViewBack
,
"scaleY"
,
1.0f
,
0.8f
));
currentAnimation
.
setInterpolator
(
new
DecelerateInterpolator
(
1.5f
));
currentAnimation
.
setInterpolator
(
new
DecelerateInterpolator
(
1.5f
));
currentAnimation
.
setDuration
(
200
);
currentAnimation
.
setDuration
(
200
);
currentAnimation
.
addListener
(
new
AnimatorListenerAdapterProxy
()
{
currentAnimation
.
addListener
(
new
AnimatorListenerAdapterProxy
()
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenu.java
View file @
a38e46cd
...
@@ -134,8 +134,9 @@ public class ActionBarMenu extends LinearLayout {
...
@@ -134,8 +134,9 @@ public class ActionBarMenu extends LinearLayout {
View
view
=
getChildAt
(
a
);
View
view
=
getChildAt
(
a
);
if
(
view
instanceof
ActionBarMenuItem
)
{
if
(
view
instanceof
ActionBarMenuItem
)
{
ActionBarMenuItem
item
=
(
ActionBarMenuItem
)
view
;
ActionBarMenuItem
item
=
(
ActionBarMenuItem
)
view
;
if
(
item
.
hasSubMenu
())
{
if
(
item
.
hasSubMenu
()
&&
item
.
getVisibility
()
==
VISIBLE
)
{
item
.
toggleSubMenu
();
item
.
toggleSubMenu
();
break
;
}
}
}
}
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BaseFragment.java
View file @
a38e46cd
...
@@ -214,15 +214,19 @@ public class BaseFragment {
...
@@ -214,15 +214,19 @@ public class BaseFragment {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
FileLog
.
e
(
"tmessages"
,
e
);
}
}
visibleDialog
=
builder
.
show
();
try
{
visibleDialog
.
setCanceledOnTouchOutside
(
true
);
visibleDialog
=
builder
.
show
();
visibleDialog
.
setOnDismissListener
(
new
DialogInterface
.
OnDismissListener
()
{
visibleDialog
.
setCanceledOnTouchOutside
(
true
);
@Override
visibleDialog
.
setOnDismissListener
(
new
DialogInterface
.
OnDismissListener
()
{
public
void
onDismiss
(
DialogInterface
dialog
)
{
@Override
visibleDialog
=
null
;
public
void
onDismiss
(
DialogInterface
dialog
)
{
onDialogDismiss
();
visibleDialog
=
null
;
}
onDialogDismiss
();
});
}
});
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
}
}
protected
void
onDialogDismiss
()
{
protected
void
onDialogDismiss
()
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsAdapter.java
View file @
a38e46cd
...
@@ -52,7 +52,9 @@ public class ContactsAdapter extends BaseSectionsAdapter {
...
@@ -52,7 +52,9 @@ public class ContactsAdapter extends BaseSectionsAdapter {
if
(
onlyUsers
)
{
if
(
onlyUsers
)
{
if
(
section
<
ContactsController
.
getInstance
().
sortedUsersSectionsArray
.
size
())
{
if
(
section
<
ContactsController
.
getInstance
().
sortedUsersSectionsArray
.
size
())
{
ArrayList
<
TLRPC
.
TL_contact
>
arr
=
ContactsController
.
getInstance
().
usersSectionsDict
.
get
(
ContactsController
.
getInstance
().
sortedUsersSectionsArray
.
get
(
section
));
ArrayList
<
TLRPC
.
TL_contact
>
arr
=
ContactsController
.
getInstance
().
usersSectionsDict
.
get
(
ContactsController
.
getInstance
().
sortedUsersSectionsArray
.
get
(
section
));
return
MessagesController
.
getInstance
().
getUser
(
arr
.
get
(
position
).
user_id
);
if
(
position
<
arr
.
size
())
{
return
MessagesController
.
getInstance
().
getUser
(
arr
.
get
(
position
).
user_id
);
}
}
}
return
null
;
return
null
;
}
else
{
}
else
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/ChangeUsernameActivity.java
View file @
a38e46cd
...
@@ -236,6 +236,11 @@ public class ChangeUsernameActivity extends BaseFragment {
...
@@ -236,6 +236,11 @@ public class ChangeUsernameActivity extends BaseFragment {
}
}
lastNameAvailable
=
false
;
lastNameAvailable
=
false
;
if
(
name
!=
null
)
{
if
(
name
!=
null
)
{
if
(
name
.
startsWith
(
"_"
)
||
name
.
endsWith
(
"_"
))
{
checkTextView
.
setText
(
LocaleController
.
getString
(
"UsernameInvalid"
,
R
.
string
.
UsernameInvalid
));
checkTextView
.
setTextColor
(
0xffcf3030
);
return
false
;
}
for
(
int
a
=
0
;
a
<
name
.
length
();
a
++)
{
for
(
int
a
=
0
;
a
<
name
.
length
();
a
++)
{
char
ch
=
name
.
charAt
(
a
);
char
ch
=
name
.
charAt
(
a
);
if
(
a
==
0
&&
ch
>=
'0'
&&
ch
<=
'9'
)
{
if
(
a
==
0
&&
ch
>=
'0'
&&
ch
<=
'9'
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
View file @
a38e46cd
...
@@ -473,7 +473,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
...
@@ -473,7 +473,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if
(
currentUser
!=
null
)
{
if
(
currentUser
!=
null
)
{
MessagesController
.
getInstance
().
cancelLoadFullUser
(
currentUser
.
id
);
MessagesController
.
getInstance
().
cancelLoadFullUser
(
currentUser
.
id
);
}
}
if
(!
AndroidUtilities
.
isTablet
())
{
if
(!
AndroidUtilities
.
isTablet
()
&&
getParentActivity
()
!=
null
)
{
getParentActivity
().
getWindow
().
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_ADJUST_PAN
);
getParentActivity
().
getWindow
().
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_ADJUST_PAN
);
}
}
AndroidUtilities
.
unlockOrientation
(
getParentActivity
());
AndroidUtilities
.
unlockOrientation
(
getParentActivity
());
...
@@ -1270,7 +1270,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
...
@@ -1270,7 +1270,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
}
private
void
scrollToLastMessage
()
{
private
void
scrollToLastMessage
()
{
if
(
(
forward_end_reached
||
first_unread_id
==
0
)
&&
startLoadFromMessageId
==
0
)
{
if
(
forward_end_reached
&&
first_unread_id
==
0
&&
startLoadFromMessageId
==
0
)
{
chatListView
.
setSelectionFromTop
(
messages
.
size
()
-
1
,
-
100000
-
chatListView
.
getPaddingTop
());
chatListView
.
setSelectionFromTop
(
messages
.
size
()
-
1
,
-
100000
-
chatListView
.
getPaddingTop
());
}
else
{
}
else
{
messages
.
clear
();
messages
.
clear
();
...
@@ -3087,7 +3087,13 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
...
@@ -3087,7 +3087,13 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
presentFragment
(
chatActivity
,
true
);
presentFragment
(
chatActivity
,
true
);
if
(!
AndroidUtilities
.
isTablet
())
{
if
(!
AndroidUtilities
.
isTablet
())
{
removeSelfFromStack
();
removeSelfFromStack
();
chatActivity
.
getParentActivity
().
getWindow
().
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_ADJUST_RESIZE
);
Activity
parentActivity
=
getParentActivity
();
if
(
parentActivity
==
null
)
{
parentActivity
=
chatActivity
.
getParentActivity
();
}
if
(
parentActivity
!=
null
)
{
parentActivity
.
getWindow
().
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_ADJUST_RESIZE
);
}
}
}
}
else
{
}
else
{
activity
.
finishFragment
();
activity
.
finishFragment
();
...
...
TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java
View file @
a38e46cd
...
@@ -1131,7 +1131,16 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
...
@@ -1131,7 +1131,16 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
}
}
}
}
if
(
fragment
instanceof
ChatActivity
)
{
if
(
fragment
instanceof
ChatActivity
)
{
if
(!
tabletFullSize
&&
layout
!=
rightActionBarLayout
)
{
if
(!
tabletFullSize
&&
layout
==
rightActionBarLayout
||
tabletFullSize
&&
layout
==
actionBarLayout
)
{
if
(!
layersActionBarLayout
.
fragmentsStack
.
isEmpty
())
{
for
(
int
a
=
0
;
a
<
layersActionBarLayout
.
fragmentsStack
.
size
()
-
1
;
a
++)
{
layersActionBarLayout
.
removeFragmentFromStack
(
layersActionBarLayout
.
fragmentsStack
.
get
(
0
));
a
--;
}
layersActionBarLayout
.
closeLastFragment
(!
forceWithoutAnimation
);
}
return
true
;
}
else
if
(!
tabletFullSize
&&
layout
!=
rightActionBarLayout
)
{
rightActionBarLayout
.
setVisibility
(
View
.
VISIBLE
);
rightActionBarLayout
.
setVisibility
(
View
.
VISIBLE
);
backgroundTablet
.
setVisibility
(
View
.
GONE
);
backgroundTablet
.
setVisibility
(
View
.
GONE
);
rightActionBarLayout
.
removeAllFragments
();
rightActionBarLayout
.
removeAllFragments
();
...
...
TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java
View file @
a38e46cd
...
@@ -530,6 +530,12 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
...
@@ -530,6 +530,12 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
void
didReceivedNotification
(
int
id
,
Object
...
args
)
{
public
void
didReceivedNotification
(
int
id
,
Object
...
args
)
{
if
(
id
==
NotificationCenter
.
dialogsNeedReload
)
{
if
(
id
==
NotificationCenter
.
dialogsNeedReload
)
{
if
(
dialogsAdapter
!=
null
)
{
dialogsAdapter
.
notifyDataSetChanged
();
}
if
(
dialogsSearchAdapter
!=
null
)
{
dialogsSearchAdapter
.
notifyDataSetChanged
();
}
if
(
messagesListView
!=
null
)
{
if
(
messagesListView
!=
null
)
{
if
(
MessagesController
.
getInstance
().
loadingDialogs
&&
MessagesController
.
getInstance
().
dialogs
.
isEmpty
())
{
if
(
MessagesController
.
getInstance
().
loadingDialogs
&&
MessagesController
.
getInstance
().
dialogs
.
isEmpty
())
{
searchEmptyView
.
setVisibility
(
View
.
GONE
);
searchEmptyView
.
setVisibility
(
View
.
GONE
);
...
@@ -537,33 +543,14 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
...
@@ -537,33 +543,14 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
messagesListView
.
setEmptyView
(
progressView
);
messagesListView
.
setEmptyView
(
progressView
);
}
else
{
}
else
{
if
(
searching
&&
searchWas
)
{
if
(
searching
&&
searchWas
)
{
if
(
dialogsAdapter
!=
null
)
{
dialogsAdapter
.
notifyDataSetChanged
();
}
if
(
dialogsSearchAdapter
!=
null
)
{
dialogsSearchAdapter
.
notifyDataSetChanged
();
}
messagesListView
.
setEmptyView
(
searchEmptyView
);
messagesListView
.
setEmptyView
(
searchEmptyView
);
emptyView
.
setVisibility
(
View
.
GONE
);
emptyView
.
setVisibility
(
View
.
GONE
);
}
else
{
}
else
{
if
(
dialogsAdapter
!=
null
)
{
dialogsAdapter
.
notifyDataSetChanged
();
}
if
(
dialogsSearchAdapter
!=
null
)
{
dialogsSearchAdapter
.
notifyDataSetChanged
();
}
messagesListView
.
setEmptyView
(
emptyView
);
messagesListView
.
setEmptyView
(
emptyView
);
searchEmptyView
.
setVisibility
(
View
.
GONE
);
searchEmptyView
.
setVisibility
(
View
.
GONE
);
}
}
progressView
.
setVisibility
(
View
.
GONE
);
progressView
.
setVisibility
(
View
.
GONE
);
}
}
}
else
{
if
(
dialogsAdapter
!=
null
)
{
dialogsAdapter
.
notifyDataSetChanged
();
}
if
(
dialogsSearchAdapter
!=
null
)
{
dialogsSearchAdapter
.
notifyDataSetChanged
();
}
}
}
}
else
if
(
id
==
NotificationCenter
.
emojiDidLoaded
)
{
}
else
if
(
id
==
NotificationCenter
.
emojiDidLoaded
)
{
if
(
messagesListView
!=
null
)
{
if
(
messagesListView
!=
null
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/PrivacySettingsActivity.java
View file @
a38e46cd
...
@@ -183,7 +183,7 @@ public class PrivacySettingsActivity extends BaseFragment implements Notificatio
...
@@ -183,7 +183,7 @@ public class PrivacySettingsActivity extends BaseFragment implements Notificatio
if
(
which
==
0
)
{
if
(
which
==
0
)
{
value
=
30
;
value
=
30
;
}
else
if
(
which
==
1
)
{
}
else
if
(
which
==
1
)
{
value
=
6
0
;
value
=
9
0
;
}
else
if
(
which
==
2
)
{
}
else
if
(
which
==
2
)
{
value
=
182
;
value
=
182
;
}
else
if
(
which
==
3
)
{
}
else
if
(
which
==
3
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java
View file @
a38e46cd
...
@@ -937,8 +937,8 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
...
@@ -937,8 +937,8 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
public
int
compare
(
Integer
lhs
,
Integer
rhs
)
{
public
int
compare
(
Integer
lhs
,
Integer
rhs
)
{
TLRPC
.
User
user1
=
MessagesController
.
getInstance
().
getUser
(
info
.
participants
.
get
(
rhs
).
user_id
);
TLRPC
.
User
user1
=
MessagesController
.
getInstance
().
getUser
(
info
.
participants
.
get
(
rhs
).
user_id
);
TLRPC
.
User
user2
=
MessagesController
.
getInstance
().
getUser
(
info
.
participants
.
get
(
lhs
).
user_id
);
TLRPC
.
User
user2
=
MessagesController
.
getInstance
().
getUser
(
info
.
participants
.
get
(
lhs
).
user_id
);
Integer
status1
=
0
;
int
status1
=
0
;
Integer
status2
=
0
;
int
status2
=
0
;
if
(
user1
!=
null
&&
user1
.
status
!=
null
)
{
if
(
user1
!=
null
&&
user1
.
status
!=
null
)
{
if
(
user1
.
id
==
UserConfig
.
getClientUserId
())
{
if
(
user1
.
id
==
UserConfig
.
getClientUserId
())
{
status1
=
ConnectionsManager
.
getInstance
().
getCurrentTime
()
+
50000
;
status1
=
ConnectionsManager
.
getInstance
().
getCurrentTime
()
+
50000
;
...
@@ -953,7 +953,26 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
...
@@ -953,7 +953,26 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
status2
=
user2
.
status
.
expires
;
status2
=
user2
.
status
.
expires
;
}
}
}
}
return
status1
.
compareTo
(
status2
);
if
(
status1
>
0
&&
status2
>
0
)
{
if
(
status1
>
status2
)
{
return
1
;
}
else
if
(
status1
<
status2
)
{
return
-
1
;
}
return
0
;
}
else
if
(
status1
<
0
&&
status2
<
0
)
{
if
(
status1
>
status2
)
{
return
1
;
}
else
if
(
status1
<
status2
)
{
return
-
1
;
}
return
0
;
}
else
if
(
status1
<
0
&&
status2
>
0
||
status1
==
0
&&
status2
!=
0
)
{
return
-
1
;
}
else
if
(
status2
<
0
&&
status1
>
0
||
status2
==
0
&&
status1
!=
0
)
{
return
1
;
}
return
0
;
}
}
});
});
...
...
TMessagesProj/src/main/java/org/telegram/ui/VideoEditorActivity.java
View file @
a38e46cd
...
@@ -184,7 +184,9 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
...
@@ -184,7 +184,9 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
@Override
@Override
public
void
onPrepared
(
MediaPlayer
mp
)
{
public
void
onPrepared
(
MediaPlayer
mp
)
{
playerPrepared
=
true
;
playerPrepared
=
true
;
videoPlayer
.
seekTo
((
int
)
(
videoTimelineView
.
getLeftProgress
()
*
videoDuration
));
if
(
videoTimelineView
!=
null
&&
videoPlayer
!=
null
)
{
videoPlayer
.
seekTo
((
int
)
(
videoTimelineView
.
getLeftProgress
()
*
videoDuration
));
}
}
}
});
});
try
{
try
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/ChatActivityEnterView.java
View file @
a38e46cd
...
@@ -391,9 +391,11 @@ public class ChatActivityEnterView implements NotificationCenter.NotificationCen
...
@@ -391,9 +391,11 @@ public class ChatActivityEnterView implements NotificationCenter.NotificationCen
});
});
runningAnimation2
.
start
();
runningAnimation2
.
start
();
FrameLayout
.
LayoutParams
layoutParams
=
(
FrameLayout
.
LayoutParams
)
messsageEditText
.
getLayoutParams
();
if
(
messsageEditText
!=
null
)
{
layoutParams
.
rightMargin
=
AndroidUtilities
.
dp
(
0
);
FrameLayout
.
LayoutParams
layoutParams
=
(
FrameLayout
.
LayoutParams
)
messsageEditText
.
getLayoutParams
();
messsageEditText
.
setLayoutParams
(
layoutParams
);
layoutParams
.
rightMargin
=
AndroidUtilities
.
dp
(
0
);
messsageEditText
.
setLayoutParams
(
layoutParams
);
}
delegate
.
onAttachButtonHidden
();
delegate
.
onAttachButtonHidden
();
}
}
...
@@ -470,9 +472,11 @@ public class ChatActivityEnterView implements NotificationCenter.NotificationCen
...
@@ -470,9 +472,11 @@ public class ChatActivityEnterView implements NotificationCenter.NotificationCen
runningAnimation2
.
setDuration
(
100
);
runningAnimation2
.
setDuration
(
100
);
runningAnimation2
.
start
();
runningAnimation2
.
start
();
FrameLayout
.
LayoutParams
layoutParams
=
(
FrameLayout
.
LayoutParams
)
messsageEditText
.
getLayoutParams
();
if
(
messsageEditText
!=
null
)
{
layoutParams
.
rightMargin
=
AndroidUtilities
.
dp
(
50
);
FrameLayout
.
LayoutParams
layoutParams
=
(
FrameLayout
.
LayoutParams
)
messsageEditText
.
getLayoutParams
();
messsageEditText
.
setLayoutParams
(
layoutParams
);
layoutParams
.
rightMargin
=
AndroidUtilities
.
dp
(
50
);
messsageEditText
.
setLayoutParams
(
layoutParams
);
}
delegate
.
onAttachButtonShow
();
delegate
.
onAttachButtonShow
();
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/SectionsListView.java
View file @
a38e46cd
...
@@ -132,6 +132,8 @@ public class SectionsListView extends ListView implements AbsListView.OnScrollLi
...
@@ -132,6 +132,8 @@ public class SectionsListView extends ListView implements AbsListView.OnScrollLi
View
child
=
getChildAt
(
itemNum
-
firstVisibleItem
);
View
child
=
getChildAt
(
itemNum
-
firstVisibleItem
);
if
(
child
!=
null
)
{
if
(
child
!=
null
)
{
header
.
setTag
(
child
.
getTop
());
header
.
setTag
(
child
.
getTop
());
}
else
{
header
.
setTag
(-
AndroidUtilities
.
dp
(
100
));
}
}
itemNum
+=
count
;
itemNum
+=
count
;
}
}
...
...
TMessagesProj/src/main/res/values/strings.xml
View file @
a38e46cd
...
@@ -106,6 +106,7 @@
...
@@ -106,6 +106,7 @@
<string
name=
"SaveToDownloads"
>
Save to downloads
</string>
<string
name=
"SaveToDownloads"
>
Save to downloads
</string>
<string
name=
"ApplyLocalizationFile"
>
Apply localization file
</string>
<string
name=
"ApplyLocalizationFile"
>
Apply localization file
</string>
<string
name=
"UnsupportedAttachment"
>
Unsupported attachment
</string>
<string
name=
"UnsupportedAttachment"
>
Unsupported attachment
</string>
<string
name=
"SetTimer"
>
Set timer
</string>
<!--notification-->
<!--notification-->
<string
name=
"MessageLifetimeChanged"
>
%1$s set the self-destruct timer to %2$s
</string>
<string
name=
"MessageLifetimeChanged"
>
%1$s set the self-destruct timer to %2$s
</string>
<string
name=
"MessageLifetimeChangedOutgoing"
>
You set the self-destruct timer to %1$s
</string>
<string
name=
"MessageLifetimeChangedOutgoing"
>
You set the self-destruct timer to %1$s
</string>
...
@@ -146,7 +147,7 @@
...
@@ -146,7 +147,7 @@
<string
name=
"SelectContact"
>
Select Contact
</string>
<string
name=
"SelectContact"
>
Select Contact
</string>
<string
name=
"NoContacts"
>
No contacts yet
</string>
<string
name=
"NoContacts"
>
No contacts yet
</string>
<string
name=
"InviteText"
>
Hey, let\'s switch to Telegram: http://telegram.org/dl2
</string>
<string
name=
"InviteText"
>
Hey, let\'s switch to Telegram: http://telegram.org/dl2
</string>
<string
name=
"TodayAt"
>
today
at
</string>
<string
name=
"TodayAt"
>
at
</string>
<string
name=
"YesterdayAt"
>
yesterday at
</string>
<string
name=
"YesterdayAt"
>
yesterday at
</string>
<string
name=
"Online"
>
online
</string>
<string
name=
"Online"
>
online
</string>
<string
name=
"LastSeen"
>
last seen
</string>
<string
name=
"LastSeen"
>
last seen
</string>
...
@@ -271,6 +272,11 @@
...
@@ -271,6 +272,11 @@
<string
name=
"NoMediaAutoDownload"
>
No media
</string>
<string
name=
"NoMediaAutoDownload"
>
No media
</string>
<string
name=
"SaveToGallerySettings"
>
Save to gallery
</string>
<string
name=
"SaveToGallerySettings"
>
Save to gallery
</string>
<string
name=
"EditName"
>
Edit name
</string>
<string
name=
"EditName"
>
Edit name
</string>
<string
name=
"NotificationsPriority"
>
Priority
</string>
<string
name=
"NotificationsPriorityDefault"
>
Default
</string>
<string
name=
"NotificationsPriorityLow"
>
Low
</string>
<string
name=
"NotificationsPriorityHigh"
>
High
</string>
<string
name=
"NotificationsPriorityMax"
>
Max
</string>
<!--media view-->
<!--media view-->
<string
name=
"NoMedia"
>
No shared media yet
</string>
<string
name=
"NoMedia"
>
No shared media yet
</string>
<!--map view-->
<!--map view-->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment