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
f60f98cd
Commit
f60f98cd
authored
May 29, 2018
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update new files to androidx
parent
aeb17466
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
44 additions
and
30 deletions
+44
-30
ChatRoomPresenter.kt
...rocket/android/chatroom/presentation/ChatRoomPresenter.kt
+1
-1
FavoriteMessagesFragmentModule.kt
...oid/favoritemessages/di/FavoriteMessagesFragmentModule.kt
+8
-2
FavoriteMessagesFragmentProvider.kt
...d/favoritemessages/di/FavoriteMessagesFragmentProvider.kt
+2
-0
FavoriteMessagesFragment.kt
...t/android/favoritemessages/ui/FavoriteMessagesFragment.kt
+6
-7
FilesAdapter.kt
...in/java/chat/rocket/android/files/adapter/FilesAdapter.kt
+1
-1
FilesFragmentModule.kt
.../java/chat/rocket/android/files/di/FilesFragmentModule.kt
+8
-2
FilesFragmentProvider.kt
...ava/chat/rocket/android/files/di/FilesFragmentProvider.kt
+2
-0
FilesFragment.kt
...c/main/java/chat/rocket/android/files/ui/FilesFragment.kt
+5
-6
ImageHelper.kt
app/src/main/java/chat/rocket/android/helper/ImageHelper.kt
+2
-2
MessageHelper.kt
...src/main/java/chat/rocket/android/helper/MessageHelper.kt
+1
-1
fragment_favorite_messages.xml
app/src/main/res/layout/fragment_favorite_messages.xml
+4
-4
fragment_files.xml
app/src/main/res/layout/fragment_files.xml
+3
-3
build.gradle
build.gradle
+1
-1
No files found.
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt
View file @
f60f98cd
...
...
@@ -448,7 +448,7 @@ class ChatRoomPresenter @Inject constructor(
is
RoomType
.
DirectMessage
->
"direct"
is
RoomType
.
PrivateGroup
->
"group"
is
RoomType
.
Channel
->
"channel"
is
RoomType
.
Live
c
hat
->
"livechat"
is
RoomType
.
Live
C
hat
->
"livechat"
else
->
"custom"
}
view
.
showReplyingAction
(
...
...
app/src/main/java/chat/rocket/android/favoritemessages/di/FavoriteMessagesFragmentModule.kt
View file @
f60f98cd
package
chat.rocket.android.chatroom.di
import
android
.arch
.lifecycle.LifecycleOwner
import
android
x
.lifecycle.LifecycleOwner
import
chat.rocket.android.core.lifecycle.CancelStrategy
import
chat.rocket.android.dagger.scope.PerFragment
import
chat.rocket.android.favoritemessages.presentation.FavoriteMessagesView
...
...
@@ -10,20 +10,26 @@ import dagger.Provides
import
kotlinx.coroutines.experimental.Job
@Module
@PerFragment
class
FavoriteMessagesFragmentModule
{
@Provides
@PerFragment
fun
provideJob
()
=
Job
()
@Provides
@PerFragment
fun
provideLifecycleOwner
(
frag
:
FavoriteMessagesFragment
):
LifecycleOwner
{
return
frag
}
@Provides
@PerFragment
fun
provideCancelStrategy
(
owner
:
LifecycleOwner
,
jobs
:
Job
):
CancelStrategy
{
return
CancelStrategy
(
owner
,
jobs
)
}
@Provides
@PerFragment
fun
provideFavoriteMessagesView
(
frag
:
FavoriteMessagesFragment
):
FavoriteMessagesView
{
return
frag
}
...
...
app/src/main/java/chat/rocket/android/favoritemessages/di/FavoriteMessagesFragmentProvider.kt
View file @
f60f98cd
package
chat.rocket.android.chatroom.di
import
chat.rocket.android.dagger.scope.PerFragment
import
chat.rocket.android.favoritemessages.ui.FavoriteMessagesFragment
import
dagger.Module
import
dagger.android.ContributesAndroidInjector
...
...
@@ -8,5 +9,6 @@ import dagger.android.ContributesAndroidInjector
abstract
class
FavoriteMessagesFragmentProvider
{
@ContributesAndroidInjector
(
modules
=
[
FavoriteMessagesFragmentModule
::
class
])
@PerFragment
abstract
fun
provideFavoriteMessageFragment
():
FavoriteMessagesFragment
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/favoritemessages/ui/FavoriteMessagesFragment.kt
View file @
f60f98cd
package
chat.rocket.android.favoritemessages.ui
import
android.os.Bundle
import
android.support.v4.app.Fragment
import
android.support.v7.widget.DefaultItemAnimator
import
android.support.v7.widget.LinearLayoutManager
import
android.support.v7.widget.RecyclerView
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.core.view.isVisible
import
androidx.fragment.app.Fragment
import
androidx.recyclerview.widget.DefaultItemAnimator
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
chat.rocket.android.R
import
chat.rocket.android.chatroom.adapter.ChatRoomAdapter
import
chat.rocket.android.chatroom.ui.ChatRoomActivity
...
...
@@ -68,8 +68,7 @@ class FavoriteMessagesFragment : Fragment(), FavoriteMessagesView {
if
(
recycler_view
.
adapter
==
null
)
{
adapter
=
ChatRoomAdapter
(
enableActions
=
false
)
recycler_view
.
adapter
=
adapter
val
linearLayoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
false
)
val
linearLayoutManager
=
LinearLayoutManager
(
context
)
recycler_view
.
layoutManager
=
linearLayoutManager
recycler_view
.
itemAnimator
=
DefaultItemAnimator
()
if
(
favoriteMessages
.
size
>
10
)
{
...
...
@@ -78,7 +77,7 @@ class FavoriteMessagesFragment : Fragment(), FavoriteMessagesView {
override
fun
onLoadMore
(
page
:
Int
,
totalItemsCount
:
Int
,
recyclerView
:
RecyclerView
?
recyclerView
:
RecyclerView
)
{
presenter
.
loadFavoriteMessages
(
chatRoomId
)
}
...
...
app/src/main/java/chat/rocket/android/files/adapter/FilesAdapter.kt
View file @
f60f98cd
package
chat.rocket.android.files.adapter
import
android.support.v7.widget.RecyclerView
import
android.view.View
import
android.view.ViewGroup
import
androidx.core.view.isVisible
import
androidx.recyclerview.widget.RecyclerView
import
chat.rocket.android.R
import
chat.rocket.android.files.viewmodel.FileViewModel
import
chat.rocket.android.util.extensions.inflate
...
...
app/src/main/java/chat/rocket/android/files/di/FilesFragmentModule.kt
View file @
f60f98cd
package
chat.rocket.android.files.di
import
android
.arch
.lifecycle.LifecycleOwner
import
android
x
.lifecycle.LifecycleOwner
import
chat.rocket.android.core.lifecycle.CancelStrategy
import
chat.rocket.android.dagger.scope.PerFragment
import
chat.rocket.android.files.presentation.FilesView
...
...
@@ -10,20 +10,26 @@ import dagger.Provides
import
kotlinx.coroutines.experimental.Job
@Module
@PerFragment
class
FilesFragmentModule
{
@Provides
@PerFragment
fun
provideJob
()
=
Job
()
@Provides
@PerFragment
fun
provideLifecycleOwner
(
frag
:
FilesFragment
):
LifecycleOwner
{
return
frag
}
@Provides
@PerFragment
fun
provideCancelStrategy
(
owner
:
LifecycleOwner
,
jobs
:
Job
):
CancelStrategy
{
return
CancelStrategy
(
owner
,
jobs
)
}
@Provides
@PerFragment
fun
provideFilesView
(
frag
:
FilesFragment
):
FilesView
{
return
frag
}
...
...
app/src/main/java/chat/rocket/android/files/di/FilesFragmentProvider.kt
View file @
f60f98cd
package
chat.rocket.android.files.di
import
chat.rocket.android.dagger.scope.PerFragment
import
chat.rocket.android.files.ui.FilesFragment
import
dagger.Module
import
dagger.android.ContributesAndroidInjector
...
...
@@ -8,5 +9,6 @@ import dagger.android.ContributesAndroidInjector
abstract
class
FilesFragmentProvider
{
@ContributesAndroidInjector
(
modules
=
[
FilesFragmentModule
::
class
])
@PerFragment
abstract
fun
provideFilesFragment
():
FilesFragment
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/files/ui/FilesFragment.kt
View file @
f60f98cd
...
...
@@ -3,13 +3,13 @@ package chat.rocket.android.files.ui
import
android.content.Intent
import
android.net.Uri
import
android.os.Bundle
import
android.support.v4.app.Fragment
import
android.support.v7.widget.LinearLayoutManager
import
android.support.v7.widget.RecyclerView
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.core.view.isVisible
import
androidx.fragment.app.Fragment
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
chat.rocket.android.R
import
chat.rocket.android.chatroom.ui.ChatRoomActivity
import
chat.rocket.android.files.adapter.FilesAdapter
...
...
@@ -42,8 +42,7 @@ class FilesFragment : Fragment(), FilesView {
lateinit
var
presenter
:
FilesPresenter
private
val
adapter
:
FilesAdapter
=
FilesAdapter
{
fileViewModel
->
presenter
.
openFile
(
fileViewModel
)
}
private
val
linearLayoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
false
)
private
val
linearLayoutManager
=
LinearLayoutManager
(
context
)
private
lateinit
var
chatRoomId
:
String
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
...
...
@@ -80,7 +79,7 @@ class FilesFragment : Fragment(), FilesView {
override
fun
onLoadMore
(
page
:
Int
,
totalItemsCount
:
Int
,
recyclerView
:
RecyclerView
?
recyclerView
:
RecyclerView
)
{
presenter
.
loadFiles
(
chatRoomId
)
}
...
...
app/src/main/java/chat/rocket/android/helper/ImageHelper.kt
View file @
f60f98cd
...
...
@@ -7,8 +7,6 @@ import android.graphics.Color
import
android.graphics.Typeface
import
android.media.MediaScannerConnection
import
android.os.Environment
import
android.support.design.widget.AppBarLayout
import
android.support.v7.widget.Toolbar
import
android.text.TextUtils
import
android.util.TypedValue
import
android.view.ContextThemeWrapper
...
...
@@ -16,6 +14,7 @@ import android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.TextView
import
android.widget.Toast
import
androidx.appcompat.widget.Toolbar
import
androidx.core.net.toUri
import
androidx.core.view.setPadding
import
chat.rocket.android.R
...
...
@@ -26,6 +25,7 @@ import com.facebook.imagepipeline.cache.DefaultCacheKeyFactory
import
com.facebook.imagepipeline.core.ImagePipelineFactory
import
com.facebook.imagepipeline.request.ImageRequest
import
com.facebook.imagepipeline.request.ImageRequestBuilder
import
com.google.android.material.appbar.AppBarLayout
import
com.stfalcon.frescoimageviewer.ImageViewer
import
timber.log.Timber
import
java.io.File
...
...
app/src/main/java/chat/rocket/android/helper/MessageHelper.kt
View file @
f60f98cd
...
...
@@ -21,7 +21,7 @@ class MessageHelper @Inject constructor(
is
RoomType
.
PrivateGroup
->
"group"
is
RoomType
.
Channel
->
"channel"
is
RoomType
.
DirectMessage
->
"direct"
is
RoomType
.
Live
c
hat
->
"livechat"
is
RoomType
.
Live
C
hat
->
"livechat"
else
->
"custom"
}
val
name
=
if
(
settings
.
useRealName
())
chatRoom
.
fullName
?:
chatRoom
.
name
else
chatRoom
.
name
...
...
app/src/main/res/layout/fragment_favorite_messages.xml
View file @
f60f98cd
<?xml version="1.0" encoding="utf-8"?>
<android
.support.constrain
t.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<android
x.constraintlayout.widge
t.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".favoritemessages.ui.FavoriteMessagesFragment"
>
<android
.support.v7
.widget.RecyclerView
<android
x.recyclerview
.widget.RecyclerView
android:id=
"@+id/recycler_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
...
...
@@ -66,7 +66,7 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/text_no_favorite_messages"
/>
<android
.support.constrain
t.Group
<android
x.constraintlayout.widge
t.Group
android:id=
"@+id/no_messages_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
@@ -74,4 +74,4 @@
app:constraint_referenced_ids=
"text_no_favorite_messages_description,image_star,text_no_favorite_messages"
tools:visibility=
"visible"
/>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_files.xml
View file @
f60f98cd
<?xml version="1.0" encoding="utf-8"?>
<android
.support.constrain
t.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<android
x.constraintlayout.widge
t.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".files.ui.FilesFragment"
>
<android
.support.v7
.widget.RecyclerView
<android
x.recyclerview
.widget.RecyclerView
android:id=
"@+id/recycler_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
...
...
@@ -71,4 +71,4 @@
app:constraint_referenced_ids=
"image_file,text_no_file,text_all_files_appear_here"
tools:visibility=
"visible"
/>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
build.gradle
View file @
f60f98cd
...
...
@@ -10,7 +10,7 @@ buildscript {
}
dependencies
{
classpath
'com.android.tools.build:gradle:3.2.0-alpha1
5
'
classpath
'com.android.tools.build:gradle:3.2.0-alpha1
6
'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath
"org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}"
classpath
'com.google.gms:google-services:3.2.0'
...
...
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