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
b85b6c10
Commit
b85b6c10
authored
Jun 22, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added white color to color picker, decelerating scrolling in photo viewer
parent
458517e4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
74 additions
and
12 deletions
+74
-12
build.gradle
TMessagesProj/build.gradle
+1
-1
ConnectionsManager.java
.../main/java/org/telegram/messenger/ConnectionsManager.java
+27
-5
FileLoadOperation.java
...c/main/java/org/telegram/messenger/FileLoadOperation.java
+5
-0
MessagesController.java
.../main/java/org/telegram/messenger/MessagesController.java
+1
-1
LoginActivityRegisterView.java
.../main/java/org/telegram/ui/LoginActivityRegisterView.java
+0
-1
LoginActivitySmsView.java
...j/src/main/java/org/telegram/ui/LoginActivitySmsView.java
+0
-1
PhotoViewer.java
TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java
+39
-2
ColorPickerView.java
.../src/main/java/org/telegram/ui/Views/ColorPickerView.java
+1
-1
No files found.
TMessagesProj/build.gradle
View file @
b85b6c10
...
@@ -81,7 +81,7 @@ android {
...
@@ -81,7 +81,7 @@ android {
defaultConfig
{
defaultConfig
{
minSdkVersion
8
minSdkVersion
8
targetSdkVersion
19
targetSdkVersion
19
versionCode
26
4
versionCode
26
5
versionName
"1.5.7"
versionName
"1.5.7"
}
}
}
}
TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java
View file @
b85b6c10
...
@@ -527,12 +527,34 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
...
@@ -527,12 +527,34 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
Utilities
.
stageQueue
.
postRunnable
(
new
Runnable
()
{
Utilities
.
stageQueue
.
postRunnable
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
Datacenter
datacenter
=
datacenterWithId
(
currentDatacenterId
);
while
(
requestQueue
.
size
()
!=
0
)
{
datacenter
.
recreateSessions
();
RPCRequest
request
=
requestQueue
.
get
(
0
);
requestQueue
.
remove
(
0
);
if
(
request
.
completionBlock
!=
null
)
{
TLRPC
.
TL_error
implicitError
=
new
TLRPC
.
TL_error
();
implicitError
.
code
=
-
1000
;
request
.
completionBlock
.
run
(
null
,
implicitError
);
}
}
while
(
runningRequests
.
size
()
!=
0
)
{
RPCRequest
request
=
runningRequests
.
get
(
0
);
runningRequests
.
remove
(
0
);
if
(
request
.
completionBlock
!=
null
)
{
TLRPC
.
TL_error
implicitError
=
new
TLRPC
.
TL_error
();
implicitError
.
code
=
-
1000
;
request
.
completionBlock
.
run
(
null
,
implicitError
);
}
}
pingIdToDate
.
clear
();
quickAckIdToRequestIds
.
clear
();
clearRequestsForRequestClass
(
RPCRequest
.
RPCRequestClassGeneric
,
datacenter
);
for
(
Datacenter
datacenter
:
datacenters
.
values
())
{
clearRequestsForRequestClass
(
RPCRequest
.
RPCRequestClassDownloadMedia
,
datacenter
);
datacenter
.
recreateSessions
();
clearRequestsForRequestClass
(
RPCRequest
.
RPCRequestClassUploadMedia
,
datacenter
);
datacenter
.
authorized
=
false
;
}
sessionsToDestroy
.
clear
();
saveSession
();
}
}
});
});
}
}
...
...
TMessagesProj/src/main/java/org/telegram/messenger/FileLoadOperation.java
View file @
b85b6c10
...
@@ -383,6 +383,11 @@ public class FileLoadOperation {
...
@@ -383,6 +383,11 @@ public class FileLoadOperation {
if
(
httpUrl
!=
null
)
{
if
(
httpUrl
!=
null
)
{
startDownloadHTTPRequest
();
startDownloadHTTPRequest
();
}
else
{
}
else
{
if
(
totalBytesCount
>=
1024
*
1024
)
{
downloadChunkSize
=
1024
*
256
;
}
else
{
downloadChunkSize
=
1024
*
32
;
}
startDownloadRequest
();
startDownloadRequest
();
}
}
}
}
...
...
TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java
View file @
b85b6c10
...
@@ -3068,7 +3068,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -3068,7 +3068,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
ConnectionsManager
.
getInstance
().
performRpc
(
req
,
new
RPCRequest
.
RPCRequestDelegate
()
{
ConnectionsManager
.
getInstance
().
performRpc
(
req
,
new
RPCRequest
.
RPCRequestDelegate
()
{
@Override
@Override
public
void
run
(
TLObject
response
,
TLRPC
.
TL_error
error
)
{
public
void
run
(
TLObject
response
,
TLRPC
.
TL_error
error
)
{
ConnectionsManager
.
getInstance
().
cleanUp
();
}
}
},
null
,
true
,
RPCRequest
.
RPCRequestClassGeneric
);
},
null
,
true
,
RPCRequest
.
RPCRequestClassGeneric
);
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/LoginActivityRegisterView.java
View file @
b85b6c10
...
@@ -152,7 +152,6 @@ public class LoginActivityRegisterView extends SlideView {
...
@@ -152,7 +152,6 @@ public class LoginActivityRegisterView extends SlideView {
UserConfig
.
clearConfig
();
UserConfig
.
clearConfig
();
MessagesStorage
.
getInstance
().
cleanUp
();
MessagesStorage
.
getInstance
().
cleanUp
();
MessagesController
.
getInstance
().
cleanUp
();
MessagesController
.
getInstance
().
cleanUp
();
ConnectionsManager
.
getInstance
().
cleanUp
();
UserConfig
.
setCurrentUser
(
user
);
UserConfig
.
setCurrentUser
(
user
);
UserConfig
.
saveConfig
(
true
);
UserConfig
.
saveConfig
(
true
);
ArrayList
<
TLRPC
.
User
>
users
=
new
ArrayList
<
TLRPC
.
User
>();
ArrayList
<
TLRPC
.
User
>
users
=
new
ArrayList
<
TLRPC
.
User
>();
...
...
TMessagesProj/src/main/java/org/telegram/ui/LoginActivitySmsView.java
View file @
b85b6c10
...
@@ -221,7 +221,6 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente
...
@@ -221,7 +221,6 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente
UserConfig
.
clearConfig
();
UserConfig
.
clearConfig
();
MessagesStorage
.
getInstance
().
cleanUp
();
MessagesStorage
.
getInstance
().
cleanUp
();
MessagesController
.
getInstance
().
cleanUp
();
MessagesController
.
getInstance
().
cleanUp
();
ConnectionsManager
.
getInstance
().
cleanUp
();
UserConfig
.
setCurrentUser
(
res
.
user
);
UserConfig
.
setCurrentUser
(
res
.
user
);
UserConfig
.
saveConfig
(
true
);
UserConfig
.
saveConfig
(
true
);
ArrayList
<
TLRPC
.
User
>
users
=
new
ArrayList
<
TLRPC
.
User
>();
ArrayList
<
TLRPC
.
User
>
users
=
new
ArrayList
<
TLRPC
.
User
>();
...
...
TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java
View file @
b85b6c10
...
@@ -42,6 +42,7 @@ import android.widget.Button;
...
@@ -42,6 +42,7 @@ import android.widget.Button;
import
android.widget.FrameLayout
;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.ProgressBar
;
import
android.widget.ProgressBar
;
import
android.widget.Scroller
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
org.telegram.messenger.ConnectionsManager
;
import
org.telegram.messenger.ConnectionsManager
;
...
@@ -160,6 +161,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
...
@@ -160,6 +161,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
private
boolean
zoomAnimation
=
false
;
private
boolean
zoomAnimation
=
false
;
private
int
switchImageAfterAnimation
=
0
;
private
int
switchImageAfterAnimation
=
0
;
private
VelocityTracker
velocityTracker
=
null
;
private
VelocityTracker
velocityTracker
=
null
;
private
Scroller
scroller
=
null
;
private
ArrayList
<
MessageObject
>
imagesArrTemp
=
new
ArrayList
<
MessageObject
>();
private
ArrayList
<
MessageObject
>
imagesArrTemp
=
new
ArrayList
<
MessageObject
>();
private
HashMap
<
Integer
,
MessageObject
>
imagesByIdsTemp
=
new
HashMap
<
Integer
,
MessageObject
>();
private
HashMap
<
Integer
,
MessageObject
>
imagesByIdsTemp
=
new
HashMap
<
Integer
,
MessageObject
>();
...
@@ -432,6 +434,8 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
...
@@ -432,6 +434,8 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
public
void
setParentActivity
(
Activity
activity
)
{
public
void
setParentActivity
(
Activity
activity
)
{
parentActivity
=
activity
;
parentActivity
=
activity
;
scroller
=
new
Scroller
(
activity
);
windowView
=
new
FrameLayoutTouchListener
(
activity
);
windowView
=
new
FrameLayoutTouchListener
(
activity
);
windowView
.
setBackgroundDrawable
(
backgroundDrawable
);
windowView
.
setBackgroundDrawable
(
backgroundDrawable
);
windowView
.
setFocusable
(
false
);
windowView
.
setFocusable
(
false
);
...
@@ -1688,6 +1692,9 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
...
@@ -1688,6 +1692,9 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
}
}
if
(
ev
.
getActionMasked
()
==
MotionEvent
.
ACTION_DOWN
||
ev
.
getActionMasked
()
==
MotionEvent
.
ACTION_POINTER_DOWN
)
{
if
(
ev
.
getActionMasked
()
==
MotionEvent
.
ACTION_DOWN
||
ev
.
getActionMasked
()
==
MotionEvent
.
ACTION_POINTER_DOWN
)
{
if
(!
scroller
.
isFinished
())
{
scroller
.
abortAnimation
();
}
if
(!
draggingDown
&&
!
changingPage
)
{
if
(!
draggingDown
&&
!
changingPage
)
{
if
(
canZoom
&&
ev
.
getPointerCount
()
==
2
)
{
if
(
canZoom
&&
ev
.
getPointerCount
()
==
2
)
{
pinchStartDistance
=
(
float
)
Math
.
hypot
(
ev
.
getX
(
1
)
-
ev
.
getX
(
0
),
ev
.
getY
(
1
)
-
ev
.
getY
(
0
));
pinchStartDistance
=
(
float
)
Math
.
hypot
(
ev
.
getX
(
1
)
-
ev
.
getX
(
0
),
ev
.
getY
(
1
)
-
ev
.
getY
(
0
));
...
@@ -1756,8 +1763,18 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
...
@@ -1756,8 +1763,18 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
if
(
translationX
<
minX
&&
!
rightImage
.
hasImage
()
||
translationX
>
maxX
&&
!
leftImage
.
hasImage
())
{
if
(
translationX
<
minX
&&
!
rightImage
.
hasImage
()
||
translationX
>
maxX
&&
!
leftImage
.
hasImage
())
{
moveDx
/=
3.0f
;
moveDx
/=
3.0f
;
}
}
if
(
translationY
<
minY
||
translationY
>
maxY
)
{
if
(
maxY
==
0
&&
minY
==
0
)
{
moveDy
/=
3.0f
;
if
(
translationY
-
moveDy
<
minY
)
{
translationY
=
minY
;
moveDy
=
0
;
}
else
if
(
translationY
-
moveDy
>
maxY
)
{
translationY
=
maxY
;
moveDy
=
0
;
}
}
else
{
if
(
translationY
<
minY
||
translationY
>
maxY
)
{
moveDy
/=
3.0f
;
}
}
}
translationX
-=
moveDx
;
translationX
-=
moveDx
;
...
@@ -1922,6 +1939,10 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
...
@@ -1922,6 +1939,10 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
}
}
if
(
ai
!=
-
1
)
{
if
(
ai
!=
-
1
)
{
if
(!
scroller
.
isFinished
())
{
scroller
.
abortAnimation
();
}
float
ts
=
scale
+
(
animateToScale
-
scale
)
*
ai
;
float
ts
=
scale
+
(
animateToScale
-
scale
)
*
ai
;
float
tx
=
translationX
+
(
animateToX
-
translationX
)
*
ai
;
float
tx
=
translationX
+
(
animateToX
-
translationX
)
*
ai
;
float
ty
=
translationY
+
(
animateToY
-
translationY
)
*
ai
;
float
ty
=
translationY
+
(
animateToY
-
translationY
)
*
ai
;
...
@@ -1944,6 +1965,17 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
...
@@ -1944,6 +1965,17 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
Utilities
.
unlockOrientation
(
parentActivity
);
Utilities
.
unlockOrientation
(
parentActivity
);
zoomAnimation
=
false
;
zoomAnimation
=
false
;
}
}
if
(!
scroller
.
isFinished
())
{
if
(
scroller
.
computeScrollOffset
())
{
if
(
scroller
.
getStartX
()
<
maxX
&&
scroller
.
getStartX
()
>
minX
)
{
translationX
=
scroller
.
getCurrX
();
}
if
(
scroller
.
getStartY
()
<
maxY
&&
scroller
.
getStartY
()
>
minY
)
{
translationY
=
scroller
.
getCurrY
();
}
containerView
.
invalidate
();
}
}
if
(
switchImageAfterAnimation
!=
0
)
{
if
(
switchImageAfterAnimation
!=
0
)
{
if
(
switchImageAfterAnimation
==
1
)
{
if
(
switchImageAfterAnimation
==
1
)
{
setImageIndex
(
currentIndex
+
1
,
false
);
setImageIndex
(
currentIndex
+
1
,
false
);
...
@@ -2119,6 +2151,11 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
...
@@ -2119,6 +2151,11 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
@Override
@Override
public
boolean
onFling
(
MotionEvent
e1
,
MotionEvent
e2
,
float
velocityX
,
float
velocityY
)
{
public
boolean
onFling
(
MotionEvent
e1
,
MotionEvent
e2
,
float
velocityX
,
float
velocityY
)
{
if
(
scale
!=
1
)
{
scroller
.
abortAnimation
();
scroller
.
fling
(
Math
.
round
(
translationX
),
Math
.
round
(
translationY
),
Math
.
round
(
velocityX
),
Math
.
round
(
velocityY
),
(
int
)
minX
,
(
int
)
maxX
,
(
int
)
minY
,
(
int
)
maxY
);
containerView
.
postInvalidate
();
}
return
false
;
return
false
;
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/ColorPickerView.java
View file @
b85b6c10
...
@@ -38,7 +38,7 @@ public class ColorPickerView extends View {
...
@@ -38,7 +38,7 @@ public class ColorPickerView extends View {
private
static
final
String
STATE_OLD_COLOR
=
"color"
;
private
static
final
String
STATE_OLD_COLOR
=
"color"
;
private
static
final
String
STATE_SHOW_OLD_COLOR
=
"showColor"
;
private
static
final
String
STATE_SHOW_OLD_COLOR
=
"showColor"
;
private
static
final
int
[]
COLORS
=
new
int
[]
{
0xFFFF0000
,
0xFFFF00FF
,
0xFF0000FF
,
0xFF00FFFF
,
0xFF00FF00
,
0xFFFFFF00
,
0xFFFF0000
};
private
static
final
int
[]
COLORS
=
new
int
[]
{
0xFFFF0000
,
0xFFFF00FF
,
0xFF0000FF
,
0xFF00FFFF
,
0xFF00FF00
,
0xFFFFFF
FF
,
0xFFFFFF
00
,
0xFFFF0000
};
private
Paint
mColorWheelPaint
;
private
Paint
mColorWheelPaint
;
private
Paint
mPointerHaloPaint
;
private
Paint
mPointerHaloPaint
;
...
...
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