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
6be743c9
Commit
6be743c9
authored
Mar 23, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed previous commit
parent
e5382430
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
MediaController.java
...src/main/java/org/telegram/messenger/MediaController.java
+8
-1
ChatActivity.java
...sagesProj/src/main/java/org/telegram/ui/ChatActivity.java
+13
-9
No files found.
TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java
View file @
6be743c9
...
...
@@ -77,6 +77,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
public
final
static
int
recordProgressChanged
=
50003
;
public
final
static
int
recordStarted
=
50004
;
public
final
static
int
recordStartError
=
50005
;
public
final
static
int
recordStopped
=
50006
;
private
HashMap
<
String
,
ArrayList
<
WeakReference
<
FileDownloadProgressListener
>>>
loadingFileObservers
=
new
HashMap
<
String
,
ArrayList
<
WeakReference
<
FileDownloadProgressListener
>>>();
private
HashMap
<
Integer
,
String
>
observersByTag
=
new
HashMap
<
Integer
,
String
>();
...
...
@@ -894,7 +895,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
}
});
}
}
,
100
);
});
}
private
void
stopRecordingInternal
(
final
boolean
send
)
{
...
...
@@ -972,6 +973,12 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
Utilities
.
RunOnUIThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
NotificationCenter
.
getInstance
().
postNotificationName
(
recordStopped
);
}
});
}
});
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
View file @
6be743c9
...
...
@@ -344,6 +344,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
NotificationCenter
.
getInstance
().
addObserver
(
this
,
MediaController
.
recordProgressChanged
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
MediaController
.
recordStarted
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
MediaController
.
recordStartError
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
MediaController
.
recordStopped
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
997
);
loading
=
true
;
...
...
@@ -392,6 +393,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
NotificationCenter
.
getInstance
().
removeObserver
(
this
,
MediaController
.
recordProgressChanged
);
NotificationCenter
.
getInstance
().
removeObserver
(
this
,
MediaController
.
recordStarted
);
NotificationCenter
.
getInstance
().
removeObserver
(
this
,
MediaController
.
recordStartError
);
NotificationCenter
.
getInstance
().
removeObserver
(
this
,
MediaController
.
recordStopped
);
NotificationCenter
.
getInstance
().
removeObserver
(
this
,
997
);
if
(
sizeNotifierRelativeLayout
!=
null
)
{
sizeNotifierRelativeLayout
.
delegate
=
null
;
...
...
@@ -409,6 +411,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
if
(
mWakeLock
!=
null
)
{
try
{
mWakeLock
.
release
();
mWakeLock
=
null
;
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
...
...
@@ -685,11 +688,9 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
updateAudioRecordIntefrace
();
}
else
if
(
motionEvent
.
getAction
()
==
MotionEvent
.
ACTION_UP
||
motionEvent
.
getAction
()
==
MotionEvent
.
ACTION_CANCEL
)
{
startedDraggingX
=
-
1
;
if
(
recordingAudio
)
{
MediaController
.
getInstance
().
stopRecording
(
true
);
recordingAudio
=
false
;
updateAudioRecordIntefrace
();
}
MediaController
.
getInstance
().
stopRecording
(
true
);
recordingAudio
=
false
;
updateAudioRecordIntefrace
();
}
else
if
(
motionEvent
.
getAction
()
==
MotionEvent
.
ACTION_MOVE
&&
recordingAudio
)
{
float
x
=
motionEvent
.
getX
();
if
(
x
<
-
distCanMove
)
{
...
...
@@ -889,9 +890,11 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
}
if
(
recordingAudio
)
{
try
{
PowerManager
pm
=
(
PowerManager
)
parentActivity
.
getSystemService
(
Context
.
POWER_SERVICE
);
mWakeLock
=
pm
.
newWakeLock
(
PowerManager
.
SCREEN_DIM_WAKE_LOCK
|
PowerManager
.
ON_AFTER_RELEASE
,
"audio record lock"
);
mWakeLock
.
acquire
();
if
(
mWakeLock
==
null
)
{
PowerManager
pm
=
(
PowerManager
)
parentActivity
.
getSystemService
(
Context
.
POWER_SERVICE
);
mWakeLock
=
pm
.
newWakeLock
(
PowerManager
.
SCREEN_DIM_WAKE_LOCK
|
PowerManager
.
ON_AFTER_RELEASE
,
"audio record lock"
);
mWakeLock
.
acquire
();
}
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
...
...
@@ -940,6 +943,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
if
(
mWakeLock
!=
null
)
{
try
{
mWakeLock
.
release
();
mWakeLock
=
null
;
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
...
...
@@ -2233,7 +2237,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
mActionMode
.
finish
();
mActionMode
=
null
;
}
}
else
if
(
id
==
MediaController
.
recordStartError
)
{
}
else
if
(
id
==
MediaController
.
recordStartError
||
id
==
MediaController
.
recordStopped
)
{
if
(
recordingAudio
)
{
recordingAudio
=
false
;
updateAudioRecordIntefrace
();
...
...
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