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
810a812e
Commit
810a812e
authored
Dec 13, 2017
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use AppCompat for Activity and Fragments
parent
f7f0277f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
10 deletions
+15
-10
ChatRoomActivity.kt
...src/main/java/chat/rocket/android/app/ChatRoomActivity.kt
+6
-3
MessageFragment.kt
.../java/chat/rocket/android/app/chatroom/MessageFragment.kt
+7
-5
ServerEntityMapper.kt
...cket/android/server/infraestructure/ServerEntityMapper.kt
+2
-2
No files found.
app/src/main/java/chat/rocket/android/app/ChatRoomActivity.kt
View file @
810a812e
package
chat.rocket.android.app
import
android.os.Bundle
import
chat.rocket.android.Base
Activity
import
android.support.v7.app.AppCompat
Activity
import
chat.rocket.android.R
import
chat.rocket.android.app.chatroom.MessageFragment
import
chat.rocket.android.util.addFragment
class
ChatRoomActivity
:
Base
Activity
()
{
class
ChatRoomActivity
:
AppCompat
Activity
()
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_chat_room
)
addFragment
(
MessageFragment
(),
"MessageFragment"
,
R
.
id
.
fragment_container
)
addFragment
(
"MessageFragment"
,
R
.
id
.
fragment_container
)
{
MessageFragment
()
}
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/app/chatroom/MessageFragment.kt
View file @
810a812e
package
chat.rocket.android.app.chatroom
import
android.app.Fragment
import
android.os.Bundle
import
android.support.v4.app.Fragment
import
android.support.v7.widget.LinearLayoutManager
import
android.view.LayoutInflater
import
android.view.View
...
...
@@ -13,9 +13,9 @@ import org.threeten.bp.LocalDateTime
class
MessageFragment
:
Fragment
()
{
override
fun
onCreateView
(
inflater
:
LayoutInflater
?,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
?
=
inflater
?
.
inflate
(
R
.
layout
.
fragment_message
,
container
,
false
)
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
?
=
inflater
.
inflate
(
R
.
layout
.
fragment_message
,
container
,
false
)
override
fun
onViewCreated
(
view
:
View
?
,
savedInstanceState
:
Bundle
?)
{
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
showMessageList
(
createDumpData
())
}
...
...
@@ -32,7 +32,9 @@ class MessageFragment : Fragment() {
// REMARK: The presenter should call this method.
private
fun
showMessageList
(
dataSet
:
List
<
Message
>)
{
recycler_view
.
layoutManager
=
LinearLayoutManager
(
activity
.
applicationContext
,
LinearLayoutManager
.
VERTICAL
,
false
)
recycler_view
.
adapter
=
MessageListAdapter
(
dataSet
.
toMutableList
())
activity
?.
apply
{
recycler_view
.
layoutManager
=
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
)
recycler_view
.
adapter
=
MessageListAdapter
(
dataSet
.
toMutableList
())
}
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/server/infraestructure/ServerEntityMapper.kt
View file @
810a812e
...
...
@@ -4,7 +4,7 @@ import chat.rocket.android.server.domain.model.Server
import
chat.rocket.android.util.DataToDomain
class
ServerEntityMapper
:
DataToDomain
<
ServerEntity
,
Server
>
{
override
fun
translate
(
serverEntity
:
ServerEntity
):
Server
{
return
Server
(
serverEntity
.
id
,
serverEntity
.
name
,
serverEntity
.
host
,
serverEntity
.
avatar
)
override
fun
translate
(
data
:
ServerEntity
):
Server
{
return
Server
(
data
.
id
,
data
.
name
,
data
.
host
,
data
.
avatar
)
}
}
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