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
Hide 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 {
defaultConfig
{
minSdkVersion
8
targetSdkVersion
21
versionCode
39
3
versionName
"2.0.
3
"
versionCode
39
5
versionName
"2.0.
4
"
}
}
TMessagesProj/src/main/java/org/telegram/android/MediaController.java
View file @
d69b5b3b
...
...
@@ -1542,13 +1542,17 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
if
(
sourceFile
.
exists
())
{
ProgressDialog
progressDialog
=
null
;
if
(
context
!=
null
)
{
progressDialog
=
new
ProgressDialog
(
context
);
progressDialog
.
setMessage
(
LocaleController
.
getString
(
"Loading"
,
R
.
string
.
Loading
));
progressDialog
.
setCanceledOnTouchOutside
(
false
);
progressDialog
.
setCancelable
(
false
);
progressDialog
.
setProgressStyle
(
ProgressDialog
.
STYLE_HORIZONTAL
);
progressDialog
.
setMax
(
100
);
progressDialog
.
show
();
try
{
progressDialog
=
new
ProgressDialog
(
context
);
progressDialog
.
setMessage
(
LocaleController
.
getString
(
"Loading"
,
R
.
string
.
Loading
));
progressDialog
.
setCanceledOnTouchOutside
(
false
);
progressDialog
.
setCancelable
(
false
);
progressDialog
.
setProgressStyle
(
ProgressDialog
.
STYLE_HORIZONTAL
);
progressDialog
.
setMax
(
100
);
progressDialog
.
show
();
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
}
final
ProgressDialog
finalProgress
=
progressDialog
;
...
...
TMessagesProj/src/main/java/org/telegram/android/NotificationsController.java
View file @
d69b5b3b
...
...
@@ -238,7 +238,7 @@ public class NotificationsController {
PendingIntent
pintent
=
PendingIntent
.
getService
(
ApplicationLoader
.
applicationContext
,
0
,
new
Intent
(
ApplicationLoader
.
applicationContext
,
NotificationRepeat
.
class
),
0
);
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"Notifications"
,
Activity
.
MODE_PRIVATE
);
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
);
}
else
{
alarm
.
cancel
(
pintent
);
...
...
TMessagesProj/src/main/java/org/telegram/android/SendMessagesHelper.java
View file @
d69b5b3b
...
...
@@ -16,6 +16,7 @@ import android.net.Uri;
import
android.os.Build
;
import
android.provider.MediaStore
;
import
android.webkit.MimeTypeMap
;
import
android.widget.Toast
;
import
org.telegram.messenger.BuffersStorage
;
import
org.telegram.messenger.ByteBufferDesc
;
...
...
@@ -23,6 +24,7 @@ import org.telegram.messenger.ConnectionsManager;
import
org.telegram.messenger.FileLoader
;
import
org.telegram.messenger.FileLog
;
import
org.telegram.messenger.MessageKeyData
;
import
org.telegram.messenger.R
;
import
org.telegram.messenger.RPCRequest
;
import
org.telegram.messenger.TLObject
;
import
org.telegram.messenger.TLRPC
;
...
...
@@ -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
)
{
return
;
return
false
;
}
MimeTypeMap
myMime
=
MimeTypeMap
.
getSingleton
();
if
(
uri
!=
null
)
{
...
...
@@ -1870,10 +1872,13 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
extension
=
"txt"
;
}
path
=
MediaController
.
copyDocumentToCache
(
uri
,
extension
);
if
(
path
==
null
)
{
return
false
;
}
}
final
File
f
=
new
File
(
path
);
if
(!
f
.
exists
()
||
f
.
length
()
==
0
)
{
return
;
return
false
;
}
boolean
isEncrypted
=
(
int
)
dialog_id
==
0
;
...
...
@@ -1938,6 +1943,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
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
)
{
...
...
@@ -1962,16 +1968,34 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
boolean
error
=
false
;
if
(
paths
!=
null
)
{
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
)
{
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
();
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java
View file @
d69b5b3b
...
...
@@ -567,6 +567,7 @@ public class ActionBarLayout extends FrameLayout {
containerViewBack
.
addView
(
fragment
.
actionBar
);
fragment
.
actionBar
.
setTitleOverlayText
(
titleOverlayText
);
}
containerViewBack
.
addView
(
fragmentView
);
ViewGroup
.
LayoutParams
layoutParams
=
fragmentView
.
getLayoutParams
();
layoutParams
.
width
=
FrameLayout
.
LayoutParams
.
MATCH_PARENT
;
...
...
@@ -623,6 +624,7 @@ public class ActionBarLayout extends FrameLayout {
public
void
run
()
{
presentFragmentInternalRemoveOld
(
removeLast
,
currentFragment
);
fragment
.
onOpenAnimationEnd
();
ViewProxy
.
setTranslationX
(
containerView
,
0
);
}
};
currentAnimation
=
new
AnimatorSetProxy
();
...
...
TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarPopupWindow.java
View file @
d69b5b3b
...
...
@@ -18,6 +18,8 @@ import android.view.ViewTreeObserver;
import
android.widget.LinearLayout
;
import
android.widget.PopupWindow
;
import
org.telegram.messenger.FileLog
;
import
java.lang.reflect.Field
;
public
class
ActionBarPopupWindow
extends
PopupWindow
{
...
...
@@ -157,8 +159,12 @@ public class ActionBarPopupWindow extends PopupWindow {
@Override
public
void
showAsDropDown
(
View
anchor
,
int
xoff
,
int
yoff
)
{
super
.
showAsDropDown
(
anchor
,
xoff
,
yoff
);
registerListener
(
anchor
);
try
{
super
.
showAsDropDown
(
anchor
,
xoff
,
yoff
);
registerListener
(
anchor
);
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
}
@Override
...
...
TMessagesProj/src/main/java/org/telegram/ui/BlockedUsersActivity.java
View file @
d69b5b3b
...
...
@@ -290,7 +290,9 @@ public class BlockedUsersActivity extends BaseFragment implements NotificationCe
view
=
new
UserCell
(
mContext
,
1
);
}
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
)
{
if
(
view
==
null
)
{
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 {
}
}
nameWidth
=
Math
.
max
(
AndroidUtilities
.
dp
(
12
),
nameWidth
);
CharSequence
nameStringFinal
=
TextUtils
.
ellipsize
(
nameString
.
replace
(
"\n"
,
" "
),
currentNamePaint
,
nameWidth
-
AndroidUtilities
.
dp
(
12
),
TextUtils
.
TruncateAt
.
END
);
try
{
nameLayout
=
new
StaticLayout
(
nameStringFinal
,
currentNamePaint
,
nameWidth
,
Layout
.
Alignment
.
ALIGN_NORMAL
,
1.0f
,
0.0f
,
false
);
...
...
@@ -510,9 +511,13 @@ public class DialogCell extends BaseCell {
}
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
);
messageLayout
=
new
StaticLayout
(
messageStringFinal
,
currentMessagePaint
,
messageWidth
,
Layout
.
Alignment
.
ALIGN_NORMAL
,
1.0f
,
0.0f
,
false
);
try
{
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
;
float
left
=
0
;
...
...
@@ -526,7 +531,7 @@ public class DialogCell extends BaseCell {
}
}
}
if
(
messageLayout
.
getLineCount
()
>
0
)
{
if
(
messageLayout
!=
null
&&
messageLayout
.
getLineCount
()
>
0
)
{
left
=
messageLayout
.
getLineLeft
(
0
);
if
(
left
==
0
)
{
widthpx
=
Math
.
ceil
(
messageLayout
.
getLineWidth
(
0
));
...
...
@@ -545,7 +550,7 @@ public class DialogCell extends BaseCell {
}
}
}
if
(
messageLayout
.
getLineCount
()
>
0
)
{
if
(
messageLayout
!=
null
&&
messageLayout
.
getLineCount
()
>
0
)
{
left
=
messageLayout
.
getLineRight
(
0
);
if
(
left
==
messageWidth
)
{
widthpx
=
Math
.
ceil
(
messageLayout
.
getLineWidth
(
0
));
...
...
@@ -677,10 +682,12 @@ public class DialogCell extends BaseCell {
timeLayout
.
draw
(
canvas
);
canvas
.
restore
();
canvas
.
save
();
canvas
.
translate
(
messageLeft
,
messageTop
);
messageLayout
.
draw
(
canvas
);
canvas
.
restore
();
if
(
messageLayout
!=
null
)
{
canvas
.
save
();
canvas
.
translate
(
messageLeft
,
messageTop
);
messageLayout
.
draw
(
canvas
);
canvas
.
restore
();
}
if
(
drawClock
)
{
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
if
(
Intent
.
ACTION_SEND
.
equals
(
intent
.
getAction
()))
{
boolean
error
=
false
;
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
subject
=
intent
.
getStringExtra
(
Intent
.
EXTRA_SUBJECT
);
...
...
@@ -950,6 +950,9 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
@SuppressWarnings
(
"unchecked"
)
public
void
didReceivedNotification
(
int
id
,
Object
...
args
)
{
if
(
id
==
NotificationCenter
.
appDidLogout
)
{
if
(
drawerLayoutAdapter
!=
null
)
{
drawerLayoutAdapter
.
notifyDataSetChanged
();
}
for
(
BaseFragment
fragment
:
actionBarLayout
.
fragmentsStack
)
{
fragment
.
onFragmentDestroy
();
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java
View file @
d69b5b3b
...
...
@@ -778,23 +778,27 @@ public class LoginActivity extends BaseFragment {
private
void
updatePhoneField
()
{
ignoreOnPhoneChange
=
true
;
String
codeText
=
codeField
.
getText
().
toString
();
String
phone
=
PhoneFormat
.
getInstance
().
format
(
"+"
+
codeText
+
phoneField
.
getText
().
toString
());
int
idx
=
phone
.
indexOf
(
" "
);
if
(
idx
!=
-
1
)
{
String
resultCode
=
PhoneFormat
.
stripExceptNumbers
(
phone
.
substring
(
0
,
idx
));
if
(!
codeText
.
equals
(
resultCode
))
{
phone
=
PhoneFormat
.
getInstance
().
format
(
phoneField
.
getText
().
toString
()).
trim
();
phoneField
.
setText
(
phone
);
int
len
=
phoneField
.
length
();
phoneField
.
setSelection
(
phoneField
.
length
());
try
{
String
codeText
=
codeField
.
getText
().
toString
();
String
phone
=
PhoneFormat
.
getInstance
().
format
(
"+"
+
codeText
+
phoneField
.
getText
().
toString
());
int
idx
=
phone
.
indexOf
(
" "
);
if
(
idx
!=
-
1
)
{
String
resultCode
=
PhoneFormat
.
stripExceptNumbers
(
phone
.
substring
(
0
,
idx
));
if
(!
codeText
.
equals
(
resultCode
))
{
phone
=
PhoneFormat
.
getInstance
().
format
(
phoneField
.
getText
().
toString
()).
trim
();
phoneField
.
setText
(
phone
);
int
len
=
phoneField
.
length
();
phoneField
.
setSelection
(
phoneField
.
length
());
}
else
{
phoneField
.
setText
(
phone
.
substring
(
idx
).
trim
());
int
len
=
phoneField
.
length
();
phoneField
.
setSelection
(
phoneField
.
length
());
}
}
else
{
phoneField
.
setText
(
phone
.
substring
(
idx
).
trim
());
int
len
=
phoneField
.
length
();
phoneField
.
setSelection
(
phoneField
.
length
());
}
}
else
{
phoneField
.
setSelection
(
phoneField
.
length
()
);
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
ignoreOnPhoneChange
=
false
;
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java
View file @
d69b5b3b
...
...
@@ -22,6 +22,7 @@ import android.view.ViewTreeObserver;
import
android.view.animation.AccelerateDecelerateInterpolator
;
import
android.widget.AbsListView
;
import
android.widget.AdapterView
;
import
android.widget.BaseAdapter
;
import
android.widget.CheckBox
;
import
android.widget.EditText
;
import
android.widget.FrameLayout
;
...
...
@@ -32,6 +33,7 @@ import android.widget.TextView;
import
org.telegram.android.AndroidUtilities
;
import
org.telegram.android.LocaleController
;
import
org.telegram.android.MessageObject
;
import
org.telegram.messenger.FileLog
;
import
org.telegram.messenger.TLRPC
;
import
org.telegram.android.ContactsController
;
import
org.telegram.android.MessagesController
;
...
...
@@ -537,19 +539,26 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
dialogsSearchAdapter
.
notifyDataSetChanged
();
}
if
(
messagesListView
!=
null
)
{
if
(
MessagesController
.
getInstance
().
loadingDialogs
&&
MessagesController
.
getInstance
().
dialogs
.
isEmpty
())
{
searchEmptyView
.
setVisibility
(
View
.
GONE
);
emptyView
.
setVisibility
(
View
.
GONE
);
messagesListView
.
setEmptyView
(
progressView
);
}
else
{
if
(
searching
&&
searchWas
)
{
messagesListView
.
setEmptyView
(
searchEmptyView
);
try
{
if
(
messagesListView
.
getAdapter
()
!=
null
&&
messagesListView
.
getAdapter
()
instanceof
BaseAdapter
)
{
((
BaseAdapter
)
messagesListView
.
getAdapter
()).
notifyDataSetChanged
();
}
if
(
MessagesController
.
getInstance
().
loadingDialogs
&&
MessagesController
.
getInstance
().
dialogs
.
isEmpty
())
{
searchEmptyView
.
setVisibility
(
View
.
GONE
);
emptyView
.
setVisibility
(
View
.
GONE
);
messagesListView
.
setEmptyView
(
progressView
);
}
else
{
messagesListView
.
setEmptyView
(
emptyView
);
searchEmptyView
.
setVisibility
(
View
.
GONE
);
if
(
searching
&&
searchWas
)
{
messagesListView
.
setEmptyView
(
searchEmptyView
);
emptyView
.
setVisibility
(
View
.
GONE
);
}
else
{
messagesListView
.
setEmptyView
(
emptyView
);
searchEmptyView
.
setVisibility
(
View
.
GONE
);
}
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
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/PhotoCropActivity.java
View file @
d69b5b3b
...
...
@@ -242,12 +242,12 @@ public class PhotoCropActivity extends BaseFragment {
}
try
{
return
Bitmap
.
createBitmap
(
imageToCrop
,
x
,
y
,
size
,
size
);
}
catch
(
Exception
e
)
{
}
catch
(
Throwable
e
)
{
FileLog
.
e
(
"tmessags"
,
e
);
System
.
gc
();
try
{
return
Bitmap
.
createBitmap
(
imageToCrop
,
x
,
y
,
size
,
size
);
}
catch
(
Exception
e2
)
{
}
catch
(
Throwable
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
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
{
if
(
windowView
.
getParent
()
!=
null
)
{
WindowManager
wm
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
...
...
@@ -1596,9 +1588,24 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
FileLog
.
e
(
"tmessages"
,
e
);
}
placeProvider
=
provider
;
WindowManager
wm
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
wm
.
addView
(
windowView
,
windowLayoutParams
);
try
{
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
)
{
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
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"Notifications"
,
Activity
.
MODE_PRIVATE
);
SharedPreferences
.
Editor
editor
=
preferences
.
edit
();
editor
.
clear
().
commit
();
NotificationCenter
.
getInstance
().
postNotificationName
(
NotificationCenter
.
appDidLogout
);
MessagesController
.
getInstance
().
unregistedPush
();
MessagesController
.
getInstance
().
logOut
();
UserConfig
.
clearConfig
();
NotificationCenter
.
getInstance
().
postNotificationName
(
NotificationCenter
.
appDidLogout
);
MessagesStorage
.
getInstance
().
cleanUp
(
false
);
MessagesController
.
getInstance
().
cleanUp
();
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
emojiPopup
.
setWidth
(
View
.
MeasureSpec
.
makeMeasureSpec
(
AndroidUtilities
.
displaySize
.
x
,
View
.
MeasureSpec
.
EXACTLY
));
}
emojiPopup
.
showAtLocation
(
parentActivity
.
getWindow
().
getDecorView
(),
Gravity
.
BOTTOM
|
Gravity
.
LEFT
,
0
,
0
);
try
{
emojiPopup
.
showAtLocation
(
parentActivity
.
getWindow
().
getDecorView
(),
Gravity
.
BOTTOM
|
Gravity
.
LEFT
,
0
,
0
);
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
if
(!
keyboardVisible
)
{
if
(
sizeNotifierRelativeLayout
!=
null
)
{
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