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
d69b5b3b
Commit
d69b5b3b
authored
Nov 21, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixes
parent
baed4120
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
137 additions
and
65 deletions
+137
-65
build.gradle
TMessagesProj/build.gradle
+2
-2
MediaController.java
...j/src/main/java/org/telegram/android/MediaController.java
+11
-7
NotificationsController.java
...in/java/org/telegram/android/NotificationsController.java
+1
-1
SendMessagesHelper.java
...rc/main/java/org/telegram/android/SendMessagesHelper.java
+29
-5
ActionBarLayout.java
.../main/java/org/telegram/ui/ActionBar/ActionBarLayout.java
+2
-0
ActionBarPopupWindow.java
.../java/org/telegram/ui/ActionBar/ActionBarPopupWindow.java
+8
-2
BlockedUsersActivity.java
...j/src/main/java/org/telegram/ui/BlockedUsersActivity.java
+3
-1
DialogCell.java
...sProj/src/main/java/org/telegram/ui/Cells/DialogCell.java
+15
-8
LaunchActivity.java
...gesProj/src/main/java/org/telegram/ui/LaunchActivity.java
+4
-1
LoginActivity.java
...agesProj/src/main/java/org/telegram/ui/LoginActivity.java
+18
-14
MessagesActivity.java
...sProj/src/main/java/org/telegram/ui/MessagesActivity.java
+19
-10
PhotoCropActivity.java
...Proj/src/main/java/org/telegram/ui/PhotoCropActivity.java
+2
-2
PhotoViewer.java
TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java
+17
-10
SettingsActivity.java
...sProj/src/main/java/org/telegram/ui/SettingsActivity.java
+1
-1
ChatActivityEnterView.java
...ain/java/org/telegram/ui/Views/ChatActivityEnterView.java
+5
-1
No files found.
TMessagesProj/build.gradle
View file @
d69b5b3b
...
@@ -80,7 +80,7 @@ android {
...
@@ -80,7 +80,7 @@ android {
defaultConfig
{
defaultConfig
{
minSdkVersion
8
minSdkVersion
8
targetSdkVersion
21
targetSdkVersion
21
versionCode
39
3
versionCode
39
5
versionName
"2.0.
3
"
versionName
"2.0.
4
"
}
}
}
}
TMessagesProj/src/main/java/org/telegram/android/MediaController.java
View file @
d69b5b3b
...
@@ -1542,6 +1542,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
...
@@ -1542,6 +1542,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
if
(
sourceFile
.
exists
())
{
if
(
sourceFile
.
exists
())
{
ProgressDialog
progressDialog
=
null
;
ProgressDialog
progressDialog
=
null
;
if
(
context
!=
null
)
{
if
(
context
!=
null
)
{
try
{
progressDialog
=
new
ProgressDialog
(
context
);
progressDialog
=
new
ProgressDialog
(
context
);
progressDialog
.
setMessage
(
LocaleController
.
getString
(
"Loading"
,
R
.
string
.
Loading
));
progressDialog
.
setMessage
(
LocaleController
.
getString
(
"Loading"
,
R
.
string
.
Loading
));
progressDialog
.
setCanceledOnTouchOutside
(
false
);
progressDialog
.
setCanceledOnTouchOutside
(
false
);
...
@@ -1549,6 +1550,9 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
...
@@ -1549,6 +1550,9 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
progressDialog
.
setProgressStyle
(
ProgressDialog
.
STYLE_HORIZONTAL
);
progressDialog
.
setProgressStyle
(
ProgressDialog
.
STYLE_HORIZONTAL
);
progressDialog
.
setMax
(
100
);
progressDialog
.
setMax
(
100
);
progressDialog
.
show
();
progressDialog
.
show
();
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
}
}
final
ProgressDialog
finalProgress
=
progressDialog
;
final
ProgressDialog
finalProgress
=
progressDialog
;
...
...
TMessagesProj/src/main/java/org/telegram/android/NotificationsController.java
View file @
d69b5b3b
...
@@ -238,7 +238,7 @@ public class NotificationsController {
...
@@ -238,7 +238,7 @@ public class NotificationsController {
PendingIntent
pintent
=
PendingIntent
.
getService
(
ApplicationLoader
.
applicationContext
,
0
,
new
Intent
(
ApplicationLoader
.
applicationContext
,
NotificationRepeat
.
class
),
0
);
PendingIntent
pintent
=
PendingIntent
.
getService
(
ApplicationLoader
.
applicationContext
,
0
,
new
Intent
(
ApplicationLoader
.
applicationContext
,
NotificationRepeat
.
class
),
0
);
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"Notifications"
,
Activity
.
MODE_PRIVATE
);
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"Notifications"
,
Activity
.
MODE_PRIVATE
);
int
minutes
=
preferences
.
getInt
(
"repeat_messages"
,
60
);
int
minutes
=
preferences
.
getInt
(
"repeat_messages"
,
60
);
if
(
minutes
>
0
||
personal_count
>
0
)
{
if
(
minutes
>
0
&&
personal_count
>
0
)
{
alarm
.
set
(
AlarmManager
.
RTC_WAKEUP
,
System
.
currentTimeMillis
()
+
minutes
*
60
*
1000
,
pintent
);
alarm
.
set
(
AlarmManager
.
RTC_WAKEUP
,
System
.
currentTimeMillis
()
+
minutes
*
60
*
1000
,
pintent
);
}
else
{
}
else
{
alarm
.
cancel
(
pintent
);
alarm
.
cancel
(
pintent
);
...
...
TMessagesProj/src/main/java/org/telegram/android/SendMessagesHelper.java
View file @
d69b5b3b
...
@@ -16,6 +16,7 @@ import android.net.Uri;
...
@@ -16,6 +16,7 @@ import android.net.Uri;
import
android.os.Build
;
import
android.os.Build
;
import
android.provider.MediaStore
;
import
android.provider.MediaStore
;
import
android.webkit.MimeTypeMap
;
import
android.webkit.MimeTypeMap
;
import
android.widget.Toast
;
import
org.telegram.messenger.BuffersStorage
;
import
org.telegram.messenger.BuffersStorage
;
import
org.telegram.messenger.ByteBufferDesc
;
import
org.telegram.messenger.ByteBufferDesc
;
...
@@ -23,6 +24,7 @@ import org.telegram.messenger.ConnectionsManager;
...
@@ -23,6 +24,7 @@ import org.telegram.messenger.ConnectionsManager;
import
org.telegram.messenger.FileLoader
;
import
org.telegram.messenger.FileLoader
;
import
org.telegram.messenger.FileLog
;
import
org.telegram.messenger.FileLog
;
import
org.telegram.messenger.MessageKeyData
;
import
org.telegram.messenger.MessageKeyData
;
import
org.telegram.messenger.R
;
import
org.telegram.messenger.RPCRequest
;
import
org.telegram.messenger.RPCRequest
;
import
org.telegram.messenger.TLObject
;
import
org.telegram.messenger.TLObject
;
import
org.telegram.messenger.TLRPC
;
import
org.telegram.messenger.TLRPC
;
...
@@ -1856,9 +1858,9 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
...
@@ -1856,9 +1858,9 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
}
}
}
}
private
static
void
prepareSendingDocumentInternal
(
String
path
,
String
originalPath
,
Uri
uri
,
String
mime
,
final
long
dialog_id
)
{
private
static
boolean
prepareSendingDocumentInternal
(
String
path
,
String
originalPath
,
Uri
uri
,
String
mime
,
final
long
dialog_id
)
{
if
((
path
==
null
||
path
.
length
()
==
0
)
&&
uri
==
null
)
{
if
((
path
==
null
||
path
.
length
()
==
0
)
&&
uri
==
null
)
{
return
;
return
false
;
}
}
MimeTypeMap
myMime
=
MimeTypeMap
.
getSingleton
();
MimeTypeMap
myMime
=
MimeTypeMap
.
getSingleton
();
if
(
uri
!=
null
)
{
if
(
uri
!=
null
)
{
...
@@ -1870,10 +1872,13 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
...
@@ -1870,10 +1872,13 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
extension
=
"txt"
;
extension
=
"txt"
;
}
}
path
=
MediaController
.
copyDocumentToCache
(
uri
,
extension
);
path
=
MediaController
.
copyDocumentToCache
(
uri
,
extension
);
if
(
path
==
null
)
{
return
false
;
}
}
}
final
File
f
=
new
File
(
path
);
final
File
f
=
new
File
(
path
);
if
(!
f
.
exists
()
||
f
.
length
()
==
0
)
{
if
(!
f
.
exists
()
||
f
.
length
()
==
0
)
{
return
;
return
false
;
}
}
boolean
isEncrypted
=
(
int
)
dialog_id
==
0
;
boolean
isEncrypted
=
(
int
)
dialog_id
==
0
;
...
@@ -1938,6 +1943,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
...
@@ -1938,6 +1943,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
SendMessagesHelper
.
getInstance
().
sendMessage
(
documentFinal
,
originalPathFinal
,
pathFinal
,
dialog_id
);
SendMessagesHelper
.
getInstance
().
sendMessage
(
documentFinal
,
originalPathFinal
,
pathFinal
,
dialog_id
);
}
}
});
});
return
true
;
}
}
public
static
void
prepareSendingDocument
(
String
path
,
String
originalPath
,
Uri
uri
,
String
mine
,
long
dialog_id
)
{
public
static
void
prepareSendingDocument
(
String
path
,
String
originalPath
,
Uri
uri
,
String
mine
,
long
dialog_id
)
{
...
@@ -1962,15 +1968,33 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
...
@@ -1962,15 +1968,33 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
new
Thread
(
new
Runnable
()
{
new
Thread
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
boolean
error
=
false
;
if
(
paths
!=
null
)
{
if
(
paths
!=
null
)
{
for
(
int
a
=
0
;
a
<
paths
.
size
();
a
++)
{
for
(
int
a
=
0
;
a
<
paths
.
size
();
a
++)
{
prepareSendingDocumentInternal
(
paths
.
get
(
a
),
originalPaths
.
get
(
a
),
null
,
mime
,
dialog_id
);
if
(!
prepareSendingDocumentInternal
(
paths
.
get
(
a
),
originalPaths
.
get
(
a
),
null
,
mime
,
dialog_id
))
{
error
=
true
;
}
}
}
}
}
if
(
uris
!=
null
)
{
if
(
uris
!=
null
)
{
for
(
int
a
=
0
;
a
<
uris
.
size
();
a
++)
{
for
(
int
a
=
0
;
a
<
uris
.
size
();
a
++)
{
prepareSendingDocumentInternal
(
null
,
null
,
uris
.
get
(
a
),
mime
,
dialog_id
);
if
(!
prepareSendingDocumentInternal
(
null
,
null
,
uris
.
get
(
a
),
mime
,
dialog_id
))
{
error
=
true
;
}
}
}
}
if
(
error
)
{
AndroidUtilities
.
runOnUIThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
Toast
toast
=
Toast
.
makeText
(
ApplicationLoader
.
applicationContext
,
LocaleController
.
getString
(
"UnsupportedAttachment"
,
R
.
string
.
UnsupportedAttachment
),
Toast
.
LENGTH_SHORT
);
toast
.
show
();
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
}
});
}
}
}
}
}).
start
();
}).
start
();
...
...
TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java
View file @
d69b5b3b
...
@@ -567,6 +567,7 @@ public class ActionBarLayout extends FrameLayout {
...
@@ -567,6 +567,7 @@ public class ActionBarLayout extends FrameLayout {
containerViewBack
.
addView
(
fragment
.
actionBar
);
containerViewBack
.
addView
(
fragment
.
actionBar
);
fragment
.
actionBar
.
setTitleOverlayText
(
titleOverlayText
);
fragment
.
actionBar
.
setTitleOverlayText
(
titleOverlayText
);
}
}
containerViewBack
.
addView
(
fragmentView
);
containerViewBack
.
addView
(
fragmentView
);
ViewGroup
.
LayoutParams
layoutParams
=
fragmentView
.
getLayoutParams
();
ViewGroup
.
LayoutParams
layoutParams
=
fragmentView
.
getLayoutParams
();
layoutParams
.
width
=
FrameLayout
.
LayoutParams
.
MATCH_PARENT
;
layoutParams
.
width
=
FrameLayout
.
LayoutParams
.
MATCH_PARENT
;
...
@@ -623,6 +624,7 @@ public class ActionBarLayout extends FrameLayout {
...
@@ -623,6 +624,7 @@ public class ActionBarLayout extends FrameLayout {
public
void
run
()
{
public
void
run
()
{
presentFragmentInternalRemoveOld
(
removeLast
,
currentFragment
);
presentFragmentInternalRemoveOld
(
removeLast
,
currentFragment
);
fragment
.
onOpenAnimationEnd
();
fragment
.
onOpenAnimationEnd
();
ViewProxy
.
setTranslationX
(
containerView
,
0
);
}
}
};
};
currentAnimation
=
new
AnimatorSetProxy
();
currentAnimation
=
new
AnimatorSetProxy
();
...
...
TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarPopupWindow.java
View file @
d69b5b3b
...
@@ -18,6 +18,8 @@ import android.view.ViewTreeObserver;
...
@@ -18,6 +18,8 @@ import android.view.ViewTreeObserver;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.PopupWindow
;
import
android.widget.PopupWindow
;
import
org.telegram.messenger.FileLog
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
public
class
ActionBarPopupWindow
extends
PopupWindow
{
public
class
ActionBarPopupWindow
extends
PopupWindow
{
...
@@ -157,8 +159,12 @@ public class ActionBarPopupWindow extends PopupWindow {
...
@@ -157,8 +159,12 @@ public class ActionBarPopupWindow extends PopupWindow {
@Override
@Override
public
void
showAsDropDown
(
View
anchor
,
int
xoff
,
int
yoff
)
{
public
void
showAsDropDown
(
View
anchor
,
int
xoff
,
int
yoff
)
{
try
{
super
.
showAsDropDown
(
anchor
,
xoff
,
yoff
);
super
.
showAsDropDown
(
anchor
,
xoff
,
yoff
);
registerListener
(
anchor
);
registerListener
(
anchor
);
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
}
}
@Override
@Override
...
...
TMessagesProj/src/main/java/org/telegram/ui/BlockedUsersActivity.java
View file @
d69b5b3b
...
@@ -290,7 +290,9 @@ public class BlockedUsersActivity extends BaseFragment implements NotificationCe
...
@@ -290,7 +290,9 @@ public class BlockedUsersActivity extends BaseFragment implements NotificationCe
view
=
new
UserCell
(
mContext
,
1
);
view
=
new
UserCell
(
mContext
,
1
);
}
}
TLRPC
.
User
user
=
MessagesController
.
getInstance
().
getUser
(
MessagesController
.
getInstance
().
blockedUsers
.
get
(
i
));
TLRPC
.
User
user
=
MessagesController
.
getInstance
().
getUser
(
MessagesController
.
getInstance
().
blockedUsers
.
get
(
i
));
((
UserCell
)
view
).
setData
(
user
,
null
,
user
.
phone
!=
null
&&
user
.
phone
.
length
()
!=
0
?
PhoneFormat
.
getInstance
().
format
(
"+"
+
user
.
phone
)
:
LocaleController
.
getString
(
"NumberUnknown"
,
R
.
string
.
NumberUnknown
),
0
);
if
(
user
!=
null
)
{
((
UserCell
)
view
).
setData
(
user
,
null
,
user
.
phone
!=
null
&&
user
.
phone
.
length
()
!=
0
?
PhoneFormat
.
getInstance
().
format
(
"+"
+
user
.
phone
)
:
LocaleController
.
getString
(
"NumberUnknown"
,
R
.
string
.
NumberUnknown
),
0
);
}
}
else
if
(
type
==
1
)
{
}
else
if
(
type
==
1
)
{
if
(
view
==
null
)
{
if
(
view
==
null
)
{
view
=
new
TextInfoCell
(
mContext
);
view
=
new
TextInfoCell
(
mContext
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java
View file @
d69b5b3b
...
@@ -458,6 +458,7 @@ public class DialogCell extends BaseCell {
...
@@ -458,6 +458,7 @@ public class DialogCell extends BaseCell {
}
}
}
}
nameWidth
=
Math
.
max
(
AndroidUtilities
.
dp
(
12
),
nameWidth
);
CharSequence
nameStringFinal
=
TextUtils
.
ellipsize
(
nameString
.
replace
(
"\n"
,
" "
),
currentNamePaint
,
nameWidth
-
AndroidUtilities
.
dp
(
12
),
TextUtils
.
TruncateAt
.
END
);
CharSequence
nameStringFinal
=
TextUtils
.
ellipsize
(
nameString
.
replace
(
"\n"
,
" "
),
currentNamePaint
,
nameWidth
-
AndroidUtilities
.
dp
(
12
),
TextUtils
.
TruncateAt
.
END
);
try
{
try
{
nameLayout
=
new
StaticLayout
(
nameStringFinal
,
currentNamePaint
,
nameWidth
,
Layout
.
Alignment
.
ALIGN_NORMAL
,
1.0f
,
0.0f
,
false
);
nameLayout
=
new
StaticLayout
(
nameStringFinal
,
currentNamePaint
,
nameWidth
,
Layout
.
Alignment
.
ALIGN_NORMAL
,
1.0f
,
0.0f
,
false
);
...
@@ -510,9 +511,13 @@ public class DialogCell extends BaseCell {
...
@@ -510,9 +511,13 @@ public class DialogCell extends BaseCell {
}
}
messageString
=
Emoji
.
replaceEmoji
(
mess
,
messagePaint
.
getFontMetricsInt
(),
AndroidUtilities
.
dp
(
17
));
messageString
=
Emoji
.
replaceEmoji
(
mess
,
messagePaint
.
getFontMetricsInt
(),
AndroidUtilities
.
dp
(
17
));
}
}
messageWidth
=
Math
.
max
(
AndroidUtilities
.
dp
(
12
),
messageWidth
);
CharSequence
messageStringFinal
=
TextUtils
.
ellipsize
(
messageString
,
currentMessagePaint
,
messageWidth
-
AndroidUtilities
.
dp
(
12
),
TextUtils
.
TruncateAt
.
END
);
CharSequence
messageStringFinal
=
TextUtils
.
ellipsize
(
messageString
,
currentMessagePaint
,
messageWidth
-
AndroidUtilities
.
dp
(
12
),
TextUtils
.
TruncateAt
.
END
);
try
{
messageLayout
=
new
StaticLayout
(
messageStringFinal
,
currentMessagePaint
,
messageWidth
,
Layout
.
Alignment
.
ALIGN_NORMAL
,
1.0f
,
0.0f
,
false
);
messageLayout
=
new
StaticLayout
(
messageStringFinal
,
currentMessagePaint
,
messageWidth
,
Layout
.
Alignment
.
ALIGN_NORMAL
,
1.0f
,
0.0f
,
false
);
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
double
widthpx
=
0
;
double
widthpx
=
0
;
float
left
=
0
;
float
left
=
0
;
...
@@ -526,7 +531,7 @@ public class DialogCell extends BaseCell {
...
@@ -526,7 +531,7 @@ public class DialogCell extends BaseCell {
}
}
}
}
}
}
if
(
messageLayout
.
getLineCount
()
>
0
)
{
if
(
messageLayout
!=
null
&&
messageLayout
.
getLineCount
()
>
0
)
{
left
=
messageLayout
.
getLineLeft
(
0
);
left
=
messageLayout
.
getLineLeft
(
0
);
if
(
left
==
0
)
{
if
(
left
==
0
)
{
widthpx
=
Math
.
ceil
(
messageLayout
.
getLineWidth
(
0
));
widthpx
=
Math
.
ceil
(
messageLayout
.
getLineWidth
(
0
));
...
@@ -545,7 +550,7 @@ public class DialogCell extends BaseCell {
...
@@ -545,7 +550,7 @@ public class DialogCell extends BaseCell {
}
}
}
}
}
}
if
(
messageLayout
.
getLineCount
()
>
0
)
{
if
(
messageLayout
!=
null
&&
messageLayout
.
getLineCount
()
>
0
)
{
left
=
messageLayout
.
getLineRight
(
0
);
left
=
messageLayout
.
getLineRight
(
0
);
if
(
left
==
messageWidth
)
{
if
(
left
==
messageWidth
)
{
widthpx
=
Math
.
ceil
(
messageLayout
.
getLineWidth
(
0
));
widthpx
=
Math
.
ceil
(
messageLayout
.
getLineWidth
(
0
));
...
@@ -677,10 +682,12 @@ public class DialogCell extends BaseCell {
...
@@ -677,10 +682,12 @@ public class DialogCell extends BaseCell {
timeLayout
.
draw
(
canvas
);
timeLayout
.
draw
(
canvas
);
canvas
.
restore
();
canvas
.
restore
();
if
(
messageLayout
!=
null
)
{
canvas
.
save
();
canvas
.
save
();
canvas
.
translate
(
messageLeft
,
messageTop
);
canvas
.
translate
(
messageLeft
,
messageTop
);
messageLayout
.
draw
(
canvas
);
messageLayout
.
draw
(
canvas
);
canvas
.
restore
();
canvas
.
restore
();
}
if
(
drawClock
)
{
if
(
drawClock
)
{
setDrawableBounds
(
clockDrawable
,
checkDrawLeft
,
checkDrawTop
);
setDrawableBounds
(
clockDrawable
,
checkDrawLeft
,
checkDrawTop
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java
View file @
d69b5b3b
...
@@ -386,7 +386,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
...
@@ -386,7 +386,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
if
(
Intent
.
ACTION_SEND
.
equals
(
intent
.
getAction
()))
{
if
(
Intent
.
ACTION_SEND
.
equals
(
intent
.
getAction
()))
{
boolean
error
=
false
;
boolean
error
=
false
;
String
type
=
intent
.
getType
();
String
type
=
intent
.
getType
();
if
(
type
!=
null
&&
type
.
equals
(
"text/plain"
))
{
if
(
type
!=
null
&&
type
.
equals
(
"text/plain"
)
&&
intent
.
getStringExtra
(
Intent
.
EXTRA_TEXT
)
!=
null
)
{
String
text
=
intent
.
getStringExtra
(
Intent
.
EXTRA_TEXT
);
String
text
=
intent
.
getStringExtra
(
Intent
.
EXTRA_TEXT
);
String
subject
=
intent
.
getStringExtra
(
Intent
.
EXTRA_SUBJECT
);
String
subject
=
intent
.
getStringExtra
(
Intent
.
EXTRA_SUBJECT
);
...
@@ -950,6 +950,9 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
...
@@ -950,6 +950,9 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
void
didReceivedNotification
(
int
id
,
Object
...
args
)
{
public
void
didReceivedNotification
(
int
id
,
Object
...
args
)
{
if
(
id
==
NotificationCenter
.
appDidLogout
)
{
if
(
id
==
NotificationCenter
.
appDidLogout
)
{
if
(
drawerLayoutAdapter
!=
null
)
{
drawerLayoutAdapter
.
notifyDataSetChanged
();
}
for
(
BaseFragment
fragment
:
actionBarLayout
.
fragmentsStack
)
{
for
(
BaseFragment
fragment
:
actionBarLayout
.
fragmentsStack
)
{
fragment
.
onFragmentDestroy
();
fragment
.
onFragmentDestroy
();
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java
View file @
d69b5b3b
...
@@ -778,6 +778,7 @@ public class LoginActivity extends BaseFragment {
...
@@ -778,6 +778,7 @@ public class LoginActivity extends BaseFragment {
private
void
updatePhoneField
()
{
private
void
updatePhoneField
()
{
ignoreOnPhoneChange
=
true
;
ignoreOnPhoneChange
=
true
;
try
{
String
codeText
=
codeField
.
getText
().
toString
();
String
codeText
=
codeField
.
getText
().
toString
();
String
phone
=
PhoneFormat
.
getInstance
().
format
(
"+"
+
codeText
+
phoneField
.
getText
().
toString
());
String
phone
=
PhoneFormat
.
getInstance
().
format
(
"+"
+
codeText
+
phoneField
.
getText
().
toString
());
int
idx
=
phone
.
indexOf
(
" "
);
int
idx
=
phone
.
indexOf
(
" "
);
...
@@ -796,6 +797,9 @@ public class LoginActivity extends BaseFragment {
...
@@ -796,6 +797,9 @@ public class LoginActivity extends BaseFragment {
}
else
{
}
else
{
phoneField
.
setSelection
(
phoneField
.
length
());
phoneField
.
setSelection
(
phoneField
.
length
());
}
}
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
ignoreOnPhoneChange
=
false
;
ignoreOnPhoneChange
=
false
;
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java
View file @
d69b5b3b
...
@@ -22,6 +22,7 @@ import android.view.ViewTreeObserver;
...
@@ -22,6 +22,7 @@ import android.view.ViewTreeObserver;
import
android.view.animation.AccelerateDecelerateInterpolator
;
import
android.view.animation.AccelerateDecelerateInterpolator
;
import
android.widget.AbsListView
;
import
android.widget.AbsListView
;
import
android.widget.AdapterView
;
import
android.widget.AdapterView
;
import
android.widget.BaseAdapter
;
import
android.widget.CheckBox
;
import
android.widget.CheckBox
;
import
android.widget.EditText
;
import
android.widget.EditText
;
import
android.widget.FrameLayout
;
import
android.widget.FrameLayout
;
...
@@ -32,6 +33,7 @@ import android.widget.TextView;
...
@@ -32,6 +33,7 @@ import android.widget.TextView;
import
org.telegram.android.AndroidUtilities
;
import
org.telegram.android.AndroidUtilities
;
import
org.telegram.android.LocaleController
;
import
org.telegram.android.LocaleController
;
import
org.telegram.android.MessageObject
;
import
org.telegram.android.MessageObject
;
import
org.telegram.messenger.FileLog
;
import
org.telegram.messenger.TLRPC
;
import
org.telegram.messenger.TLRPC
;
import
org.telegram.android.ContactsController
;
import
org.telegram.android.ContactsController
;
import
org.telegram.android.MessagesController
;
import
org.telegram.android.MessagesController
;
...
@@ -537,6 +539,10 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
...
@@ -537,6 +539,10 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
dialogsSearchAdapter
.
notifyDataSetChanged
();
dialogsSearchAdapter
.
notifyDataSetChanged
();
}
}
if
(
messagesListView
!=
null
)
{
if
(
messagesListView
!=
null
)
{
try
{
if
(
messagesListView
.
getAdapter
()
!=
null
&&
messagesListView
.
getAdapter
()
instanceof
BaseAdapter
)
{
((
BaseAdapter
)
messagesListView
.
getAdapter
()).
notifyDataSetChanged
();
}
if
(
MessagesController
.
getInstance
().
loadingDialogs
&&
MessagesController
.
getInstance
().
dialogs
.
isEmpty
())
{
if
(
MessagesController
.
getInstance
().
loadingDialogs
&&
MessagesController
.
getInstance
().
dialogs
.
isEmpty
())
{
searchEmptyView
.
setVisibility
(
View
.
GONE
);
searchEmptyView
.
setVisibility
(
View
.
GONE
);
emptyView
.
setVisibility
(
View
.
GONE
);
emptyView
.
setVisibility
(
View
.
GONE
);
...
@@ -551,6 +557,9 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
...
@@ -551,6 +557,9 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
}
}
progressView
.
setVisibility
(
View
.
GONE
);
progressView
.
setVisibility
(
View
.
GONE
);
}
}
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
//TODO fix it in other way?
}
}
}
}
else
if
(
id
==
NotificationCenter
.
emojiDidLoaded
)
{
}
else
if
(
id
==
NotificationCenter
.
emojiDidLoaded
)
{
if
(
messagesListView
!=
null
)
{
if
(
messagesListView
!=
null
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/PhotoCropActivity.java
View file @
d69b5b3b
...
@@ -242,12 +242,12 @@ public class PhotoCropActivity extends BaseFragment {
...
@@ -242,12 +242,12 @@ public class PhotoCropActivity extends BaseFragment {
}
}
try
{
try
{
return
Bitmap
.
createBitmap
(
imageToCrop
,
x
,
y
,
size
,
size
);
return
Bitmap
.
createBitmap
(
imageToCrop
,
x
,
y
,
size
,
size
);
}
catch
(
Exception
e
)
{
}
catch
(
Throwable
e
)
{
FileLog
.
e
(
"tmessags"
,
e
);
FileLog
.
e
(
"tmessags"
,
e
);
System
.
gc
();
System
.
gc
();
try
{
try
{
return
Bitmap
.
createBitmap
(
imageToCrop
,
x
,
y
,
size
,
size
);
return
Bitmap
.
createBitmap
(
imageToCrop
,
x
,
y
,
size
,
size
);
}
catch
(
Exception
e2
)
{
}
catch
(
Throwable
e2
)
{
FileLog
.
e
(
"tmessages"
,
e2
);
FileLog
.
e
(
"tmessages"
,
e2
);
}
}
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java
View file @
d69b5b3b
...
@@ -1579,14 +1579,6 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
...
@@ -1579,14 +1579,6 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
return
;
return
;
}
}
actionBar
.
setTitle
(
LocaleController
.
formatString
(
"Of"
,
R
.
string
.
Of
,
1
,
1
));
NotificationCenter
.
getInstance
().
addObserver
(
this
,
NotificationCenter
.
FileDidFailedLoad
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
NotificationCenter
.
FileDidLoaded
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
NotificationCenter
.
FileLoadProgressChanged
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
NotificationCenter
.
mediaCountDidLoaded
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
NotificationCenter
.
mediaDidLoaded
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
NotificationCenter
.
userPhotosLoaded
);
try
{
try
{
if
(
windowView
.
getParent
()
!=
null
)
{
if
(
windowView
.
getParent
()
!=
null
)
{
WindowManager
wm
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
WindowManager
wm
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
...
@@ -1596,9 +1588,24 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
...
@@ -1596,9 +1588,24 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
FileLog
.
e
(
"tmessages"
,
e
);
FileLog
.
e
(
"tmessages"
,
e
);
}
}
placeProvider
=
provider
;
WindowManager
wm
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
WindowManager
wm
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
try
{
wm
.
addView
(
windowView
,
windowLayoutParams
);
wm
.
addView
(
windowView
,
windowLayoutParams
);
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
return
;
}
actionBar
.
setTitle
(
LocaleController
.
formatString
(
"Of"
,
R
.
string
.
Of
,
1
,
1
));
NotificationCenter
.
getInstance
().
addObserver
(
this
,
NotificationCenter
.
FileDidFailedLoad
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
NotificationCenter
.
FileDidLoaded
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
NotificationCenter
.
FileLoadProgressChanged
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
NotificationCenter
.
mediaCountDidLoaded
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
NotificationCenter
.
mediaDidLoaded
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
NotificationCenter
.
userPhotosLoaded
);
placeProvider
=
provider
;
if
(
velocityTracker
==
null
)
{
if
(
velocityTracker
==
null
)
{
velocityTracker
=
VelocityTracker
.
obtain
();
velocityTracker
=
VelocityTracker
.
obtain
();
...
...
TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java
View file @
d69b5b3b
...
@@ -287,10 +287,10 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
...
@@ -287,10 +287,10 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"Notifications"
,
Activity
.
MODE_PRIVATE
);
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"Notifications"
,
Activity
.
MODE_PRIVATE
);
SharedPreferences
.
Editor
editor
=
preferences
.
edit
();
SharedPreferences
.
Editor
editor
=
preferences
.
edit
();
editor
.
clear
().
commit
();
editor
.
clear
().
commit
();
NotificationCenter
.
getInstance
().
postNotificationName
(
NotificationCenter
.
appDidLogout
);
MessagesController
.
getInstance
().
unregistedPush
();
MessagesController
.
getInstance
().
unregistedPush
();
MessagesController
.
getInstance
().
logOut
();
MessagesController
.
getInstance
().
logOut
();
UserConfig
.
clearConfig
();
UserConfig
.
clearConfig
();
NotificationCenter
.
getInstance
().
postNotificationName
(
NotificationCenter
.
appDidLogout
);
MessagesStorage
.
getInstance
().
cleanUp
(
false
);
MessagesStorage
.
getInstance
().
cleanUp
(
false
);
MessagesController
.
getInstance
().
cleanUp
();
MessagesController
.
getInstance
().
cleanUp
();
ContactsController
.
getInstance
().
deleteAllAppAccounts
();
ContactsController
.
getInstance
().
deleteAllAppAccounts
();
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/ChatActivityEnterView.java
View file @
d69b5b3b
...
@@ -631,7 +631,11 @@ public class ChatActivityEnterView implements NotificationCenter.NotificationCen
...
@@ -631,7 +631,11 @@ public class ChatActivityEnterView implements NotificationCenter.NotificationCen
emojiPopup
.
setWidth
(
View
.
MeasureSpec
.
makeMeasureSpec
(
AndroidUtilities
.
displaySize
.
x
,
View
.
MeasureSpec
.
EXACTLY
));
emojiPopup
.
setWidth
(
View
.
MeasureSpec
.
makeMeasureSpec
(
AndroidUtilities
.
displaySize
.
x
,
View
.
MeasureSpec
.
EXACTLY
));
}
}
try
{
emojiPopup
.
showAtLocation
(
parentActivity
.
getWindow
().
getDecorView
(),
Gravity
.
BOTTOM
|
Gravity
.
LEFT
,
0
,
0
);
emojiPopup
.
showAtLocation
(
parentActivity
.
getWindow
().
getDecorView
(),
Gravity
.
BOTTOM
|
Gravity
.
LEFT
,
0
,
0
);
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
if
(!
keyboardVisible
)
{
if
(!
keyboardVisible
)
{
if
(
sizeNotifierRelativeLayout
!=
null
)
{
if
(
sizeNotifierRelativeLayout
!=
null
)
{
sizeNotifierRelativeLayout
.
setPadding
(
0
,
0
,
0
,
currentHeight
);
sizeNotifierRelativeLayout
.
setPadding
(
0
,
0
,
0
,
currentHeight
);
...
...
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