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
ea8f9244
Commit
ea8f9244
authored
Mar 02, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed RTL name position in messages
parent
aa5ff577
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
11 deletions
+18
-11
AndroidManifest.xml
TMessagesProj/src/main/AndroidManifest.xml
+1
-1
ConnectionsManager.java
.../main/java/org/telegram/messenger/ConnectionsManager.java
+1
-0
MessageObject.java
...roj/src/main/java/org/telegram/objects/MessageObject.java
+2
-2
ChatBaseCell.java
...roj/src/main/java/org/telegram/ui/Cells/ChatBaseCell.java
+6
-2
ChatMessageCell.java
.../src/main/java/org/telegram/ui/Cells/ChatMessageCell.java
+5
-5
ChatActivity.java
...sagesProj/src/main/java/org/telegram/ui/ChatActivity.java
+2
-0
SettingsActivity.java
...sProj/src/main/java/org/telegram/ui/SettingsActivity.java
+1
-1
No files found.
TMessagesProj/src/main/AndroidManifest.xml
View file @
ea8f9244
<?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=
"17
5
"
android:versionCode=
"17
7
"
android:versionName=
"1.3.26"
>
android:versionName=
"1.3.26"
>
<supports-screens
android:anyDensity=
"true"
<supports-screens
android:anyDensity=
"true"
...
...
TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java
View file @
ea8f9244
...
@@ -35,6 +35,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
...
@@ -35,6 +35,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
public
static
String
APP_HASH
=
"5bce48dc7d331e62c955669eb7233217"
;
public
static
String
APP_HASH
=
"5bce48dc7d331e62c955669eb7233217"
;
public
static
String
HOCKEY_APP_HASH
=
"your-hockeyapp-api-key-here"
;
public
static
String
HOCKEY_APP_HASH
=
"your-hockeyapp-api-key-here"
;
public
static
String
GCM_SENDER_ID
=
"760348033672"
;
public
static
String
GCM_SENDER_ID
=
"760348033672"
;
public
static
String
SEND_LOGS_EMAIL
=
"email@gmail.com"
;
private
HashMap
<
Integer
,
Datacenter
>
datacenters
=
new
HashMap
<
Integer
,
Datacenter
>();
private
HashMap
<
Integer
,
Datacenter
>
datacenters
=
new
HashMap
<
Integer
,
Datacenter
>();
private
HashMap
<
Long
,
ArrayList
<
Long
>>
processedMessageIdsSet
=
new
HashMap
<
Long
,
ArrayList
<
Long
>>();
private
HashMap
<
Long
,
ArrayList
<
Long
>>
processedMessageIdsSet
=
new
HashMap
<
Long
,
ArrayList
<
Long
>>();
...
...
TMessagesProj/src/main/java/org/telegram/objects/MessageObject.java
View file @
ea8f9244
...
@@ -376,9 +376,9 @@ public class MessageObject {
...
@@ -376,9 +376,9 @@ public class MessageObject {
textLayoutBlocks
=
new
ArrayList
<
TextLayoutBlock
>();
textLayoutBlocks
=
new
ArrayList
<
TextLayoutBlock
>();
if
(
messageText
instanceof
Spannable
)
{
if
(
messageText
instanceof
Spannable
)
{
if
(
messageOwner
.
message
!=
null
&&
messageOwner
.
message
.
contains
(
"."
))
{
if
(
messageOwner
.
message
!=
null
&&
messageOwner
.
message
.
contains
(
"."
)
&&
(
messageOwner
.
message
.
contains
(
".com"
)
||
messageOwner
.
message
.
contains
(
"http"
)
||
messageOwner
.
message
.
contains
(
".ru"
)
||
messageOwner
.
message
.
contains
(
".org"
)
||
messageOwner
.
message
.
contains
(
".net"
))
)
{
Linkify
.
addLinks
((
Spannable
)
messageText
,
Linkify
.
WEB_URLS
);
Linkify
.
addLinks
((
Spannable
)
messageText
,
Linkify
.
WEB_URLS
);
}
else
if
(
messageText
.
length
()
<
4
00
)
{
}
else
if
(
messageText
.
length
()
<
1
00
)
{
Linkify
.
addLinks
((
Spannable
)
messageText
,
Linkify
.
WEB_URLS
|
Linkify
.
EMAIL_ADDRESSES
|
Linkify
.
PHONE_NUMBERS
);
Linkify
.
addLinks
((
Spannable
)
messageText
,
Linkify
.
WEB_URLS
|
Linkify
.
EMAIL_ADDRESSES
|
Linkify
.
PHONE_NUMBERS
);
}
}
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatBaseCell.java
View file @
ea8f9244
...
@@ -68,6 +68,7 @@ public class ChatBaseCell extends BaseCell {
...
@@ -68,6 +68,7 @@ public class ChatBaseCell extends BaseCell {
private
StaticLayout
nameLayout
;
private
StaticLayout
nameLayout
;
protected
int
nameWidth
;
protected
int
nameWidth
;
private
float
nameOffsetX
=
0
;
protected
boolean
drawName
=
false
;
protected
boolean
drawName
=
false
;
private
StaticLayout
forwardedNameLayout
;
private
StaticLayout
forwardedNameLayout
;
...
@@ -75,6 +76,7 @@ public class ChatBaseCell extends BaseCell {
...
@@ -75,6 +76,7 @@ public class ChatBaseCell extends BaseCell {
protected
boolean
drawForwardedName
=
false
;
protected
boolean
drawForwardedName
=
false
;
private
int
forwardNameX
;
private
int
forwardNameX
;
private
int
forwardNameY
;
private
int
forwardNameY
;
private
float
forwardNameOffsetX
=
0
;
private
StaticLayout
timeLayout
;
private
StaticLayout
timeLayout
;
protected
int
timeWidth
;
protected
int
timeWidth
;
...
@@ -218,6 +220,7 @@ public class ChatBaseCell extends BaseCell {
...
@@ -218,6 +220,7 @@ public class ChatBaseCell extends BaseCell {
if
(
nameLayout
.
getLineCount
()
>
0
)
{
if
(
nameLayout
.
getLineCount
()
>
0
)
{
nameWidth
=
(
int
)
Math
.
ceil
(
nameLayout
.
getLineWidth
(
0
));
nameWidth
=
(
int
)
Math
.
ceil
(
nameLayout
.
getLineWidth
(
0
));
namesOffset
+=
Utilities
.
dp
(
18
);
namesOffset
+=
Utilities
.
dp
(
18
);
nameOffsetX
=
nameLayout
.
getLineLeft
(
0
);
}
else
{
}
else
{
nameWidth
=
0
;
nameWidth
=
0
;
}
}
...
@@ -240,6 +243,7 @@ public class ChatBaseCell extends BaseCell {
...
@@ -240,6 +243,7 @@ public class ChatBaseCell extends BaseCell {
if
(
forwardedNameLayout
.
getLineCount
()
>
1
)
{
if
(
forwardedNameLayout
.
getLineCount
()
>
1
)
{
forwardedNameWidth
=
Math
.
max
((
int
)
Math
.
ceil
(
forwardedNameLayout
.
getLineWidth
(
0
)),
(
int
)
Math
.
ceil
(
forwardedNameLayout
.
getLineWidth
(
1
)));
forwardedNameWidth
=
Math
.
max
((
int
)
Math
.
ceil
(
forwardedNameLayout
.
getLineWidth
(
0
)),
(
int
)
Math
.
ceil
(
forwardedNameLayout
.
getLineWidth
(
1
)));
namesOffset
+=
Utilities
.
dp
(
36
);
namesOffset
+=
Utilities
.
dp
(
36
);
forwardNameOffsetX
=
Math
.
min
(
forwardedNameLayout
.
getLineLeft
(
0
),
forwardedNameLayout
.
getLineLeft
(
1
));
}
else
{
}
else
{
forwardedNameWidth
=
0
;
forwardedNameWidth
=
0
;
}
}
...
@@ -381,7 +385,7 @@ public class ChatBaseCell extends BaseCell {
...
@@ -381,7 +385,7 @@ public class ChatBaseCell extends BaseCell {
if
(
drawName
&&
nameLayout
!=
null
)
{
if
(
drawName
&&
nameLayout
!=
null
)
{
canvas
.
save
();
canvas
.
save
();
canvas
.
translate
(
currentBackgroundDrawable
.
getBounds
().
left
+
Utilities
.
dp
(
19
),
Utilities
.
dp
(
10
));
canvas
.
translate
(
currentBackgroundDrawable
.
getBounds
().
left
+
Utilities
.
dp
(
19
)
-
nameOffsetX
,
Utilities
.
dp
(
10
));
namePaint
.
setColor
(
Utilities
.
getColorForId
(
currentUser
.
id
));
namePaint
.
setColor
(
Utilities
.
getColorForId
(
currentUser
.
id
));
nameLayout
.
draw
(
canvas
);
nameLayout
.
draw
(
canvas
);
canvas
.
restore
();
canvas
.
restore
();
...
@@ -398,7 +402,7 @@ public class ChatBaseCell extends BaseCell {
...
@@ -398,7 +402,7 @@ public class ChatBaseCell extends BaseCell {
forwardNameX
=
currentBackgroundDrawable
.
getBounds
().
left
+
Utilities
.
dp
(
19
);
forwardNameX
=
currentBackgroundDrawable
.
getBounds
().
left
+
Utilities
.
dp
(
19
);
forwardNameY
=
Utilities
.
dp
(
10
+
(
drawName
?
18
:
0
));
forwardNameY
=
Utilities
.
dp
(
10
+
(
drawName
?
18
:
0
));
}
}
canvas
.
translate
(
forwardNameX
,
forwardNameY
);
canvas
.
translate
(
forwardNameX
-
forwardNameOffsetX
,
forwardNameY
);
forwardedNameLayout
.
draw
(
canvas
);
forwardedNameLayout
.
draw
(
canvas
);
canvas
.
restore
();
canvas
.
restore
();
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java
View file @
ea8f9244
...
@@ -12,7 +12,6 @@ import android.content.Context;
...
@@ -12,7 +12,6 @@ import android.content.Context;
import
android.graphics.Canvas
;
import
android.graphics.Canvas
;
import
android.text.Spannable
;
import
android.text.Spannable
;
import
android.text.style.ClickableSpan
;
import
android.text.style.ClickableSpan
;
import
android.util.Log
;
import
android.view.MotionEvent
;
import
android.view.MotionEvent
;
import
org.telegram.messenger.Utilities
;
import
org.telegram.messenger.Utilities
;
...
@@ -30,6 +29,8 @@ public class ChatMessageCell extends ChatBaseCell {
...
@@ -30,6 +29,8 @@ public class ChatMessageCell extends ChatBaseCell {
private
int
firstVisibleBlockNum
=
0
;
private
int
firstVisibleBlockNum
=
0
;
private
int
totalVisibleBlocksCount
=
0
;
private
int
totalVisibleBlocksCount
=
0
;
private
boolean
wasLayout
=
false
;
public
ChatMessageCell
(
Context
context
,
boolean
isChat
)
{
public
ChatMessageCell
(
Context
context
,
boolean
isChat
)
{
super
(
context
,
isChat
);
super
(
context
,
isChat
);
drawForwardedName
=
true
;
drawForwardedName
=
true
;
...
@@ -88,9 +89,6 @@ public class ChatMessageCell extends ChatBaseCell {
...
@@ -88,9 +89,6 @@ public class ChatMessageCell extends ChatBaseCell {
public
void
setVisiblePart
(
int
position
,
int
height
)
{
public
void
setVisiblePart
(
int
position
,
int
height
)
{
visibleY
=
position
;
visibleY
=
position
;
visibleHeight
=
height
;
visibleHeight
=
height
;
if
(
visibleY
<
0
)
{
Log
.
e
(
"tmessages"
,
"vis = "
+
visibleY
);
}
int
newFirst
=
-
1
,
newLast
=
-
1
,
newCount
=
0
;
int
newFirst
=
-
1
,
newLast
=
-
1
,
newCount
=
0
;
...
@@ -126,6 +124,7 @@ public class ChatMessageCell extends ChatBaseCell {
...
@@ -126,6 +124,7 @@ public class ChatMessageCell extends ChatBaseCell {
@Override
@Override
public
void
setMessageObject
(
MessageObject
messageObject
)
{
public
void
setMessageObject
(
MessageObject
messageObject
)
{
if
(
currentMessageObject
!=
messageObject
||
isUserDataChanged
())
{
if
(
currentMessageObject
!=
messageObject
||
isUserDataChanged
())
{
wasLayout
=
false
;
pressedLink
=
null
;
pressedLink
=
null
;
int
maxWidth
;
int
maxWidth
;
if
(
chat
)
{
if
(
chat
)
{
...
@@ -173,7 +172,7 @@ public class ChatMessageCell extends ChatBaseCell {
...
@@ -173,7 +172,7 @@ public class ChatMessageCell extends ChatBaseCell {
protected
void
onLayout
(
boolean
changed
,
int
left
,
int
top
,
int
right
,
int
bottom
)
{
protected
void
onLayout
(
boolean
changed
,
int
left
,
int
top
,
int
right
,
int
bottom
)
{
super
.
onLayout
(
changed
,
left
,
top
,
right
,
bottom
);
super
.
onLayout
(
changed
,
left
,
top
,
right
,
bottom
);
if
(
changed
)
{
if
(
changed
||
!
wasLayout
)
{
if
(
currentMessageObject
.
messageOwner
.
out
)
{
if
(
currentMessageObject
.
messageOwner
.
out
)
{
textX
=
layoutWidth
-
backgroundWidth
+
Utilities
.
dp
(
10
);
textX
=
layoutWidth
-
backgroundWidth
+
Utilities
.
dp
(
10
);
textY
=
Utilities
.
dp
(
10
)
+
namesOffset
;
textY
=
Utilities
.
dp
(
10
)
+
namesOffset
;
...
@@ -181,6 +180,7 @@ public class ChatMessageCell extends ChatBaseCell {
...
@@ -181,6 +180,7 @@ public class ChatMessageCell extends ChatBaseCell {
textX
=
Utilities
.
dp
(
19
)
+
(
chat
?
Utilities
.
dp
(
52
)
:
0
);
textX
=
Utilities
.
dp
(
19
)
+
(
chat
?
Utilities
.
dp
(
52
)
:
0
);
textY
=
Utilities
.
dp
(
10
)
+
namesOffset
;
textY
=
Utilities
.
dp
(
10
)
+
namesOffset
;
}
}
wasLayout
=
true
;
}
}
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
View file @
ea8f9244
...
@@ -2897,6 +2897,8 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
...
@@ -2897,6 +2897,8 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
view
.
setBackgroundColor
(
0
);
view
.
setBackgroundColor
(
0
);
}
}
cell
.
setMessageObject
(
cell
.
getMessageObject
());
cell
.
setCheckPressed
(!
disableSelection
,
disableSelection
&&
selected
);
cell
.
setCheckPressed
(!
disableSelection
,
disableSelection
&&
selected
);
}
}
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java
View file @
ea8f9244
...
@@ -456,7 +456,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
...
@@ -456,7 +456,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
}
}
Intent
i
=
new
Intent
(
Intent
.
ACTION_SEND_MULTIPLE
);
Intent
i
=
new
Intent
(
Intent
.
ACTION_SEND_MULTIPLE
);
i
.
setType
(
"message/rfc822"
)
;
i
.
setType
(
"message/rfc822"
)
;
i
.
putExtra
(
Intent
.
EXTRA_EMAIL
,
new
String
[]{
"drklo.2kb@gmail.com"
});
i
.
putExtra
(
Intent
.
EXTRA_EMAIL
,
new
String
[]{
ConnectionsManager
.
SEND_LOGS_EMAIL
});
i
.
putExtra
(
Intent
.
EXTRA_SUBJECT
,
"last logs"
);
i
.
putExtra
(
Intent
.
EXTRA_SUBJECT
,
"last logs"
);
i
.
putParcelableArrayListExtra
(
Intent
.
EXTRA_STREAM
,
uris
);
i
.
putParcelableArrayListExtra
(
Intent
.
EXTRA_STREAM
,
uris
);
startActivity
(
Intent
.
createChooser
(
i
,
"Select email application."
));
startActivity
(
Intent
.
createChooser
(
i
,
"Select email application."
));
...
...
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