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
b1514363
Commit
b1514363
authored
Dec 11, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert HomeFragment, RoomContract and RoomPresenter to Kotlin
parent
ada461e5
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
346 additions
and
390 deletions
+346
-390
HomeFragment.java
...a/chat/rocket/android/fragment/chatroom/HomeFragment.java
+0
-18
HomeFragment.kt
...ava/chat/rocket/android/fragment/chatroom/HomeFragment.kt
+14
-0
RoomContract.java
...a/chat/rocket/android/fragment/chatroom/RoomContract.java
+0
-81
RoomContract.kt
...ava/chat/rocket/android/fragment/chatroom/RoomContract.kt
+76
-0
RoomPresenter.java
.../chat/rocket/android/fragment/chatroom/RoomPresenter.java
+256
-291
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/HomeFragment.java
deleted
100644 → 0
View file @
ada461e5
package
chat
.
rocket
.
android
.
fragment
.
chatroom
;
import
chat.rocket.android.R
;
public
class
HomeFragment
extends
AbstractChatRoomFragment
{
public
HomeFragment
()
{}
@Override
protected
int
getLayout
()
{
return
R
.
layout
.
fragment_home
;
}
@Override
protected
void
onSetupView
()
{
setToolbarTitle
(
getText
(
R
.
string
.
home_fragment_title
));
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/fragment/chatroom/HomeFragment.kt
0 → 100644
View file @
b1514363
package
chat.rocket.android.fragment.chatroom
import
chat.rocket.android.R
class
HomeFragment
:
AbstractChatRoomFragment
()
{
override
fun
getLayout
():
Int
{
return
R
.
layout
.
fragment_home
}
override
fun
onSetupView
()
{
setToolbarTitle
(
getText
(
R
.
string
.
home_fragment_title
))
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomContract.java
deleted
100644 → 0
View file @
ada461e5
package
chat
.
rocket
.
android
.
fragment
.
chatroom
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.Nullable
;
import
java.util.List
;
import
chat.rocket.android.shared.BaseContract
;
import
chat.rocket.android.widget.AbsoluteUrl
;
import
chat.rocket.core.models.Message
;
import
chat.rocket.core.models.Room
;
import
chat.rocket.core.models.User
;
public
interface
RoomContract
{
interface
View
extends
BaseContract
.
View
{
void
setupWith
(
RocketChatAbsoluteUrl
rocketChatAbsoluteUrl
);
void
render
(
Room
room
);
void
showUserStatus
(
User
user
);
void
updateHistoryState
(
boolean
hasNext
,
boolean
isLoaded
);
void
onMessageSendSuccessfully
();
void
disableMessageInput
();
void
enableMessageInput
();
void
showUnreadCount
(
int
count
);
void
showMessages
(
List
<
Message
>
messages
);
void
showMessageSendFailure
(
Message
message
);
void
showMessageDeleteFailure
(
Message
message
);
void
autoloadImages
();
void
manualLoadImages
();
void
onReply
(
AbsoluteUrl
absoluteUrl
,
String
markdown
,
Message
message
);
void
onCopy
(
String
message
);
void
showMessageActions
(
Message
message
);
}
interface
Presenter
extends
BaseContract
.
Presenter
<
View
>
{
void
loadMessages
();
void
loadMoreMessages
();
void
onMessageSelected
(
@Nullable
Message
message
);
void
onMessageTap
(
@Nullable
Message
message
);
void
sendMessage
(
String
messageText
);
void
resendMessage
(
@NonNull
Message
message
);
void
updateMessage
(
@NonNull
Message
message
,
String
content
);
void
deleteMessage
(
@NonNull
Message
message
);
void
onUnreadCount
();
void
onMarkAsRead
();
void
refreshRoom
();
void
replyMessage
(
@NonNull
Message
message
,
boolean
justQuote
);
void
acceptMessageDeleteFailure
(
Message
message
);
void
loadMissedMessages
();
}
}
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomContract.kt
0 → 100644
View file @
b1514363
package
chat.rocket.android.fragment.chatroom
import
chat.rocket.android.shared.BaseContract
import
chat.rocket.android.widget.AbsoluteUrl
import
chat.rocket.core.models.Message
import
chat.rocket.core.models.Room
import
chat.rocket.core.models.User
interface
RoomContract
{
interface
View
:
BaseContract
.
View
{
fun
setupWith
(
rocketChatAbsoluteUrl
:
RocketChatAbsoluteUrl
)
fun
render
(
room
:
Room
)
fun
showUserStatus
(
user
:
User
)
fun
updateHistoryState
(
hasNext
:
Boolean
,
isLoaded
:
Boolean
)
fun
onMessageSendSuccessfully
()
fun
disableMessageInput
()
fun
enableMessageInput
()
fun
showUnreadCount
(
count
:
Int
)
fun
showMessages
(
messages
:
List
<
Message
>)
fun
showMessageSendFailure
(
message
:
Message
)
fun
showMessageDeleteFailure
(
message
:
Message
)
fun
autoloadImages
()
fun
manualLoadImages
()
fun
onReply
(
absoluteUrl
:
AbsoluteUrl
,
markdown
:
String
,
message
:
Message
)
fun
onCopy
(
message
:
String
)
fun
showMessageActions
(
message
:
Message
)
}
interface
Presenter
:
BaseContract
.
Presenter
<
View
>
{
fun
loadMessages
()
fun
loadMoreMessages
()
fun
onMessageSelected
(
message
:
Message
?)
fun
onMessageTap
(
message
:
Message
?)
fun
sendMessage
(
messageText
:
String
)
fun
resendMessage
(
message
:
Message
)
fun
updateMessage
(
message
:
Message
,
content
:
String
)
fun
deleteMessage
(
message
:
Message
)
fun
onUnreadCount
()
fun
onMarkAsRead
()
fun
refreshRoom
()
fun
replyMessage
(
message
:
Message
,
justQuote
:
Boolean
)
fun
acceptMessageDeleteFailure
(
message
:
Message
)
fun
loadMissedMessages
()
}
}
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomPresenter.java
View file @
b1514363
This diff is collapsed.
Click to expand it.
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