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
30748b91
Commit
30748b91
authored
Jun 04, 2018
by
aniket
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
makes suggested changes
parent
9a820a67
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
47 additions
and
25 deletions
+47
-25
build.gradle
app/build.gradle
+2
-0
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+2
-2
ChatRoomsFragment.kt
...ava/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.kt
+2
-2
AddMembersView.kt
...d/createChannel/addMembers/presentation/AddMembersView.kt
+1
-0
AddMembersActivity.kt
...android/createChannel/addMembers/ui/AddMembersActivity.kt
+10
-6
CreateNewChannelPresenter.kt
...d/createChannel/presentation/CreateNewChannelPresenter.kt
+0
-1
CreateNewChannelView.kt
...ndroid/createChannel/presentation/CreateNewChannelView.kt
+15
-7
CreateNewChannelActivity.kt
...cket/android/createChannel/ui/CreateNewChannelActivity.kt
+13
-5
activity_add_members.xml
app/src/main/res/layout/activity_add_members.xml
+1
-1
dependencies.gradle
dependencies.gradle
+1
-1
No files found.
app/build.gradle
View file @
30748b91
...
...
@@ -57,6 +57,7 @@ dependencies {
implementation
libraries
.
kotlin
implementation
libraries
.
coroutines
implementation
libraries
.
coroutinesAndroid
implementation
libraries
.
appCompat
implementation
libraries
.
recyclerview
implementation
libraries
.
design
...
...
@@ -64,6 +65,7 @@ dependencies {
implementation
libraries
.
cardView
implementation
libraries
.
flexbox
implementation
libraries
.
customTabs
implementation
libraries
.
supportv4
implementation
libraries
.
androidKtx
...
...
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
30748b91
...
...
@@ -532,8 +532,8 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
override
fun
onNonEmojiKeyPressed
(
keyCode
:
Int
)
{
when
(
keyCode
)
{
KeyEvent
.
KEYCODE_BACK
->
with
(
text_message
)
{
if
(
selectionStart
>
0
)
text
!!
.
delete
(
selectionStart
-
1
,
selectionStart
)
KeyEvent
.
KEYCODE_BACK
->
{
if
(
text_message
.
selectionStart
>
0
)
text_message
.
text
!!
.
delete
(
text_message
.
selectionStart
-
1
,
text_message
.
selectionStart
)
}
else
->
throw
IllegalArgumentException
(
"pressed key not expected"
)
}
...
...
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.kt
View file @
30748b91
...
...
@@ -80,7 +80,7 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
setupToolbar
()
setupRecyclerView
()
set
UpFAB
()
set
upFab
()
presenter
.
loadChatRooms
()
}
...
...
@@ -289,7 +289,7 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
sectionedAdapter
?.
setSections
(
sections
.
toArray
(
dummy
))
}
private
fun
set
UpFAB
()
{
private
fun
set
upFab
()
{
create_new_channel_fab
.
setOnClickListener
{
val
intent
=
Intent
(
activity
,
CreateNewChannelActivity
::
class
.
java
)
startActivity
(
intent
)
...
...
app/src/main/java/chat/rocket/android/createChannel/addMembers/presentation/AddMembersView.kt
View file @
30748b91
...
...
@@ -7,6 +7,7 @@ import chat.rocket.android.members.viewmodel.MemberViewModel
interface
AddMembersView
:
LoadingView
,
MessageView
{
/**
* Show members on the basis of query
*
* @param dataSet The list of members
* @param total The number of members returned
*/
...
...
app/src/main/java/chat/rocket/android/createChannel/addMembers/ui/AddMembersActivity.kt
View file @
30748b91
...
...
@@ -10,6 +10,7 @@ import android.support.v7.widget.RecyclerView
import
android.view.MenuItem
import
android.widget.EditText
import
android.widget.Toast
import
androidx.core.view.isVisible
import
chat.rocket.android.R
import
chat.rocket.android.createChannel.addMembers.presentation.AddMembersPresenter
import
chat.rocket.android.createChannel.addMembers.presentation.AddMembersView
...
...
@@ -43,8 +44,7 @@ class AddMembersActivity : AppCompatActivity(), AddMembersView {
updateToolBar
()
search_view
.
setText
(
""
)
}
else
{
Toast
.
makeText
(
this
,
getString
(
R
.
string
.
msg_member_already_added
),
Toast
.
LENGTH_LONG
)
.
show
()
showMessage
(
getString
(
R
.
string
.
msg_member_already_added
))
}
}
private
lateinit
var
observableForSearchView
:
Disposable
...
...
@@ -59,11 +59,15 @@ class AddMembersActivity : AppCompatActivity(), AddMembersView {
setUpRecyclerView
()
setOnClickListeners
()
setInitialChips
()
}
override
fun
onStart
()
{
super
.
onStart
()
setUpObservableForSearchView
()
}
override
fun
on
Destroy
()
{
super
.
on
Destroy
()
override
fun
on
Stop
()
{
super
.
on
Stop
()
//dispose off the rx disposables
observableForToolbarAction
.
dispose
()
observableForSearchView
.
dispose
()
...
...
@@ -102,11 +106,11 @@ class AddMembersActivity : AppCompatActivity(), AddMembersView {
}
override
fun
showLoading
()
{
progress_bar
.
setVisible
(
true
)
view_loading
.
isVisible
=
true
}
override
fun
hideLoading
()
{
progress_bar
.
setVisible
(
false
)
view_loading
.
isVisible
=
false
}
override
fun
showMessage
(
resId
:
Int
)
{
...
...
app/src/main/java/chat/rocket/android/createChannel/presentation/CreateNewChannelPresenter.kt
View file @
30748b91
...
...
@@ -11,7 +11,6 @@ import chat.rocket.core.RocketChatClient
import
chat.rocket.core.internal.rest.createChannel
import
javax.inject.Inject
class
CreateNewChannelPresenter
@Inject
constructor
(
private
val
view
:
CreateNewChannelView
,
private
val
strategy
:
CancelStrategy
,
...
...
app/src/main/java/chat/rocket/android/createChannel/presentation/CreateNewChannelView.kt
View file @
30748b91
...
...
@@ -3,20 +3,28 @@ package chat.rocket.android.createChannel.presentation
import
chat.rocket.android.core.behaviours.LoadingView
interface
CreateNewChannelView
:
LoadingView
{
/*
Show a message that a channel was successfully created
*/
/*
*
*
Show a message that a channel was successfully created
*/
fun
showChannelCreatedSuccessfullyMessage
()
/*
Show message and clear text in edit text
/**
* Show message and clear text in edit text
*
* @param resId Resource id of the message to be shown
*/
fun
showMessageAndClearText
(
resId
:
Int
)
/**
* Show message and clear text in edit text
*
* @param message Toast message to be shown
*/
fun
showMessageAndClearText
(
message
:
String
)
/*
Show error message
/*
*
*
Show error message
*/
fun
showErrorMessage
()
...
...
app/src/main/java/chat/rocket/android/createChannel/ui/CreateNewChannelActivity.kt
View file @
30748b91
...
...
@@ -7,6 +7,7 @@ import android.os.Bundle
import
android.support.design.chip.Chip
import
android.support.v7.app.AppCompatActivity
import
android.view.MenuItem
import
androidx.core.view.isVisible
import
chat.rocket.android.R
import
chat.rocket.android.createChannel.addMembers.ui.AddMembersActivity
import
chat.rocket.android.createChannel.presentation.CreateNewChannelPresenter
...
...
@@ -38,8 +39,13 @@ class CreateNewChannelActivity : AppCompatActivity(), CreateNewChannelView {
setUpOnClickListeners
()
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
override
fun
onStart
()
{
super
.
onStart
()
setUpToolbarObservable
()
}
override
fun
onStop
()
{
super
.
onStop
()
observableForToolbarAction
.
dispose
()
}
...
...
@@ -66,13 +72,13 @@ class CreateNewChannelActivity : AppCompatActivity(), CreateNewChannelView {
}
override
fun
showLoading
()
{
view_loading
.
setVisible
(
true
)
view_loading
.
isVisible
=
true
layout_container
.
alpha
=
0.5f
layout_container
.
isEnabled
=
false
}
override
fun
hideLoading
()
{
view_loading
.
setVisible
(
false
)
view_loading
.
isVisible
=
false
layout_container
.
alpha
=
1.0f
layout_container
.
isEnabled
=
true
}
...
...
@@ -96,7 +102,6 @@ class CreateNewChannelActivity : AppCompatActivity(), CreateNewChannelView {
showMessageAndClearText
(
getString
(
R
.
string
.
msg_generic_error
))
}
private
fun
refreshMembersChips
()
{
for
(
element
in
listOfUsers
)
{
val
memberChip
=
Chip
(
this
)
...
...
@@ -114,6 +119,9 @@ class CreateNewChannelActivity : AppCompatActivity(), CreateNewChannelView {
toolbar_action_text
.
text
=
getString
(
R
.
string
.
action_create_new_channel
)
supportActionBar
?.
setDisplayHomeAsUpEnabled
(
true
)
}
private
fun
setUpToolbarObservable
(){
observableForToolbarAction
=
RxTextView
.
textChanges
(
channel_name_edit_text
).
subscribe
{
text
->
toolbar_action_text
.
isEnabled
=
(
text
.
isNotEmpty
()
&&
listOfUsers
.
isNotEmpty
())
...
...
app/src/main/res/layout/activity_add_members.xml
View file @
30748b91
...
...
@@ -33,7 +33,7 @@
</android.support.design.chip.ChipGroup>
<com.wang.avi.AVLoadingIndicatorView
android:id=
"@+id/
progress_bar
"
android:id=
"@+id/
view_loading
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:visibility=
"gone"
...
...
dependencies.gradle
View file @
30748b91
...
...
@@ -56,7 +56,7 @@ ext {
cardView
:
"com.android.support:cardview-v7:${versions.support}"
,
flexbox
:
"com.google.android:flexbox:${versions.flexbox}"
,
customTabs
:
"com.android.support:customtabs:${versions.support}"
,
supportv4
:
"com.android.support:support-v4:${versions.support}"
,
androidKtx
:
"androidx.core:core-ktx:${versions.androidKtx}"
,
dagger
:
"com.google.dagger:dagger:${versions.dagger}"
,
...
...
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