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
f83a1b56
Commit
f83a1b56
authored
Sep 28, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixes
https://github.com/DrKLO/Telegram/pull/581
parent
dff98476
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
66 deletions
+93
-66
build.gradle
TMessagesProj/build.gradle
+1
-1
ChatActivity.java
...sagesProj/src/main/java/org/telegram/ui/ChatActivity.java
+1
-1
ChatProfileActivity.java
...oj/src/main/java/org/telegram/ui/ChatProfileActivity.java
+1
-1
LaunchActivity.java
...gesProj/src/main/java/org/telegram/ui/LaunchActivity.java
+7
-6
VideoEditorActivity.java
...oj/src/main/java/org/telegram/ui/VideoEditorActivity.java
+82
-56
AvatarUpdater.java
...oj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java
+1
-1
No files found.
TMessagesProj/build.gradle
View file @
f83a1b56
...
@@ -80,7 +80,7 @@ android {
...
@@ -80,7 +80,7 @@ android {
defaultConfig
{
defaultConfig
{
minSdkVersion
8
minSdkVersion
8
targetSdkVersion
19
targetSdkVersion
19
versionCode
33
1
versionCode
33
2
versionName
"1.9.0"
versionName
"1.9.0"
}
}
}
}
TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
View file @
f83a1b56
...
@@ -1364,7 +1364,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
...
@@ -1364,7 +1364,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
args
.
putString
(
"videoPath"
,
videoPath
);
args
.
putString
(
"videoPath"
,
videoPath
);
VideoEditorActivity
fragment
=
new
VideoEditorActivity
(
args
);
VideoEditorActivity
fragment
=
new
VideoEditorActivity
(
args
);
fragment
.
setDelegate
(
this
);
fragment
.
setDelegate
(
this
);
presentFragment
(
fragment
);
presentFragment
(
fragment
,
false
,
true
);
}
else
{
}
else
{
processSendingVideo
(
videoPath
,
0
,
0
,
0
,
0
,
null
);
processSendingVideo
(
videoPath
,
0
,
0
,
0
,
0
,
null
);
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java
View file @
f83a1b56
...
@@ -629,7 +629,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
...
@@ -629,7 +629,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
count
=
info
.
participants
.
size
();
count
=
info
.
participants
.
size
();
}
}
if
(
count
!=
0
&&
onlineCount
>
0
)
{
if
(
count
!=
0
&&
onlineCount
>
1
)
{
onlineText
.
setText
(
Html
.
fromHtml
(
String
.
format
(
"%s, <font color='#357aa8'>%d %s</font>"
,
LocaleController
.
formatPluralString
(
"Members"
,
count
),
onlineCount
,
LocaleController
.
getString
(
"Online"
,
R
.
string
.
Online
))));
onlineText
.
setText
(
Html
.
fromHtml
(
String
.
format
(
"%s, <font color='#357aa8'>%d %s</font>"
,
LocaleController
.
formatPluralString
(
"Members"
,
count
),
onlineCount
,
LocaleController
.
getString
(
"Online"
,
R
.
string
.
Online
))));
}
else
{
}
else
{
onlineText
.
setText
(
LocaleController
.
formatPluralString
(
"Members"
,
count
));
onlineText
.
setText
(
LocaleController
.
formatPluralString
(
"Members"
,
count
));
...
...
TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java
View file @
f83a1b56
...
@@ -760,15 +760,16 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
...
@@ -760,15 +760,16 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
public
void
fixLayout
()
{
public
void
fixLayout
()
{
if
(
AndroidUtilities
.
isTablet
())
{
if
(
AndroidUtilities
.
isTablet
())
{
final
ViewTreeObserver
obs
=
actionBarLayout
.
getViewTreeObserver
();
actionBarLayout
.
getViewTreeObserver
().
addOnGlobalLayoutListener
(
new
ViewTreeObserver
.
OnGlobalLayoutListener
()
{
obs
.
addOnGlobalLayoutListener
(
new
ViewTreeObserver
.
OnGlobalLayoutListener
()
{
@Override
@Override
public
void
onGlobalLayout
()
{
public
void
onGlobalLayout
()
{
needLayout
();
needLayout
();
if
(
actionBarLayout
!=
null
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
16
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
16
)
{
obs
.
removeGlobalOnLayoutListener
(
this
);
actionBarLayout
.
getViewTreeObserver
()
.
removeGlobalOnLayoutListener
(
this
);
}
else
{
}
else
{
obs
.
removeOnGlobalLayoutListener
(
this
);
actionBarLayout
.
getViewTreeObserver
().
removeOnGlobalLayoutListener
(
this
);
}
}
}
}
}
});
});
...
...
TMessagesProj/src/main/java/org/telegram/ui/VideoEditorActivity.java
View file @
f83a1b56
...
@@ -12,6 +12,7 @@ import android.annotation.TargetApi;
...
@@ -12,6 +12,7 @@ import android.annotation.TargetApi;
import
android.content.res.Configuration
;
import
android.content.res.Configuration
;
import
android.graphics.SurfaceTexture
;
import
android.graphics.SurfaceTexture
;
import
android.media.MediaPlayer
;
import
android.media.MediaPlayer
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.view.Gravity
;
import
android.view.Gravity
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
...
@@ -76,6 +77,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
...
@@ -76,6 +77,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
private
final
Object
sync
=
new
Object
();
private
final
Object
sync
=
new
Object
();
private
Thread
thread
=
null
;
private
Thread
thread
=
null
;
private
long
createTime
=
0
;
private
int
rotationValue
=
0
;
private
int
rotationValue
=
0
;
private
int
originalWidth
=
0
;
private
int
originalWidth
=
0
;
...
@@ -106,7 +108,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
...
@@ -106,7 +108,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
AndroidUtilities
.
RunOnUIThread
(
new
Runnable
()
{
AndroidUtilities
.
RunOnUIThread
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
if
(
videoPlayer
.
isPlaying
())
{
if
(
videoPlayer
!=
null
&&
videoPlayer
.
isPlaying
())
{
float
startTime
=
videoTimelineView
.
getLeftProgress
()
*
videoDuration
;
float
startTime
=
videoTimelineView
.
getLeftProgress
()
*
videoDuration
;
float
endTime
=
videoTimelineView
.
getRightProgress
()
*
videoDuration
;
float
endTime
=
videoTimelineView
.
getRightProgress
()
*
videoDuration
;
if
(
startTime
==
endTime
)
{
if
(
startTime
==
endTime
)
{
...
@@ -186,6 +188,15 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
...
@@ -186,6 +188,15 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
if
(
videoTimelineView
!=
null
)
{
if
(
videoTimelineView
!=
null
)
{
videoTimelineView
.
destroy
();
videoTimelineView
.
destroy
();
}
}
if
(
videoPlayer
!=
null
)
{
try
{
videoPlayer
.
stop
();
videoPlayer
.
release
();
videoPlayer
=
null
;
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
}
super
.
onFragmentDestroy
();
super
.
onFragmentDestroy
();
}
}
...
@@ -323,13 +334,15 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
...
@@ -323,13 +334,15 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
parent
.
removeView
(
fragmentView
);
parent
.
removeView
(
fragmentView
);
}
}
}
}
fixLayoutInternal
();
createTime
=
System
.
currentTimeMillis
();
return
fragmentView
;
return
fragmentView
;
}
}
@Override
@Override
public
void
onResume
()
{
public
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
fixLayout
();
fixLayout
Internal
();
}
}
@Override
@Override
...
@@ -479,14 +492,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
...
@@ -479,14 +492,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
textureView
.
setLayoutParams
(
layoutParams
);
textureView
.
setLayoutParams
(
layoutParams
);
}
}
private
void
fixLayout
()
{
private
void
fixLayoutInternal
()
{
if
(
originalSizeTextView
==
null
)
{
return
;
}
originalSizeTextView
.
getViewTreeObserver
().
addOnPreDrawListener
(
new
ViewTreeObserver
.
OnPreDrawListener
()
{
@Override
public
boolean
onPreDraw
()
{
originalSizeTextView
.
getViewTreeObserver
().
removeOnPreDrawListener
(
this
);
if
(!
AndroidUtilities
.
isTablet
()
&&
getParentActivity
().
getResources
().
getConfiguration
().
orientation
==
Configuration
.
ORIENTATION_LANDSCAPE
)
{
if
(!
AndroidUtilities
.
isTablet
()
&&
getParentActivity
().
getResources
().
getConfiguration
().
orientation
==
Configuration
.
ORIENTATION_LANDSCAPE
)
{
FrameLayout
.
LayoutParams
layoutParams
=
(
FrameLayout
.
LayoutParams
)
videoContainerView
.
getLayoutParams
();
FrameLayout
.
LayoutParams
layoutParams
=
(
FrameLayout
.
LayoutParams
)
videoContainerView
.
getLayoutParams
();
layoutParams
.
topMargin
=
AndroidUtilities
.
dp
(
16
);
layoutParams
.
topMargin
=
AndroidUtilities
.
dp
(
16
);
...
@@ -534,9 +540,29 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
...
@@ -534,9 +540,29 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
}
}
fixVideoSize
();
fixVideoSize
();
videoTimelineView
.
clearFrames
();
videoTimelineView
.
clearFrames
();
return
false
;
}
private
void
fixLayout
()
{
if
(
originalSizeTextView
==
null
)
{
return
;
}
if
(
createTime
<
System
.
currentTimeMillis
()
-
3000
)
{
originalSizeTextView
.
getViewTreeObserver
().
addOnGlobalLayoutListener
(
new
ViewTreeObserver
.
OnGlobalLayoutListener
()
{
@Override
public
void
onGlobalLayout
()
{
if
(
originalSizeTextView
!=
null
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
16
)
{
originalSizeTextView
.
getViewTreeObserver
().
removeGlobalOnLayoutListener
(
this
);
}
else
{
originalSizeTextView
.
getViewTreeObserver
().
removeOnGlobalLayoutListener
(
this
);
}
}
fixLayoutInternal
();
}
}
});
});
}
else
{
fixLayoutInternal
();
}
}
}
private
void
play
()
{
private
void
play
()
{
...
@@ -571,7 +597,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
...
@@ -571,7 +597,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
});
});
videoPlayer
.
start
();
videoPlayer
.
start
();
synchronized
(
sync
)
{
synchronized
(
sync
)
{
if
(
thread
!
=
null
)
{
if
(
thread
=
=
null
)
{
thread
=
new
Thread
(
progressRunnable
);
thread
=
new
Thread
(
progressRunnable
);
thread
.
start
();
thread
.
start
();
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java
View file @
f83a1b56
...
@@ -69,7 +69,7 @@ public class AvatarUpdater implements NotificationCenter.NotificationCenterDeleg
...
@@ -69,7 +69,7 @@ public class AvatarUpdater implements NotificationCenter.NotificationCenterDeleg
public
void
openGallery
()
{
public
void
openGallery
()
{
try
{
try
{
Intent
photoPickerIntent
=
new
Intent
(
Intent
.
ACTION_
PICK
);
Intent
photoPickerIntent
=
new
Intent
(
Intent
.
ACTION_
GET_CONTENT
);
photoPickerIntent
.
setType
(
"image/*"
);
photoPickerIntent
.
setType
(
"image/*"
);
parentFragment
.
getParentActivity
().
startActivityForResult
(
photoPickerIntent
,
14
);
parentFragment
.
getParentActivity
().
startActivityForResult
(
photoPickerIntent
,
14
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
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