Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
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
AloqaIM-Android
Commits
3c7ac659
Commit
3c7ac659
authored
Oct 17, 2017
by
dimsedane
Committed by
GitHub
Oct 17, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into feature/delete_message
parents
14e80ca7
afe0cff6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
61 additions
and
36 deletions
+61
-36
build.gradle
app/build.gradle
+1
-1
FileUploadProgressDialogFragment.java
...ent/chatroom/dialog/FileUploadProgressDialogFragment.java
+11
-9
dependencies.gradle
dependencies.gradle
+2
-2
RealmUser.java
...a/chat/rocket/persistence/realm/models/ddp/RealmUser.java
+36
-20
build.gradle
rocket-chat-android-widgets/build.gradle
+2
-2
RoomToolbar.java
...src/main/java/chat/rocket/android/widget/RoomToolbar.java
+3
-1
AvatarHelper.kt
...in/java/chat/rocket/android/widget/helper/AvatarHelper.kt
+0
-1
FrescoHelper.kt
...in/java/chat/rocket/android/widget/helper/FrescoHelper.kt
+6
-0
No files found.
app/build.gradle
View file @
3c7ac659
...
...
@@ -45,7 +45,7 @@ android {
applicationId
"chat.rocket.android"
minSdkVersion
16
targetSdkVersion
rootProject
.
ext
.
targetSdkVersion
versionCode
4
3
versionCode
4
4
versionName
"1.0.22"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
vectorDrawables
.
useSupportLibrary
=
true
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/dialog/FileUploadProgressDialogFragment.java
View file @
3c7ac659
package
chat
.
rocket
.
android
.
fragment
.
chatroom
.
dialog
;
import
android.app.Dialog
;
import
android.content.DialogInterface
;
import
android.os.Bundle
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.Nullable
;
import
android.widget.ProgressBar
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
chat.rocket.android.R
;
import
chat.rocket.android.renderer.FileUploadingRenderer
;
import
chat.rocket.core.SyncState
;
import
chat.rocket.persistence.realm.models.internal.FileUploading
;
import
chat.rocket.persistence.realm.RealmObjectObserver
;
import
chat.rocket.
android.renderer.FileUploadingRenderer
;
import
chat.rocket.
persistence.realm.models.internal.FileUploading
;
/**
* dialog fragment to display progress of file uploading.
...
...
@@ -76,11 +75,14 @@ public class FileUploadProgressDialogFragment extends AbstractChatRoomDialogFrag
//TODO: prompt retry.
dismiss
();
}
else
{
new
FileUploadingRenderer
(
getContext
(),
state
)
.
progressInto
((
ProgressBar
)
getDialog
().
findViewById
(
R
.
id
.
progressBar
))
.
progressTextInto
(
(
TextView
)
getDialog
().
findViewById
(
R
.
id
.
txt_filesize_uploaded
),
(
TextView
)
getDialog
().
findViewById
(
R
.
id
.
txt_filesize_total
));
final
Dialog
dialog
=
getDialog
();
if
(
dialog
!=
null
)
{
new
FileUploadingRenderer
(
getContext
(),
state
)
.
progressInto
(
dialog
.
findViewById
(
R
.
id
.
progressBar
))
.
progressTextInto
(
dialog
.
findViewById
(
R
.
id
.
txt_filesize_uploaded
),
dialog
.
findViewById
(
R
.
id
.
txt_filesize_total
));
}
}
}
...
...
dependencies.gradle
View file @
3c7ac659
...
...
@@ -16,8 +16,8 @@ ext {
okHTTP
:
"com.squareup.okhttp3:okhttp:3.8.0"
,
rxJava
:
"io.reactivex.rxjava2:rxjava:2.1.0"
,
boltTask
:
"com.parse.bolts:bolts-tasks:1.4.0"
,
textDrawable
:
"com.amulyakhare:com.amulyakhare.textdrawable:1
.0.1"
,
rxAndroid
:
"io.reactivex.rxjava2:rxandroid:2.0.1
"
rxAndroid
:
"io.reactivex.rxjava2:rxandroid:2
.0.1"
,
textDrawable
:
"com.github.rocketchat:textdrawable:1.0.2
"
]
rxbindingDependencies
=
[
rxBinding
:
"com.jakewharton.rxbinding2:rxbinding:${rxbindingVersion}"
,
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/models/ddp/RealmUser.java
View file @
3c7ac659
package
chat
.
rocket
.
persistence
.
realm
.
models
.
ddp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
chat.rocket.core.models.Email
;
import
chat.rocket.core.models.User
;
import
io.realm.Realm
;
import
io.realm.RealmList
;
import
io.realm.RealmObject
;
import
io.realm.RealmQuery
;
import
io.realm.annotations.PrimaryKey
;
import
java.util.ArrayList
;
import
java.util.List
;
import
chat.rocket.core.models.Email
;
import
chat.rocket.core.models.User
;
/**
* RealmUser.
*/
@SuppressWarnings
({
"PMD.ShortClassName"
,
"PMD.ShortVariable"
,
"PMD.MethodNamingConventions"
,
"PMD.VariableNamingConventions"
})
"PMD.MethodNamingConventions"
,
"PMD.VariableNamingConventions"
})
public
class
RealmUser
extends
RealmObject
{
public
static
final
String
ID
=
"_id"
;
public
static
final
String
NAME
=
"name"
;
public
static
final
String
USERNAME
=
"username"
;
public
static
final
String
STATUS
=
"status"
;
public
static
final
String
UTC_OFFSET
=
"utcOffset"
;
...
...
@@ -31,6 +32,7 @@ public class RealmUser extends RealmObject {
public
static
final
String
STATUS_OFFLINE
=
"offline"
;
@PrimaryKey
private
String
_id
;
private
String
name
;
private
String
username
;
private
String
status
;
private
double
utcOffset
;
...
...
@@ -57,6 +59,14 @@ public class RealmUser extends RealmObject {
this
.
username
=
username
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getStatus
()
{
return
status
;
}
...
...
@@ -95,25 +105,27 @@ public class RealmUser extends RealmObject {
}
return
User
.
builder
()
.
setId
(
_id
)
.
setUsername
(
username
)
.
setStatus
(
status
)
.
setUtcOffset
(
utcOffset
)
.
setEmails
(
coreEmails
)
.
setSettings
(
settings
!=
null
?
settings
.
asSettings
()
:
null
)
.
build
();
.
setId
(
_id
)
.
setName
(
name
)
.
setUsername
(
username
)
.
setStatus
(
status
)
.
setUtcOffset
(
utcOffset
)
.
setEmails
(
coreEmails
)
.
setSettings
(
settings
!=
null
?
settings
.
asSettings
()
:
null
)
.
build
();
}
@Override
public
String
toString
()
{
return
"RealmUser{"
+
"_id='"
+
_id
+
'\''
+
", username='"
+
username
+
'\''
+
", status='"
+
status
+
'\''
+
", utcOffset="
+
utcOffset
+
", emails="
+
emails
+
", settings="
+
settings
+
'}'
;
"_id='"
+
_id
+
'\''
+
", name='"
+
name
+
'\''
+
", username='"
+
username
+
'\''
+
", status='"
+
status
+
'\''
+
", utcOffset="
+
utcOffset
+
", emails="
+
emails
+
", settings="
+
settings
+
'}'
;
}
@Override
...
...
@@ -133,6 +145,9 @@ public class RealmUser extends RealmObject {
if
(
_id
!=
null
?
!
_id
.
equals
(
user
.
_id
)
:
user
.
_id
!=
null
)
{
return
false
;
}
if
(
name
!=
null
?
!
name
.
equals
(
user
.
name
)
:
user
.
name
!=
null
)
{
return
false
;
}
if
(
username
!=
null
?
!
username
.
equals
(
user
.
username
)
:
user
.
username
!=
null
)
{
return
false
;
}
...
...
@@ -151,6 +166,7 @@ public class RealmUser extends RealmObject {
int
result
;
long
temp
;
result
=
_id
!=
null
?
_id
.
hashCode
()
:
0
;
result
=
31
*
result
+
(
name
!=
null
?
name
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
username
!=
null
?
username
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
status
!=
null
?
status
.
hashCode
()
:
0
);
temp
=
Double
.
doubleToLongBits
(
utcOffset
);
...
...
rocket-chat-android-widgets/build.gradle
View file @
3c7ac659
...
...
@@ -44,13 +44,13 @@ ext {
}
dependencies
{
compile
project
(
':rocket-chat-core'
)
compile
extraDependencies
.
okHTTP
;
compile
extraDependencies
.
okHTTP
compile
extraDependencies
.
textDrawable
compile
supportDependencies
.
annotation
compile
supportDependencies
.
cardView
compile
supportDependencies
.
designSupportLibrary
compile
supportDependencies
.
constrainLayout
compile
supportDependencies
.
kotlin
compile
extraDependencies
.
textDrawable
compile
rxbindingDependencies
.
rxBinding
compile
rxbindingDependencies
.
rxBindingSupport
compile
"com.android.support:support-v13:$rootProject.ext.supportLibraryVersion"
...
...
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/RoomToolbar.java
View file @
3c7ac659
...
...
@@ -16,11 +16,13 @@ import android.view.View;
import
android.widget.ImageButton
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
chat.rocket.android.widget.helper.DrawableHelper
;
import
com.amulyakhare.textdrawable.TextDrawable
;
import
java.lang.reflect.Field
;
import
chat.rocket.android.widget.helper.DrawableHelper
;
public
class
RoomToolbar
extends
Toolbar
{
private
TextView
toolbarText
;
private
ImageView
roomTypeImage
;
...
...
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/helper/AvatarHelper.kt
View file @
3c7ac659
...
...
@@ -6,7 +6,6 @@ import android.graphics.Typeface
import
android.graphics.drawable.Drawable
import
chat.rocket.android.widget.AbsoluteUrl
import
com.amulyakhare.textdrawable.TextDrawable
import
java.net.URLEncoder
/**
...
...
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/helper/FrescoHelper.kt
View file @
3c7ac659
package
chat.rocket.android.widget.helper
import
android.graphics.Rect
import
android.graphics.drawable.Drawable
import
android.graphics.drawable.ShapeDrawable
import
android.net.Uri
import
android.support.graphics.drawable.VectorDrawableCompat
import
chat.rocket.android.widget.R
...
...
@@ -14,6 +16,10 @@ import com.facebook.drawee.view.SimpleDraweeView
object
FrescoHelper
{
fun
loadImage
(
simpleDraweeView
:
SimpleDraweeView
,
imageUri
:
String
,
placeholderDrawable
:
Drawable
)
{
// ref: https://github.com/facebook/fresco/issues/501
if
(
placeholderDrawable
is
ShapeDrawable
)
{
placeholderDrawable
.
setPadding
(
Rect
())
}
simpleDraweeView
.
hierarchy
.
setPlaceholderImage
(
placeholderDrawable
)
simpleDraweeView
.
controller
=
Fresco
.
newDraweeControllerBuilder
().
setUri
(
imageUri
).
setAutoPlayAnimations
(
true
).
build
()
}
...
...
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