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
98a0a67c
Commit
98a0a67c
authored
Oct 11, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stability improvements
parent
ad863779
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
98 additions
and
78 deletions
+98
-78
build.gradle
TMessagesProj/build.gradle
+1
-1
AndroidUtilities.java
.../src/main/java/org/telegram/android/AndroidUtilities.java
+32
-0
MessagesStorage.java
...j/src/main/java/org/telegram/android/MessagesStorage.java
+11
-2
SendMessagesHelper.java
...rc/main/java/org/telegram/android/SendMessagesHelper.java
+10
-10
VideoEncodingService.java
.../main/java/org/telegram/android/VideoEncodingService.java
+1
-1
Utilities.java
...sProj/src/main/java/org/telegram/messenger/Utilities.java
+0
-31
ChatActivity.java
...sagesProj/src/main/java/org/telegram/ui/ChatActivity.java
+26
-24
MediaActivity.java
...agesProj/src/main/java/org/telegram/ui/MediaActivity.java
+1
-1
PhotoPickerActivity.java
...oj/src/main/java/org/telegram/ui/PhotoPickerActivity.java
+1
-1
ActionBarLayer.java
.../java/org/telegram/ui/Views/ActionBar/ActionBarLayer.java
+2
-2
BaseFragment.java
...in/java/org/telegram/ui/Views/ActionBar/BaseFragment.java
+5
-1
LayoutListView.java
...j/src/main/java/org/telegram/ui/Views/LayoutListView.java
+1
-1
VideoTimelineView.java
...rc/main/java/org/telegram/ui/Views/VideoTimelineView.java
+7
-3
No files found.
TMessagesProj/build.gradle
View file @
98a0a67c
...
@@ -19,7 +19,7 @@ tasks.withType(JavaCompile) {
...
@@ -19,7 +19,7 @@ tasks.withType(JavaCompile) {
dependencies
{
dependencies
{
compile
'com.android.support:support-v4:20.0.+'
compile
'com.android.support:support-v4:20.0.+'
compile
'com.google.android.gms:play-services:3.2.+'
compile
'com.google.android.gms:play-services:3.2.+'
compile
'net.hockeyapp.android:HockeySDK:3.0.
1
'
compile
'net.hockeyapp.android:HockeySDK:3.0.
2
'
compile
'com.googlecode.mp4parser:isoparser:1.0.+'
compile
'com.googlecode.mp4parser:isoparser:1.0.+'
}
}
...
...
TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java
View file @
98a0a67c
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
package
org
.
telegram
.
android
;
package
org
.
telegram
.
android
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.app.ProgressDialog
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.pm.ActivityInfo
;
import
android.content.pm.ActivityInfo
;
import
android.content.res.Configuration
;
import
android.content.res.Configuration
;
...
@@ -32,6 +33,9 @@ import java.util.Hashtable;
...
@@ -32,6 +33,9 @@ import java.util.Hashtable;
import
java.util.Locale
;
import
java.util.Locale
;
public
class
AndroidUtilities
{
public
class
AndroidUtilities
{
public
static
ProgressDialog
progressDialog
;
private
static
final
Hashtable
<
String
,
Typeface
>
typefaceCache
=
new
Hashtable
<
String
,
Typeface
>();
private
static
final
Hashtable
<
String
,
Typeface
>
typefaceCache
=
new
Hashtable
<
String
,
Typeface
>();
private
static
int
prevOrientation
=
-
10
;
private
static
int
prevOrientation
=
-
10
;
private
static
boolean
waitingForSms
=
false
;
private
static
boolean
waitingForSms
=
false
;
...
@@ -371,4 +375,32 @@ public class AndroidUtilities {
...
@@ -371,4 +375,32 @@ public class AndroidUtilities {
}
}
return
photoSize
;
return
photoSize
;
}
}
public
static
void
ShowProgressDialog
(
final
Activity
activity
,
final
String
message
)
{
activity
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
activity
!=
null
&&
!
activity
.
isFinishing
())
{
progressDialog
=
new
ProgressDialog
(
activity
);
if
(
message
!=
null
)
{
progressDialog
.
setMessage
(
message
);
}
progressDialog
.
setCanceledOnTouchOutside
(
false
);
progressDialog
.
setCancelable
(
false
);
progressDialog
.
show
();
}
}
});
}
public
static
void
HideProgressDialog
()
{
RunOnUIThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
progressDialog
!=
null
)
{
progressDialog
.
dismiss
();
}
}
});
}
}
}
TMessagesProj/src/main/java/org/telegram/android/MessagesStorage.java
View file @
98a0a67c
...
@@ -183,7 +183,8 @@ public class MessagesStorage {
...
@@ -183,7 +183,8 @@ public class MessagesStorage {
@Override
@Override
public
void
run
()
{
public
void
run
()
{
try
{
try
{
if
(
currentVersion
<
4
)
{
int
version
=
currentVersion
;
if
(
version
<
4
)
{
database
.
executeFast
(
"CREATE TABLE IF NOT EXISTS user_photos(uid INTEGER, id INTEGER, data BLOB, PRIMARY KEY (uid, id))"
).
stepThis
().
dispose
();
database
.
executeFast
(
"CREATE TABLE IF NOT EXISTS user_photos(uid INTEGER, id INTEGER, data BLOB, PRIMARY KEY (uid, id))"
).
stepThis
().
dispose
();
database
.
executeFast
(
"CREATE INDEX IF NOT EXISTS mid_idx_media ON media(mid);"
).
stepThis
().
dispose
();
database
.
executeFast
(
"CREATE INDEX IF NOT EXISTS mid_idx_media ON media(mid);"
).
stepThis
().
dispose
();
...
@@ -254,8 +255,10 @@ public class MessagesStorage {
...
@@ -254,8 +255,10 @@ public class MessagesStorage {
}
}
}
}
});
});
database
.
executeFast
(
"PRAGMA user_version = 4"
).
stepThis
().
dispose
();
version
=
4
;
}
}
if
(
currentV
ersion
<
6
)
{
if
(
version
==
4
&&
v
ersion
<
6
)
{
database
.
executeFast
(
"CREATE TABLE IF NOT EXISTS enc_tasks_v2(mid INTEGER PRIMARY KEY, date INTEGER)"
).
stepThis
().
dispose
();
database
.
executeFast
(
"CREATE TABLE IF NOT EXISTS enc_tasks_v2(mid INTEGER PRIMARY KEY, date INTEGER)"
).
stepThis
().
dispose
();
database
.
executeFast
(
"CREATE INDEX IF NOT EXISTS date_idx_enc_tasks_v2 ON enc_tasks_v2(date);"
).
stepThis
().
dispose
();
database
.
executeFast
(
"CREATE INDEX IF NOT EXISTS date_idx_enc_tasks_v2 ON enc_tasks_v2(date);"
).
stepThis
().
dispose
();
database
.
beginTransaction
();
database
.
beginTransaction
();
...
@@ -284,6 +287,12 @@ public class MessagesStorage {
...
@@ -284,6 +287,12 @@ public class MessagesStorage {
database
.
executeFast
(
"ALTER TABLE messages ADD COLUMN media INTEGER default 0"
).
stepThis
().
dispose
();
database
.
executeFast
(
"ALTER TABLE messages ADD COLUMN media INTEGER default 0"
).
stepThis
().
dispose
();
database
.
executeFast
(
"PRAGMA user_version = 6"
).
stepThis
().
dispose
();
database
.
executeFast
(
"PRAGMA user_version = 6"
).
stepThis
().
dispose
();
version
=
6
;
}
if
(
version
==
6
&&
version
<
7
)
{
database
.
executeFast
(
"ALTER TABLE enc_chats ADD COLUMN layer INTEGER default 0"
).
stepThis
().
dispose
();
database
.
executeFast
(
"PRAGMA user_version = 6"
).
stepThis
().
dispose
();
version
=
7
;
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
FileLog
.
e
(
"tmessages"
,
e
);
...
...
TMessagesProj/src/main/java/org/telegram/android/SendMessagesHelper.java
View file @
98a0a67c
...
@@ -326,23 +326,23 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
...
@@ -326,23 +326,23 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
}
}
public
void
sendMessage
(
TLRPC
.
User
user
,
long
peer
)
{
public
void
sendMessage
(
TLRPC
.
User
user
,
long
peer
)
{
sendMessage
(
null
,
0
,
0
,
null
,
null
,
null
,
user
,
null
,
null
,
null
,
peer
,
false
,
null
);
sendMessage
(
null
,
null
,
null
,
null
,
null
,
null
,
user
,
null
,
null
,
null
,
peer
,
false
,
null
);
}
}
public
void
sendMessage
(
MessageObject
message
)
{
public
void
sendMessage
(
MessageObject
message
)
{
sendMessage
(
null
,
0
,
0
,
null
,
null
,
message
,
null
,
null
,
null
,
null
,
message
.
getDialogId
(),
true
,
message
.
messageOwner
.
attachPath
);
sendMessage
(
null
,
null
,
null
,
null
,
null
,
message
,
null
,
null
,
null
,
null
,
message
.
getDialogId
(),
true
,
message
.
messageOwner
.
attachPath
);
}
}
public
void
sendMessage
(
MessageObject
message
,
long
peer
)
{
public
void
sendMessage
(
MessageObject
message
,
long
peer
)
{
sendMessage
(
null
,
0
,
0
,
null
,
null
,
message
,
null
,
null
,
null
,
null
,
peer
,
false
,
message
.
messageOwner
.
attachPath
);
sendMessage
(
null
,
null
,
null
,
null
,
null
,
message
,
null
,
null
,
null
,
null
,
peer
,
false
,
message
.
messageOwner
.
attachPath
);
}
}
public
void
sendMessage
(
TLRPC
.
TL_document
document
,
String
originalPath
,
String
path
,
long
peer
)
{
public
void
sendMessage
(
TLRPC
.
TL_document
document
,
String
originalPath
,
String
path
,
long
peer
)
{
sendMessage
(
null
,
0
,
0
,
null
,
null
,
null
,
null
,
document
,
null
,
originalPath
,
peer
,
false
,
path
);
sendMessage
(
null
,
null
,
null
,
null
,
null
,
null
,
null
,
document
,
null
,
originalPath
,
peer
,
false
,
path
);
}
}
public
void
sendMessage
(
String
message
,
long
peer
)
{
public
void
sendMessage
(
String
message
,
long
peer
)
{
sendMessage
(
message
,
0
,
0
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
peer
,
false
,
null
);
sendMessage
(
message
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
peer
,
false
,
null
);
}
}
public
void
sendMessage
(
double
lat
,
double
lon
,
long
peer
)
{
public
void
sendMessage
(
double
lat
,
double
lon
,
long
peer
)
{
...
@@ -350,18 +350,18 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
...
@@ -350,18 +350,18 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
}
}
public
void
sendMessage
(
TLRPC
.
TL_photo
photo
,
String
originalPath
,
long
peer
)
{
public
void
sendMessage
(
TLRPC
.
TL_photo
photo
,
String
originalPath
,
long
peer
)
{
sendMessage
(
null
,
0
,
0
,
photo
,
null
,
null
,
null
,
null
,
null
,
originalPath
,
peer
,
false
,
null
);
sendMessage
(
null
,
null
,
null
,
photo
,
null
,
null
,
null
,
null
,
null
,
originalPath
,
peer
,
false
,
null
);
}
}
public
void
sendMessage
(
TLRPC
.
TL_video
video
,
String
originalPath
,
String
path
,
long
peer
)
{
public
void
sendMessage
(
TLRPC
.
TL_video
video
,
String
originalPath
,
String
path
,
long
peer
)
{
sendMessage
(
null
,
0
,
0
,
null
,
video
,
null
,
null
,
null
,
null
,
originalPath
,
peer
,
false
,
path
);
sendMessage
(
null
,
null
,
null
,
null
,
video
,
null
,
null
,
null
,
null
,
originalPath
,
peer
,
false
,
path
);
}
}
public
void
sendMessage
(
TLRPC
.
TL_audio
audio
,
String
path
,
long
peer
)
{
public
void
sendMessage
(
TLRPC
.
TL_audio
audio
,
String
path
,
long
peer
)
{
sendMessage
(
null
,
0
,
0
,
null
,
null
,
null
,
null
,
null
,
audio
,
null
,
peer
,
false
,
path
);
sendMessage
(
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
audio
,
null
,
peer
,
false
,
path
);
}
}
private
int
sendMessage
(
String
message
,
double
lat
,
d
ouble
lon
,
TLRPC
.
TL_photo
photo
,
TLRPC
.
TL_video
video
,
MessageObject
msgObj
,
TLRPC
.
User
user
,
TLRPC
.
TL_document
document
,
TLRPC
.
TL_audio
audio
,
String
originalPath
,
long
peer
,
boolean
retry
,
String
path
)
{
private
int
sendMessage
(
String
message
,
Double
lat
,
D
ouble
lon
,
TLRPC
.
TL_photo
photo
,
TLRPC
.
TL_video
video
,
MessageObject
msgObj
,
TLRPC
.
User
user
,
TLRPC
.
TL_document
document
,
TLRPC
.
TL_audio
audio
,
String
originalPath
,
long
peer
,
boolean
retry
,
String
path
)
{
TLRPC
.
Message
newMsg
=
null
;
TLRPC
.
Message
newMsg
=
null
;
int
type
=
-
1
;
int
type
=
-
1
;
int
lower_id
=
(
int
)
peer
;
int
lower_id
=
(
int
)
peer
;
...
@@ -420,7 +420,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
...
@@ -420,7 +420,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
newMsg
.
media
=
new
TLRPC
.
TL_messageMediaEmpty
();
newMsg
.
media
=
new
TLRPC
.
TL_messageMediaEmpty
();
type
=
0
;
type
=
0
;
newMsg
.
message
=
message
;
newMsg
.
message
=
message
;
}
else
if
(
lat
!=
0
&&
lon
!=
0
)
{
}
else
if
(
lat
!=
null
&&
lon
!=
null
)
{
if
(
lower_id
!=
0
)
{
if
(
lower_id
!=
0
)
{
newMsg
=
new
TLRPC
.
TL_message
();
newMsg
=
new
TLRPC
.
TL_message
();
}
else
{
}
else
{
...
...
TMessagesProj/src/main/java/org/telegram/android/VideoEncodingService.java
View file @
98a0a67c
...
@@ -45,7 +45,7 @@ public class VideoEncodingService extends Service implements NotificationCenter.
...
@@ -45,7 +45,7 @@ public class VideoEncodingService extends Service implements NotificationCenter.
public
void
didReceivedNotification
(
int
id
,
Object
...
args
)
{
public
void
didReceivedNotification
(
int
id
,
Object
...
args
)
{
if
(
id
==
NotificationCenter
.
FileUploadProgressChanged
)
{
if
(
id
==
NotificationCenter
.
FileUploadProgressChanged
)
{
String
fileName
=
(
String
)
args
[
0
];
String
fileName
=
(
String
)
args
[
0
];
if
(
path
.
equals
(
fileName
))
{
if
(
path
!=
null
&&
path
.
equals
(
fileName
))
{
Float
progress
=
(
Float
)
args
[
1
];
Float
progress
=
(
Float
)
args
[
1
];
Boolean
enc
=
(
Boolean
)
args
[
2
];
Boolean
enc
=
(
Boolean
)
args
[
2
];
currentProgress
=
(
int
)(
progress
*
100
);
currentProgress
=
(
int
)(
progress
*
100
);
...
...
TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java
View file @
98a0a67c
...
@@ -9,7 +9,6 @@
...
@@ -9,7 +9,6 @@
package
org
.
telegram
.
messenger
;
package
org
.
telegram
.
messenger
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.app.ProgressDialog
;
import
android.content.ContentUris
;
import
android.content.ContentUris
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
...
@@ -73,8 +72,6 @@ public class Utilities {
...
@@ -73,8 +72,6 @@ public class Utilities {
final
protected
static
char
[]
hexArray
=
"0123456789ABCDEF"
.
toCharArray
();
final
protected
static
char
[]
hexArray
=
"0123456789ABCDEF"
.
toCharArray
();
public
static
ProgressDialog
progressDialog
;
static
{
static
{
try
{
try
{
File
URANDOM_FILE
=
new
File
(
"/dev/urandom"
);
File
URANDOM_FILE
=
new
File
(
"/dev/urandom"
);
...
@@ -426,34 +423,6 @@ public class Utilities {
...
@@ -426,34 +423,6 @@ public class Utilities {
return
packedData
;
return
packedData
;
}
}
public
static
void
ShowProgressDialog
(
final
Activity
activity
,
final
String
message
)
{
activity
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(!
activity
.
isFinishing
())
{
progressDialog
=
new
ProgressDialog
(
activity
);
if
(
message
!=
null
)
{
progressDialog
.
setMessage
(
message
);
}
progressDialog
.
setCanceledOnTouchOutside
(
false
);
progressDialog
.
setCancelable
(
false
);
progressDialog
.
show
();
}
}
});
}
public
static
void
HideProgressDialog
(
Activity
activity
)
{
activity
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
progressDialog
!=
null
)
{
progressDialog
.
dismiss
();
}
}
});
}
public
static
boolean
copyFile
(
InputStream
sourceFile
,
File
destFile
)
throws
IOException
{
public
static
boolean
copyFile
(
InputStream
sourceFile
,
File
destFile
)
throws
IOException
{
OutputStream
out
=
new
FileOutputStream
(
destFile
);
OutputStream
out
=
new
FileOutputStream
(
destFile
);
byte
[]
buf
=
new
byte
[
4096
];
byte
[]
buf
=
new
byte
[
4096
];
...
...
TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
View file @
98a0a67c
...
@@ -834,35 +834,37 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
...
@@ -834,35 +834,37 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
chatListView
.
setOnTouchListener
(
new
View
.
OnTouchListener
()
{
chatListView
.
setOnTouchListener
(
new
View
.
OnTouchListener
()
{
@Override
@Override
public
boolean
onTouch
(
View
v
,
MotionEvent
event
)
{
public
boolean
onTouch
(
View
v
,
MotionEvent
event
)
{
if
(
event
.
getAction
()
==
MotionEvent
.
ACTION_UP
||
event
.
getAction
()
==
MotionEvent
.
ACTION_CANCEL
||
event
.
getAction
()
==
MotionEvent
.
ACTION_POINTER_UP
)
{
if
(
openSecretPhotoRunnable
!=
null
||
SecretPhotoViewer
.
getInstance
().
isVisible
())
{
if
(
openSecretPhotoRunnable
!=
null
)
{
if
(
event
.
getAction
()
==
MotionEvent
.
ACTION_UP
||
event
.
getAction
()
==
MotionEvent
.
ACTION_CANCEL
||
event
.
getAction
()
==
MotionEvent
.
ACTION_POINTER_UP
)
{
AndroidUtilities
.
CancelRunOnUIThread
(
openSecretPhotoRunnable
);
if
(
openSecretPhotoRunnable
!=
null
)
{
openSecretPhotoRunnable
=
null
;
AndroidUtilities
.
CancelRunOnUIThread
(
openSecretPhotoRunnable
);
}
else
{
openSecretPhotoRunnable
=
null
;
}
else
{
if
(
SecretPhotoViewer
.
getInstance
().
isVisible
())
{
AndroidUtilities
.
RunOnUIThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
chatListView
.
setOnItemLongClickListener
(
onItemLongClickListener
);
chatListView
.
setOnItemClickListener
(
onItemClickListener
);
chatListView
.
setLongClickable
(
true
);
}
});
SecretPhotoViewer
.
getInstance
().
closePhoto
();
}
}
}
else
if
(
event
.
getAction
()
!=
MotionEvent
.
ACTION_DOWN
)
{
if
(
SecretPhotoViewer
.
getInstance
().
isVisible
())
{
if
(
SecretPhotoViewer
.
getInstance
().
isVisible
())
{
AndroidUtilities
.
RunOnUIThread
(
new
Runnable
()
{
return
true
;
@Override
}
else
if
(
openSecretPhotoRunnable
!=
null
)
{
public
void
run
(
)
{
if
(
event
.
getAction
()
==
MotionEvent
.
ACTION_MOVE
)
{
chatListView
.
setOnItemLongClickListener
(
onItemLongClickListener
);
if
(
Math
.
hypot
(
startX
-
event
.
getX
(),
startY
-
event
.
getY
())
>
AndroidUtilities
.
dp
(
5
))
{
chatListView
.
setOnItemClickListener
(
onItemClickListener
);
AndroidUtilities
.
CancelRunOnUIThread
(
openSecretPhotoRunnable
);
chatListView
.
setLongClickable
(
true
)
;
openSecretPhotoRunnable
=
null
;
}
}
});
}
else
{
SecretPhotoViewer
.
getInstance
().
closePhoto
();
}
}
}
else
if
(
event
.
getAction
()
!=
MotionEvent
.
ACTION_DOWN
)
{
if
(
SecretPhotoViewer
.
getInstance
().
isVisible
())
{
return
true
;
}
else
if
(
openSecretPhotoRunnable
!=
null
)
{
if
(
event
.
getAction
()
==
MotionEvent
.
ACTION_MOVE
)
{
if
(
Math
.
hypot
(
startX
-
event
.
getX
(),
startY
-
event
.
getY
())
>
AndroidUtilities
.
dp
(
5
))
{
AndroidUtilities
.
CancelRunOnUIThread
(
openSecretPhotoRunnable
);
AndroidUtilities
.
CancelRunOnUIThread
(
openSecretPhotoRunnable
);
openSecretPhotoRunnable
=
null
;
openSecretPhotoRunnable
=
null
;
}
}
}
else
{
AndroidUtilities
.
CancelRunOnUIThread
(
openSecretPhotoRunnable
);
openSecretPhotoRunnable
=
null
;
}
}
}
}
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java
View file @
98a0a67c
...
@@ -94,7 +94,7 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No
...
@@ -94,7 +94,7 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No
@Override
@Override
public
void
onItemClick
(
int
id
)
{
public
void
onItemClick
(
int
id
)
{
if
(
id
==
-
1
)
{
if
(
id
==
-
1
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
11
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
11
&&
listView
!=
null
)
{
listView
.
setAdapter
(
null
);
listView
.
setAdapter
(
null
);
listView
=
null
;
listView
=
null
;
listAdapter
=
null
;
listAdapter
=
null
;
...
...
TMessagesProj/src/main/java/org/telegram/ui/PhotoPickerActivity.java
View file @
98a0a67c
...
@@ -341,7 +341,7 @@ public class PhotoPickerActivity extends BaseFragment implements NotificationCen
...
@@ -341,7 +341,7 @@ public class PhotoPickerActivity extends BaseFragment implements NotificationCen
@Override
@Override
public
void
sendButtonPressed
(
int
index
)
{
public
void
sendButtonPressed
(
int
index
)
{
if
(
selectedPhotos
.
isEmpty
())
{
if
(
selectedPhotos
.
isEmpty
())
{
if
(
index
<
0
||
index
>=
selectedAlbum
.
photos
.
size
())
{
if
(
selectedAlbum
==
null
||
index
<
0
||
index
>=
selectedAlbum
.
photos
.
size
())
{
return
;
return
;
}
}
MediaController
.
PhotoEntry
photoEntry
=
selectedAlbum
.
photos
.
get
(
index
);
MediaController
.
PhotoEntry
photoEntry
=
selectedAlbum
.
photos
.
get
(
index
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarLayer.java
View file @
98a0a67c
...
@@ -171,9 +171,9 @@ public class ActionBarLayer extends FrameLayout {
...
@@ -171,9 +171,9 @@ public class ActionBarLayer extends FrameLayout {
x
=
AndroidUtilities
.
dp
(
16
+
leftMargin
);
x
=
AndroidUtilities
.
dp
(
16
+
leftMargin
);
}
else
{
}
else
{
if
(!
AndroidUtilities
.
isTablet
()
&&
getResources
().
getConfiguration
().
orientation
==
Configuration
.
ORIENTATION_LANDSCAPE
)
{
if
(!
AndroidUtilities
.
isTablet
()
&&
getResources
().
getConfiguration
().
orientation
==
Configuration
.
ORIENTATION_LANDSCAPE
)
{
x
=
AndroidUtilities
.
dp
(
22
+
leftMargin
)
+
(
int
)(
logoImageView
.
getDrawable
().
getIntrinsicWidth
()
/
1.3f
);
x
=
AndroidUtilities
.
dp
(
22
+
leftMargin
)
+
(
logoImageView
.
getDrawable
()
!=
null
?
(
int
)(
logoImageView
.
getDrawable
().
getIntrinsicWidth
()
/
1.3f
)
:
0
);
}
else
{
}
else
{
x
=
AndroidUtilities
.
dp
(
22
+
leftMargin
)
+
logoImageView
.
getDrawable
().
getIntrinsicWidth
(
);
x
=
AndroidUtilities
.
dp
(
22
+
leftMargin
)
+
(
logoImageView
.
getDrawable
()
!=
null
?
logoImageView
.
getDrawable
().
getIntrinsicWidth
()
:
0
);
}
}
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/BaseFragment.java
View file @
98a0a67c
...
@@ -54,7 +54,11 @@ public class BaseFragment {
...
@@ -54,7 +54,11 @@ public class BaseFragment {
if
(
fragmentView
!=
null
)
{
if
(
fragmentView
!=
null
)
{
ViewGroup
parent
=
(
ViewGroup
)
fragmentView
.
getParent
();
ViewGroup
parent
=
(
ViewGroup
)
fragmentView
.
getParent
();
if
(
parent
!=
null
)
{
if
(
parent
!=
null
)
{
parent
.
removeView
(
fragmentView
);
try
{
parent
.
removeView
(
fragmentView
);
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
}
}
fragmentView
=
null
;
fragmentView
=
null
;
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/LayoutListView.java
View file @
98a0a67c
...
@@ -42,7 +42,7 @@ public class LayoutListView extends ListView {
...
@@ -42,7 +42,7 @@ public class LayoutListView extends ListView {
@Override
@Override
public
boolean
onInterceptTouchEvent
(
MotionEvent
ev
)
{
public
boolean
onInterceptTouchEvent
(
MotionEvent
ev
)
{
if
(
onInterceptTouchEventListener
!=
null
)
{
if
(
onInterceptTouchEventListener
!=
null
)
{
return
onInterceptTouchEventListener
.
onInterceptTouchEvent
(
ev
);
return
onInterceptTouchEventListener
.
onInterceptTouchEvent
(
ev
)
||
super
.
onInterceptTouchEvent
(
ev
)
;
}
}
return
super
.
onInterceptTouchEvent
(
ev
);
return
super
.
onInterceptTouchEvent
(
ev
);
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/VideoTimelineView.java
View file @
98a0a67c
...
@@ -153,9 +153,13 @@ public class VideoTimelineView extends View {
...
@@ -153,9 +153,13 @@ public class VideoTimelineView extends View {
public
void
setVideoPath
(
String
path
)
{
public
void
setVideoPath
(
String
path
)
{
mediaMetadataRetriever
=
new
MediaMetadataRetriever
();
mediaMetadataRetriever
=
new
MediaMetadataRetriever
();
mediaMetadataRetriever
.
setDataSource
(
path
);
try
{
String
duration
=
mediaMetadataRetriever
.
extractMetadata
(
MediaMetadataRetriever
.
METADATA_KEY_DURATION
);
mediaMetadataRetriever
.
setDataSource
(
path
);
videoLength
=
Long
.
parseLong
(
duration
);
String
duration
=
mediaMetadataRetriever
.
extractMetadata
(
MediaMetadataRetriever
.
METADATA_KEY_DURATION
);
videoLength
=
Long
.
parseLong
(
duration
);
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
}
}
public
void
setDelegate
(
VideoTimelineViewDelegate
delegate
)
{
public
void
setDelegate
(
VideoTimelineViewDelegate
delegate
)
{
...
...
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