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
87cb843e
Commit
87cb843e
authored
Oct 18, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed video compression in Android L, bug fixes
parent
bc76df2f
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
121 additions
and
22 deletions
+121
-22
build.gradle
TMessagesProj/build.gradle
+3
-3
ImageReceiver.java
...roj/src/main/java/org/telegram/android/ImageReceiver.java
+3
-0
MediaController.java
...j/src/main/java/org/telegram/android/MediaController.java
+19
-10
MP4Builder.java
.../src/main/java/org/telegram/android/video/MP4Builder.java
+14
-4
TLClassStore.java
...oj/src/main/java/org/telegram/messenger/TLClassStore.java
+1
-0
ChatActionCell.java
...j/src/main/java/org/telegram/ui/Cells/ChatActionCell.java
+6
-4
ChatActivity.java
...sagesProj/src/main/java/org/telegram/ui/ChatActivity.java
+1
-1
styles.xml
TMessagesProj/src/main/res/values-v21/styles.xml
+74
-0
No files found.
TMessagesProj/build.gradle
View file @
87cb843e
...
@@ -24,8 +24,8 @@ dependencies {
...
@@ -24,8 +24,8 @@ dependencies {
}
}
android
{
android
{
compileSdkVersion
19
compileSdkVersion
21
buildToolsVersion
'2
0
.0.0'
buildToolsVersion
'2
1
.0.0'
signingConfigs
{
signingConfigs
{
debug
{
debug
{
...
@@ -80,7 +80,7 @@ android {
...
@@ -80,7 +80,7 @@ android {
defaultConfig
{
defaultConfig
{
minSdkVersion
8
minSdkVersion
8
targetSdkVersion
19
targetSdkVersion
19
versionCode
3
59
versionCode
3
61
versionName
"1.9.5"
versionName
"1.9.5"
}
}
}
}
TMessagesProj/src/main/java/org/telegram/android/ImageReceiver.java
View file @
87cb843e
...
@@ -108,6 +108,9 @@ public class ImageReceiver {
...
@@ -108,6 +108,9 @@ public class ImageReceiver {
if
(
img
==
null
)
{
if
(
img
==
null
)
{
isPlaceholder
=
true
;
isPlaceholder
=
true
;
ImageLoader
.
getInstance
().
loadImage
(
fileLocation
,
httpUrl
,
this
,
size
,
cacheOnly
);
ImageLoader
.
getInstance
().
loadImage
(
fileLocation
,
httpUrl
,
this
,
size
,
cacheOnly
);
if
(
parentView
!=
null
)
{
parentView
.
invalidate
();
}
}
else
{
}
else
{
setImageBitmap
(
img
,
currentPath
);
setImageBitmap
(
img
,
currentPath
);
}
}
...
...
TMessagesProj/src/main/java/org/telegram/android/MediaController.java
View file @
87cb843e
...
@@ -2081,12 +2081,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
...
@@ -2081,12 +2081,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
if
(
end
<
0
||
info
.
presentationTimeUs
<
end
)
{
if
(
end
<
0
||
info
.
presentationTimeUs
<
end
)
{
info
.
offset
=
0
;
info
.
offset
=
0
;
info
.
flags
=
extractor
.
getSampleFlags
();
info
.
flags
=
extractor
.
getSampleFlags
();
if
(!
isAudio
)
{
if
(
mediaMuxer
.
writeSampleData
(
muxerTrackIndex
,
buffer
,
info
,
isAudio
))
{
buffer
.
limit
(
info
.
offset
+
info
.
size
);
buffer
.
position
(
info
.
offset
);
buffer
.
putInt
(
info
.
size
-
4
);
}
if
(
mediaMuxer
.
writeSampleData
(
muxerTrackIndex
,
buffer
,
info
))
{
didWriteData
(
messageObject
,
file
,
false
,
false
);
didWriteData
(
messageObject
,
file
,
false
,
false
);
}
}
extractor
.
advance
();
extractor
.
advance
();
...
@@ -2168,6 +2163,23 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
...
@@ -2168,6 +2163,23 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
resultWidth
=
temp
;
resultWidth
=
temp
;
rotationValue
=
90
;
rotationValue
=
90
;
rotateRender
=
270
;
rotateRender
=
270
;
}
else
if
(
Build
.
VERSION
.
SDK_INT
>
20
)
{
if
(
rotationValue
==
90
)
{
int
temp
=
resultHeight
;
resultHeight
=
resultWidth
;
resultWidth
=
temp
;
rotationValue
=
0
;
rotateRender
=
270
;
}
else
if
(
rotationValue
==
180
)
{
rotateRender
=
180
;
rotationValue
=
0
;
}
else
if
(
rotationValue
==
270
)
{
int
temp
=
resultHeight
;
resultHeight
=
resultWidth
;
resultWidth
=
temp
;
rotationValue
=
0
;
rotateRender
=
90
;
}
}
}
File
inputFile
=
new
File
(
videoPath
);
File
inputFile
=
new
File
(
videoPath
);
...
@@ -2374,10 +2386,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
...
@@ -2374,10 +2386,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
}
}
if
(
info
.
size
>
1
)
{
if
(
info
.
size
>
1
)
{
if
((
info
.
flags
&
MediaCodec
.
BUFFER_FLAG_CODEC_CONFIG
)
==
0
)
{
if
((
info
.
flags
&
MediaCodec
.
BUFFER_FLAG_CODEC_CONFIG
)
==
0
)
{
encodedData
.
limit
(
info
.
offset
+
info
.
size
);
if
(
mediaMuxer
.
writeSampleData
(
videoTrackIndex
,
encodedData
,
info
,
false
))
{
encodedData
.
position
(
info
.
offset
);
encodedData
.
putInt
(
Integer
.
reverseBytes
(
info
.
size
-
4
));
if
(
mediaMuxer
.
writeSampleData
(
videoTrackIndex
,
encodedData
,
info
))
{
didWriteData
(
messageObject
,
cacheFile
,
false
,
false
);
didWriteData
(
messageObject
,
cacheFile
,
false
,
false
);
}
}
}
else
if
(
videoTrackIndex
==
-
5
)
{
}
else
if
(
videoTrackIndex
==
-
5
)
{
...
...
TMessagesProj/src/main/java/org/telegram/android/video/MP4Builder.java
View file @
87cb843e
...
@@ -54,12 +54,13 @@ public class MP4Builder {
...
@@ -54,12 +54,13 @@ public class MP4Builder {
private
InterleaveChunkMdat
mdat
=
null
;
private
InterleaveChunkMdat
mdat
=
null
;
private
Mp4Movie
currentMp4Movie
=
null
;
private
Mp4Movie
currentMp4Movie
=
null
;
FileOutputStream
fos
=
null
;
private
FileOutputStream
fos
=
null
;
private
FileChannel
fc
=
null
;
private
FileChannel
fc
=
null
;
private
long
dataOffset
=
0
;
private
long
dataOffset
=
0
;
private
long
writedSinceLastMdat
=
0
;
private
long
writedSinceLastMdat
=
0
;
private
boolean
writeNewMdat
=
true
;
private
boolean
writeNewMdat
=
true
;
HashMap
<
Track
,
long
[]>
track2SampleSizes
=
new
HashMap
<
Track
,
long
[]>();
private
HashMap
<
Track
,
long
[]>
track2SampleSizes
=
new
HashMap
<
Track
,
long
[]>();
private
ByteBuffer
sizeBuffer
=
null
;
public
MP4Builder
createMovie
(
Mp4Movie
mp4Movie
)
throws
Exception
{
public
MP4Builder
createMovie
(
Mp4Movie
mp4Movie
)
throws
Exception
{
currentMp4Movie
=
mp4Movie
;
currentMp4Movie
=
mp4Movie
;
...
@@ -74,6 +75,8 @@ public class MP4Builder {
...
@@ -74,6 +75,8 @@ public class MP4Builder {
mdat
=
new
InterleaveChunkMdat
();
mdat
=
new
InterleaveChunkMdat
();
sizeBuffer
=
ByteBuffer
.
allocateDirect
(
4
);
return
this
;
return
this
;
}
}
...
@@ -87,7 +90,7 @@ public class MP4Builder {
...
@@ -87,7 +90,7 @@ public class MP4Builder {
fos
.
flush
();
fos
.
flush
();
}
}
public
boolean
writeSampleData
(
int
trackIndex
,
ByteBuffer
byteBuf
,
MediaCodec
.
BufferInfo
bufferInfo
)
throws
Exception
{
public
boolean
writeSampleData
(
int
trackIndex
,
ByteBuffer
byteBuf
,
MediaCodec
.
BufferInfo
bufferInfo
,
boolean
isAudio
)
throws
Exception
{
if
(
writeNewMdat
)
{
if
(
writeNewMdat
)
{
mdat
.
setContentSize
(
0
);
mdat
.
setContentSize
(
0
);
mdat
.
getBox
(
fc
);
mdat
.
getBox
(
fc
);
...
@@ -109,9 +112,16 @@ public class MP4Builder {
...
@@ -109,9 +112,16 @@ public class MP4Builder {
}
}
currentMp4Movie
.
addSample
(
trackIndex
,
dataOffset
,
bufferInfo
);
currentMp4Movie
.
addSample
(
trackIndex
,
dataOffset
,
bufferInfo
);
byteBuf
.
position
(
bufferInfo
.
offset
);
byteBuf
.
position
(
bufferInfo
.
offset
+
(
isAudio
?
0
:
4
)
);
byteBuf
.
limit
(
bufferInfo
.
offset
+
bufferInfo
.
size
);
byteBuf
.
limit
(
bufferInfo
.
offset
+
bufferInfo
.
size
);
if
(!
isAudio
)
{
sizeBuffer
.
position
(
0
);
sizeBuffer
.
putInt
(
bufferInfo
.
size
-
4
);
sizeBuffer
.
position
(
0
);
fc
.
write
(
sizeBuffer
);
}
fc
.
write
(
byteBuf
);
fc
.
write
(
byteBuf
);
dataOffset
+=
bufferInfo
.
size
;
dataOffset
+=
bufferInfo
.
size
;
...
...
TMessagesProj/src/main/java/org/telegram/messenger/TLClassStore.java
View file @
87cb843e
...
@@ -370,6 +370,7 @@ public class TLClassStore {
...
@@ -370,6 +370,7 @@ public class TLClassStore {
classStore
.
put
(
TLRPC
.
TL_userRequest_old
.
constructor
,
TLRPC
.
TL_userRequest_old
.
class
);
classStore
.
put
(
TLRPC
.
TL_userRequest_old
.
constructor
,
TLRPC
.
TL_userRequest_old
.
class
);
classStore
.
put
(
TLRPC
.
TL_userForeign_old
.
constructor
,
TLRPC
.
TL_userForeign_old
.
class
);
classStore
.
put
(
TLRPC
.
TL_userForeign_old
.
constructor
,
TLRPC
.
TL_userForeign_old
.
class
);
classStore
.
put
(
TLRPC
.
TL_userDeleted_old
.
constructor
,
TLRPC
.
TL_userDeleted_old
.
class
);
classStore
.
put
(
TLRPC
.
TL_userDeleted_old
.
constructor
,
TLRPC
.
TL_userDeleted_old
.
class
);
classStore
.
put
(
TLRPC
.
TL_messageEcryptedAction
.
constructor
,
TLRPC
.
TL_messageEcryptedAction
.
class
);
}
}
static
TLClassStore
store
=
null
;
static
TLClassStore
store
=
null
;
...
...
TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java
View file @
87cb843e
...
@@ -278,9 +278,11 @@ public class ChatActionCell extends BaseCell {
...
@@ -278,9 +278,11 @@ public class ChatActionCell extends BaseCell {
imageReceiver
.
draw
(
canvas
,
imageReceiver
.
getImageX
(),
imageReceiver
.
getImageY
(),
imageReceiver
.
getImageWidth
(),
imageReceiver
.
getImageHeight
());
imageReceiver
.
draw
(
canvas
,
imageReceiver
.
getImageX
(),
imageReceiver
.
getImageY
(),
imageReceiver
.
getImageWidth
(),
imageReceiver
.
getImageHeight
());
}
}
if
(
textLayout
!=
null
)
{
canvas
.
save
();
canvas
.
save
();
canvas
.
translate
(
textXLeft
,
textY
);
canvas
.
translate
(
textXLeft
,
textY
);
textLayout
.
draw
(
canvas
);
textLayout
.
draw
(
canvas
);
canvas
.
restore
();
canvas
.
restore
();
}
}
}
}
}
TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
View file @
87cb843e
...
@@ -926,7 +926,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
...
@@ -926,7 +926,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
@Override
@Override
public
void
onScroll
(
AbsListView
absListView
,
int
firstVisibleItem
,
int
visibleItemCount
,
int
totalItemCount
)
{
public
void
onScroll
(
AbsListView
absListView
,
int
firstVisibleItem
,
int
visibleItemCount
,
int
totalItemCount
)
{
if
(
visibleItemCount
>
0
)
{
if
(
visibleItemCount
>
0
)
{
if
(
firstVisibleItem
<=
4
)
{
if
(
firstVisibleItem
<=
10
)
{
if
(!
endReached
&&
!
loading
)
{
if
(!
endReached
&&
!
loading
)
{
if
(
messagesByDays
.
size
()
!=
0
)
{
if
(
messagesByDays
.
size
()
!=
0
)
{
MessagesController
.
getInstance
().
loadMessages
(
dialog_id
,
20
,
maxMessageId
,
!
cacheEndReaced
,
minDate
,
classGuid
,
false
,
false
,
null
);
MessagesController
.
getInstance
().
loadMessages
(
dialog_id
,
20
,
maxMessageId
,
!
cacheEndReaced
,
minDate
,
classGuid
,
false
,
false
,
null
);
...
...
TMessagesProj/src/main/res/values-v21/styles.xml
0 → 100644
View file @
87cb843e
<!--
~ This is the source code of Telegram for Android v. 1.7.x.
~ It is licensed under GNU GPL v. 2 or later.
~ You should have received a copy of the license in this archive (see LICENSE).
~
~ Copyright Nikolai Kudashov, 2013-2014.
-->
<resources
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<!--THEMES-->
<style
name=
"Theme.TMessages.Start"
parent=
"@android:style/Theme.Material"
>
<item
name=
"android:actionBarStyle"
>
@style/ActionBar.Transparent.TMessages.Start
</item>
<item
name=
"android:colorBackground"
>
@android:color/white
</item>
<item
name=
"android:windowBackground"
>
@android:color/white
</item>
<item
name=
"android:windowContentOverlay"
>
@null
</item>
</style>
<style
name=
"Theme.TMessages"
parent=
"@android:style/Theme.Material.Light"
>
<item
name=
"android:windowActionBar"
>
false
</item>
<item
name=
"android:windowNoTitle"
>
true
</item>
<item
name=
"android:windowActionBarOverlay"
>
false
</item>
<item
name=
"android:windowContentOverlay"
>
@null
</item>
<item
name=
"android:colorBackground"
>
@android:color/white
</item>
<item
name=
"android:windowBackground"
>
@android:color/white
</item>
<item
name=
"android:itemTextAppearance"
>
@style/ActionBar.Transparent.TMessages.Item
</item>
<item
name=
"android:listViewStyle"
>
@style/Theme.TMessages.ListView
</item>
<!--<item name="android:listChoiceBackgroundIndicator">@drawable/list_selector</item>-->
<item
name=
"android:editTextStyle"
>
@style/Theme.TMessages.EditText
</item>
<item
name=
"android:actionBarItemBackground"
>
@drawable/bar_selector_style
</item>
</style>
<style
name=
"Theme.TMessages.PopupNotification"
parent=
"Theme.TMessages"
>
<item
name=
"android:windowBackground"
>
@android:color/transparent
</item>
<item
name=
"android:windowIsTranslucent"
>
true
</item>
<item
name=
"android:windowAnimationStyle"
>
@null
</item>
<item
name=
"android:windowActionBar"
>
false
</item>
<item
name=
"android:windowNoTitle"
>
true
</item>
</style>
<!--ACTION BAR-->
<style
name=
"ActionBar.Transparent.TMessages.Start"
parent=
"android:style/Widget.Material.Light.ActionBar"
>
<item
name=
"android:background"
>
@color/header
</item>
<item
name=
"android:logo"
>
@drawable/transparent
</item>
<item
name=
"android:title"
>
""
</item>
</style>
<!--ACTION BAR ITEMS-->
<style
name=
"ActionBar.Transparent.TMessages.Item"
parent=
"@android:TextAppearance.Widget.IconMenu.Item"
>
<item
name=
"android:textColor"
>
#000000
</item>
<item
name=
"android:textSize"
>
18sp
</item>
</style>
<!--LIST VIEW-->
<style
name=
"Theme.TMessages.ListView"
parent=
"@android:style/Widget.Material.Light.ListView"
>
<!--<item name="android:listSelector">@drawable/list_selector</item>-->
<item
name=
"android:fadingEdge"
>
none
</item>
<item
name=
"android:dividerHeight"
>
1dp
</item>
<item
name=
"android:divider"
>
@color/divider
</item>
</style>
<!--EDIT TEXT-->
<style
name=
"Theme.TMessages.EditText"
parent=
"android:Widget.Material.Light.EditText"
>
<item
name=
"android:background"
>
@drawable/holo_edit_text_light
</item>
<item
name=
"android:textColor"
>
#000000
</item>
</style>
</resources>
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