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
9d2dfd33
Commit
9d2dfd33
authored
Dec 26, 2013
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update to 1.3.7
parent
51add404
Changes
32
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
168 additions
and
213 deletions
+168
-213
AndroidManifest.xml
TMessagesProj/src/main/AndroidManifest.xml
+2
-2
TLRPC.java
TMessagesProj/src/main/java/org/telegram/TL/TLRPC.java
+1
-1
ConnectionsManager.java
.../main/java/org/telegram/messenger/ConnectionsManager.java
+12
-0
Emoji.java
...sagesProj/src/main/java/org/telegram/messenger/Emoji.java
+5
-5
FileLoadOperation.java
...c/main/java/org/telegram/messenger/FileLoadOperation.java
+4
-4
FileLoader.java
...Proj/src/main/java/org/telegram/messenger/FileLoader.java
+0
-2
MessagesController.java
.../main/java/org/telegram/messenger/MessagesController.java
+14
-0
MessagesStorage.java
...src/main/java/org/telegram/messenger/MessagesStorage.java
+1
-0
Utilities.java
...sProj/src/main/java/org/telegram/messenger/Utilities.java
+6
-0
ApplicationActivity.java
...oj/src/main/java/org/telegram/ui/ApplicationActivity.java
+6
-8
ChatActivity.java
...sagesProj/src/main/java/org/telegram/ui/ChatActivity.java
+56
-60
ContactsActivity.java
...sProj/src/main/java/org/telegram/ui/ContactsActivity.java
+3
-5
CountrySelectActivity.java
.../src/main/java/org/telegram/ui/CountrySelectActivity.java
+3
-5
GalleryImageViewer.java
...roj/src/main/java/org/telegram/ui/GalleryImageViewer.java
+7
-9
IdenticonActivity.java
...Proj/src/main/java/org/telegram/ui/IdenticonActivity.java
+3
-3
IntroActivity.java
...agesProj/src/main/java/org/telegram/ui/IntroActivity.java
+1
-4
LocationActivity.java
...sProj/src/main/java/org/telegram/ui/LocationActivity.java
+9
-68
LoginActivity.java
...agesProj/src/main/java/org/telegram/ui/LoginActivity.java
+2
-2
LoginActivityPhoneView.java
...src/main/java/org/telegram/ui/LoginActivityPhoneView.java
+3
-0
MediaActivity.java
...agesProj/src/main/java/org/telegram/ui/MediaActivity.java
+4
-4
MessagesActivity.java
...sProj/src/main/java/org/telegram/ui/MessagesActivity.java
+4
-6
SettingsChangeNameActivity.java
...main/java/org/telegram/ui/SettingsChangeNameActivity.java
+1
-1
SettingsWallpapersActivity.java
...main/java/org/telegram/ui/SettingsWallpapersActivity.java
+5
-7
UserProfileActivity.java
...oj/src/main/java/org/telegram/ui/UserProfileActivity.java
+2
-2
MessageActionLayout.java
.../main/java/org/telegram/ui/Views/MessageActionLayout.java
+2
-2
MessageLayout.java
...oj/src/main/java/org/telegram/ui/Views/MessageLayout.java
+3
-4
NotificationView.java
...src/main/java/org/telegram/ui/Views/NotificationView.java
+9
-9
map_dot.png
TMessagesProj/src/main/res/drawable-hdpi/map_dot.png
+0
-0
map_dot.png
TMessagesProj/src/main/res/drawable-ldpi/map_dot.png
+0
-0
map_dot.png
TMessagesProj/src/main/res/drawable-mdpi/map_dot.png
+0
-0
map_dot.png
TMessagesProj/src/main/res/drawable-xhdpi/map_dot.png
+0
-0
map_dot.png
TMessagesProj/src/main/res/drawable-xxhdpi/map_dot.png
+0
-0
No files found.
TMessagesProj/src/main/AndroidManifest.xml
View file @
9d2dfd33
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"org.telegram.messenger"
package=
"org.telegram.messenger"
android:versionCode=
"1
29
"
android:versionCode=
"1
31
"
android:versionName=
"1.3.
6
"
>
android:versionName=
"1.3.
7
"
>
<supports-screens
android:anyDensity=
"true"
<supports-screens
android:anyDensity=
"true"
android:smallScreens=
"true"
android:smallScreens=
"true"
...
...
TMessagesProj/src/main/java/org/telegram/TL/TLRPC.java
View file @
9d2dfd33
...
@@ -8961,7 +8961,7 @@ public class TLRPC {
...
@@ -8961,7 +8961,7 @@ public class TLRPC {
}
}
}
}
public
static
class
TL_encryptedChat_old
extends
E
ncryptedChat
{
public
static
class
TL_encryptedChat_old
extends
TL_e
ncryptedChat
{
public
static
int
constructor
=
0x6601d14f
;
public
static
int
constructor
=
0x6601d14f
;
...
...
TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java
View file @
9d2dfd33
...
@@ -659,6 +659,18 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
...
@@ -659,6 +659,18 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
invoke
.
app_version
=
"App version unknown"
;
invoke
.
app_version
=
"App version unknown"
;
invoke
.
system_version
=
"SDK "
+
Build
.
VERSION
.
SDK_INT
;
invoke
.
system_version
=
"SDK "
+
Build
.
VERSION
.
SDK_INT
;
}
}
if
(
invoke
.
lang_code
==
null
||
invoke
.
lang_code
.
length
()
==
0
)
{
invoke
.
lang_code
=
"en"
;
}
if
(
invoke
.
device_model
==
null
||
invoke
.
device_model
.
length
()
==
0
)
{
invoke
.
device_model
=
"Android unknown"
;
}
if
(
invoke
.
app_version
==
null
||
invoke
.
app_version
.
length
()
==
0
)
{
invoke
.
app_version
=
"App version unknown"
;
}
if
(
invoke
.
system_version
==
null
||
invoke
.
system_version
.
length
()
==
0
)
{
invoke
.
system_version
=
"SDK Unknown"
;
}
object
=
invoke
;
object
=
invoke
;
}
}
TLRPC
.
invokeWithLayer11
invoke
=
new
TLRPC
.
invokeWithLayer11
();
TLRPC
.
invokeWithLayer11
invoke
=
new
TLRPC
.
invokeWithLayer11
();
...
...
TMessagesProj/src/main/java/org/telegram/messenger/Emoji.java
View file @
9d2dfd33
...
@@ -287,7 +287,7 @@ public class Emoji {
...
@@ -287,7 +287,7 @@ public class Emoji {
0x00000000D83DDD34
L
,
0x00000000D83DDD35
L
,
0x00000000D83DDD3B
L
,
0x00000000D83DDD36
L
,
0x00000000D83DDD37
L
,
0x00000000D83DDD38
L
,
0x00000000D83DDD39
L
}};
0x00000000D83DDD34
L
,
0x00000000D83DDD35
L
,
0x00000000D83DDD3B
L
,
0x00000000D83DDD36
L
,
0x00000000D83DDD37
L
,
0x00000000D83DDD38
L
,
0x00000000D83DDD39
L
}};
static
{
static
{
imgSize
=
Math
.
min
(
scale
(
30
),
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
()
.
density
<
1.5f
?
28
:
56
);
imgSize
=
Math
.
min
(
scale
(
30
),
Utilities
.
density
<
1.5f
?
28
:
56
);
drawImgSize
=
scale
(
20
);
drawImgSize
=
scale
(
20
);
bigImgSize
=
scale
(
30
);
bigImgSize
=
scale
(
30
);
if
(
Math
.
abs
(
imgSize
-
bigImgSize
)
<
5
)
{
if
(
Math
.
abs
(
imgSize
-
bigImgSize
)
<
5
)
{
...
@@ -317,7 +317,7 @@ public class Emoji {
...
@@ -317,7 +317,7 @@ public class Emoji {
opts
.
inPreferredConfig
=
Bitmap
.
Config
.
ARGB_8888
;
opts
.
inPreferredConfig
=
Bitmap
.
Config
.
ARGB_8888
;
opts
.
inDither
=
false
;
opts
.
inDither
=
false
;
if
(
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
()
.
density
<
1.5f
)
{
if
(
Utilities
.
density
<
1.5f
)
{
opts
.
inSampleSize
=
2
;
opts
.
inSampleSize
=
2
;
}
}
...
@@ -559,8 +559,8 @@ public class Emoji {
...
@@ -559,8 +559,8 @@ public class Emoji {
int
sz
=
super
.
getSize
(
paint
,
text
,
start
,
end
,
fm
);
int
sz
=
super
.
getSize
(
paint
,
text
,
start
,
end
,
fm
);
int
offset
=
(
int
)(
8
*
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
);
int
offset
=
Utilities
.
dp
(
8
);
int
w
=
(
int
)(
20
*
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
/
2
);
int
w
=
Utilities
.
dp
(
10
);
fm
.
top
=
-
w
-
offset
;
fm
.
top
=
-
w
-
offset
;
fm
.
bottom
=
w
-
offset
;
fm
.
bottom
=
w
-
offset
;
fm
.
ascent
=
-
w
-
offset
;
fm
.
ascent
=
-
w
-
offset
;
...
@@ -586,7 +586,7 @@ public class Emoji {
...
@@ -586,7 +586,7 @@ public class Emoji {
int
sz
=
super
.
getSize
(
paint
,
text
,
start
,
end
,
fm
);
int
sz
=
super
.
getSize
(
paint
,
text
,
start
,
end
,
fm
);
int
offset
=
(
int
)(
6
*
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
);
int
offset
=
Utilities
.
dp
(
6
);
int
w
=
(
fm
.
bottom
-
fm
.
top
)
/
2
;
int
w
=
(
fm
.
bottom
-
fm
.
top
)
/
2
;
fm
.
top
=
-
w
-
offset
;
fm
.
top
=
-
w
-
offset
;
fm
.
bottom
=
w
-
offset
;
fm
.
bottom
=
w
-
offset
;
...
...
TMessagesProj/src/main/java/org/telegram/messenger/FileLoadOperation.java
View file @
9d2dfd33
...
@@ -205,8 +205,8 @@ public class FileLoadOperation {
...
@@ -205,8 +205,8 @@ public class FileLoadOperation {
float
h_filter
;
float
h_filter
;
if
(
filter
!=
null
)
{
if
(
filter
!=
null
)
{
String
args
[]
=
filter
.
split
(
"_"
);
String
args
[]
=
filter
.
split
(
"_"
);
w_filter
=
Float
.
parseFloat
(
args
[
0
])
*
FileLoader
.
Instance
.
density
;
w_filter
=
Float
.
parseFloat
(
args
[
0
])
*
Utilities
.
density
;
h_filter
=
Float
.
parseFloat
(
args
[
1
])
*
FileLoader
.
Instance
.
density
;
h_filter
=
Float
.
parseFloat
(
args
[
1
])
*
Utilities
.
density
;
opts
.
inJustDecodeBounds
=
true
;
opts
.
inJustDecodeBounds
=
true
;
BitmapFactory
.
decodeFile
(
cacheFileFinal
.
getAbsolutePath
(),
opts
);
BitmapFactory
.
decodeFile
(
cacheFileFinal
.
getAbsolutePath
(),
opts
);
...
@@ -399,8 +399,8 @@ public class FileLoadOperation {
...
@@ -399,8 +399,8 @@ public class FileLoadOperation {
float
h_filter
;
float
h_filter
;
if
(
filter
!=
null
)
{
if
(
filter
!=
null
)
{
String
args
[]
=
filter
.
split
(
"_"
);
String
args
[]
=
filter
.
split
(
"_"
);
w_filter
=
Float
.
parseFloat
(
args
[
0
])
*
FileLoader
.
Instance
.
density
;
w_filter
=
Float
.
parseFloat
(
args
[
0
])
*
Utilities
.
density
;
h_filter
=
Float
.
parseFloat
(
args
[
1
])
*
FileLoader
.
Instance
.
density
;
h_filter
=
Float
.
parseFloat
(
args
[
1
])
*
Utilities
.
density
;
opts
.
inJustDecodeBounds
=
true
;
opts
.
inJustDecodeBounds
=
true
;
BitmapFactory
.
decodeFile
(
cacheFileFinal
.
getAbsolutePath
(),
opts
);
BitmapFactory
.
decodeFile
(
cacheFileFinal
.
getAbsolutePath
(),
opts
);
...
...
TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java
View file @
9d2dfd33
...
@@ -53,7 +53,6 @@ public class FileLoader {
...
@@ -53,7 +53,6 @@ public class FileLoader {
public
static
long
lastCacheOutTime
=
0
;
public
static
long
lastCacheOutTime
=
0
;
public
ConcurrentHashMap
<
String
,
Float
>
fileProgresses
=
new
ConcurrentHashMap
<
String
,
Float
>();
public
ConcurrentHashMap
<
String
,
Float
>
fileProgresses
=
new
ConcurrentHashMap
<
String
,
Float
>();
private
long
lastProgressUpdateTime
=
0
;
private
long
lastProgressUpdateTime
=
0
;
public
float
density
=
1
;
private
HashMap
<
String
,
Integer
>
BitmapUseCounts
=
new
HashMap
<
String
,
Integer
>();
private
HashMap
<
String
,
Integer
>
BitmapUseCounts
=
new
HashMap
<
String
,
Integer
>();
int
lastImageNum
;
int
lastImageNum
;
...
@@ -254,7 +253,6 @@ public class FileLoader {
...
@@ -254,7 +253,6 @@ public class FileLoader {
public
FileLoader
()
{
public
FileLoader
()
{
int
cacheSize
=
Math
.
min
(
15
,
((
ActivityManager
)
ApplicationLoader
.
applicationContext
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
)).
getMemoryClass
()
/
7
)
*
1024
*
1024
;
int
cacheSize
=
Math
.
min
(
15
,
((
ActivityManager
)
ApplicationLoader
.
applicationContext
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
)).
getMemoryClass
()
/
7
)
*
1024
*
1024
;
density
=
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
;
if
(
Build
.
VERSION
.
SDK_INT
<
11
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
11
)
{
runtimeHack
=
new
VMRuntimeHack
();
runtimeHack
=
new
VMRuntimeHack
();
cacheSize
=
1024
*
1024
*
3
;
cacheSize
=
1024
*
1024
*
3
;
...
...
TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java
View file @
9d2dfd33
...
@@ -3364,6 +3364,20 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -3364,6 +3364,20 @@ public class MessagesController implements NotificationCenter.NotificationCenter
req
.
system_version
=
"SDK "
+
Build
.
VERSION
.
SDK_INT
;
req
.
system_version
=
"SDK "
+
Build
.
VERSION
.
SDK_INT
;
req
.
app_version
=
"App version unknown"
;
req
.
app_version
=
"App version unknown"
;
}
}
if
(
req
.
lang_code
==
null
||
req
.
lang_code
.
length
()
==
0
)
{
req
.
lang_code
=
"en"
;
}
if
(
req
.
device_model
==
null
||
req
.
device_model
.
length
()
==
0
)
{
req
.
device_model
=
"Android unknown"
;
}
if
(
req
.
app_version
==
null
||
req
.
app_version
.
length
()
==
0
)
{
req
.
app_version
=
"App version unknown"
;
}
if
(
req
.
system_version
==
null
||
req
.
system_version
.
length
()
==
0
)
{
req
.
system_version
=
"SDK Unknown"
;
}
if
(
req
.
app_version
!=
null
)
{
if
(
req
.
app_version
!=
null
)
{
ConnectionsManager
.
Instance
.
performRpc
(
req
,
new
RPCRequest
.
RPCRequestDelegate
()
{
ConnectionsManager
.
Instance
.
performRpc
(
req
,
new
RPCRequest
.
RPCRequestDelegate
()
{
@Override
@Override
...
...
TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java
View file @
9d2dfd33
...
@@ -48,6 +48,7 @@ public class MessagesStorage {
...
@@ -48,6 +48,7 @@ public class MessagesStorage {
public
void
openDatabase
()
{
public
void
openDatabase
()
{
cacheFile
=
new
File
(
ApplicationLoader
.
applicationContext
.
getFilesDir
(),
"cache4.db"
);
cacheFile
=
new
File
(
ApplicationLoader
.
applicationContext
.
getFilesDir
(),
"cache4.db"
);
boolean
createTable
=
false
;
boolean
createTable
=
false
;
//cacheFile.delete();
//cacheFile.delete();
if
(!
cacheFile
.
exists
())
{
if
(!
cacheFile
.
exists
())
{
...
...
TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java
View file @
9d2dfd33
...
@@ -56,6 +56,7 @@ import javax.crypto.Cipher;
...
@@ -56,6 +56,7 @@ import javax.crypto.Cipher;
public
class
Utilities
{
public
class
Utilities
{
public
static
Handler
applicationHandler
;
public
static
Handler
applicationHandler
;
public
static
int
statusBarHeight
=
0
;
public
static
int
statusBarHeight
=
0
;
public
static
float
density
=
1
;
private
final
static
Integer
lock
=
1
;
private
final
static
Integer
lock
=
1
;
public
static
ArrayList
<
String
>
goodPrimes
=
new
ArrayList
<
String
>();
public
static
ArrayList
<
String
>
goodPrimes
=
new
ArrayList
<
String
>();
...
@@ -74,6 +75,7 @@ public class Utilities {
...
@@ -74,6 +75,7 @@ public class Utilities {
public
native
static
byte
[]
aesIgeEncryption
(
byte
[]
_what
,
byte
[]
_key
,
byte
[]
_iv
,
boolean
encrypt
,
boolean
changeIv
);
public
native
static
byte
[]
aesIgeEncryption
(
byte
[]
_what
,
byte
[]
_key
,
byte
[]
_iv
,
boolean
encrypt
,
boolean
changeIv
);
static
{
static
{
density
=
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
;
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"primes"
,
Context
.
MODE_PRIVATE
);
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"primes"
,
Context
.
MODE_PRIVATE
);
String
primes
=
preferences
.
getString
(
"primes"
,
null
);
String
primes
=
preferences
.
getString
(
"primes"
,
null
);
if
(
primes
==
null
)
{
if
(
primes
==
null
)
{
...
@@ -121,6 +123,10 @@ public class Utilities {
...
@@ -121,6 +123,10 @@ public class Utilities {
return
new
String
(
hexChars
);
return
new
String
(
hexChars
);
}
}
public
static
int
dp
(
int
value
)
{
return
(
int
)(
density
*
value
);
}
public
static
boolean
isGoodPrime
(
byte
[]
prime
,
int
g
)
{
public
static
boolean
isGoodPrime
(
byte
[]
prime
,
int
g
)
{
if
(!(
g
>=
2
&&
g
<=
7
))
{
if
(!(
g
>=
2
&&
g
<=
7
))
{
return
false
;
return
false
;
...
...
TMessagesProj/src/main/java/org/telegram/ui/ApplicationActivity.java
View file @
9d2dfd33
...
@@ -393,21 +393,20 @@ public class ApplicationActivity extends ActionBarActivity implements Notificati
...
@@ -393,21 +393,20 @@ public class ApplicationActivity extends ActionBarActivity implements Notificati
public
void
onGlobalLayout
()
{
public
void
onGlobalLayout
()
{
WindowManager
manager
=
(
WindowManager
)
getSystemService
(
WINDOW_SERVICE
);
WindowManager
manager
=
(
WindowManager
)
getSystemService
(
WINDOW_SERVICE
);
int
rotation
=
manager
.
getDefaultDisplay
().
getRotation
();
int
rotation
=
manager
.
getDefaultDisplay
().
getRotation
();
float
density
=
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
;
int
height
;
int
height
;
int
currentActionBarHeight
=
getSupportActionBar
().
getHeight
();
int
currentActionBarHeight
=
getSupportActionBar
().
getHeight
();
if
(
currentActionBarHeight
!=
48
*
density
&&
currentActionBarHeight
!=
40
*
density
)
{
if
(
currentActionBarHeight
!=
Utilities
.
dp
(
48
)
&&
currentActionBarHeight
!=
Utilities
.
dp
(
40
)
)
{
height
=
currentActionBarHeight
;
height
=
currentActionBarHeight
;
}
else
{
}
else
{
height
=
(
int
)
(
48.0f
*
density
);
height
=
Utilities
.
dp
(
48
);
if
(
rotation
==
Surface
.
ROTATION_270
||
rotation
==
Surface
.
ROTATION_90
)
{
if
(
rotation
==
Surface
.
ROTATION_270
||
rotation
==
Surface
.
ROTATION_90
)
{
height
=
(
int
)
(
40.0f
*
density
);
height
=
Utilities
.
dp
(
40
);
}
}
}
}
if
(
notificationView
!=
null
)
{
if
(
notificationView
!=
null
)
{
notificationView
.
applyOrientationPaddings
(
rotation
==
Surface
.
ROTATION_270
||
rotation
==
Surface
.
ROTATION_90
,
density
,
height
);
notificationView
.
applyOrientationPaddings
(
rotation
==
Surface
.
ROTATION_270
||
rotation
==
Surface
.
ROTATION_90
,
height
);
}
}
if
(
Build
.
VERSION
.
SDK_INT
<
16
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
16
)
{
...
@@ -579,17 +578,16 @@ public class ApplicationActivity extends ActionBarActivity implements Notificati
...
@@ -579,17 +578,16 @@ public class ApplicationActivity extends ActionBarActivity implements Notificati
actionBar
.
setCustomView
(
statusView
);
actionBar
.
setCustomView
(
statusView
);
}
}
float
density
=
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
;
try
{
try
{
if
(
statusView
.
getLayoutParams
()
instanceof
android
.
support
.
v7
.
app
.
ActionBar
.
LayoutParams
)
{
if
(
statusView
.
getLayoutParams
()
instanceof
android
.
support
.
v7
.
app
.
ActionBar
.
LayoutParams
)
{
android
.
support
.
v7
.
app
.
ActionBar
.
LayoutParams
statusParams
=
(
android
.
support
.
v7
.
app
.
ActionBar
.
LayoutParams
)
statusView
.
getLayoutParams
();
android
.
support
.
v7
.
app
.
ActionBar
.
LayoutParams
statusParams
=
(
android
.
support
.
v7
.
app
.
ActionBar
.
LayoutParams
)
statusView
.
getLayoutParams
();
statusText
.
measure
(
View
.
MeasureSpec
.
makeMeasureSpec
(
800
,
View
.
MeasureSpec
.
AT_MOST
),
100
);
statusText
.
measure
(
View
.
MeasureSpec
.
makeMeasureSpec
(
800
,
View
.
MeasureSpec
.
AT_MOST
),
100
);
statusParams
.
width
=
(
int
)(
statusText
.
getMeasuredWidth
()
+
54
*
density
);
statusParams
.
width
=
(
int
)(
statusText
.
getMeasuredWidth
()
+
Utilities
.
dp
(
54
)
);
statusView
.
setLayoutParams
(
statusParams
);
statusView
.
setLayoutParams
(
statusParams
);
}
else
if
(
statusView
.
getLayoutParams
()
instanceof
android
.
app
.
ActionBar
.
LayoutParams
)
{
}
else
if
(
statusView
.
getLayoutParams
()
instanceof
android
.
app
.
ActionBar
.
LayoutParams
)
{
android
.
app
.
ActionBar
.
LayoutParams
statusParams
=
(
android
.
app
.
ActionBar
.
LayoutParams
)
statusView
.
getLayoutParams
();
android
.
app
.
ActionBar
.
LayoutParams
statusParams
=
(
android
.
app
.
ActionBar
.
LayoutParams
)
statusView
.
getLayoutParams
();
statusText
.
measure
(
View
.
MeasureSpec
.
makeMeasureSpec
(
800
,
View
.
MeasureSpec
.
AT_MOST
),
100
);
statusText
.
measure
(
View
.
MeasureSpec
.
makeMeasureSpec
(
800
,
View
.
MeasureSpec
.
AT_MOST
),
100
);
statusParams
.
width
=
(
int
)(
statusText
.
getMeasuredWidth
()
+
54
*
density
);
statusParams
.
width
=
(
int
)(
statusText
.
getMeasuredWidth
()
+
Utilities
.
dp
(
54
)
);
statusView
.
setLayoutParams
(
statusParams
);
statusView
.
setLayoutParams
(
statusParams
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
View file @
9d2dfd33
This diff is collapsed.
Click to expand it.
TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java
View file @
9d2dfd33
...
@@ -502,8 +502,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
...
@@ -502,8 +502,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
if
(
s
.
length
()
!=
0
)
{
if
(
s
.
length
()
!=
0
)
{
searchWas
=
true
;
searchWas
=
true
;
if
(
listView
!=
null
)
{
if
(
listView
!=
null
)
{
float
density
=
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
;
listView
.
setPadding
(
Utilities
.
dp
(
16
),
listView
.
getPaddingTop
(),
Utilities
.
dp
(
16
),
listView
.
getPaddingBottom
());
listView
.
setPadding
((
int
)(
density
*
16
),
listView
.
getPaddingTop
(),
(
int
)(
density
*
16
),
listView
.
getPaddingBottom
());
listView
.
setAdapter
(
searchListViewAdapter
);
listView
.
setAdapter
(
searchListViewAdapter
);
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
11
)
{
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
11
)
{
listView
.
setFastScrollAlwaysVisible
(
false
);
listView
.
setFastScrollAlwaysVisible
(
false
);
...
@@ -538,11 +537,10 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
...
@@ -538,11 +537,10 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
searchWas
=
false
;
searchWas
=
false
;
ViewGroup
group
=
(
ViewGroup
)
listView
.
getParent
();
ViewGroup
group
=
(
ViewGroup
)
listView
.
getParent
();
listView
.
setAdapter
(
listViewAdapter
);
listView
.
setAdapter
(
listViewAdapter
);
float
density
=
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
;
if
(!
isRTL
)
{
if
(!
isRTL
)
{
listView
.
setPadding
(
(
int
)
(
density
*
16
),
listView
.
getPaddingTop
(),
(
int
)
(
density
*
30
),
listView
.
getPaddingBottom
());
listView
.
setPadding
(
Utilities
.
dp
(
16
),
listView
.
getPaddingTop
(),
Utilities
.
dp
(
30
),
listView
.
getPaddingBottom
());
}
else
{
}
else
{
listView
.
setPadding
(
(
int
)
(
density
*
30
),
listView
.
getPaddingTop
(),
(
int
)
(
density
*
16
),
listView
.
getPaddingBottom
());
listView
.
setPadding
(
Utilities
.
dp
(
30
),
listView
.
getPaddingTop
(),
Utilities
.
dp
(
16
),
listView
.
getPaddingBottom
());
}
}
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
11
)
{
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
11
)
{
listView
.
setFastScrollAlwaysVisible
(
true
);
listView
.
setFastScrollAlwaysVisible
(
true
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java
View file @
9d2dfd33
...
@@ -228,8 +228,7 @@ public class CountrySelectActivity extends ActionBarActivity {
...
@@ -228,8 +228,7 @@ public class CountrySelectActivity extends ActionBarActivity {
if
(
s
.
length
()
!=
0
)
{
if
(
s
.
length
()
!=
0
)
{
searchWas
=
true
;
searchWas
=
true
;
if
(
listView
!=
null
)
{
if
(
listView
!=
null
)
{
float
density
=
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
;
listView
.
setPadding
(
Utilities
.
dp
(
16
),
listView
.
getPaddingTop
(),
Utilities
.
dp
(
16
),
listView
.
getPaddingBottom
());
listView
.
setPadding
((
int
)(
density
*
16
),
listView
.
getPaddingTop
(),
(
int
)(
density
*
16
),
listView
.
getPaddingBottom
());
listView
.
setAdapter
(
searchListViewAdapter
);
listView
.
setAdapter
(
searchListViewAdapter
);
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
11
)
{
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
11
)
{
listView
.
setFastScrollAlwaysVisible
(
false
);
listView
.
setFastScrollAlwaysVisible
(
false
);
...
@@ -261,11 +260,10 @@ public class CountrySelectActivity extends ActionBarActivity {
...
@@ -261,11 +260,10 @@ public class CountrySelectActivity extends ActionBarActivity {
searchWas
=
false
;
searchWas
=
false
;
ViewGroup
group
=
(
ViewGroup
)
listView
.
getParent
();
ViewGroup
group
=
(
ViewGroup
)
listView
.
getParent
();
listView
.
setAdapter
(
listViewAdapter
);
listView
.
setAdapter
(
listViewAdapter
);
float
density
=
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
;
if
(!
isRTL
)
{
if
(!
isRTL
)
{
listView
.
setPadding
(
(
int
)
(
density
*
16
),
listView
.
getPaddingTop
(),
(
int
)
(
density
*
30
),
listView
.
getPaddingBottom
());
listView
.
setPadding
(
Utilities
.
dp
(
16
),
listView
.
getPaddingTop
(),
Utilities
.
dp
(
30
),
listView
.
getPaddingBottom
());
}
else
{
}
else
{
listView
.
setPadding
(
(
int
)
(
density
*
30
),
listView
.
getPaddingTop
(),
(
int
)
(
density
*
16
),
listView
.
getPaddingBottom
());
listView
.
setPadding
(
Utilities
.
dp
(
30
),
listView
.
getPaddingTop
(),
Utilities
.
dp
(
16
),
listView
.
getPaddingBottom
());
}
}
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
11
)
{
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
11
)
{
listView
.
setFastScrollAlwaysVisible
(
true
);
listView
.
setFastScrollAlwaysVisible
(
true
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/GalleryImageViewer.java
View file @
9d2dfd33
...
@@ -182,9 +182,7 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif
...
@@ -182,9 +182,7 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif
}
}
}
}
float
density
=
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
;
mViewPager
.
setPageMargin
(
Utilities
.
dp
(
20
));
mViewPager
.
setPageMargin
((
int
)(
20
*
density
));
mViewPager
.
setOffscreenPageLimit
(
1
);
mViewPager
.
setOffscreenPageLimit
(
1
);
mViewPager
.
setAdapter
(
localPagerAdapter
);
mViewPager
.
setAdapter
(
localPagerAdapter
);
...
@@ -357,8 +355,8 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif
...
@@ -357,8 +355,8 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif
if
(
title
!=
null
)
{
if
(
title
!=
null
)
{
fakeTitleView
.
setText
(
String
.
format
(
"%d %s %d"
,
pos
,
getString
(
R
.
string
.
Of
),
totalCount
));
fakeTitleView
.
setText
(
String
.
format
(
"%d %s %d"
,
pos
,
getString
(
R
.
string
.
Of
),
totalCount
));
fakeTitleView
.
measure
(
View
.
MeasureSpec
.
makeMeasureSpec
(
400
,
View
.
MeasureSpec
.
AT_MOST
),
40
);
fakeTitleView
.
measure
(
View
.
MeasureSpec
.
makeMeasureSpec
(
400
,
View
.
MeasureSpec
.
AT_MOST
),
40
);
title
.
setWidth
(
fakeTitleView
.
getMeasuredWidth
()
+
(
int
)(
8
*
getResources
().
getDisplayMetrics
().
density
));
title
.
setWidth
(
fakeTitleView
.
getMeasuredWidth
()
+
Utilities
.
dp
(
8
));
title
.
setMaxWidth
(
fakeTitleView
.
getMeasuredWidth
()
+
(
int
)(
8
*
getResources
().
getDisplayMetrics
().
density
));
title
.
setMaxWidth
(
fakeTitleView
.
getMeasuredWidth
()
+
Utilities
.
dp
(
8
));
}
}
}
}
});
});
...
@@ -778,8 +776,8 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif
...
@@ -778,8 +776,8 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif
if
(
title
!=
null
)
{
if
(
title
!=
null
)
{
fakeTitleView
.
setText
(
String
.
format
(
"%d %s %d"
,
(
totalCount
-
imagesArr
.
size
())
+
position
+
1
,
getString
(
R
.
string
.
Of
),
totalCount
));
fakeTitleView
.
setText
(
String
.
format
(
"%d %s %d"
,
(
totalCount
-
imagesArr
.
size
())
+
position
+
1
,
getString
(
R
.
string
.
Of
),
totalCount
));
fakeTitleView
.
measure
(
View
.
MeasureSpec
.
makeMeasureSpec
(
400
,
View
.
MeasureSpec
.
AT_MOST
),
40
);
fakeTitleView
.
measure
(
View
.
MeasureSpec
.
makeMeasureSpec
(
400
,
View
.
MeasureSpec
.
AT_MOST
),
40
);
title
.
setWidth
(
fakeTitleView
.
getMeasuredWidth
()
+
(
int
)(
8
*
getResources
().
getDisplayMetrics
().
density
));
title
.
setWidth
(
fakeTitleView
.
getMeasuredWidth
()
+
Utilities
.
dp
(
8
));
title
.
setMaxWidth
(
fakeTitleView
.
getMeasuredWidth
()
+
(
int
)(
8
*
getResources
().
getDisplayMetrics
().
density
));
title
.
setMaxWidth
(
fakeTitleView
.
getMeasuredWidth
()
+
Utilities
.
dp
(
8
));
}
}
}
}
});
});
...
@@ -797,8 +795,8 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif
...
@@ -797,8 +795,8 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif
if
(
title
!=
null
)
{
if
(
title
!=
null
)
{
fakeTitleView
.
setText
(
String
.
format
(
"%d %s %d"
,
position
+
1
,
getString
(
R
.
string
.
Of
),
imagesArrLocations
.
size
()));
fakeTitleView
.
setText
(
String
.
format
(
"%d %s %d"
,
position
+
1
,
getString
(
R
.
string
.
Of
),
imagesArrLocations
.
size
()));
fakeTitleView
.
measure
(
View
.
MeasureSpec
.
makeMeasureSpec
(
400
,
View
.
MeasureSpec
.
AT_MOST
),
40
);
fakeTitleView
.
measure
(
View
.
MeasureSpec
.
makeMeasureSpec
(
400
,
View
.
MeasureSpec
.
AT_MOST
),
40
);
title
.
setWidth
(
fakeTitleView
.
getMeasuredWidth
()
+
(
int
)(
8
*
getResources
().
getDisplayMetrics
().
density
));
title
.
setWidth
(
fakeTitleView
.
getMeasuredWidth
()
+
Utilities
.
dp
(
8
));
title
.
setMaxWidth
(
fakeTitleView
.
getMeasuredWidth
()
+
(
int
)(
8
*
getResources
().
getDisplayMetrics
().
density
));
title
.
setMaxWidth
(
fakeTitleView
.
getMeasuredWidth
()
+
Utilities
.
dp
(
8
));
}
}
}
}
});
});
...
...
TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java
View file @
9d2dfd33
...
@@ -25,6 +25,7 @@ import android.widget.TextView;
...
@@ -25,6 +25,7 @@ import android.widget.TextView;
import
org.telegram.TL.TLRPC
;
import
org.telegram.TL.TLRPC
;
import
org.telegram.messenger.MessagesController
;
import
org.telegram.messenger.MessagesController
;
import
org.telegram.messenger.R
;
import
org.telegram.messenger.R
;
import
org.telegram.messenger.Utilities
;
import
org.telegram.ui.Views.BaseFragment
;
import
org.telegram.ui.Views.BaseFragment
;
import
org.telegram.ui.Views.IdenticonView
;
import
org.telegram.ui.Views.IdenticonView
;
...
@@ -91,7 +92,7 @@ public class IdenticonActivity extends BaseFragment {
...
@@ -91,7 +92,7 @@ public class IdenticonActivity extends BaseFragment {
}
}
if
(
title
!=
null
)
{
if
(
title
!=
null
)
{
title
.
setCompoundDrawablesWithIntrinsicBounds
(
R
.
drawable
.
ic_lock_white
,
0
,
0
,
0
);
title
.
setCompoundDrawablesWithIntrinsicBounds
(
R
.
drawable
.
ic_lock_white
,
0
,
0
,
0
);
title
.
setCompoundDrawablePadding
(
(
int
)(
4
*
getResources
().
getDisplayMetrics
().
density
));
title
.
setCompoundDrawablePadding
(
Utilities
.
dp
(
4
));
}
}
}
}
...
@@ -125,7 +126,6 @@ public class IdenticonActivity extends BaseFragment {
...
@@ -125,7 +126,6 @@ public class IdenticonActivity extends BaseFragment {
LinearLayout
layout
=
(
LinearLayout
)
fragmentView
;
LinearLayout
layout
=
(
LinearLayout
)
fragmentView
;
WindowManager
manager
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
WindowManager
manager
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
int
rotation
=
manager
.
getDefaultDisplay
().
getRotation
();
int
rotation
=
manager
.
getDefaultDisplay
().
getRotation
();
float
density
=
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
;
if
(
rotation
==
Surface
.
ROTATION_270
||
rotation
==
Surface
.
ROTATION_90
)
{
if
(
rotation
==
Surface
.
ROTATION_270
||
rotation
==
Surface
.
ROTATION_90
)
{
layout
.
setOrientation
(
LinearLayout
.
HORIZONTAL
);
layout
.
setOrientation
(
LinearLayout
.
HORIZONTAL
);
...
@@ -143,7 +143,7 @@ public class IdenticonActivity extends BaseFragment {
...
@@ -143,7 +143,7 @@ public class IdenticonActivity extends BaseFragment {
}
}
if
(
title
!=
null
)
{
if
(
title
!=
null
)
{
title
.
setCompoundDrawablesWithIntrinsicBounds
(
R
.
drawable
.
ic_lock_white
,
0
,
0
,
0
);
title
.
setCompoundDrawablesWithIntrinsicBounds
(
R
.
drawable
.
ic_lock_white
,
0
,
0
,
0
);
title
.
setCompoundDrawablePadding
(
(
int
)(
4
*
density
));
title
.
setCompoundDrawablePadding
(
Utilities
.
dp
(
4
));
}
}
return
false
;
return
false
;
...
...
TMessagesProj/src/main/java/org/telegram/ui/IntroActivity.java
View file @
9d2dfd33
...
@@ -30,10 +30,8 @@ public class IntroActivity extends ActionBarActivity {
...
@@ -30,10 +30,8 @@ public class IntroActivity extends ActionBarActivity {
private
ViewPager
viewPager
;
private
ViewPager
viewPager
;
private
ImageView
topImage1
;
private
ImageView
topImage1
;
private
ImageView
topImage2
;
private
ImageView
topImage2
;
private
TextView
startMessagingButton
;
private
ViewGroup
bottomPages
;
private
ViewGroup
bottomPages
;
private
int
lastPage
=
0
;
private
int
lastPage
=
0
;
private
float
density
=
1
;
private
boolean
isRTL
=
false
;
private
boolean
isRTL
=
false
;
private
boolean
justCreated
=
false
;
private
boolean
justCreated
=
false
;
private
boolean
startPressed
=
false
;
private
boolean
startPressed
=
false
;
...
@@ -107,9 +105,8 @@ public class IntroActivity extends ActionBarActivity {
...
@@ -107,9 +105,8 @@ public class IntroActivity extends ActionBarActivity {
R
.
string
.
Page7Message
R
.
string
.
Page7Message
};
};
}
}
density
=
getResources
().
getDisplayMetrics
().
density
;
viewPager
=
(
ViewPager
)
findViewById
(
R
.
id
.
intro_view_pager
);
viewPager
=
(
ViewPager
)
findViewById
(
R
.
id
.
intro_view_pager
);
startMessagingButton
=
(
TextView
)
findViewById
(
R
.
id
.
start_messaging_button
);
TextView
startMessagingButton
=
(
TextView
)
findViewById
(
R
.
id
.
start_messaging_button
);
topImage1
=
(
ImageView
)
findViewById
(
R
.
id
.
icon_image1
);
topImage1
=
(
ImageView
)
findViewById
(
R
.
id
.
icon_image1
);
topImage2
=
(
ImageView
)
findViewById
(
R
.
id
.
icon_image2
);
topImage2
=
(
ImageView
)
findViewById
(
R
.
id
.
icon_image2
);
bottomPages
=
(
ViewGroup
)
findViewById
(
R
.
id
.
bottom_pages
);
bottomPages
=
(
ViewGroup
)
findViewById
(
R
.
id
.
bottom_pages
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java
View file @
9d2dfd33
...
@@ -8,10 +8,7 @@
...
@@ -8,10 +8,7 @@
package
org
.
telegram
.
ui
;
package
org
.
telegram
.
ui
;
import
android.app.Activity
;
import
android.location.Location
;
import
android.location.Location
;
import
android.location.LocationListener
;
import
android.location.LocationManager
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.v7.app.ActionBar
;
import
android.support.v7.app.ActionBar
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
...
@@ -32,7 +29,6 @@ import com.google.android.gms.maps.model.LatLng;
...
@@ -32,7 +29,6 @@ import com.google.android.gms.maps.model.LatLng;
import
com.google.android.gms.maps.model.Marker
;
import
com.google.android.gms.maps.model.Marker
;
import
com.google.android.gms.maps.model.MarkerOptions
;
import
com.google.android.gms.maps.model.MarkerOptions
;
import
org.telegram.TL.TLRPC
;
import
org.telegram.TL.TLRPC
;
import
org.telegram.messenger.FileLog
;
import
org.telegram.objects.MessageObject
;
import
org.telegram.objects.MessageObject
;
import
org.telegram.messenger.MessagesController
;
import
org.telegram.messenger.MessagesController
;
import
org.telegram.messenger.NotificationCenter
;
import
org.telegram.messenger.NotificationCenter
;
...
@@ -41,10 +37,9 @@ import org.telegram.messenger.Utilities;
...
@@ -41,10 +37,9 @@ import org.telegram.messenger.Utilities;
import
org.telegram.ui.Views.BackupImageView
;
import
org.telegram.ui.Views.BackupImageView
;
import
org.telegram.ui.Views.BaseFragment
;
import
org.telegram.ui.Views.BaseFragment
;
public
class
LocationActivity
extends
BaseFragment
implements
LocationListener
,
NotificationCenter
.
NotificationCenterDelegate
{
public
class
LocationActivity
extends
BaseFragment
implements
NotificationCenter
.
NotificationCenterDelegate
{
private
GoogleMap
googleMap
;
private
GoogleMap
googleMap
;
private
TextView
distanceTextView
;
private
TextView
distanceTextView
;
private
Marker
myLocationMarker
;
private
Marker
userMarker
;
private
Marker
userMarker
;
private
Location
myLocation
;
private
Location
myLocation
;
private
Location
userLocation
;
private
Location
userLocation
;
...
@@ -60,16 +55,22 @@ public class LocationActivity extends BaseFragment implements LocationListener,
...
@@ -60,16 +55,22 @@ public class LocationActivity extends BaseFragment implements LocationListener,
@Override
@Override
public
void
onActivityCreated
(
Bundle
savedInstanceState
)
{
public
void
onActivityCreated
(
Bundle
savedInstanceState
)
{
super
.
onActivityCreated
(
savedInstanceState
);
super
.
onActivityCreated
(
savedInstanceState
);
setupLocationListener
();
googleMap
=
getMap
();
googleMap
=
getMap
();
if
(
googleMap
==
null
)
{
if
(
googleMap
==
null
)
{
return
;
return
;
}
}
googleMap
.
setMyLocationEnabled
(
fals
e
);
googleMap
.
setMyLocationEnabled
(
tru
e
);
googleMap
.
getUiSettings
().
setMyLocationButtonEnabled
(
false
);
googleMap
.
getUiSettings
().
setMyLocationButtonEnabled
(
false
);
googleMap
.
getUiSettings
().
setZoomControlsEnabled
(
false
);
googleMap
.
getUiSettings
().
setZoomControlsEnabled
(
false
);
googleMap
.
getUiSettings
().
setCompassEnabled
(
false
);
googleMap
.
getUiSettings
().
setCompassEnabled
(
false
);
googleMap
.
setOnMyLocationChangeListener
(
new
GoogleMap
.
OnMyLocationChangeListener
()
{
@Override
public
void
onMyLocationChange
(
Location
location
)
{
positionMarker
(
location
);
}
});
myLocation
=
googleMap
.
getMyLocation
();
if
(
sendButton
!=
null
)
{
if
(
sendButton
!=
null
)
{
userLocation
=
new
Location
(
"network"
);
userLocation
=
new
Location
(
"network"
);
...
@@ -160,8 +161,6 @@ public class LocationActivity extends BaseFragment implements LocationListener,
...
@@ -160,8 +161,6 @@ public class LocationActivity extends BaseFragment implements LocationListener,
@Override
@Override
public
void
onFragmentDestroy
()
{
public
void
onFragmentDestroy
()
{
super
.
onFragmentDestroy
();
super
.
onFragmentDestroy
();
LocationManager
locationManager
=
(
LocationManager
)
parentActivity
.
getSystemService
(
Activity
.
LOCATION_SERVICE
);
locationManager
.
removeUpdates
(
this
);
NotificationCenter
.
Instance
.
removeObserver
(
this
,
MessagesController
.
updateInterfaces
);
NotificationCenter
.
Instance
.
removeObserver
(
this
,
MessagesController
.
updateInterfaces
);
NotificationCenter
.
Instance
.
removeObserver
(
this
,
MessagesController
.
closeChats
);
NotificationCenter
.
Instance
.
removeObserver
(
this
,
MessagesController
.
closeChats
);
}
}
...
@@ -295,47 +294,11 @@ public class LocationActivity extends BaseFragment implements LocationListener,
...
@@ -295,47 +294,11 @@ public class LocationActivity extends BaseFragment implements LocationListener,
return
true
;
return
true
;
}
}
private
void
setupLocationListener
()
{
try
{
LocationManager
locationManager
=
(
LocationManager
)
parentActivity
.
getSystemService
(
Activity
.
LOCATION_SERVICE
);
boolean
isGPSEnabled
=
locationManager
.
isProviderEnabled
(
LocationManager
.
GPS_PROVIDER
);
boolean
isNetworkEnabled
=
locationManager
.
isProviderEnabled
(
LocationManager
.
NETWORK_PROVIDER
);
Location
location
=
null
;
if
(
isGPSEnabled
||
isNetworkEnabled
)
{
if
(
isGPSEnabled
)
{
locationManager
.
requestLocationUpdates
(
LocationManager
.
GPS_PROVIDER
,
1000
*
3
*
1
,
1
,
this
);
if
(
locationManager
!=
null
)
{
location
=
locationManager
.
getLastKnownLocation
(
LocationManager
.
GPS_PROVIDER
);
}
}
if
(
location
==
null
&&
isNetworkEnabled
)
{
locationManager
.
requestLocationUpdates
(
LocationManager
.
NETWORK_PROVIDER
,
1000
*
3
*
1
,
1
,
this
);
if
(
locationManager
!=
null
)
{
location
=
locationManager
.
getLastKnownLocation
(
LocationManager
.
NETWORK_PROVIDER
);
}
}
}
positionMarker
(
location
);
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
}
private
void
positionMarker
(
Location
location
)
{
private
void
positionMarker
(
Location
location
)
{
if
(
location
==
null
)
{
if
(
location
==
null
)
{
return
;
return
;
}
}
myLocation
=
location
;
myLocation
=
location
;
if
(
myLocationMarker
==
null
)
{
if
(
googleMap
!=
null
)
{
myLocationMarker
=
googleMap
.
addMarker
(
new
MarkerOptions
().
position
(
new
LatLng
(
location
.
getLatitude
(),
location
.
getLongitude
())).
icon
(
BitmapDescriptorFactory
.
fromResource
(
R
.
drawable
.
map_dot
)).
anchor
(
0.5f
,
0.5f
));
}
}
else
{
myLocationMarker
.
setPosition
(
new
LatLng
(
location
.
getLatitude
(),
location
.
getLongitude
()));
}
if
(
messageObject
!=
null
)
{
if
(
messageObject
!=
null
)
{
if
(
userLocation
!=
null
&&
distanceTextView
!=
null
)
{
if
(
userLocation
!=
null
&&
distanceTextView
!=
null
)
{
float
distance
=
location
.
distanceTo
(
userLocation
);
float
distance
=
location
.
distanceTo
(
userLocation
);
...
@@ -363,28 +326,6 @@ public class LocationActivity extends BaseFragment implements LocationListener,
...
@@ -363,28 +326,6 @@ public class LocationActivity extends BaseFragment implements LocationListener,
}
}
@Override
public
void
onLocationChanged
(
final
Location
location
)
{
Utilities
.
RunOnUIThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
positionMarker
(
location
);
}
});
}
@Override
public
void
onProviderDisabled
(
String
provider
)
{
}
@Override
public
void
onProviderEnabled
(
String
provider
)
{
}
@Override
public
void
onStatusChanged
(
String
provider
,
int
status
,
Bundle
extras
)
{
}
@Override
@Override
public
void
didReceivedNotification
(
int
id
,
Object
...
args
)
{
public
void
didReceivedNotification
(
int
id
,
Object
...
args
)
{
if
(
id
==
MessagesController
.
updateInterfaces
)
{
if
(
id
==
MessagesController
.
updateInterfaces
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java
View file @
9d2dfd33
...
@@ -82,13 +82,13 @@ public class LoginActivity extends ActionBarActivity implements SlideView.SlideV
...
@@ -82,13 +82,13 @@ public class LoginActivity extends ActionBarActivity implements SlideView.SlideV
getSupportActionBar
().
setLogo
(
R
.
drawable
.
ab_icon_fixed2
);
getSupportActionBar
().
setLogo
(
R
.
drawable
.
ab_icon_fixed2
);
getSupportActionBar
().
show
();
getSupportActionBar
().
show
();
float
density
=
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
;
ImageView
view
=
(
ImageView
)
findViewById
(
16908332
);
ImageView
view
=
(
ImageView
)
findViewById
(
16908332
);
if
(
view
==
null
)
{
if
(
view
==
null
)
{
view
=
(
ImageView
)
findViewById
(
R
.
id
.
home
);
view
=
(
ImageView
)
findViewById
(
R
.
id
.
home
);
}
}
if
(
view
!=
null
)
{
if
(
view
!=
null
)
{
view
.
setPadding
(
(
int
)(
density
*
6
),
0
,
(
int
)(
density
*
6
),
0
);
view
.
setPadding
(
Utilities
.
dp
(
6
),
0
,
Utilities
.
dp
(
6
),
0
);
}
}
views
[
0
]
=
(
SlideView
)
findViewById
(
R
.
id
.
login_page1
);
views
[
0
]
=
(
SlideView
)
findViewById
(
R
.
id
.
login_page1
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/LoginActivityPhoneView.java
View file @
9d2dfd33
...
@@ -306,6 +306,9 @@ public class LoginActivityPhoneView extends SlideView implements AdapterView.OnI
...
@@ -306,6 +306,9 @@ public class LoginActivityPhoneView extends SlideView implements AdapterView.OnI
req
.
sms_type
=
0
;
req
.
sms_type
=
0
;
req
.
phone_number
=
phone
;
req
.
phone_number
=
phone
;
req
.
lang_code
=
Locale
.
getDefault
().
getCountry
();
req
.
lang_code
=
Locale
.
getDefault
().
getCountry
();
if
(
req
.
lang_code
==
null
||
req
.
lang_code
.
length
()
==
0
)
{
req
.
lang_code
=
"en"
;
}
final
Bundle
params
=
new
Bundle
();
final
Bundle
params
=
new
Bundle
();
params
.
putString
(
"phone"
,
"+"
+
codeField
.
getText
()
+
phoneField
.
getText
());
params
.
putString
(
"phone"
,
"+"
+
codeField
.
getText
()
+
phoneField
.
getText
());
...
...
TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java
View file @
9d2dfd33
...
@@ -28,6 +28,7 @@ import android.widget.GridView;
...
@@ -28,6 +28,7 @@ import android.widget.GridView;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
org.telegram.TL.TLRPC
;
import
org.telegram.TL.TLRPC
;
import
org.telegram.messenger.Utilities
;
import
org.telegram.objects.MessageObject
;
import
org.telegram.objects.MessageObject
;
import
org.telegram.messenger.MessagesController
;
import
org.telegram.messenger.MessagesController
;
import
org.telegram.messenger.NotificationCenter
;
import
org.telegram.messenger.NotificationCenter
;
...
@@ -289,20 +290,19 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No
...
@@ -289,20 +290,19 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No
public
boolean
onPreDraw
()
{
public
boolean
onPreDraw
()
{
WindowManager
manager
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Activity
.
WINDOW_SERVICE
);
WindowManager
manager
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Activity
.
WINDOW_SERVICE
);
int
rotation
=
manager
.
getDefaultDisplay
().
getRotation
();
int
rotation
=
manager
.
getDefaultDisplay
().
getRotation
();
float
density
=
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
;
if
(
rotation
==
Surface
.
ROTATION_270
||
rotation
==
Surface
.
ROTATION_90
)
{
if
(
rotation
==
Surface
.
ROTATION_270
||
rotation
==
Surface
.
ROTATION_90
)
{
orientation
=
1
;
orientation
=
1
;
listView
.
setNumColumns
(
6
);
listView
.
setNumColumns
(
6
);
itemWidth
=
getResources
().
getDisplayMetrics
().
widthPixels
/
6
-
(
int
)(
2
*
density
)
*
5
;
itemWidth
=
getResources
().
getDisplayMetrics
().
widthPixels
/
6
-
Utilities
.
dp
(
2
)
*
5
;
listView
.
setColumnWidth
(
itemWidth
);
listView
.
setColumnWidth
(
itemWidth
);
}
else
{
}
else
{
orientation
=
0
;
orientation
=
0
;
listView
.
setNumColumns
(
4
);
listView
.
setNumColumns
(
4
);
itemWidth
=
getResources
().
getDisplayMetrics
().
widthPixels
/
4
-
(
int
)(
2
*
density
)
*
3
;
itemWidth
=
getResources
().
getDisplayMetrics
().
widthPixels
/
4
-
Utilities
.
dp
(
2
)
*
3
;
listView
.
setColumnWidth
(
itemWidth
);
listView
.
setColumnWidth
(
itemWidth
);
}
}
listView
.
setPadding
(
listView
.
getPaddingLeft
(),
(
int
)(
4
*
density
),
listView
.
getPaddingRight
(),
listView
.
getPaddingBottom
());
listView
.
setPadding
(
listView
.
getPaddingLeft
(),
Utilities
.
dp
(
4
),
listView
.
getPaddingRight
(),
listView
.
getPaddingBottom
());
listAdapter
.
notifyDataSetChanged
();
listAdapter
.
notifyDataSetChanged
();
listView
.
getViewTreeObserver
().
removeOnPreDrawListener
(
this
);
listView
.
getViewTreeObserver
().
removeOnPreDrawListener
(
this
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java
View file @
9d2dfd33
...
@@ -70,7 +70,6 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
...
@@ -70,7 +70,6 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
private
static
boolean
dialogsLoaded
=
false
;
private
static
boolean
dialogsLoaded
=
false
;
private
boolean
searching
=
false
;
private
boolean
searching
=
false
;
private
boolean
searchWas
=
false
;
private
boolean
searchWas
=
false
;
private
float
density
=
1
;
private
boolean
onlySelect
=
false
;
private
boolean
onlySelect
=
false
;
private
int
activityToken
=
(
int
)(
MessagesController
.
random
.
nextDouble
()
*
Integer
.
MAX_VALUE
);
private
int
activityToken
=
(
int
)(
MessagesController
.
random
.
nextDouble
()
*
Integer
.
MAX_VALUE
);
private
long
selectedDialog
;
private
long
selectedDialog
;
...
@@ -88,7 +87,6 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
...
@@ -88,7 +87,6 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
@Override
@Override
public
boolean
onFragmentCreate
()
{
public
boolean
onFragmentCreate
()
{
super
.
onFragmentCreate
();
super
.
onFragmentCreate
();
density
=
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
;
NotificationCenter
.
Instance
.
addObserver
(
this
,
MessagesController
.
dialogsNeedReload
);
NotificationCenter
.
Instance
.
addObserver
(
this
,
MessagesController
.
dialogsNeedReload
);
NotificationCenter
.
Instance
.
addObserver
(
this
,
999
);
NotificationCenter
.
Instance
.
addObserver
(
this
,
999
);
NotificationCenter
.
Instance
.
addObserver
(
this
,
MessagesController
.
updateInterfaces
);
NotificationCenter
.
Instance
.
addObserver
(
this
,
MessagesController
.
updateInterfaces
);
...
@@ -324,7 +322,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
...
@@ -324,7 +322,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
view
=
(
ImageView
)
parentActivity
.
findViewById
(
R
.
id
.
home
);
view
=
(
ImageView
)
parentActivity
.
findViewById
(
R
.
id
.
home
);
}
}
if
(
view
!=
null
)
{
if
(
view
!=
null
)
{
view
.
setPadding
(
(
int
)(
density
*
6
),
0
,
(
int
)(
density
*
6
),
0
);
view
.
setPadding
(
Utilities
.
dp
(
6
),
0
,
Utilities
.
dp
(
6
),
0
);
}
}
actionBar
.
setHomeButtonEnabled
(
false
);
actionBar
.
setHomeButtonEnabled
(
false
);
actionBar
.
setDisplayShowTitleEnabled
(
true
);
actionBar
.
setDisplayShowTitleEnabled
(
true
);
...
@@ -752,7 +750,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
...
@@ -752,7 +750,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
}
}
View
v
=
view
.
findViewById
(
R
.
id
.
settings_row_divider
);
View
v
=
view
.
findViewById
(
R
.
id
.
settings_row_divider
);
v
.
setVisibility
(
View
.
VISIBLE
);
v
.
setVisibility
(
View
.
VISIBLE
);
view
.
setPadding
(
(
int
)(
11
*
density
),
0
,
(
int
)(
11
*
density
),
0
);
view
.
setPadding
(
Utilities
.
dp
(
11
),
0
,
Utilities
.
dp
(
11
),
0
);
}
}
MessagesListSearchRowHolder
holder
=
(
MessagesListSearchRowHolder
)
view
.
getTag
();
MessagesListSearchRowHolder
holder
=
(
MessagesListSearchRowHolder
)
view
.
getTag
();
if
(
holder
==
null
)
{
if
(
holder
==
null
)
{
...
@@ -781,7 +779,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
...
@@ -781,7 +779,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
}
else
{
}
else
{
holder
.
nameTextView
.
setCompoundDrawablesWithIntrinsicBounds
(
0
,
0
,
R
.
drawable
.
ic_lock_green
,
0
);
holder
.
nameTextView
.
setCompoundDrawablesWithIntrinsicBounds
(
0
,
0
,
R
.
drawable
.
ic_lock_green
,
0
);
}
}
holder
.
nameTextView
.
setCompoundDrawablePadding
(
(
int
)(
4
*
density
));
holder
.
nameTextView
.
setCompoundDrawablePadding
(
Utilities
.
dp
(
4
));
}
else
{
}
else
{
holder
.
nameTextView
.
setCompoundDrawablesWithIntrinsicBounds
(
0
,
0
,
0
,
0
);
holder
.
nameTextView
.
setCompoundDrawablesWithIntrinsicBounds
(
0
,
0
,
0
,
0
);
holder
.
nameTextView
.
setCompoundDrawablePadding
(
0
);
holder
.
nameTextView
.
setCompoundDrawablePadding
(
0
);
...
@@ -972,7 +970,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
...
@@ -972,7 +970,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
}
else
{
}
else
{
nameTextView
.
setCompoundDrawablesWithIntrinsicBounds
(
0
,
0
,
R
.
drawable
.
ic_lock_green
,
0
);
nameTextView
.
setCompoundDrawablesWithIntrinsicBounds
(
0
,
0
,
R
.
drawable
.
ic_lock_green
,
0
);
}
}
nameTextView
.
setCompoundDrawablePadding
(
(
int
)(
4
*
density
));
nameTextView
.
setCompoundDrawablePadding
(
Utilities
.
dp
(
4
));
}
else
{
}
else
{
Log
.
e
(
"test"
,
"tda"
);
Log
.
e
(
"test"
,
"tda"
);
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeNameActivity.java
View file @
9d2dfd33
...
@@ -75,7 +75,7 @@ public class SettingsChangeNameActivity extends BaseFragment {
...
@@ -75,7 +75,7 @@ public class SettingsChangeNameActivity extends BaseFragment {
doneButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
doneButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
view
)
{
public
void
onClick
(
View
view
)
{
if
(
firstNameField
.
getText
().
length
()
!=
0
&&
lastNameField
.
getText
().
length
()
!=
0
)
{
if
(
firstNameField
.
getText
().
length
()
!=
0
)
{
saveName
();
saveName
();
finishFragment
();
finishFragment
();
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java
View file @
9d2dfd33
...
@@ -52,7 +52,6 @@ import java.util.HashMap;
...
@@ -52,7 +52,6 @@ import java.util.HashMap;
public
class
SettingsWallpapersActivity
extends
BaseFragment
implements
NotificationCenter
.
NotificationCenterDelegate
{
public
class
SettingsWallpapersActivity
extends
BaseFragment
implements
NotificationCenter
.
NotificationCenterDelegate
{
private
HorizontalListView
listView
;
private
HorizontalListView
listView
;
private
ListAdapter
listAdapter
;
private
ListAdapter
listAdapter
;
private
float
density
;
private
ImageView
backgroundImage
;
private
ImageView
backgroundImage
;
private
ProgressBar
progressBar
;
private
ProgressBar
progressBar
;
private
int
selectedBackground
;
private
int
selectedBackground
;
...
@@ -95,7 +94,6 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
...
@@ -95,7 +94,6 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
if
(
fragmentView
==
null
)
{
if
(
fragmentView
==
null
)
{
fragmentView
=
inflater
.
inflate
(
R
.
layout
.
settings_wallpapers_layout
,
container
,
false
);
fragmentView
=
inflater
.
inflate
(
R
.
layout
.
settings_wallpapers_layout
,
container
,
false
);
listAdapter
=
new
ListAdapter
(
parentActivity
);
listAdapter
=
new
ListAdapter
(
parentActivity
);
density
=
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
;
progressBar
=
(
ProgressBar
)
fragmentView
.
findViewById
(
R
.
id
.
action_progress
);
progressBar
=
(
ProgressBar
)
fragmentView
.
findViewById
(
R
.
id
.
action_progress
);
backgroundImage
=
(
ImageView
)
fragmentView
.
findViewById
(
R
.
id
.
background_image
);
backgroundImage
=
(
ImageView
)
fragmentView
.
findViewById
(
R
.
id
.
background_image
);
...
@@ -152,7 +150,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
...
@@ -152,7 +150,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
boolean
done
;
boolean
done
;
TLRPC
.
WallPaper
wallPaper
=
wallpappersByIds
.
get
(
selectedBackground
);
TLRPC
.
WallPaper
wallPaper
=
wallpappersByIds
.
get
(
selectedBackground
);
if
(
wallPaper
!=
null
&&
wallPaper
.
id
!=
1000001
&&
wallPaper
instanceof
TLRPC
.
TL_wallPaper
)
{
if
(
wallPaper
!=
null
&&
wallPaper
.
id
!=
1000001
&&
wallPaper
instanceof
TLRPC
.
TL_wallPaper
)
{
TLRPC
.
PhotoSize
size
=
PhotoObject
.
getClosestPhotoSizeWithSize
(
wallPaper
.
sizes
,
(
int
)
(
320
*
density
),
(
int
)
(
480
*
density
));
TLRPC
.
PhotoSize
size
=
PhotoObject
.
getClosestPhotoSizeWithSize
(
wallPaper
.
sizes
,
Utilities
.
dp
(
320
),
Utilities
.
dp
(
480
));
String
fileName
=
size
.
location
.
volume_id
+
"_"
+
size
.
location
.
local_id
+
".jpg"
;
String
fileName
=
size
.
location
.
volume_id
+
"_"
+
size
.
location
.
local_id
+
".jpg"
;
File
f
=
new
File
(
Utilities
.
getCacheDir
(),
fileName
);
File
f
=
new
File
(
Utilities
.
getCacheDir
(),
fileName
);
File
toFile
=
new
File
(
ApplicationLoader
.
applicationContext
.
getFilesDir
(),
"wallpaper.jpg"
);
File
toFile
=
new
File
(
ApplicationLoader
.
applicationContext
.
getFilesDir
(),
"wallpaper.jpg"
);
...
@@ -195,7 +193,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
...
@@ -195,7 +193,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
if
(
requestCode
==
0
)
{
if
(
requestCode
==
0
)
{
Utilities
.
addMediaToGallery
(
currentPicturePath
);
Utilities
.
addMediaToGallery
(
currentPicturePath
);
try
{
try
{
Bitmap
bitmap
=
FileLoader
.
loadBitmap
(
currentPicturePath
,
(
int
)(
320
*
density
),
(
int
)(
480
*
density
));
Bitmap
bitmap
=
FileLoader
.
loadBitmap
(
currentPicturePath
,
Utilities
.
dp
(
320
),
Utilities
.
dp
(
480
));
File
toFile
=
new
File
(
ApplicationLoader
.
applicationContext
.
getFilesDir
(),
"wallpaper.jpg"
);
File
toFile
=
new
File
(
ApplicationLoader
.
applicationContext
.
getFilesDir
(),
"wallpaper.jpg"
);
FileOutputStream
stream
=
new
FileOutputStream
(
toFile
);
FileOutputStream
stream
=
new
FileOutputStream
(
toFile
);
bitmap
.
compress
(
Bitmap
.
CompressFormat
.
JPEG
,
87
,
stream
);
bitmap
.
compress
(
Bitmap
.
CompressFormat
.
JPEG
,
87
,
stream
);
...
@@ -220,7 +218,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
...
@@ -220,7 +218,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
}
}
cursor
.
close
();
cursor
.
close
();
Bitmap
bitmap
=
FileLoader
.
loadBitmap
(
imageFilePath
,
(
int
)(
320
*
density
),
(
int
)(
480
*
density
));
Bitmap
bitmap
=
FileLoader
.
loadBitmap
(
imageFilePath
,
Utilities
.
dp
(
320
),
Utilities
.
dp
(
480
));
File
toFile
=
new
File
(
ApplicationLoader
.
applicationContext
.
getFilesDir
(),
"wallpaper.jpg"
);
File
toFile
=
new
File
(
ApplicationLoader
.
applicationContext
.
getFilesDir
(),
"wallpaper.jpg"
);
FileOutputStream
stream
=
new
FileOutputStream
(
toFile
);
FileOutputStream
stream
=
new
FileOutputStream
(
toFile
);
bitmap
.
compress
(
Bitmap
.
CompressFormat
.
JPEG
,
87
,
stream
);
bitmap
.
compress
(
Bitmap
.
CompressFormat
.
JPEG
,
87
,
stream
);
...
@@ -237,7 +235,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
...
@@ -237,7 +235,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
private
void
processSelectedBackground
()
{
private
void
processSelectedBackground
()
{
TLRPC
.
WallPaper
wallPaper
=
wallpappersByIds
.
get
(
selectedBackground
);
TLRPC
.
WallPaper
wallPaper
=
wallpappersByIds
.
get
(
selectedBackground
);
if
(
selectedBackground
!=
-
1
&&
selectedBackground
!=
1000001
&&
wallPaper
!=
null
&&
wallPaper
instanceof
TLRPC
.
TL_wallPaper
)
{
if
(
selectedBackground
!=
-
1
&&
selectedBackground
!=
1000001
&&
wallPaper
!=
null
&&
wallPaper
instanceof
TLRPC
.
TL_wallPaper
)
{
TLRPC
.
PhotoSize
size
=
PhotoObject
.
getClosestPhotoSizeWithSize
(
wallPaper
.
sizes
,
(
int
)(
320
*
density
),
(
int
)(
480
*
density
));
TLRPC
.
PhotoSize
size
=
PhotoObject
.
getClosestPhotoSizeWithSize
(
wallPaper
.
sizes
,
Utilities
.
dp
(
320
),
Utilities
.
dp
(
480
));
String
fileName
=
size
.
location
.
volume_id
+
"_"
+
size
.
location
.
local_id
+
".jpg"
;
String
fileName
=
size
.
location
.
volume_id
+
"_"
+
size
.
location
.
local_id
+
".jpg"
;
File
f
=
new
File
(
Utilities
.
getCacheDir
(),
fileName
);
File
f
=
new
File
(
Utilities
.
getCacheDir
(),
fileName
);
if
(!
f
.
exists
())
{
if
(!
f
.
exists
())
{
...
@@ -509,7 +507,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
...
@@ -509,7 +507,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
BackupImageView
image
=
(
BackupImageView
)
view
.
findViewById
(
R
.
id
.
image
);
BackupImageView
image
=
(
BackupImageView
)
view
.
findViewById
(
R
.
id
.
image
);
View
selection
=
view
.
findViewById
(
R
.
id
.
selection
);
View
selection
=
view
.
findViewById
(
R
.
id
.
selection
);
TLRPC
.
WallPaper
wallPaper
=
wallPapers
.
get
(
i
-
1
);
TLRPC
.
WallPaper
wallPaper
=
wallPapers
.
get
(
i
-
1
);
TLRPC
.
PhotoSize
size
=
PhotoObject
.
getClosestPhotoSizeWithSize
(
wallPaper
.
sizes
,
(
int
)(
100
*
density
),
(
int
)(
100
*
density
));
TLRPC
.
PhotoSize
size
=
PhotoObject
.
getClosestPhotoSizeWithSize
(
wallPaper
.
sizes
,
Utilities
.
dp
(
100
),
Utilities
.
dp
(
100
));
image
.
setImage
(
size
.
location
,
"100_100"
,
0
);
image
.
setImage
(
size
.
location
,
"100_100"
,
0
);
if
(
wallPaper
.
id
==
selectedBackground
)
{
if
(
wallPaper
.
id
==
selectedBackground
)
{
selection
.
setVisibility
(
View
.
VISIBLE
);
selection
.
setVisibility
(
View
.
VISIBLE
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java
View file @
9d2dfd33
...
@@ -345,7 +345,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
...
@@ -345,7 +345,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
if
(
title
!=
null
)
{
if
(
title
!=
null
)
{
if
(
dialog_id
!=
0
)
{
if
(
dialog_id
!=
0
)
{
title
.
setCompoundDrawablesWithIntrinsicBounds
(
R
.
drawable
.
ic_lock_white
,
0
,
0
,
0
);
title
.
setCompoundDrawablesWithIntrinsicBounds
(
R
.
drawable
.
ic_lock_white
,
0
,
0
,
0
);
title
.
setCompoundDrawablePadding
(
(
int
)(
4
*
getResources
().
getDisplayMetrics
().
density
));
title
.
setCompoundDrawablePadding
(
Utilities
.
dp
(
4
));
}
else
{
}
else
{
title
.
setCompoundDrawablesWithIntrinsicBounds
(
0
,
0
,
0
,
0
);
title
.
setCompoundDrawablesWithIntrinsicBounds
(
0
,
0
,
0
,
0
);
title
.
setCompoundDrawablePadding
(
0
);
title
.
setCompoundDrawablePadding
(
0
);
...
@@ -392,7 +392,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
...
@@ -392,7 +392,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
}
}
if
(
title
!=
null
)
{
if
(
title
!=
null
)
{
title
.
setCompoundDrawablesWithIntrinsicBounds
(
R
.
drawable
.
ic_lock_white
,
0
,
0
,
0
);
title
.
setCompoundDrawablesWithIntrinsicBounds
(
R
.
drawable
.
ic_lock_white
,
0
,
0
,
0
);
title
.
setCompoundDrawablePadding
(
(
int
)(
4
*
ApplicationLoader
.
applicationContext
.
getResources
().
getDisplayMetrics
().
density
));
title
.
setCompoundDrawablePadding
(
Utilities
.
dp
(
4
));
}
}
}
}
return
false
;
return
false
;
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/MessageActionLayout.java
View file @
9d2dfd33
...
@@ -11,10 +11,10 @@ package org.telegram.ui.Views;
...
@@ -11,10 +11,10 @@ package org.telegram.ui.Views;
import
android.widget.FrameLayout
;
import
android.widget.FrameLayout
;
import
org.telegram.messenger.R
;
import
org.telegram.messenger.R
;
import
org.telegram.messenger.Utilities
;
public
class
MessageActionLayout
extends
FrameLayout
{
public
class
MessageActionLayout
extends
FrameLayout
{
public
TightTextView
messageTextView
;
public
TightTextView
messageTextView
;
public
float
density
=
1
;
public
MessageActionLayout
(
android
.
content
.
Context
context
)
{
public
MessageActionLayout
(
android
.
content
.
Context
context
)
{
super
(
context
);
super
(
context
);
...
@@ -31,7 +31,7 @@ public class MessageActionLayout extends FrameLayout {
...
@@ -31,7 +31,7 @@ public class MessageActionLayout extends FrameLayout {
@Override
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
setMeasuredDimension
(
messageTextView
.
linesMaxWidth
+
(
int
)(
14
*
density
),
getMeasuredHeight
());
setMeasuredDimension
(
messageTextView
.
linesMaxWidth
+
Utilities
.
dp
(
14
),
getMeasuredHeight
());
}
}
@Override
@Override
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/MessageLayout.java
View file @
9d2dfd33
...
@@ -12,12 +12,12 @@ import android.view.View;
...
@@ -12,12 +12,12 @@ import android.view.View;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
org.telegram.messenger.R
;
import
org.telegram.messenger.R
;
import
org.telegram.messenger.Utilities
;
public
class
MessageLayout
extends
FrameLayoutFixed
{
public
class
MessageLayout
extends
FrameLayoutFixed
{
public
TextView
timeTextView
;
public
TextView
timeTextView
;
public
View
timeLayout
;
public
View
timeLayout
;
public
TightTextView
messageTextView
;
public
TightTextView
messageTextView
;
public
float
density
=
1
;
public
int
maxWidth
;
public
int
maxWidth
;
public
MessageLayout
(
android
.
content
.
Context
context
)
{
public
MessageLayout
(
android
.
content
.
Context
context
)
{
...
@@ -38,18 +38,17 @@ public class MessageLayout extends FrameLayoutFixed {
...
@@ -38,18 +38,17 @@ public class MessageLayout extends FrameLayoutFixed {
int
timeWidth
=
timeLayout
!=
null
?
timeLayout
.
getMeasuredWidth
()
:
timeTextView
.
getMeasuredWidth
();
int
timeWidth
=
timeLayout
!=
null
?
timeLayout
.
getMeasuredWidth
()
:
timeTextView
.
getMeasuredWidth
();
int
totalWidth
=
getMeasuredWidth
();
int
totalWidth
=
getMeasuredWidth
();
int
maxChildWidth
=
getChildAt
(
0
).
getMeasuredWidth
();
int
maxChildWidth
=
getChildAt
(
0
).
getMeasuredWidth
();
int
count
=
getChildCount
();
int
count
=
getChildCount
();
for
(
int
a
=
1
;
a
<
count
-
1
;
a
++)
{
for
(
int
a
=
1
;
a
<
count
-
1
;
a
++)
{
maxChildWidth
=
Math
.
max
(
maxChildWidth
,
getChildAt
(
a
).
getMeasuredWidth
());
maxChildWidth
=
Math
.
max
(
maxChildWidth
,
getChildAt
(
a
).
getMeasuredWidth
());
}
}
int
timeMore
=
(
int
)(
timeWidth
+
6
*
density
);
int
timeMore
=
timeWidth
+
Utilities
.
dp
(
6
);
int
fields
=
totalWidth
-
Math
.
max
(
maxChildWidth
,
timeWidth
);
int
fields
=
totalWidth
-
Math
.
max
(
maxChildWidth
,
timeWidth
);
int
height
=
getMeasuredHeight
();
int
height
=
getMeasuredHeight
();
if
(
maxWidth
-
messageTextView
.
lastLineWidth
<
timeMore
)
{
if
(
maxWidth
-
messageTextView
.
lastLineWidth
<
timeMore
)
{
setMeasuredDimension
(
Math
.
max
(
maxChildWidth
,
messageTextView
.
lastLineWidth
)
+
fields
,
(
int
)(
height
+
14
*
density
));
setMeasuredDimension
(
Math
.
max
(
maxChildWidth
,
messageTextView
.
lastLineWidth
)
+
fields
,
height
+
Utilities
.
dp
(
14
));
}
else
{
}
else
{
int
diff
=
maxChildWidth
-
messageTextView
.
lastLineWidth
;
int
diff
=
maxChildWidth
-
messageTextView
.
lastLineWidth
;
if
(
diff
>=
0
&&
diff
<=
timeMore
)
{
if
(
diff
>=
0
&&
diff
<=
timeMore
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/NotificationView.java
View file @
9d2dfd33
...
@@ -289,7 +289,7 @@ public class NotificationView extends LinearLayout {
...
@@ -289,7 +289,7 @@ public class NotificationView extends LinearLayout {
}
}
}
}
public
void
applyOrientationPaddings
(
boolean
isLandscape
,
float
density
,
int
height
)
{
public
void
applyOrientationPaddings
(
boolean
isLandscape
,
int
height
)
{
FrameLayout
.
LayoutParams
params
=
(
FrameLayout
.
LayoutParams
)
avatarImage
.
getLayoutParams
();
FrameLayout
.
LayoutParams
params
=
(
FrameLayout
.
LayoutParams
)
avatarImage
.
getLayoutParams
();
params
.
width
=
height
;
params
.
width
=
height
;
params
.
height
=
height
;
params
.
height
=
height
;
...
@@ -298,22 +298,22 @@ public class NotificationView extends LinearLayout {
...
@@ -298,22 +298,22 @@ public class NotificationView extends LinearLayout {
if
(
isLandscape
)
{
if
(
isLandscape
)
{
nameTextView
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_SP
,
14
);
nameTextView
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_SP
,
14
);
messageTextView
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_SP
,
14
);
messageTextView
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_SP
,
14
);
nameTextView
.
setPadding
(
0
,
(
int
)(
2
*
density
),
0
,
0
);
nameTextView
.
setPadding
(
0
,
Utilities
.
dp
(
2
),
0
,
0
);
messageTextView
.
setPadding
(
0
,
(
int
)(
18
*
density
),
0
,
0
);
messageTextView
.
setPadding
(
0
,
Utilities
.
dp
(
18
),
0
,
0
);
if
(
isRTL
)
{
if
(
isRTL
)
{
params1
.
setMargins
(
(
int
)(
40
*
density
),
0
,
(
int
)(
height
+
6
*
density
),
0
);
params1
.
setMargins
(
Utilities
.
dp
(
40
),
0
,
height
+
Utilities
.
dp
(
6
),
0
);
}
else
{
}
else
{
params1
.
setMargins
(
(
int
)(
height
+
6
*
density
),
0
,
(
int
)(
40
*
density
),
0
);
params1
.
setMargins
(
height
+
Utilities
.
dp
(
6
),
0
,
Utilities
.
dp
(
40
),
0
);
}
}
}
else
{
}
else
{
nameTextView
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_SP
,
15
);
nameTextView
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_SP
,
15
);
messageTextView
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_SP
,
15
);
messageTextView
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_SP
,
15
);
nameTextView
.
setPadding
(
0
,
(
int
)(
4
*
density
),
0
,
0
);
nameTextView
.
setPadding
(
0
,
Utilities
.
dp
(
4
),
0
,
0
);
messageTextView
.
setPadding
(
0
,
(
int
)
(
24
*
density
),
0
,
0
);
messageTextView
.
setPadding
(
0
,
Utilities
.
dp
(
24
),
0
,
0
);
if
(
isRTL
)
{
if
(
isRTL
)
{
params1
.
setMargins
(
(
int
)(
40
*
density
),
0
,
(
int
)(
height
+
8
*
density
),
0
);
params1
.
setMargins
(
Utilities
.
dp
(
40
),
0
,
height
+
Utilities
.
dp
(
8
),
0
);
}
else
{
}
else
{
params1
.
setMargins
(
(
int
)(
height
+
8
*
density
),
0
,
(
int
)(
40
*
density
),
0
);
params1
.
setMargins
(
height
+
Utilities
.
dp
(
8
),
0
,
Utilities
.
dp
(
40
),
0
);
}
}
}
}
textLayout
.
setLayoutParams
(
params1
);
textLayout
.
setLayoutParams
(
params1
);
...
...
TMessagesProj/src/main/res/drawable-hdpi/map_dot.png
deleted
100644 → 0
View file @
51add404
2.02 KB
TMessagesProj/src/main/res/drawable-ldpi/map_dot.png
deleted
100644 → 0
View file @
51add404
1.44 KB
TMessagesProj/src/main/res/drawable-mdpi/map_dot.png
deleted
100644 → 0
View file @
51add404
1.62 KB
TMessagesProj/src/main/res/drawable-xhdpi/map_dot.png
deleted
100644 → 0
View file @
51add404
2.39 KB
TMessagesProj/src/main/res/drawable-xxhdpi/map_dot.png
deleted
100644 → 0
View file @
51add404
3.38 KB
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