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
3d0c3ff5
Unverified
Commit
3d0c3ff5
authored
Dec 22, 2016
by
Diego Sampaio
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into change-colors-to-default
parents
e6a9e4f0
9af2a0d2
Changes
76
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
76 changed files
with
2746 additions
and
2132 deletions
+2746
-2132
RoomFragment.java
...a/chat/rocket/android/fragment/chatroom/RoomFragment.java
+29
-32
AbstractChatroomDialogFragment.java
...gment/chatroom/dialog/AbstractChatroomDialogFragment.java
+1
-1
FileUploadProgressDialogFragment.java
...ent/chatroom/dialog/FileUploadProgressDialogFragment.java
+1
-1
MessageSelectionDialogFragment.java
...gment/chatroom/dialog/MessageSelectionDialogFragment.java
+52
-0
UsersOfRoomDialogFragment.java
...d/fragment/chatroom/dialog/UsersOfRoomDialogFragment.java
+8
-8
AbstractMessageViewHolder.java
...roid/layouthelper/chatroom/AbstractMessageViewHolder.java
+3
-3
MessageComposerManager.java
...android/layouthelper/chatroom/MessageComposerManager.java
+29
-47
MessageListAdapter.java
...ket/android/layouthelper/chatroom/MessageListAdapter.java
+0
-1
MessageNormalViewHolder.java
...ndroid/layouthelper/chatroom/MessageNormalViewHolder.java
+1
-1
MessageSystemViewHolder.java
...ndroid/layouthelper/chatroom/MessageSystemViewHolder.java
+1
-1
PairedMessage.java
...t/rocket/android/layouthelper/chatroom/PairedMessage.java
+1
-1
MessageSelectionAdapter.java
...layouthelper/chatroom/dialog/MessageSelectionAdapter.java
+58
-0
MessageSelectionViewHolder.java
...outhelper/chatroom/dialog/MessageSelectionViewHolder.java
+49
-0
OAuthProviderInfo.java
.../rocket/android/layouthelper/oauth/OAuthProviderInfo.java
+1
-1
AbstractMessageSpec.java
...java/chat/rocket/android/message/AbstractMessageSpec.java
+27
-0
AbstractUploadMessageSpec.java
...hat/rocket/android/message/AbstractUploadMessageSpec.java
+34
-0
AudioUploadMessageSpec.java
...a/chat/rocket/android/message/AudioUploadMessageSpec.java
+38
-0
ImageUploadMessageSpec.java
...a/chat/rocket/android/message/ImageUploadMessageSpec.java
+38
-0
VideoUploadMessageSpec.java
...a/chat/rocket/android/message/VideoUploadMessageSpec.java
+38
-0
NotificationItem.java
.../chat/rocket/android/model/internal/NotificationItem.java
+1
-1
NotificationItemObserver.java
...et/android/service/observer/NotificationItemObserver.java
+1
-1
rocket_chat_notification.xml
...main/res/drawable-anydpi-v21/rocket_chat_notification.xml
+0
-0
rocket_chat_notification.png
app/src/main/res/drawable-hdpi/rocket_chat_notification.png
+0
-0
rocket_chat_notification.png
app/src/main/res/drawable-mdpi/rocket_chat_notification.png
+0
-0
rocket_chat_notification.png
app/src/main/res/drawable-xhdpi/rocket_chat_notification.png
+0
-0
rocket_chat_notification.png
...src/main/res/drawable-xxhdpi/rocket_chat_notification.png
+0
-0
rocket_chat_notification.png
...rc/main/res/drawable-xxxhdpi/rocket_chat_notification.png
+0
-0
circle_black.xml
app/src/main/res/drawable/circle_black.xml
+5
-0
ic_attach_file_black_24dp.xml
app/src/main/res/drawable/ic_attach_file_black_24dp.xml
+9
-0
ic_audiotrack_white_24dp.xml
app/src/main/res/drawable/ic_audiotrack_white_24dp.xml
+9
-0
ic_insert_photo_white_24dp.xml
app/src/main/res/drawable/ic_insert_photo_white_24dp.xml
+2
-3
ic_video_call_white_24dp.xml
app/src/main/res/drawable/ic_video_call_white_24dp.xml
+9
-0
activity_main.xml
app/src/main/res/layout-w720dp/activity_main.xml
+6
-11
fragment_room.xml
app/src/main/res/layout-w720dp/fragment_room.xml
+3
-4
activity_main.xml
app/src/main/res/layout/activity_main.xml
+11
-16
dialog_add_channel.xml
app/src/main/res/layout/dialog_add_channel.xml
+12
-18
dialog_add_direct_message.xml
app/src/main/res/layout/dialog_add_direct_message.xml
+8
-12
dialog_file_uploading.xml
app/src/main/res/layout/dialog_file_uploading.xml
+11
-15
dialog_message_selection.xml
app/src/main/res/layout/dialog_message_selection.xml
+11
-0
dialog_message_selection_item.xml
app/src/main/res/layout/dialog_message_selection_item.xml
+25
-0
dialog_user_registration.xml
app/src/main/res/layout/dialog_user_registration.xml
+12
-24
dialog_users_of_room.xml
app/src/main/res/layout/dialog_users_of_room.xml
+8
-15
dialog_waiting.xml
app/src/main/res/layout/dialog_waiting.xml
+4
-8
fragment_home.xml
app/src/main/res/layout/fragment_home.xml
+3
-6
fragment_input_hostname.xml
app/src/main/res/layout/fragment_input_hostname.xml
+7
-14
fragment_login.xml
app/src/main/res/layout/fragment_login.xml
+16
-28
fragment_retry_login.xml
app/src/main/res/layout/fragment_retry_login.xml
+8
-16
fragment_room.xml
app/src/main/res/layout/fragment_room.xml
+4
-6
fragment_room_main.xml
app/src/main/res/layout/fragment_room_main.xml
+5
-29
fragment_sidebar_main.xml
app/src/main/res/layout/fragment_sidebar_main.xml
+8
-4
fragment_waiting.xml
app/src/main/res/layout/fragment_waiting.xml
+4
-8
list_item_message_header.xml
app/src/main/res/layout/list_item_message_header.xml
+1
-2
list_item_message_loading.xml
app/src/main/res/layout/list_item_message_loading.xml
+2
-4
list_item_message_newday.xml
app/src/main/res/layout/list_item_message_newday.xml
+4
-8
list_item_message_start_of_conversation.xml
...in/res/layout/list_item_message_start_of_conversation.xml
+2
-4
list_item_normal_message.xml
app/src/main/res/layout/list_item_normal_message.xml
+19
-26
list_item_system_message.xml
app/src/main/res/layout/list_item_system_message.xml
+15
-23
listitem_room_user.xml
app/src/main/res/layout/listitem_room_user.xml
+4
-8
room_side_menu.xml
app/src/main/res/layout/room_side_menu.xml
+4
-8
sidebar.xml
app/src/main/res/layout/sidebar.xml
+6
-12
simple_screen.xml
app/src/main/res/layout/simple_screen.xml
+1
-2
webview.xml
app/src/main/res/layout/webview.xml
+1
-2
strings.xml
app/src/main/res/values/strings.xml
+6
-1
styles.xml
app/src/main/res/values/styles.xml
+1
-0
AutofitRecyclerView.java
.../java/chat/rocket/android/widget/AutofitRecyclerView.java
+56
-0
MessageComposer.java
...a/chat/rocket/android/widget/message/MessageComposer.java
+67
-5
Emojione.java
...-android-widgets/src/main/java/com/emojione/Emojione.java
+1863
-1634
ic_add_circle_outline_black_24dp.xml
...rc/main/res/drawable/ic_add_circle_outline_black_24dp.xml
+9
-0
message_body.xml
...chat-android-widgets/src/main/res/layout/message_body.xml
+1
-2
message_body_highlight.xml
...id-widgets/src/main/res/layout/message_body_highlight.xml
+3
-3
message_composer.xml
...-android-widgets/src/main/res/layout/message_composer.xml
+40
-16
message_inline_attachment.xml
...widgets/src/main/res/layout/message_inline_attachment.xml
+6
-10
message_inline_embed_url.xml
...-widgets/src/main/res/layout/message_inline_embed_url.xml
+8
-12
message_inline_image.xml
...roid-widgets/src/main/res/layout/message_inline_image.xml
+3
-4
room_list_item.xml
...at-android-widgets/src/main/res/layout/room_list_item.xml
+9
-10
strings.xml
rocket-chat-android-widgets/src/main/res/values/strings.xml
+4
-0
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomFragment.java
View file @
3d0c3ff5
...
...
@@ -4,7 +4,6 @@ import android.app.Activity;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.design.widget.FloatingActionButton
;
import
android.support.v4.view.GravityCompat
;
import
android.support.v4.widget.DrawerLayout
;
import
android.support.v4.widget.SlidingPaneLayout
;
...
...
@@ -21,6 +20,7 @@ import java.util.UUID;
import
chat.rocket.android.R
;
import
chat.rocket.android.api.MethodCallHelper
;
import
chat.rocket.android.fragment.chatroom.dialog.FileUploadProgressDialogFragment
;
import
chat.rocket.android.fragment.chatroom.dialog.MessageSelectionDialogFragment
;
import
chat.rocket.android.fragment.chatroom.dialog.UsersOfRoomDialogFragment
;
import
chat.rocket.android.helper.FileUploadHelper
;
import
chat.rocket.android.helper.LoadMoreScrollListener
;
...
...
@@ -31,6 +31,10 @@ import chat.rocket.android.layouthelper.chatroom.MessageComposerManager;
import
chat.rocket.android.layouthelper.chatroom.MessageListAdapter
;
import
chat.rocket.android.layouthelper.chatroom.PairedMessage
;
import
chat.rocket.android.log.RCLog
;
import
chat.rocket.android.message.AudioUploadMessageSpec
;
import
chat.rocket.android.message.AbstractUploadMessageSpec
;
import
chat.rocket.android.message.ImageUploadMessageSpec
;
import
chat.rocket.android.message.VideoUploadMessageSpec
;
import
chat.rocket.android.model.ServerConfig
;
import
chat.rocket.android.model.SyncState
;
import
chat.rocket.android.model.ddp.Message
;
...
...
@@ -51,8 +55,6 @@ import chat.rocket.android.widget.message.MessageComposer;
public
class
RoomFragment
extends
AbstractChatRoomFragment
implements
OnBackPressListener
,
RealmModelListAdapter
.
OnItemClickListener
<
PairedMessage
>
{
private
static
final
int
RC_UPL
=
0x12
;
private
String
serverConfigId
;
private
RealmHelper
realmHelper
;
private
String
roomId
;
...
...
@@ -64,6 +66,9 @@ public class RoomFragment extends AbstractChatRoomFragment
private
RealmObjectObserver
<
LoadMessageProcedure
>
procedureObserver
;
private
MessageComposerManager
messageComposerManager
;
private
MessageSelectionDialogFragment
.
ClickListener
messageSelectionClickListener
=
messageSpec
->
messageSpec
.
onSelect
(
RoomFragment
.
this
);
public
RoomFragment
()
{
}
...
...
@@ -148,14 +153,13 @@ public class RoomFragment extends AbstractChatRoomFragment
setupSideMenu
();
setupMessageComposer
();
setupFileUploader
();
}
@Override
public
void
onItemClick
(
PairedMessage
pairedMessage
)
{
if
(
pairedMessage
.
target
!=
null
)
{
final
int
sync
s
tate
=
pairedMessage
.
target
.
getSyncState
();
if
(
sync
s
tate
==
SyncState
.
FAILED
)
{
final
int
sync
S
tate
=
pairedMessage
.
target
.
getSyncState
();
if
(
sync
S
tate
==
SyncState
.
FAILED
)
{
final
String
messageId
=
pairedMessage
.
target
.
getId
();
new
AlertDialog
.
Builder
(
getContext
())
.
setPositiveButton
(
R
.
string
.
resend
,
(
dialog
,
which
)
->
{
...
...
@@ -171,7 +175,6 @@ public class RoomFragment extends AbstractChatRoomFragment
realm
.
where
(
Message
.
class
)
.
equalTo
(
"_id"
,
messageId
).
findAll
().
deleteAllFromRealm
()
).
continueWith
(
new
LogcatIfError
());
;
})
.
show
();
}
...
...
@@ -180,8 +183,8 @@ public class RoomFragment extends AbstractChatRoomFragment
}
private
void
setupSideMenu
()
{
View
side
m
enu
=
rootView
.
findViewById
(
R
.
id
.
room_side_menu
);
side
m
enu
.
findViewById
(
R
.
id
.
btn_users
).
setOnClickListener
(
view
->
{
View
side
M
enu
=
rootView
.
findViewById
(
R
.
id
.
room_side_menu
);
side
M
enu
.
findViewById
(
R
.
id
.
btn_users
).
setOnClickListener
(
view
->
{
UsersOfRoomDialogFragment
.
create
(
serverConfigId
,
roomId
,
hostname
)
.
show
(
getFragmentManager
(),
UsersOfRoomDialogFragment
.
class
.
getSimpleName
());
closeSideMenuIfNeeded
();
...
...
@@ -214,11 +217,9 @@ public class RoomFragment extends AbstractChatRoomFragment
}
private
void
setupMessageComposer
()
{
final
FloatingActionButton
fabCompose
=
(
FloatingActionButton
)
rootView
.
findViewById
(
R
.
id
.
fab_compose
);
final
MessageComposer
messageComposer
=
(
MessageComposer
)
rootView
.
findViewById
(
R
.
id
.
message_composer
);
messageComposerManager
=
new
MessageComposerManager
(
fabCompose
,
messageComposer
);
messageComposerManager
=
new
MessageComposerManager
(
messageComposer
);
messageComposerManager
.
setSendMessageCallback
(
messageText
->
realmHelper
.
executeTransaction
(
realm
->
realm
.
createOrUpdateObjectFromJson
(
Message
.
class
,
new
JSONObject
()
...
...
@@ -227,29 +228,25 @@ public class RoomFragment extends AbstractChatRoomFragment
.
put
(
"ts"
,
System
.
currentTimeMillis
())
.
put
(
"rid"
,
roomId
)
.
put
(
"msg"
,
messageText
))));
messageComposerManager
.
setVisibilityChangedListener
(
shown
->
{
FloatingActionButton
fab
=
(
FloatingActionButton
)
rootView
.
findViewById
(
R
.
id
.
fab_upload_file
);
if
(
shown
)
{
fab
.
hide
();
}
else
{
fab
.
show
();
}
});
}
messageComposerManager
.
setExtrasPickerListener
(()
->
{
MessageSelectionDialogFragment
fragment
=
MessageSelectionDialogFragment
.
create
();
fragment
.
addMessageSpec
(
new
ImageUploadMessageSpec
());
fragment
.
addMessageSpec
(
new
AudioUploadMessageSpec
());
fragment
.
addMessageSpec
(
new
VideoUploadMessageSpec
());
fragment
.
setListener
(
messageSelectionClickListener
);
private
void
setupFileUploader
()
{
rootView
.
findViewById
(
R
.
id
.
fab_upload_file
).
setOnClickListener
(
view
->
{
Intent
intent
=
new
Intent
();
intent
.
setType
(
"image/*"
);
intent
.
setAction
(
Intent
.
ACTION_GET_CONTENT
);
startActivityForResult
(
Intent
.
createChooser
(
intent
,
"Select Picture to Upload"
),
RC_UPL
);
fragment
.
show
(
getFragmentManager
(),
MessageSelectionDialogFragment
.
TAG
);
closeSideMenuIfNeeded
();
});
}
@Override
public
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
!=
RC_UPL
||
resultCode
!=
Activity
.
RESULT_OK
)
{
if
(
requestCode
!=
AbstractUploadMessageSpec
.
RC_UPL
||
resultCode
!=
Activity
.
RESULT_OK
)
{
return
;
}
...
...
@@ -292,10 +289,10 @@ public class RoomFragment extends AbstractChatRoomFragment
RecyclerView
listView
=
(
RecyclerView
)
rootView
.
findViewById
(
R
.
id
.
recyclerview
);
if
(
listView
!=
null
&&
listView
.
getAdapter
()
instanceof
MessageListAdapter
)
{
MessageListAdapter
adapter
=
(
MessageListAdapter
)
listView
.
getAdapter
();
final
int
sync
s
tate
=
procedure
.
getSyncState
();
final
int
sync
S
tate
=
procedure
.
getSyncState
();
final
boolean
hasNext
=
procedure
.
hasNext
();
RCLog
.
d
(
"hasNext: %s syncstate: %d"
,
hasNext
,
sync
s
tate
);
if
(
sync
state
==
SyncState
.
SYNCED
||
syncs
tate
==
SyncState
.
FAILED
)
{
RCLog
.
d
(
"hasNext: %s syncstate: %d"
,
hasNext
,
sync
S
tate
);
if
(
sync
State
==
SyncState
.
SYNCED
||
syncS
tate
==
SyncState
.
FAILED
)
{
scrollListener
.
setLoadingDone
();
adapter
.
updateFooter
(
hasNext
,
true
);
}
else
{
...
...
@@ -366,6 +363,6 @@ public class RoomFragment extends AbstractChatRoomFragment
@Override
public
boolean
onBackPressed
()
{
return
closeSideMenuIfNeeded
()
||
messageComposerManager
.
hideMessageComposerIfNeeded
()
;
return
closeSideMenuIfNeeded
();
}
}
app/src/main/java/chat/rocket/android/fragment/chatroom/dialog/AbstractChatroomDialogFragment.java
View file @
3d0c3ff5
...
...
@@ -10,7 +10,7 @@ import android.support.design.widget.BottomSheetDialogFragment;
import
chat.rocket.android.realm_helper.RealmHelper
;
import
chat.rocket.android.realm_helper.RealmStore
;
abstract
class
AbstractChat
r
oomDialogFragment
extends
BottomSheetDialogFragment
{
abstract
class
AbstractChat
R
oomDialogFragment
extends
BottomSheetDialogFragment
{
protected
RealmHelper
realmHelper
;
protected
String
roomId
;
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/dialog/FileUploadProgressDialogFragment.java
View file @
3d0c3ff5
...
...
@@ -17,7 +17,7 @@ import chat.rocket.android.renderer.FileUploadingRenderer;
/**
* dialog fragment to display progress of file uploading.
*/
public
class
FileUploadProgressDialogFragment
extends
AbstractChat
r
oomDialogFragment
{
public
class
FileUploadProgressDialogFragment
extends
AbstractChat
R
oomDialogFragment
{
private
String
uplId
;
private
RealmObjectObserver
<
FileUploading
>
fileUploadingObserver
;
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/dialog/MessageSelectionDialogFragment.java
0 → 100644
View file @
3d0c3ff5
package
chat
.
rocket
.
android
.
fragment
.
chatroom
.
dialog
;
import
android.support.v7.widget.RecyclerView
;
import
chat.rocket.android.R
;
import
chat.rocket.android.layouthelper.chatroom.dialog.MessageSelectionAdapter
;
import
chat.rocket.android.message.AbstractMessageSpec
;
public
class
MessageSelectionDialogFragment
extends
AbstractChatRoomDialogFragment
{
public
static
final
String
TAG
=
"MessageSelectionDialogFragment"
;
private
MessageSelectionAdapter
adapter
;
private
ClickListener
listener
;
public
static
MessageSelectionDialogFragment
create
()
{
return
new
MessageSelectionDialogFragment
();
}
public
MessageSelectionDialogFragment
()
{
adapter
=
new
MessageSelectionAdapter
();
adapter
.
setListener
(
messageSpec
->
{
if
(
listener
!=
null
)
{
listener
.
onClick
(
messageSpec
);
}
dismiss
();
});
}
public
void
addMessageSpec
(
AbstractMessageSpec
abstractMessageSpec
)
{
adapter
.
addMessageSpec
(
abstractMessageSpec
);
}
public
void
setListener
(
ClickListener
listener
)
{
this
.
listener
=
listener
;
}
@Override
protected
int
getLayout
()
{
return
R
.
layout
.
dialog_message_selection
;
}
@Override
protected
void
onSetupDialog
()
{
RecyclerView
messageSpecList
=
(
RecyclerView
)
getDialog
().
findViewById
(
R
.
id
.
message_spec_list
);
messageSpecList
.
setAdapter
(
adapter
);
}
public
interface
ClickListener
{
void
onClick
(
AbstractMessageSpec
abstractMessageSpec
);
}
}
app/src/main/java/chat/rocket/android/fragment/chatroom/dialog/UsersOfRoomDialogFragment.java
View file @
3d0c3ff5
...
...
@@ -25,7 +25,7 @@ import chat.rocket.android.service.RocketChatService;
/**
* Dialog to show members in a room.
*/
public
class
UsersOfRoomDialogFragment
extends
AbstractChat
r
oomDialogFragment
{
public
class
UsersOfRoomDialogFragment
extends
AbstractChat
R
oomDialogFragment
{
private
String
hostname
;
private
RealmObjectObserver
<
GetUsersOfRoomsProcedure
>
procedureObserver
;
...
...
@@ -113,13 +113,13 @@ public class UsersOfRoomDialogFragment extends AbstractChatroomDialogFragment {
return
;
}
int
sync
s
tate
=
procedure
.
getSyncState
();
if
(
previousSyncState
!=
sync
s
tate
)
{
onSyncStateUpdated
(
sync
s
tate
);
previousSyncState
=
sync
s
tate
;
int
sync
S
tate
=
procedure
.
getSyncState
();
if
(
previousSyncState
!=
sync
S
tate
)
{
onSyncStateUpdated
(
sync
S
tate
);
previousSyncState
=
sync
S
tate
;
}
if
(
sync
s
tate
==
SyncState
.
SYNCED
)
{
if
(
sync
S
tate
==
SyncState
.
SYNCED
)
{
onRenderTotalCount
(
procedure
.
getTotal
());
try
{
...
...
@@ -138,8 +138,8 @@ public class UsersOfRoomDialogFragment extends AbstractChatroomDialogFragment {
/**
* called only if prevSyncstate != newSyncstate.
*/
private
void
onSyncStateUpdated
(
int
newSync
s
tate
)
{
boolean
show
=
newSync
state
==
SyncState
.
NOT_SYNCED
||
newSyncs
tate
==
SyncState
.
SYNCING
;
private
void
onSyncStateUpdated
(
int
newSync
S
tate
)
{
boolean
show
=
newSync
State
==
SyncState
.
NOT_SYNCED
||
newSyncS
tate
==
SyncState
.
SYNCING
;
getDialog
().
findViewById
(
R
.
id
.
waiting
).
setVisibility
(
show
?
View
.
VISIBLE
:
View
.
GONE
);
}
...
...
app/src/main/java/chat/rocket/android/layouthelper/chatroom/AbstractMessageViewHolder.java
View file @
3d0c3ff5
...
...
@@ -45,8 +45,8 @@ public abstract class AbstractMessageViewHolder extends RealmModelViewHolder<Pai
bindMessage
(
pairedMessage
);
if
(
pairedMessage
.
target
!=
null
)
{
int
sync
s
tate
=
pairedMessage
.
target
.
getSyncState
();
if
(
sync
state
==
SyncState
.
NOT_SYNCED
||
syncs
tate
==
SyncState
.
SYNCING
)
{
int
sync
S
tate
=
pairedMessage
.
target
.
getSyncState
();
if
(
sync
State
==
SyncState
.
NOT_SYNCED
||
syncS
tate
==
SyncState
.
SYNCING
)
{
itemView
.
setAlpha
(
0.6f
);
}
else
{
itemView
.
setAlpha
(
1.0f
);
...
...
@@ -76,7 +76,7 @@ public abstract class AbstractMessageViewHolder extends RealmModelViewHolder<Pai
private
void
setSequential
(
boolean
sequential
)
{
if
(
avatar
!=
null
)
{
if
(
sequential
)
{
avatar
.
setVisibility
(
View
.
INVISIBL
E
);
avatar
.
setVisibility
(
View
.
GON
E
);
}
else
{
avatar
.
setVisibility
(
View
.
VISIBLE
);
}
...
...
app/src/main/java/chat/rocket/android/layouthelper/chatroom/MessageComposerManager.java
View file @
3d0c3ff5
package
chat
.
rocket
.
android
.
layouthelper
.
chatroom
;
import
android.support.design.widget.FloatingActionButton
;
import
bolts.Task
;
import
chat.rocket.android.widget.message.MessageComposer
;
...
...
@@ -9,89 +7,73 @@ import chat.rocket.android.widget.message.MessageComposer;
* handling visibility of FAB-compose and MessageComposer.
*/
public
class
MessageComposerManager
{
private
final
FloatingActionButton
fabCompose
;
private
final
MessageComposer
messageComposer
;
private
SendMessageCallback
sendMessageCallback
;
private
VisibilityChangedListener
visibilityChanged
Listener
;
private
ExtrasPickerListener
extrasPicker
Listener
;
public
MessageComposerManager
(
FloatingActionButton
fabCompose
,
MessageComposer
messageComposer
)
{
this
.
fabCompose
=
fabCompose
;
public
MessageComposerManager
(
MessageComposer
messageComposer
)
{
this
.
messageComposer
=
messageComposer
;
init
();
}
private
void
init
()
{
fabCompose
.
setOnClickListener
(
view
->
{
setMessageComposerVisibility
(
true
);
});
messageComposer
.
setOnActionListener
(
new
MessageComposer
.
ActionListener
()
{
@Override
public
void
onSubmit
(
String
message
)
{
if
(
sendMessageCallback
!=
null
)
{
messageComposer
.
setEnabled
(
false
);
sendMessageCallback
.
onSubmit
(
message
).
onSuccess
(
task
->
{
clearComposingText
();
return
null
;
}).
continueWith
(
task
->
{
messageComposer
.
setEnabled
(
true
);
return
null
;
});
}
sendMessage
(
message
);
}
@Override
public
void
onExtra
()
{
openExtras
();
}
@Override
public
void
onCancel
()
{
setMessageComposerVisibility
(
false
);
}
});
setMessageComposerVisibility
(
false
);
}
public
void
setSendMessageCallback
(
SendMessageCallback
sendMessageCallback
)
{
this
.
sendMessageCallback
=
sendMessageCallback
;
}
public
void
set
VisibilityChangedListener
(
VisibilityChanged
Listener
listener
)
{
this
.
visibilityChanged
Listener
=
listener
;
public
void
set
ExtrasPickerListener
(
ExtrasPicker
Listener
listener
)
{
extrasPicker
Listener
=
listener
;
}
public
void
clearComposingText
()
{
messageComposer
.
setText
(
""
);
}
private
void
setMessageComposerVisibility
(
boolean
show
)
{
if
(
show
)
{
fabCompose
.
hide
();
messageComposer
.
show
(()
->
{
if
(
visibilityChangedListener
!=
null
)
{
visibilityChangedListener
.
onVisibilityChanged
(
true
);
}
});
}
else
{
messageComposer
.
hide
(()
->
{
fabCompose
.
show
();
if
(
visibilityChangedListener
!=
null
)
{
visibilityChangedListener
.
onVisibilityChanged
(
false
);
}
});
private
void
sendMessage
(
String
message
)
{
if
(
sendMessageCallback
==
null
)
{
return
;
}
messageComposer
.
setEnabled
(
false
);
sendMessageCallback
.
onSubmit
(
message
).
onSuccess
(
task
->
{
clearComposingText
();
return
null
;
}).
continueWith
(
task
->
{
messageComposer
.
setEnabled
(
true
);
return
null
;
});
}
public
boolean
hideMessageComposerIfNeeded
()
{
if
(
messageComposer
.
isShown
())
{
setMessageComposerVisibility
(
false
);
return
true
;
private
void
openExtras
()
{
if
(
extrasPickerListener
==
null
)
{
return
;
}
return
false
;
extrasPickerListener
.
onOpen
();
}
public
interface
SendMessageCallback
{
Task
<
Void
>
onSubmit
(
String
messageText
);
}
public
interface
VisibilityChanged
Listener
{
void
on
VisibilityChanged
(
boolean
shown
);
public
interface
ExtrasPicker
Listener
{
void
on
Open
(
);
}
}
app/src/main/java/chat/rocket/android/layouthelper/chatroom/MessageListAdapter.java
View file @
3d0c3ff5
...
...
@@ -92,7 +92,6 @@ public class MessageListAdapter
return
new
AbstractMessageViewHolder
(
itemView
,
hostname
,
userId
,
token
)
{
@Override
protected
void
bindMessage
(
PairedMessage
pairedMessage
)
{
}
};
}
...
...
app/src/main/java/chat/rocket/android/layouthelper/chatroom/MessageNormalViewHolder.java
View file @
3d0c3ff5
...
...
@@ -9,7 +9,7 @@ import chat.rocket.android.widget.message.RocketChatMessageLayout;
import
chat.rocket.android.widget.message.RocketChatMessageUrlsLayout
;
/**
* View holder of NORMAL chat message.
* View
Data
holder of NORMAL chat message.
*/
public
class
MessageNormalViewHolder
extends
AbstractMessageViewHolder
{
private
final
RocketChatMessageLayout
body
;
...
...
app/src/main/java/chat/rocket/android/layouthelper/chatroom/MessageSystemViewHolder.java
View file @
3d0c3ff5
...
...
@@ -7,7 +7,7 @@ import chat.rocket.android.R;
import
chat.rocket.android.renderer.MessageRenderer
;
/**
* View holder of NORMAL chat message.
* View
Data
holder of NORMAL chat message.
*/
public
class
MessageSystemViewHolder
extends
AbstractMessageViewHolder
{
private
final
TextView
body
;
...
...
app/src/main/java/chat/rocket/android/layouthelper/chatroom/PairedMessage.java
View file @
3d0c3ff5
...
...
@@ -4,7 +4,7 @@ import chat.rocket.android.helper.DateTime;
import
chat.rocket.android.model.ddp.Message
;
/**
* View Model for messages in chatroom.
* View
Data
Model for messages in chatroom.
*/
public
class
PairedMessage
{
public
final
Message
target
;
...
...
app/src/main/java/chat/rocket/android/layouthelper/chatroom/dialog/MessageSelectionAdapter.java
0 → 100644
View file @
3d0c3ff5
package
chat
.
rocket
.
android
.
layouthelper
.
chatroom
.
dialog
;
import
android.support.v7.widget.RecyclerView
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
java.util.ArrayList
;
import
java.util.List
;
import
chat.rocket.android.R
;
import
chat.rocket.android.message.AbstractMessageSpec
;
public
class
MessageSelectionAdapter
extends
RecyclerView
.
Adapter
<
MessageSelectionViewHolder
>
{
private
List
<
AbstractMessageSpec
>
abstractMessageSpecs
=
new
ArrayList
<>();
private
ClickListener
listener
;
public
void
setListener
(
ClickListener
listener
)
{
this
.
listener
=
listener
;
}
public
void
addMessageSpec
(
AbstractMessageSpec
abstractMessageSpec
)
{
abstractMessageSpecs
.
add
(
abstractMessageSpec
);
notifyDataSetChanged
();
}
@Override
public
MessageSelectionViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
View
itemView
=
LayoutInflater
.
from
(
parent
.
getContext
())
.
inflate
(
R
.
layout
.
dialog_message_selection_item
,
parent
,
false
);
itemView
.
setOnClickListener
(
view
->
{
if
(
listener
!=
null
)
{
listener
.
onClick
((
AbstractMessageSpec
)
itemView
.
getTag
());
}
});
return
new
MessageSelectionViewHolder
(
itemView
);
}
@Override
public
void
onBindViewHolder
(
MessageSelectionViewHolder
holder
,
int
position
)
{
holder
.
onBind
(
abstractMessageSpecs
.
get
(
position
));
}
@Override
public
int
getItemCount
()
{
return
abstractMessageSpecs
.
size
();
}
public
interface
ClickListener
{
void
onClick
(
AbstractMessageSpec
abstractMessageSpec
);
}
}
app/src/main/java/chat/rocket/android/layouthelper/chatroom/dialog/MessageSelectionViewHolder.java
0 → 100644
View file @
3d0c3ff5
package
chat
.
rocket
.
android
.
layouthelper
.
chatroom
.
dialog
;
import
android.support.annotation.ColorRes
;
import
android.support.annotation.DrawableRes
;
import
android.support.annotation.StringRes
;
import
android.support.v4.content.ContextCompat
;
import
android.support.v4.graphics.drawable.DrawableCompat
;
import
android.support.v7.widget.RecyclerView
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
chat.rocket.android.R
;
import
chat.rocket.android.message.AbstractMessageSpec
;
public
class
MessageSelectionViewHolder
extends
RecyclerView
.
ViewHolder
{
private
ImageView
messageSpecIcon
;
private
TextView
messageSpecTitle
;
public
MessageSelectionViewHolder
(
View
itemView
)
{
super
(
itemView
);
messageSpecIcon
=
(
ImageView
)
itemView
.
findViewById
(
R
.
id
.
message_spec_icon
);
messageSpecTitle
=
(
TextView
)
itemView
.
findViewById
(
R
.
id
.
message_spec_title
);
}
public
void
onBind
(
AbstractMessageSpec
abstractMessageSpec
)
{
itemView
.
setTag
(
abstractMessageSpec
);
AbstractMessageSpec
.
ViewData
viewData
=
abstractMessageSpec
.
getViewData
();
setIconBackgroundColorTint
(
viewData
.
getBackgroundTint
());
setIcon
(
viewData
.
getIcon
());
setTitle
(
viewData
.
getTitle
());
}
public
void
setIconBackgroundColorTint
(
@ColorRes
int
color
)
{
// Drawable background = DrawableCompat.wrap(messageSpecIcon.getBackground());
DrawableCompat
.
setTint
(
messageSpecIcon
.
getBackground
(),
ContextCompat
.
getColor
(
messageSpecIcon
.
getContext
(),
color
));
}
public
void
setIcon
(
@DrawableRes
int
icon
)
{
messageSpecIcon
.
setImageResource
(
icon
);
}
public
void
setTitle
(
@StringRes
int
title
)
{
messageSpecTitle
.
setText
(
title
);
}
}
app/src/main/java/chat/rocket/android/layouthelper/oauth/OAuthProviderInfo.java
View file @
3d0c3ff5
...
...
@@ -11,7 +11,7 @@ import chat.rocket.android.fragment.oauth.GoogleOAuthFragment;
import
chat.rocket.android.fragment.oauth.TwitterOAuthFragment
;
/**
* View model for OAuth login button.
* View
Data
model for OAuth login button.
*/
public
class
OAuthProviderInfo
{
private
static
final
ArrayList
<
OAuthProviderInfo
>
_LIST
=
new
ArrayList
<
OAuthProviderInfo
>()
{
...
...
app/src/main/java/chat/rocket/android/message/AbstractMessageSpec.java
0 → 100644
View file @
3d0c3ff5
package
chat
.
rocket
.
android
.
message
;
import
android.app.Activity
;
import
android.support.v4.app.Fragment
;
import
android.support.annotation.ColorRes
;
import
android.support.annotation.DrawableRes
;
import
android.support.annotation.StringRes
;
public
abstract
class
AbstractMessageSpec
{
public
abstract
ViewData
getViewData
();
public
abstract
void
onSelect
(
Activity
activity
);
public
abstract
void
onSelect
(
Fragment
fragment
);
public
interface
ViewData
{
@ColorRes
int
getBackgroundTint
();
@DrawableRes
int
getIcon
();
@StringRes
int
getTitle
();
}
}
app/src/main/java/chat/rocket/android/message/AbstractUploadMessageSpec.java
0 → 100644
View file @
3d0c3ff5
package
chat
.
rocket
.
android
.
message
;
import
android.app.Activity
;
import
android.support.v4.app.Fragment
;
import
android.content.Intent
;
public
abstract
class
AbstractUploadMessageSpec
extends
AbstractMessageSpec
{
public
static
final
int
RC_UPL
=
0x12
;
private
ViewData
viewData
;
@Override
public
ViewData
getViewData
()
{
if
(
viewData
==
null
)
{
viewData
=
getSpecificViewData
();
}
return
viewData
;
}
@Override
public
void
onSelect
(
Activity
activity
)
{
activity
.
startActivityForResult
(
getIntent
(),
RC_UPL
);
}
@Override
public
void
onSelect
(
Fragment
fragment
)
{
fragment
.
startActivityForResult
(
getIntent
(),
RC_UPL
);
}
protected
abstract
Intent
getIntent
();
protected
abstract
ViewData
getSpecificViewData
();
}
app/src/main/java/chat/rocket/android/message/AudioUploadMessageSpec.java
0 → 100644
View file @
3d0c3ff5
package
chat
.
rocket
.
android
.
message
;
import
android.content.Intent
;
import
chat.rocket.android.R
;
public
class
AudioUploadMessageSpec
extends
AbstractUploadMessageSpec
{
@Override
protected
Intent
getIntent
()
{
Intent
intent
=
new
Intent
();
intent
.
setType
(
"audio/*"
);
intent
.
setAction
(
Intent
.
ACTION_GET_CONTENT
);
return
Intent
.
createChooser
(
intent
,
"Select Audio to Upload"
);
}
@Override
public
ViewData
getSpecificViewData
()
{
return
new
AudioUploadViewData
();
}
private
static
class
AudioUploadViewData
implements
AbstractMessageSpec
.
ViewData
{
@Override
public
int
getBackgroundTint
()
{
return
R
.
color
.
colorAccent
;
}
@Override
public
int
getIcon
()
{
return
R
.
drawable
.
ic_audiotrack_white_24dp
;
}
@Override
public
int
getTitle
()
{
return
R
.
string
.
audio_upload_message_spec_title
;
}
}
}
app/src/main/java/chat/rocket/android/message/ImageUploadMessageSpec.java
0 → 100644
View file @
3d0c3ff5
package
chat
.
rocket
.
android
.
message
;
import
android.content.Intent
;
import
chat.rocket.android.R
;
public
class
ImageUploadMessageSpec
extends
AbstractUploadMessageSpec
{
@Override
public
ViewData
getSpecificViewData
()
{
return
new
ImageUploadViewData
();
}
@Override
protected
Intent
getIntent
()
{
Intent
intent
=
new
Intent
();
intent
.
setType
(
"image/*"
);
intent
.
setAction
(
Intent
.
ACTION_GET_CONTENT
);
return
Intent
.
createChooser
(
intent
,
"Select Picture to Upload"
);
}
private
static
class
ImageUploadViewData
implements
AbstractMessageSpec
.
ViewData
{
@Override
public
int
getBackgroundTint
()
{
return
R
.
color
.
colorAccent
;
}
@Override
public
int
getIcon
()
{
return
R
.
drawable
.
ic_insert_photo_white_24dp
;
}
@Override
public
int
getTitle
()
{
return
R
.
string
.
image_upload_message_spec_title
;
}
}
}
app/src/main/java/chat/rocket/android/message/VideoUploadMessageSpec.java
0 → 100644
View file @
3d0c3ff5
package
chat
.
rocket
.
android
.
message
;
import
android.content.Intent
;
import
chat.rocket.android.R
;
public
class
VideoUploadMessageSpec
extends
AbstractUploadMessageSpec
{
@Override
public
ViewData
getSpecificViewData
()
{
return
new
VideoUploadViewData
();
}
@Override
protected
Intent
getIntent
()
{
Intent
intent
=
new
Intent
();
intent
.
setType
(
"video/*"
);
intent
.
setAction
(
Intent
.
ACTION_GET_CONTENT
);
return
Intent
.
createChooser
(
intent
,
"Select Video to Upload"
);
}
private
static
class
VideoUploadViewData
implements
AbstractMessageSpec
.
ViewData
{
@Override
public
int
getBackgroundTint
()
{
return
R
.
color
.
colorAccent
;
}
@Override
public
int
getIcon
()
{
return
R
.
drawable
.
ic_video_call_white_24dp
;
}
@Override
public
int
getTitle
()
{
return
R
.
string
.
video_upload_message_spec_title
;
}
}
}
app/src/main/java/chat/rocket/android/model/internal/NotificationItem.java
View file @
3d0c3ff5
...
...
@@ -4,7 +4,7 @@ import io.realm.RealmObject;
import
io.realm.annotations.PrimaryKey
;
/**
* View model for notification.
* View
Data
model for notification.
*/
public
class
NotificationItem
extends
RealmObject
{
@PrimaryKey
private
String
roomId
;
...
...
app/src/main/java/chat/rocket/android/service/observer/NotificationItemObserver.java
View file @
3d0c3ff5
...
...
@@ -125,7 +125,7 @@ public class NotificationItemObserver extends AbstractModelObserver<Notification
.
setContentText
(
description
)
.
setNumber
(
unreadCount
)
.
setColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
colorPrimary
))
.
setSmallIcon
(
R
.
drawable
.
rocket_chat_notification
_24dp
)
.
setSmallIcon
(
R
.
drawable
.
rocket_chat_notification
)
.
setContentIntent
(
getContentIntent
(
roomId
))
.
setDeleteIntent
(
getDeleteIntent
(
roomId
));
...
...
app/src/main/res/drawable
/rocket_chat_notification_24dp
.xml
→
app/src/main/res/drawable
-anydpi-v21/rocket_chat_notification
.xml
View file @
3d0c3ff5
File moved
app/src/main/res/drawable-hdpi/rocket_chat_notification.png
0 → 100644
View file @
3d0c3ff5
5.11 KB
app/src/main/res/drawable-mdpi/rocket_chat_notification.png
0 → 100644
View file @
3d0c3ff5
3.24 KB
app/src/main/res/drawable-xhdpi/rocket_chat_notification.png
0 → 100644
View file @
3d0c3ff5
6.79 KB
app/src/main/res/drawable-xxhdpi/rocket_chat_notification.png
0 → 100644
View file @
3d0c3ff5
10.4 KB
app/src/main/res/drawable-xxxhdpi/rocket_chat_notification.png
0 → 100644
View file @
3d0c3ff5
14.1 KB
app/src/main/res/drawable/circle_black.xml
0 → 100644
View file @
3d0c3ff5
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"oval"
>
<solid
android:color=
"@android:color/black"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable/ic_attach_file_black_24dp.xml
0 → 100644
View file @
3d0c3ff5
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M16.5,6v11.5c0,2.21 -1.79,4 -4,4s-4,-1.79 -4,-4V5c0,-1.38 1.12,-2.5 2.5,-2.5s2.5,1.12 2.5,2.5v10.5c0,0.55 -0.45,1 -1,1s-1,-0.45 -1,-1V6H10v9.5c0,1.38 1.12,2.5 2.5,2.5s2.5,-1.12 2.5,-2.5V5c0,-2.21 -1.79,-4 -4,-4S7,2.79 7,5v12.5c0,3.04 2.46,5.5 5.5,5.5s5.5,-2.46 5.5,-5.5V6h-1.5z"
/>
</vector>
app/src/main/res/drawable/ic_audiotrack_white_24dp.xml
0 → 100644
View file @
3d0c3ff5
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:pathData=
"M12,3v9.28c-0.47,-0.17 -0.97,-0.28 -1.5,-0.28C8.01,12 6,14.01 6,16.5S8.01,21 10.5,21c2.31,0 4.2,-1.75 4.45,-4H15V6h4V3h-7z"
android:fillColor=
"#FFFFFF"
/>
</vector>
app/src/main/res/drawable/ic_insert_photo_white_24dp.xml
View file @
3d0c3ff5
...
...
@@ -2,9 +2,8 @@
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
android:alpha=
"0.78"
>
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FFFFFFFF"
android:pathData=
"M21,19V5c0,-1.1 -0.9,-2 -2,-2H5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2zM8.5,13.5l2.5,3.01L14.5,12l4.5,6H5l3.5,-4.5z"
/>
android:pathData=
"M21,19V5c0,-1.1 -0.9,-2 -2,-2H5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2zM8.5,13.5l2.5,3.01L14.5,12l4.5,6H5l3.5,-4.5z"
/>
</vector>
app/src/main/res/drawable/ic_video_call_white_24dp.xml
0 → 100644
View file @
3d0c3ff5
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:pathData=
"M17,10.5V7c0,-0.55 -0.45,-1 -1,-1H4c-0.55,0 -1,0.45 -1,1v10c0,0.55 0.45,1 1,1h12c0.55,0 1,-0.45 1,-1v-3.5l4,4v-11l-4,4zM14,13h-3v3H9v-3H6v-2h3V8h2v3h3v2z"
android:fillColor=
"#FFFFFF"
/>
</vector>
app/src/main/res/layout-w720dp/activity_main.xml
View file @
3d0c3ff5
...
...
@@ -2,28 +2,24 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
<include
layout=
"@layout/sidebar"
/>
<include
layout=
"@layout/sidebar"
/>
<android.support.design.widget.CoordinatorLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
<android.support.design.widget.AppBarLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<android.support.v7.widget.Toolbar
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:theme=
"@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme=
"@style/ThemeOverlay.AppCompat.Light"
app:title=
"@string/app_name"
/>
app:title=
"@string/app_name"
/>
</android.support.design.widget.AppBarLayout>
<FrameLayout
...
...
@@ -31,8 +27,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout-w720dp/fragment_room.xml
View file @
3d0c3ff5
...
...
@@ -2,10 +2,9 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<include
layout=
"@layout/fragment_room_main"
/>
<include
layout=
"@layout/fragment_room_main"
/>
<include
layout=
"@layout/room_side_menu"
/>
<include
layout=
"@layout/room_side_menu"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_main.xml
View file @
3d0c3ff5
...
...
@@ -3,20 +3,17 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/sliding_pane"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
<include
layout=
"@layout/sidebar"
/>
<include
layout=
"@layout/sidebar"
/>
<android.support.design.widget.CoordinatorLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
<android.support.design.widget.AppBarLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<android.support.v7.widget.Toolbar
android:id=
"@+id/activity_main_toolbar"
...
...
@@ -25,22 +22,20 @@
android:background=
"@color/white"
android:titleTextColor=
"@color/titleTextColor"
app:popupTheme=
"@style/ThemeOverlay.AppCompat.Light"
app:title=
"@string/app_name"
/>
app:title=
"@string/app_name"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_below=
"@+id/button_menu"
android:background=
"@color/borderColor"
/>
android:layout_height=
"1dp"
android:layout_below=
"@+id/button_menu"
android:background=
"@color/borderColor"
/>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id=
"@+id/activity_main_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:clickable=
"true"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.SlidingPaneLayout>
\ No newline at end of file
</android.support.v4.widget.SlidingPaneLayout>
app/src/main/res/layout/dialog_add_channel.xml
View file @
3d0c3ff5
...
...
@@ -5,20 +5,19 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:minWidth=
"288dp"
android:padding=
"@dimen/margin_24"
>
android:padding=
"@dimen/margin_24"
>
<android.support.design.widget.TextInputLayout
android:id=
"@+id/text_input_channel_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<android.support.design.widget.TextInputEditText
android:id=
"@+id/editor_channel_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:inputType=
"textWebEmailAddress"
android:hint=
"@string/dialog_add_channel_name"
/>
android:hint=
"@string/dialog_add_channel_name"
/>
</android.support.design.widget.TextInputLayout>
<LinearLayout
...
...
@@ -27,29 +26,26 @@
android:orientation=
"horizontal"
android:layout_marginTop=
"@dimen/margin_16"
android:layout_marginStart=
"@dimen/margin_8"
android:layout_marginEnd=
"@dimen/margin_8"
>
android:layout_marginEnd=
"@dimen/margin_8"
>
<CheckBox
android:id=
"@+id/checkbox_private"
android:layout_width=
"0px"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"@string/dialog_add_channel_private"
/>
android:text=
"@string/dialog_add_channel_private"
/>
<CheckBox
android:id=
"@+id/checkbox_read_only"
android:layout_width=
"0px"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"@string/dialog_add_channel_read_only"
/>
android:text=
"@string/dialog_add_channel_read_only"
/>
</LinearLayout>
<Space
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/margin_16"
/>
android:layout_height=
"@dimen/margin_16"
/>
<android.support.design.widget.FloatingActionButton
android:id=
"@+id/btn_add_channel"
...
...
@@ -58,8 +54,7 @@
android:layout_gravity=
"end|bottom"
app:elevation=
"2dp"
app:fabSize=
"mini"
app:srcCompat=
"@drawable/ic_arrow_forward_white_24dp"
/>
app:srcCompat=
"@drawable/ic_arrow_forward_white_24dp"
/>
<chat.rocket.android.widget.WaitingView
android:id=
"@+id/waiting"
...
...
@@ -68,7 +63,6 @@
android:layout_gravity=
"center"
android:visibility=
"gone"
app:dotCount=
"5"
app:dotSize=
"12dp"
/>
app:dotSize=
"12dp"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/dialog_add_direct_message.xml
View file @
3d0c3ff5
...
...
@@ -5,26 +5,24 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:minWidth=
"288dp"
android:padding=
"@dimen/margin_24"
>
android:padding=
"@dimen/margin_24"
>
<android.support.design.widget.TextInputLayout
android:id=
"@+id/text_input_username"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<android.support.v7.widget.AppCompatAutoCompleteTextView
android:id=
"@+id/editor_username"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:hint=
"username"
android:completionThreshold=
"3"
/>
android:completionThreshold=
"3"
/>
</android.support.design.widget.TextInputLayout>
<Space
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/margin_16"
/>
android:layout_height=
"@dimen/margin_16"
/>
<android.support.design.widget.FloatingActionButton
android:id=
"@+id/btn_add_direct_message"
...
...
@@ -33,8 +31,7 @@
android:layout_gravity=
"end|bottom"
app:elevation=
"2dp"
app:fabSize=
"mini"
app:srcCompat=
"@drawable/ic_arrow_forward_white_24dp"
/>
app:srcCompat=
"@drawable/ic_arrow_forward_white_24dp"
/>
<chat.rocket.android.widget.WaitingView
android:id=
"@+id/waiting"
...
...
@@ -43,7 +40,6 @@
android:layout_gravity=
"center"
android:visibility=
"gone"
app:dotCount=
"5"
app:dotSize=
"12dp"
/>
app:dotSize=
"12dp"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/dialog_file_uploading.xml
View file @
3d0c3ff5
...
...
@@ -6,22 +6,19 @@
android:paddingStart=
"@dimen/margin_16"
android:paddingEnd=
"@dimen/margin_16"
android:paddingBottom=
"@dimen/margin_16"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<FrameLayout
android:id=
"@+id/room_user_titlebar"
android:layout_width=
"match_parent"
android:layout_height=
"?attr/actionBarSize"
>
android:layout_height=
"?attr/actionBarSize"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"start|center_vertical"
android:text=
"@string/file_uploading_title"
android:textAppearance=
"@style/TextAppearance.AppCompat.Title"
/>
android:textAppearance=
"@style/TextAppearance.AppCompat.Title"
/>
</FrameLayout>
...
...
@@ -33,8 +30,7 @@
android:layout_marginTop=
"@dimen/margin_8"
android:layout_marginBottom=
"@dimen/margin_8"
tools:progress=
"12"
tools:max=
"120"
/>
tools:max=
"120"
/>
<LinearLayout
android:layout_width=
"wrap_content"
...
...
@@ -42,25 +38,25 @@
android:orientation=
"horizontal"
android:layout_gravity=
"end"
android:paddingEnd=
"2dp"
>
android:paddingRight=
"2dp"
>
<TextView
android:id=
"@+id/txt_filesize_uploaded"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"12"
/>
tools:text=
"12"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"/"
android:layout_marginStart=
"2dp"
android:layout_marginEnd=
"2dp"
/>
android:layout_marginEnd=
"2dp"
/>
<TextView
android:id=
"@+id/txt_filesize_total"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
tools:text=
"120"
/>
tools:text=
"120"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/dialog_message_selection.xml
0 → 100644
View file @
3d0c3ff5
<?xml version="1.0" encoding="utf-8"?>
<chat.rocket.android.widget.AutofitRecyclerView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/message_spec_list"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:columnWidth=
"80dp"
tools:listitem=
"@layout/dialog_message_selection_item"
android:clipToPadding=
"false"
>
</chat.rocket.android.widget.AutofitRecyclerView>
\ No newline at end of file
app/src/main/res/layout/dialog_message_selection_item.xml
0 → 100644
View file @
3d0c3ff5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:orientation=
"vertical"
android:layout_width=
"80dp"
android:layout_height=
"wrap_content"
android:padding=
"@dimen/margin_8"
>
<ImageView
android:id=
"@+id/message_spec_icon"
android:layout_width=
"64dp"
android:layout_height=
"64dp"
android:padding=
"@dimen/margin_16"
tools:src=
"@drawable/ic_insert_photo_white_24dp"
android:layout_marginBottom=
"4dp"
android:background=
"@drawable/circle_black"
/>
<TextView
android:id=
"@+id/message_spec_title"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
tools:text=
"Attach file"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/dialog_user_registration.xml
View file @
3d0c3ff5
...
...
@@ -5,14 +5,12 @@
android:layout_height=
"match_parent"
android:minWidth=
"288dp"
android:orientation=
"vertical"
android:padding=
"@dimen/margin_24"
>
android:padding=
"@dimen/margin_24"
>
<android.support.design.widget.TextInputLayout
android:id=
"@+id/text_input_email"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<android.support.design.widget.TextInputEditText
android:id=
"@+id/editor_email"
...
...
@@ -21,20 +19,17 @@
android:hint=
"@string/dialog_user_registration_email"
android:imeOptions=
"actionNext"
android:inputType=
"textWebEmailAddress"
android:singleLine=
"true"
/>
android:singleLine=
"true"
/>
</android.support.design.widget.TextInputLayout>
<Space
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/margin_8"
/>
android:layout_height=
"@dimen/margin_8"
/>
<android.support.design.widget.TextInputLayout
android:id=
"@+id/text_input_username"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<android.support.design.widget.TextInputEditText
android:id=
"@+id/editor_username"
...
...
@@ -43,21 +38,18 @@
android:hint=
"@string/dialog_user_registration_username"
android:imeOptions=
"actionNext"
android:inputType=
"textWebEmailAddress"
android:singleLine=
"true"
/>
android:singleLine=
"true"
/>
</android.support.design.widget.TextInputLayout>
<Space
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/margin_8"
/>
android:layout_height=
"@dimen/margin_8"
/>
<android.support.design.widget.TextInputLayout
android:id=
"@+id/text_input_passwd"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:passwordToggleEnabled=
"true"
>
app:passwordToggleEnabled=
"true"
>
<android.support.design.widget.TextInputEditText
android:id=
"@+id/editor_passwd"
...
...
@@ -66,14 +58,12 @@
android:hint=
"@string/dialog_user_registration_password"
android:imeOptions=
"actionNext"
android:inputType=
"textWebPassword"
android:singleLine=
"true"
/>
android:singleLine=
"true"
/>
</android.support.design.widget.TextInputLayout>
<Space
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/margin_16"
/>
android:layout_height=
"@dimen/margin_16"
/>
<android.support.design.widget.FloatingActionButton
android:id=
"@+id/btn_register_user"
...
...
@@ -82,8 +72,7 @@
android:layout_gravity=
"end|bottom"
app:elevation=
"2dp"
app:fabSize=
"mini"
app:srcCompat=
"@drawable/ic_arrow_forward_white_24dp"
/>
app:srcCompat=
"@drawable/ic_arrow_forward_white_24dp"
/>
<chat.rocket.android.widget.WaitingView
android:id=
"@+id/waiting"
...
...
@@ -91,7 +80,6 @@
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
app:dotCount=
"5"
app:dotSize=
"12dp"
/>
app:dotSize=
"12dp"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/dialog_users_of_room.xml
View file @
3d0c3ff5
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<FrameLayout
android:id=
"@+id/room_user_titlebar"
android:layout_width=
"match_parent"
android:layout_height=
"?attr/actionBarSize"
android:paddingRight=
"@dimen/margin_16"
android:paddingStart=
"@dimen/margin_16"
>
android:paddingEnd=
"@dimen/margin_16"
android:paddingStart=
"@dimen/margin_16"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"start|center_vertical"
android:text=
"@string/users_of_room_title"
android:textAppearance=
"@style/TextAppearance.AppCompat.Title"
/>
android:textAppearance=
"@style/TextAppearance.AppCompat.Title"
/>
<TextView
android:id=
"@+id/room_user_count"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end|center_vertical"
android:textAppearance=
"@style/TextAppearance.AppCompat.Small"
/>
android:textAppearance=
"@style/TextAppearance.AppCompat.Small"
/>
</FrameLayout>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/recyclerview"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
/>
android:orientation=
"vertical"
/>
</LinearLayout>
...
...
@@ -48,7 +42,6 @@
android:id=
"@+id/waiting"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
/>
android:layout_gravity=
"center"
/>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/dialog_waiting.xml
View file @
3d0c3ff5
...
...
@@ -5,27 +5,23 @@
android:gravity=
"center"
android:minWidth=
"288dp"
android:orientation=
"vertical"
android:padding=
"@dimen/margin_24"
>
android:padding=
"@dimen/margin_24"
>
<ImageView
android:layout_width=
"80dp"
android:layout_height=
"80dp"
android:layout_marginBottom=
"@dimen/margin_24"
android:scaleType=
"fitCenter"
android:src=
"@mipmap/ic_launcher"
/>
android:src=
"@mipmap/ic_launcher"
/>
<chat.rocket.android.widget.WaitingView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
<TextView
android:id=
"@+id/txt_caption"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/margin_16"
android:textAppearance=
"@style/TextAppearance.AppCompat.Caption"
/>
android:textAppearance=
"@style/TextAppearance.AppCompat.Caption"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_home.xml
View file @
3d0c3ff5
...
...
@@ -5,8 +5,7 @@
android:gravity=
"center"
android:orientation=
"vertical"
android:padding=
"@dimen/margin_16"
android:theme=
"@style/Theme.AppCompat.Light"
>
android:theme=
"@style/Theme.AppCompat.Light"
>
<TextView
android:layout_width=
"match_parent"
...
...
@@ -14,12 +13,10 @@
android:layout_marginBottom=
"@dimen/margin_16"
android:gravity=
"center"
android:text=
"@string/fragment_home_welcome_message"
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/ic_launcher"
/>
android:src=
"@mipmap/ic_launcher"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_input_hostname.xml
View file @
3d0c3ff5
...
...
@@ -3,8 +3,7 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"?attr/colorPrimaryDark"
>
android:background=
"?attr/colorPrimaryDark"
>
<LinearLayout
android:layout_width=
"wrap_content"
...
...
@@ -13,22 +12,19 @@
android:background=
"@color/white"
android:minWidth=
"288dp"
android:orientation=
"horizontal"
android:padding=
"@dimen/margin_24"
>
android:padding=
"@dimen/margin_24"
>
<LinearLayout
android:layout_width=
"0px"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_input_hostname_hostname"
android:textAppearance=
"@style/TextAppearance.AppCompat.Caption"
/>
android:textAppearance=
"@style/TextAppearance.AppCompat.Caption"
/>
<EditText
android:id=
"@+id/editor_hostname"
...
...
@@ -37,14 +33,12 @@
android:hint=
"@string/fragment_input_hostname_server_hint"
android:imeOptions=
"actionGo"
android:inputType=
"textWebEditText"
android:singleLine=
"true"
/>
android:singleLine=
"true"
/>
</LinearLayout>
<Space
android:layout_width=
"@dimen/margin_8"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
<android.support.design.widget.FloatingActionButton
android:id=
"@+id/btn_connect"
...
...
@@ -53,7 +47,6 @@
android:layout_gravity=
"end|bottom"
app:elevation=
"2dp"
app:fabSize=
"mini"
app:srcCompat=
"@drawable/ic_arrow_forward_white_24dp"
/>
app:srcCompat=
"@drawable/ic_arrow_forward_white_24dp"
/>
</LinearLayout>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_login.xml
View file @
3d0c3ff5
...
...
@@ -3,8 +3,7 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"?attr/colorPrimaryDark"
>
android:background=
"?attr/colorPrimaryDark"
>
<LinearLayout
android:layout_width=
"wrap_content"
...
...
@@ -13,14 +12,12 @@
android:background=
"@color/white"
android:minWidth=
"288dp"
android:orientation=
"vertical"
android:padding=
"@dimen/margin_24"
>
android:padding=
"@dimen/margin_24"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<chat.rocket.android.widget.FontAwesomeButton
android:id=
"@+id/btn_login_with_twitter"
...
...
@@ -29,7 +26,7 @@
android:layout_marginEnd=
"@dimen/margin_8"
android:text=
"@string/fa_twitter"
android:textSize=
"16dp"
/>
android:layout_marginRight=
"@dimen/margin_8"
/>
<chat.rocket.android.widget.FontAwesomeButton
android:id=
"@+id/btn_login_with_facebook"
...
...
@@ -38,7 +35,7 @@
android:layout_marginEnd=
"@dimen/margin_8"
android:text=
"@string/fa_facebook_official"
android:textSize=
"16dp"
/>
android:layout_marginRight=
"@dimen/margin_8"
/>
<chat.rocket.android.widget.FontAwesomeButton
android:id=
"@+id/btn_login_with_github"
...
...
@@ -47,7 +44,7 @@
android:layout_marginEnd=
"@dimen/margin_8"
android:text=
"@string/fa_github"
android:textSize=
"16dp"
/>
android:layout_marginRight=
"@dimen/margin_8"
/>
<chat.rocket.android.widget.FontAwesomeButton
android:id=
"@+id/btn_login_with_google"
...
...
@@ -56,15 +53,14 @@
android:layout_marginEnd=
"@dimen/margin_8"
android:text=
"@string/fa_google"
android:textSize=
"16dp"
/>
android:layout_marginRight=
"@dimen/margin_8"
/>
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:id=
"@+id/text_input_username"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<android.support.design.widget.TextInputEditText
android:id=
"@+id/editor_username"
...
...
@@ -73,21 +69,18 @@
android:hint=
"@string/fragment_login_username_or_email"
android:imeOptions=
"actionNext"
android:inputType=
"textWebEmailAddress"
android:singleLine=
"true"
/>
android:singleLine=
"true"
/>
</android.support.design.widget.TextInputLayout>
<Space
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/margin_8"
/>
android:layout_height=
"@dimen/margin_8"
/>
<android.support.design.widget.TextInputLayout
android:id=
"@+id/text_input_passwd"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:passwordToggleEnabled=
"true"
>
app:passwordToggleEnabled=
"true"
>
<android.support.design.widget.TextInputEditText
android:id=
"@+id/editor_passwd"
...
...
@@ -96,20 +89,17 @@
android:hint=
"@string/fragment_login_password"
android:imeOptions=
"actionNext"
android:inputType=
"textWebPassword"
android:singleLine=
"true"
/>
android:singleLine=
"true"
/>
</android.support.design.widget.TextInputLayout>
<Space
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/margin_16"
/>
android:layout_height=
"@dimen/margin_16"
/>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<android.support.design.widget.FloatingActionButton
android:id=
"@+id/btn_user_registration"
...
...
@@ -119,8 +109,7 @@
app:backgroundTint=
"@color/white"
app:elevation=
"2dp"
app:fabSize=
"mini"
app:srcCompat=
"@drawable/ic_user_registration_blue_24dp"
/>
app:srcCompat=
"@drawable/ic_user_registration_blue_24dp"
/>
<android.support.design.widget.FloatingActionButton
android:id=
"@+id/btn_login_with_email"
...
...
@@ -129,8 +118,7 @@
android:layout_gravity=
"end|bottom"
app:elevation=
"2dp"
app:fabSize=
"normal"
app:srcCompat=
"@drawable/ic_arrow_forward_white_24dp"
/>
app:srcCompat=
"@drawable/ic_arrow_forward_white_24dp"
/>
</FrameLayout>
</LinearLayout>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_retry_login.xml
View file @
3d0c3ff5
...
...
@@ -3,8 +3,7 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"?attr/colorPrimaryDark"
>
android:background=
"?attr/colorPrimaryDark"
>
<LinearLayout
android:layout_width=
"wrap_content"
...
...
@@ -13,15 +12,13 @@
android:background=
"@color/white"
android:minWidth=
"288dp"
android:orientation=
"vertical"
android:padding=
"@dimen/margin_24"
>
android:padding=
"@dimen/margin_24"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_retry_login_error_title"
android:textAppearance=
"@style/TextAppearance.AppCompat.Title"
/>
android:textAppearance=
"@style/TextAppearance.AppCompat.Title"
/>
<TextView
android:id=
"@+id/txt_error_description"
...
...
@@ -29,16 +26,14 @@
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"@dimen/margin_8"
android:layout_marginTop=
"@dimen/margin_8"
android:textAppearance=
"@style/Base.TextAppearance.AppCompat.Body1"
/>
android:textAppearance=
"@style/Base.TextAppearance.AppCompat.Body1"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"center"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<android.support.design.widget.FloatingActionButton
android:id=
"@+id/btn_retry_login"
...
...
@@ -47,15 +42,13 @@
android:layout_margin=
"@dimen/margin_8"
app:elevation=
"2dp"
app:fabSize=
"normal"
app:srcCompat=
"@drawable/ic_arrow_forward_white_24dp"
/>
app:srcCompat=
"@drawable/ic_arrow_forward_white_24dp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/fragment_retry_login_retry_title"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
/>
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
/>
</LinearLayout>
...
...
@@ -66,8 +59,7 @@
android:layout_gravity=
"center"
android:layout_marginTop=
"@dimen/margin_16"
app:dotCount=
"5"
app:dotSize=
"12dp"
/>
app:dotSize=
"12dp"
/>
</LinearLayout>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_room.xml
View file @
3d0c3ff5
...
...
@@ -2,19 +2,17 @@
<android.support.v4.widget.DrawerLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/drawer_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
<include
layout=
"@layout/fragment_room_main"
/>
<include
layout=
"@layout/fragment_room_main"
/>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"end"
android:clickable=
"true"
android:theme=
"@style/AppTheme.Dark"
>
android:theme=
"@style/AppTheme.Dark"
>
<include
layout=
"@layout/room_side_menu"
/>
<include
layout=
"@layout/room_side_menu"
/>
</FrameLayout>
</android.support.v4.widget.DrawerLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_room_main.xml
View file @
3d0c3ff5
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/recyclerview"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_above=
"@+id/message_composer"
/>
<chat.rocket.android.widget.message.MessageComposer
android:id=
"@+id/message_composer"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:theme=
"@style/Theme.AppCompat.Light"
android:layout_gravity=
"bottom"
android:background=
"@android:color/white"
/>
<android.support.design.widget.FloatingActionButton
android:id=
"@+id/fab_upload_file"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"start|bottom"
android:layout_margin=
"@dimen/margin_16"
app:fabSize=
"mini"
app:srcCompat=
"@drawable/ic_insert_photo_white_24dp"
/>
<android.support.design.widget.FloatingActionButton
android:id=
"@+id/fab_compose"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end|bottom"
android:layout_margin=
"@dimen/margin_16"
app:srcCompat=
"@drawable/ic_compose_white_24dp"
/>
</FrameLayout>
\ No newline at end of file
android:layout_alignParentBottom=
"true"
/>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_sidebar_main.xml
View file @
3d0c3ff5
...
...
@@ -61,7 +61,8 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:paddingStart=
"?attr/listPreferredItemPaddingLeft"
>
android:paddingStart=
"?attr/listPreferredItemPaddingLeft"
android:paddingLeft=
"?attr/listPreferredItemPaddingLeft"
>
<TextView
android:id=
"@+id/unread_title"
...
...
@@ -80,7 +81,8 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"?attr/listPreferredItemPaddingRight"
android:orientation=
"vertical"
/>
android:orientation=
"vertical"
android:layout_marginRight=
"?attr/listPreferredItemPaddingRight"
/>
<FrameLayout
android:layout_width=
"match_parent"
...
...
@@ -112,7 +114,8 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"?attr/listPreferredItemPaddingRight"
android:orientation=
"vertical"
/>
android:orientation=
"vertical"
android:layout_marginRight=
"?attr/listPreferredItemPaddingRight"
/>
<FrameLayout
android:layout_width=
"match_parent"
...
...
@@ -144,7 +147,8 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"?attr/listPreferredItemPaddingRight"
android:orientation=
"vertical"
/>
android:orientation=
"vertical"
android:layout_marginRight=
"?attr/listPreferredItemPaddingRight"
/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
...
...
app/src/main/res/layout/fragment_waiting.xml
View file @
3d0c3ff5
...
...
@@ -3,29 +3,25 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"?attr/colorPrimaryDark"
android:theme=
"@style/AppTheme.Dark"
>
android:theme=
"@style/AppTheme.Dark"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"center"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<chat.rocket.android.widget.WaitingView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
<TextView
android:id=
"@+id/txt_caption"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/margin_32"
android:textAppearance=
"@style/TextAppearance.AppCompat.Caption"
/>
android:textAppearance=
"@style/TextAppearance.AppCompat.Caption"
/>
</LinearLayout>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/list_item_message_header.xml
View file @
3d0c3ff5
...
...
@@ -2,5 +2,4 @@
<Space
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/space"
android:layout_width=
"match_parent"
android:layout_height=
"88dp"
/>
\ No newline at end of file
android:layout_height=
"0dp"
/>
\ No newline at end of file
app/src/main/res/layout/list_item_message_loading.xml
View file @
3d0c3ff5
...
...
@@ -3,14 +3,12 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:theme=
"@style/AppTheme"
>
android:theme=
"@style/AppTheme"
>
<chat.rocket.android.widget.WaitingView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_margin=
"@dimen/margin_8"
/>
android:layout_margin=
"@dimen/margin_8"
/>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/list_item_message_newday.xml
View file @
3d0c3ff5
...
...
@@ -6,15 +6,13 @@
android:layout_height=
"wrap_content"
android:layout_margin=
"16dp"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<View
android:layout_width=
"0px"
android:layout_height=
"1dp"
android:layout_weight=
"1"
android:background=
"@color/newday_color"
/>
android:background=
"@color/newday_color"
/>
<TextView
android:id=
"@+id/newday_text"
...
...
@@ -25,14 +23,12 @@
android:textColor=
"@color/newday_text_color"
android:textSize=
"8sp"
android:textStyle=
"bold"
tools:text=
"2016/01/23"
/>
tools:text=
"2016/01/23"
/>
<View
android:layout_width=
"0px"
android:layout_height=
"1dp"
android:layout_weight=
"1"
android:background=
"@color/newday_color"
/>
android:background=
"@color/newday_color"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/list_item_message_start_of_conversation.xml
View file @
3d0c3ff5
...
...
@@ -3,8 +3,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:theme=
"@style/AppTheme"
>
android:theme=
"@style/AppTheme"
>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -12,7 +11,6 @@
android:layout_gravity=
"center"
android:layout_margin=
"@dimen/margin_16"
android:text=
"@string/start_of_conversation"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
/>
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
/>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/list_item_normal_message.xml
View file @
3d0c3ff5
...
...
@@ -4,77 +4,70 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:theme=
"@style/AppTheme"
>
android:theme=
"@style/AppTheme"
>
<include
layout=
"@layout/list_item_message_newday"
/>
<include
layout=
"@layout/list_item_message_newday"
/>
<
Linear
Layout
<
Frame
Layout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:layout_marginBottom=
"2dp"
>
<ImageView
android:id=
"@+id/user_avatar"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_margin=
"8dp"
tools:src=
"@drawable/ic_default_avatar"
/>
tools:src=
"@drawable/ic_default_avatar"
/>
<LinearLayout
android:layout_width=
"
0px
"
android:layout_width=
"
match_parent
"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"8dp"
android:layout_
weight=
"1
"
android:layout_
marginStart=
"48dp
"
android:orientation=
"vertical"
>
android:layout_marginRight=
"8dp"
android:layout_marginLeft=
"48dp"
>
<LinearLayout
android:id=
"@+id/user_and_timestamp_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/username"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textStyle=
"bold"
tools:text=
"John Doe"
/>
tools:text=
"John Doe"
/>
<Space
android:layout_width=
"@dimen/margin_8"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
<TextView
android:id=
"@+id/timestamp"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:enabled=
"false"
tools:text=
"12:34"
/>
tools:text=
"12:34"
/>
</LinearLayout>
<chat.rocket.android.widget.message.RocketChatMessageLayout
android:id=
"@+id/message_body"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
<chat.rocket.android.widget.message.RocketChatMessageUrlsLayout
android:id=
"@+id/message_urls"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
<chat.rocket.android.widget.message.RocketChatMessageAttachmentsLayout
android:id=
"@+id/message_attachments"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
</LinearLayout>
</
Linear
Layout>
</
Frame
Layout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/list_item_system_message.xml
View file @
3d0c3ff5
...
...
@@ -4,60 +4,53 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:theme=
"@style/AppTheme"
>
android:theme=
"@style/AppTheme"
>
<include
layout=
"@layout/list_item_message_newday"
/>
<include
layout=
"@layout/list_item_message_newday"
/>
<
Linear
Layout
<
Frame
Layout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/user_avatar"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_margin=
"8dp"
tools:src=
"@drawable/ic_default_avatar"
/>
tools:src=
"@drawable/ic_default_avatar"
/>
<LinearLayout
android:layout_width=
"
0px
"
android:layout_width=
"
match_parent
"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"8dp"
android:layout_
weight=
"1
"
android:layout_
marginStart=
"48dp
"
android:orientation=
"vertical"
>
android:layout_marginRight=
"8dp"
android:layout_marginLeft=
"48dp"
>
<LinearLayout
android:id=
"@+id/user_and_timestamp_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/username"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textStyle=
"bold"
tools:text=
"John Doe"
/>
tools:text=
"John Doe"
/>
<Space
android:layout_width=
"@dimen/margin_8"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
<TextView
android:id=
"@+id/timestamp"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:enabled=
"false"
tools:text=
"12:34"
/>
tools:text=
"12:34"
/>
</LinearLayout>
<TextView
...
...
@@ -66,8 +59,7 @@
android:layout_height=
"wrap_content"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
android:textStyle=
"italic"
android:enabled=
"false"
/>
android:enabled=
"false"
/>
</LinearLayout>
</
Linear
Layout>
</
Frame
Layout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/listitem_room_user.xml
View file @
3d0c3ff5
...
...
@@ -3,21 +3,18 @@
android:layout_width=
"match_parent"
android:layout_height=
"?attr/listPreferredItemHeightSmall"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/room_user_status"
android:layout_width=
"8dp"
android:layout_height=
"8dp"
android:layout_margin=
"@dimen/margin_8"
/>
android:layout_margin=
"@dimen/margin_8"
/>
<ImageView
android:id=
"@+id/room_user_avatar"
android:layout_width=
"24dp"
android:layout_height=
"24dp"
/>
android:layout_height=
"24dp"
/>
<TextView
android:id=
"@+id/room_user_name"
...
...
@@ -27,7 +24,6 @@
android:layout_marginLeft=
"@dimen/margin_8"
android:layout_marginRight=
"@dimen/margin_8"
android:layout_weight=
"1"
android:textAppearance=
"@style/TextAppearance.AppCompat.Small"
/>
android:textAppearance=
"@style/TextAppearance.AppCompat.Small"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/room_side_menu.xml
View file @
3d0c3ff5
...
...
@@ -4,31 +4,27 @@
android:layout_width=
"48dp"
android:layout_height=
"match_parent"
android:layout_gravity=
"end"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<chat.rocket.android.widget.FontAwesomeButton
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:enabled=
"false"
android:text=
"@string/fa_search"
android:textSize=
"24dp"
/>
android:textSize=
"24dp"
/>
<chat.rocket.android.widget.FontAwesomeButton
android:id=
"@+id/btn_users"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:text=
"@string/fa_users"
android:textSize=
"24dp"
/>
android:textSize=
"24dp"
/>
<chat.rocket.android.widget.FontAwesomeButton
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:enabled=
"false"
android:text=
"@string/fa_at"
android:textSize=
"24dp"
/>
android:textSize=
"24dp"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/sidebar.xml
View file @
3d0c3ff5
...
...
@@ -4,44 +4,38 @@
android:layout_width=
"280dp"
android:layout_height=
"match_parent"
android:layout_gravity=
"start"
android:theme=
"@style/AppTheme.Dark"
>
android:theme=
"@style/AppTheme.Dark"
>
<android.support.v4.widget.NestedScrollView
android:layout_width=
"96dp"
android:layout_height=
"match_parent"
android:layout_gravity=
"start"
android:background=
"?attr/colorPrimaryDark"
>
android:background=
"?attr/colorPrimaryDark"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<ImageButton
style=
"@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width=
"80dp"
android:layout_height=
"80dp"
android:layout_margin=
"@dimen/margin_8"
android:src=
"@mipmap/ic_launcher"
/>
android:src=
"@mipmap/ic_launcher"
/>
<chat.rocket.android.widget.FontAwesomeButton
style=
"@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width=
"80dp"
android:layout_height=
"80dp"
android:layout_margin=
"@dimen/margin_8"
android:text=
"@string/fa_plus"
/>
android:text=
"@string/fa_plus"
/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<FrameLayout
android:id=
"@+id/sidebar_fragment_container"
android:layout_width=
"280dp"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
</android.support.v4.widget.SlidingPaneLayout>
\ No newline at end of file
app/src/main/res/layout/simple_screen.xml
View file @
3d0c3ff5
...
...
@@ -2,7 +2,6 @@
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/content"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/webview.xml
View file @
3d0c3ff5
...
...
@@ -2,5 +2,4 @@
<WebView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/webview"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
\ No newline at end of file
android:layout_height=
"match_parent"
/>
\ No newline at end of file
app/src/main/res/values/strings.xml
View file @
3d0c3ff5
...
...
@@ -18,7 +18,7 @@
<string
name=
"resend"
>
Resend
</string>
<string
name=
"discard"
>
Discard
</string>
<string
name=
"file_uploading_title"
>
Uploading
...
</string>
<string
name=
"file_uploading_title"
>
Uploading
…
</string>
<string
name=
"dialog_user_registration_email"
>
Email
</string>
<string
name=
"dialog_user_registration_username"
>
Username
</string>
...
...
@@ -34,4 +34,9 @@
<string
name=
"server_config_activity_authenticating"
>
Authenticating…
</string>
<string
name=
"home_fragment_title"
>
Rocket.Chat - Home
</string>
<string
name=
"fragment_sidebar_main_unread_rooms_title"
>
UNREAD ROOMS
</string>
<string
name=
"doc_upload_message_spec_title"
>
Attach file
</string>
<string
name=
"image_upload_message_spec_title"
>
Attach image
</string>
<string
name=
"audio_upload_message_spec_title"
>
Attach audio
</string>
<string
name=
"video_upload_message_spec_title"
>
Attach video
</string>
</resources>
app/src/main/res/values/styles.xml
View file @
3d0c3ff5
...
...
@@ -13,6 +13,7 @@
<item
name=
"actionModeBackground"
>
?attr/colorPrimaryDark
</item>
<item
name=
"android:statusBarColor"
tools:targetApi=
"21"
>
?attr/colorPrimaryDark
</item>
<item
name=
"android:navigationBarColor"
tools:targetApi=
"21"
>
?attr/colorPrimaryDark
</item>
<item
name=
"android:windowBackground"
>
@android:color/white
</item>
</style>
<style
name=
"AppTheme.Dark"
parent=
"Theme.AppCompat.NoActionBar"
>
...
...
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/AutofitRecyclerView.java
0 → 100644
View file @
3d0c3ff5
package
chat
.
rocket
.
android
.
widget
;
import
android.content.Context
;
import
android.content.res.TypedArray
;
import
android.support.v7.widget.GridLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.util.AttributeSet
;
/**
* Chiu-Ki Chan's autofit recycler view
*
* Available at: https://github.com/chiuki/android-recyclerview/blob/master/app/src/main/java/com/sqisland/android/recyclerview/AutofitRecyclerView.java
*/
public
class
AutofitRecyclerView
extends
RecyclerView
{
private
GridLayoutManager
manager
;
private
int
columnWidth
=
-
1
;
public
AutofitRecyclerView
(
Context
context
)
{
super
(
context
);
init
(
context
,
null
);
}
public
AutofitRecyclerView
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
init
(
context
,
attrs
);
}
public
AutofitRecyclerView
(
Context
context
,
AttributeSet
attrs
,
int
defStyle
)
{
super
(
context
,
attrs
,
defStyle
);
init
(
context
,
attrs
);
}
private
void
init
(
Context
context
,
AttributeSet
attrs
)
{
if
(
attrs
!=
null
)
{
int
[]
attrsArray
=
{
android
.
R
.
attr
.
columnWidth
};
TypedArray
array
=
context
.
obtainStyledAttributes
(
attrs
,
attrsArray
);
columnWidth
=
array
.
getDimensionPixelSize
(
0
,
-
1
);
array
.
recycle
();
}
manager
=
new
GridLayoutManager
(
getContext
(),
1
);
setLayoutManager
(
manager
);
}
@Override
protected
void
onMeasure
(
int
widthSpec
,
int
heightSpec
)
{
super
.
onMeasure
(
widthSpec
,
heightSpec
);
if
(
columnWidth
>
0
)
{
int
spanCount
=
Math
.
max
(
1
,
getMeasuredWidth
()
/
columnWidth
);
manager
.
setSpanCount
(
spanCount
);
}
}
}
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/MessageComposer.java
View file @
3d0c3ff5
...
...
@@ -4,11 +4,14 @@ import android.annotation.TargetApi;
import
android.content.Context
;
import
android.os.Build
;
import
android.support.annotation.Nullable
;
import
android.text.Editable
;
import
android.text.TextWatcher
;
import
android.util.AttributeSet
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.inputmethod.InputMethodManager
;
import
android.widget.EditText
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
...
...
@@ -19,6 +22,9 @@ public class MessageComposer extends LinearLayout {
protected
ActionListener
actionListener
;
protected
ViewGroup
composer
;
private
View
btnExtra
;
private
View
btnSubmit
;
public
MessageComposer
(
Context
context
)
{
super
(
context
);
init
();
...
...
@@ -47,14 +53,50 @@ public class MessageComposer extends LinearLayout {
private
void
init
()
{
composer
=
(
ViewGroup
)
LayoutInflater
.
from
(
getContext
())
.
inflate
(
R
.
layout
.
message_composer
,
this
,
false
);
composer
.
findViewById
(
R
.
id
.
btn_submit
).
setOnClickListener
(
new
OnClickListener
()
{
btnExtra
=
composer
.
findViewById
(
R
.
id
.
btn_extras
);
btnExtra
.
setOnClickListener
(
new
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
onExtra
();
}
}
});
btnSubmit
=
composer
.
findViewById
(
R
.
id
.
btn_submit
);
btnSubmit
.
setOnClickListener
(
new
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
String
messageText
=
getText
();
if
(
messageText
.
length
()
>
0
)
{
if
(
actionListener
!=
null
)
{
actionListener
.
onSubmit
(
messageText
);
}
if
(
messageText
.
length
()
>
0
&&
actionListener
!=
null
)
{
actionListener
.
onSubmit
(
messageText
);
}
}
});
btnSubmit
.
animate
().
scaleX
(
0
).
scaleY
(
0
).
setDuration
(
0
);
btnSubmit
.
setVisibility
(
GONE
);
((
EditText
)
composer
.
findViewById
(
R
.
id
.
editor
)).
addTextChangedListener
(
new
TextWatcher
()
{
@Override
public
void
beforeTextChanged
(
CharSequence
s
,
int
start
,
int
count
,
int
after
)
{
}
@Override
public
void
onTextChanged
(
CharSequence
s
,
int
start
,
int
before
,
int
count
)
{
}
@Override
public
void
afterTextChanged
(
Editable
s
)
{
if
(
s
.
toString
().
trim
().
length
()
>
0
)
{
animateHide
(
btnExtra
);
animateShow
(
btnSubmit
);
}
else
{
animateShow
(
btnExtra
);
animateHide
(
btnSubmit
);
}
}
});
...
...
@@ -113,9 +155,29 @@ public class MessageComposer extends LinearLayout {
return
getVisibility
()
==
View
.
VISIBLE
;
}
private
void
animateHide
(
final
View
view
)
{
view
.
animate
().
scaleX
(
0
).
scaleY
(
0
).
setDuration
(
150
).
withEndAction
(
new
Runnable
()
{
@Override
public
void
run
()
{
view
.
setVisibility
(
GONE
);
}
});
}
private
void
animateShow
(
final
View
view
)
{
view
.
animate
().
scaleX
(
1
).
scaleY
(
1
).
setDuration
(
150
).
withStartAction
(
new
Runnable
()
{
@Override
public
void
run
()
{
view
.
setVisibility
(
VISIBLE
);
}
});
}
public
interface
ActionListener
{
void
onSubmit
(
String
message
);
void
onExtra
();
void
onCancel
();
}
}
rocket-chat-android-widgets/src/main/java/com/emojione/Emojione.java
View file @
3d0c3ff5
This diff is collapsed.
Click to expand it.
rocket-chat-android-widgets/src/main/res/drawable/ic_add_circle_outline_black_24dp.xml
0 → 100644
View file @
3d0c3ff5
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M13,7h-2v4L7,11v2h4v4h2v-4h4v-2h-4L13,7zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"
/>
</vector>
rocket-chat-android-widgets/src/main/res/layout/message_body.xml
View file @
3d0c3ff5
...
...
@@ -3,5 +3,4 @@
android:id=
"@android:id/text1"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:textAppearance=
"@style/TextAppearance.RocketChat.MessageBody"
/>
android:textAppearance=
"@style/TextAppearance.RocketChat.MessageBody"
/>
rocket-chat-android-widgets/src/main/res/layout/message_body_highlight.xml
View file @
3d0c3ff5
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
<TextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@android:id/text1"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
@@ -11,4 +10,5 @@
android:layout_marginEnd=
"6dp"
android:layout_marginTop=
"3dp"
android:layout_marginBottom=
"3dp"
/>
\ No newline at end of file
android:layout_marginLeft=
"0px"
android:layout_marginRight=
"6dp"
/>
\ No newline at end of file
rocket-chat-android-widgets/src/main/res/layout/message_composer.xml
View file @
3d0c3ff5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<chat.rocket.android.widget.DividerView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:gravity=
"bottom"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/emoji_keyboard_toggle"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_margin=
"8dp"
/>
<EditText
android:id=
"@+id/editor"
android:layout_width=
"0px"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:background=
"@null"
android:layout_marginLeft=
"0dp"
android:layout_marginRight=
"0dp"
android:layout_marginTop=
"4dp"
android:layout_marginBottom=
"4dp"
android:padding=
"0dp"
android:layout_weight=
"1"
android:maxLines=
"3"
/>
android:textSize=
"14sp"
android:hint=
"@string/message_composer_message_hint"
android:minLines=
"1"
android:maxLines=
"4"
/>
<ImageButton
android:id=
"@+id/btn_submit"
<FrameLayout
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_gravity=
"center_vertical"
app:srcCompat=
"@drawable/ic_send_black_24dp"
/>
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/btn_extras"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:padding=
"8dp"
app:srcCompat=
"@drawable/ic_add_circle_outline_black_24dp"
/>
<ImageView
android:id=
"@+id/btn_submit"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:padding=
"8dp"
app:srcCompat=
"@drawable/ic_send_black_24dp"
/>
</FrameLayout>
</LinearLayout>
</LinearLayout>
rocket-chat-android-widgets/src/main/res/layout/message_inline_attachment.xml
View file @
3d0c3ff5
...
...
@@ -4,21 +4,19 @@
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:layout_margin=
"4dp"
android:padding=
"4dp"
>
android:padding=
"4dp"
>
<View
android:layout_width=
"3dp"
android:layout_height=
"match_parent"
android:layout_marginRight=
"5dp"
android:background=
"@color/inline_attachment_quote_line"
/>
android:background=
"@color/inline_attachment_quote_line"
/>
<LinearLayout
android:layout_width=
"0px"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/title"
...
...
@@ -27,8 +25,7 @@
android:layout_marginTop=
"2dp"
android:layout_marginBottom=
"2dp"
android:textAppearance=
"@style/TextAppearance.RocketChat.MessageAttachment.Title"
android:background=
"?attr/selectableItemBackground"
/>
android:background=
"?attr/selectableItemBackground"
/>
<ImageView
android:id=
"@+id/image"
...
...
@@ -38,8 +35,7 @@
android:layout_marginTop=
"4dp"
android:layout_marginRight=
"8dp"
android:adjustViewBounds=
"true"
android:scaleType=
"fitStart"
/>
android:scaleType=
"fitStart"
/>
</LinearLayout>
</LinearLayout>
rocket-chat-android-widgets/src/main/res/layout/message_inline_embed_url.xml
View file @
3d0c3ff5
...
...
@@ -5,14 +5,14 @@
android:orientation=
"horizontal"
android:background=
"?attr/selectableItemBackground"
android:layout_margin=
"4dp"
android:padding=
"4dp"
>
android:padding=
"4dp"
>
<View
android:layout_width=
"3dp"
android:layout_height=
"match_parent"
android:layout_marginEnd=
"5dp"
android:background=
"@color/inline_attachment_quote_line"
/>
android:layout_marginRight=
"5dp"
/>
<ImageView
android:id=
"@+id/image"
...
...
@@ -23,14 +23,13 @@
android:layout_marginEnd=
"8dp"
android:adjustViewBounds=
"true"
android:scaleType=
"fitStart"
/>
android:layout_marginRight=
"8dp"
/>
<LinearLayout
android:layout_width=
"0px"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/hostname"
...
...
@@ -38,8 +37,7 @@
android:layout_height=
"wrap_content"
android:layout_marginTop=
"2dp"
android:layout_marginBottom=
"2dp"
android:enabled=
"false"
/>
android:enabled=
"false"
/>
<TextView
android:id=
"@+id/title"
...
...
@@ -47,8 +45,7 @@
android:layout_height=
"wrap_content"
android:layout_marginTop=
"2dp"
android:layout_marginBottom=
"2dp"
android:textAppearance=
"@style/TextAppearance.RocketChat.MessageAttachment.Title"
/>
android:textAppearance=
"@style/TextAppearance.RocketChat.MessageAttachment.Title"
/>
<TextView
android:id=
"@+id/description"
...
...
@@ -56,8 +53,7 @@
android:layout_height=
"wrap_content"
android:layout_marginTop=
"2dp"
android:layout_marginBottom=
"2dp"
android:textAppearance=
"@style/TextAppearance.RocketChat.MessageAttachment.Description"
/>
android:textAppearance=
"@style/TextAppearance.RocketChat.MessageAttachment.Description"
/>
</LinearLayout>
...
...
rocket-chat-android-widgets/src/main/res/layout/message_inline_image.xml
View file @
3d0c3ff5
...
...
@@ -3,14 +3,13 @@
android:layout_height=
"wrap_content"
android:background=
"@drawable/inline_attachment_background"
android:layout_margin=
"4dp"
android:padding=
"4dp"
>
android:padding=
"4dp"
>
<ImageView
android:id=
"@+id/message_inline_image"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxHeight=
"200dp"
android:adjustViewBounds=
"true"
android:scaleType=
"fitStart"
/>
android:scaleType=
"fitStart"
/>
</FrameLayout>
rocket-chat-android-widgets/src/main/res/layout/room_list_item.xml
View file @
3d0c3ff5
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<FrameLayout
android:layout_width=
"32dp"
android:layout_height=
"?attr/listPreferredItemHeightSmall"
android:layout_marginEnd=
"16dp"
>
android:layout_marginRight=
"16dp"
>
<chat.rocket.android.widget.FontAwesomeTextView
android:id=
"@+id/icon"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
/>
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
/>
</FrameLayout>
<TextView
...
...
@@ -23,8 +23,7 @@
android:layout_height=
"?attr/listPreferredItemHeightSmall"
android:layout_weight=
"1"
android:gravity=
"center_vertical"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body2"
/>
android:textAppearance=
"@style/TextAppearance.AppCompat.Body2"
/>
<FrameLayout
android:id=
"@+id/alert_count_container"
...
...
@@ -35,14 +34,14 @@
android:padding=
"3dp"
android:layout_gravity=
"center_vertical"
android:background=
"@drawable/unread_count_background"
>
android:layout_marginLeft=
"8dp"
>
<TextView
android:id=
"@+id/alert_count"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"14dp"
android:layout_gravity=
"center"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
/>
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
/>
</FrameLayout>
</merge>
\ No newline at end of file
rocket-chat-android-widgets/src/main/res/values/strings.xml
0 → 100644
View file @
3d0c3ff5
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string
name=
"message_composer_message_hint"
>
Message
</string>
</resources>
\ No newline at end of file
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