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
a9f3f098
Unverified
Commit
a9f3f098
authored
Jun 29, 2018
by
Filipe de Lima Brito
Committed by
GitHub
Jun 29, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into new/allow-room-names-whit-special-chars
parents
88af8195
fab68e52
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
75 additions
and
86 deletions
+75
-86
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+0
-5
AboutFragment.kt
...c/main/java/chat/rocket/android/about/ui/AboutFragment.kt
+49
-0
ChatRoomsFragment.kt
...ava/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.kt
+9
-10
RocketChatClientFactory.kt
...android/server/infraestructure/RocketChatClientFactory.kt
+1
-1
AboutActivity.kt
...va/chat/rocket/android/settings/about/ui/AboutActivity.kt
+0
-41
SettingsFragment.kt
.../java/chat/rocket/android/settings/ui/SettingsFragment.kt
+5
-2
activity_about.xml
app/src/main/res/layout/activity_about.xml
+0
-14
fragment_about.xml
app/src/main/res/layout/fragment_about.xml
+8
-10
chatrooms.xml
app/src/main/res/menu/chatrooms.xml
+3
-3
No files found.
app/src/main/AndroidManifest.xml
View file @
a9f3f098
...
@@ -79,11 +79,6 @@
...
@@ -79,11 +79,6 @@
android:name=
".settings.password.ui.PasswordActivity"
android:name=
".settings.password.ui.PasswordActivity"
android:theme=
"@style/AppTheme"
/>
android:theme=
"@style/AppTheme"
/>
<!-- TODO: Change to fragment -->
<activity
android:name=
".settings.about.ui.AboutActivity"
android:theme=
"@style/AppTheme"
/>
<receiver
<receiver
android:name=
".push.DirectReplyReceiver"
android:name=
".push.DirectReplyReceiver"
android:enabled=
"true"
android:enabled=
"true"
...
...
app/src/main/java/chat/rocket/android/about/ui/AboutFragment.kt
0 → 100644
View file @
a9f3f098
package
chat.rocket.android.about.ui
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.fragment.app.Fragment
import
chat.rocket.android.BuildConfig
import
chat.rocket.android.R
import
chat.rocket.android.main.ui.MainActivity
import
kotlinx.android.synthetic.main.app_bar.*
import
kotlinx.android.synthetic.main.fragment_about.*
class
AboutFragment
:
Fragment
()
{
companion
object
{
fun
newInstance
()
=
AboutFragment
()
}
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
):
View
?
=
inflater
.
inflate
(
R
.
layout
.
fragment_about
,
container
,
false
)
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
setupToolbar
()
setupViews
()
}
private
fun
setupViews
()
{
text_version_name
.
text
=
getString
(
R
.
string
.
msg_version
,
BuildConfig
.
VERSION_NAME
)
text_build_number
.
text
=
getString
(
R
.
string
.
msg_build
,
BuildConfig
.
VERSION_CODE
)
}
private
fun
setupToolbar
()
{
val
toolbar
=
(
activity
as
MainActivity
).
toolbar
toolbar
.
title
=
getString
(
R
.
string
.
title_about
)
toolbar
.
setNavigationIcon
(
R
.
drawable
.
ic_arrow_back_white_24dp
)
toolbar
.
setNavigationOnClickListener
{
this
.
activity
?.
onBackPressed
()
}
}
override
fun
onStop
()
{
super
.
onStop
()
(
activity
as
MainActivity
).
toolbar
.
setNavigationIcon
(
R
.
drawable
.
ic_menu_white_24dp
)
}
}
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.kt
View file @
a9f3f098
...
@@ -148,7 +148,8 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
...
@@ -148,7 +148,8 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
inflater
.
inflate
(
R
.
menu
.
chatrooms
,
menu
)
inflater
.
inflate
(
R
.
menu
.
chatrooms
,
menu
)
val
searchItem
=
menu
.
findItem
(
R
.
id
.
action_search
)
val
searchItem
=
menu
.
findItem
(
R
.
id
.
action_search
)
searchView
=
searchItem
?.
actionView
as
SearchView
searchView
=
searchItem
?.
actionView
as
?
SearchView
searchView
?.
setIconifiedByDefault
(
false
)
searchView
?.
maxWidth
=
Integer
.
MAX_VALUE
searchView
?.
maxWidth
=
Integer
.
MAX_VALUE
searchView
?.
setOnQueryTextListener
(
object
:
SearchView
.
OnQueryTextListener
{
searchView
?.
setOnQueryTextListener
(
object
:
SearchView
.
OnQueryTextListener
{
override
fun
onQueryTextSubmit
(
query
:
String
?):
Boolean
{
override
fun
onQueryTextSubmit
(
query
:
String
?):
Boolean
{
...
@@ -176,7 +177,7 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
...
@@ -176,7 +177,7 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
0
->
R
.
id
.
radio_sort_alphabetical
0
->
R
.
id
.
radio_sort_alphabetical
else
->
R
.
id
.
radio_sort_activity
else
->
R
.
id
.
radio_sort_activity
})
})
radioGroup
.
setOnCheckedChangeListener
(
{
_
,
checkedId
->
radioGroup
.
setOnCheckedChangeListener
{
_
,
checkedId
->
run
{
run
{
SharedPreferenceHelper
.
putInt
(
Constants
.
CHATROOM_SORT_TYPE_KEY
,
when
(
checkedId
)
{
SharedPreferenceHelper
.
putInt
(
Constants
.
CHATROOM_SORT_TYPE_KEY
,
when
(
checkedId
)
{
R
.
id
.
radio_sort_alphabetical
->
0
R
.
id
.
radio_sort_alphabetical
->
0
...
@@ -184,23 +185,21 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
...
@@ -184,23 +185,21 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
else
->
1
else
->
1
})
})
}
}
}
)
}
groupByTypeCheckBox
.
isChecked
=
groupByType
groupByTypeCheckBox
.
isChecked
=
groupByType
groupByTypeCheckBox
.
setOnCheckedChangeListener
(
{
_
,
isChecked
->
groupByTypeCheckBox
.
setOnCheckedChangeListener
{
_
,
isChecked
->
SharedPreferenceHelper
.
putBoolean
(
Constants
.
CHATROOM_GROUP_BY_TYPE_KEY
,
isChecked
)
SharedPreferenceHelper
.
putBoolean
(
Constants
.
CHATROOM_GROUP_BY_TYPE_KEY
,
isChecked
)
}
)
}
val
dialogSort
=
AlertDialog
.
Builder
(
context
)
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
dialog_sort_title
)
.
setTitle
(
R
.
string
.
dialog_sort_title
)
.
setView
(
dialogLayout
)
.
setView
(
dialogLayout
)
.
setPositiveButton
(
"Done"
,
{
dialog
,
_
->
.
setPositiveButton
(
"Done"
)
{
dialog
,
_
->
invalidateQueryOnSearch
()
invalidateQueryOnSearch
()
updateSort
()
updateSort
()
dialog
.
dismiss
()
dialog
.
dismiss
()
})
}.
show
()
dialogSort
.
show
()
}
}
}
}
return
super
.
onOptionsItemSelected
(
item
)
return
super
.
onOptionsItemSelected
(
item
)
...
...
app/src/main/java/chat/rocket/android/server/infraestructure/RocketChatClientFactory.kt
View file @
a9f3f098
...
@@ -27,7 +27,7 @@ class RocketChatClientFactory @Inject constructor(
...
@@ -27,7 +27,7 @@ class RocketChatClientFactory @Inject constructor(
val
client
=
RocketChatClient
.
create
{
val
client
=
RocketChatClient
.
create
{
httpClient
=
okHttpClient
httpClient
=
okHttpClient
restUrl
=
url
restUrl
=
url
userAgent
=
"RC Mobile; Android
(${Build.VERSION.RELEASE}); v(${BuildConfig.VERSION_NAME}) ((${BuildConfig.VERSION_CODE})
)"
userAgent
=
"RC Mobile; Android
${Build.VERSION.RELEASE}; v${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE}
)"
tokenRepository
=
repository
tokenRepository
=
repository
platformLogger
=
logger
platformLogger
=
logger
}
}
...
...
app/src/main/java/chat/rocket/android/settings/about/ui/AboutActivity.kt
deleted
100644 → 0
View file @
88af8195
package
chat.rocket.android.settings.about.ui
import
android.os.Bundle
import
androidx.appcompat.app.AppCompatActivity
import
chat.rocket.android.BuildConfig
import
chat.rocket.android.R
import
chat.rocket.android.util.extensions.textContent
import
kotlinx.android.synthetic.main.about_view.*
import
kotlinx.android.synthetic.main.app_bar_password.*
class
AboutActivity
:
AppCompatActivity
()
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_about
)
setupToolbar
()
setupViews
()
}
private
fun
setupViews
()
{
text_version_name
.
text
=
getString
(
R
.
string
.
msg_version
,
BuildConfig
.
VERSION_NAME
)
text_build_number
.
text
=
getString
(
R
.
string
.
msg_build
,
BuildConfig
.
VERSION_CODE
)
}
private
fun
setupToolbar
()
{
setSupportActionBar
(
toolbar
)
text_change_password
.
textContent
=
getString
(
R
.
string
.
title_about
)
}
override
fun
onBackPressed
()
{
super
.
onBackPressed
()
finish
()
overridePendingTransition
(
R
.
anim
.
close_enter
,
R
.
anim
.
close_exit
)
}
override
fun
onSupportNavigateUp
():
Boolean
{
onBackPressed
()
return
super
.
onNavigateUp
()
}
}
app/src/main/java/chat/rocket/android/settings/ui/SettingsFragment.kt
View file @
a9f3f098
...
@@ -9,9 +9,10 @@ import android.view.View
...
@@ -9,9 +9,10 @@ import android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
android.widget.AdapterView
import
android.widget.AdapterView
import
chat.rocket.android.R
import
chat.rocket.android.R
import
chat.rocket.android.
settings.about.ui.AboutActivity
import
chat.rocket.android.
about.ui.AboutFragment
import
chat.rocket.android.settings.password.ui.PasswordActivity
import
chat.rocket.android.settings.password.ui.PasswordActivity
import
chat.rocket.android.settings.presentation.SettingsView
import
chat.rocket.android.settings.presentation.SettingsView
import
chat.rocket.android.util.extensions.addFragmentBackStack
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.util.extensions.inflate
import
kotlinx.android.synthetic.main.fragment_settings.*
import
kotlinx.android.synthetic.main.fragment_settings.*
import
kotlin.reflect.KClass
import
kotlin.reflect.KClass
...
@@ -39,7 +40,9 @@ class SettingsFragment : Fragment(), SettingsView, AdapterView.OnItemClickListen
...
@@ -39,7 +40,9 @@ class SettingsFragment : Fragment(), SettingsView, AdapterView.OnItemClickListen
startNewActivity
(
PasswordActivity
::
class
)
startNewActivity
(
PasswordActivity
::
class
)
}
}
resources
.
getString
(
R
.
string
.
title_about
)
->
{
resources
.
getString
(
R
.
string
.
title_about
)
->
{
startNewActivity
(
AboutActivity
::
class
)
(
activity
as
AppCompatActivity
).
addFragmentBackStack
(
"AboutFragmnet"
,
R
.
id
.
fragment_container
){
AboutFragment
.
newInstance
()
}
}
}
}
}
}
}
...
...
app/src/main/res/layout/activity_about.xml
deleted
100644 → 0
View file @
88af8195
<?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:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:theme=
"@style/AppTheme"
tools:context=
"chat.rocket.android.settings.about.ui.AboutActivity"
>
<include
android:id=
"@+id/layout_app_bar"
layout=
"@layout/app_bar_password"
/>
<include
layout=
"@layout/about_view"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/
about_view
.xml
→
app/src/main/res/layout/
fragment_about
.xml
View file @
a9f3f098
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools
"
>
tools:context=
"chat.rocket.android.about.ui.AboutFragment
"
>
<ImageView
<ImageView
android:id=
"@+id/image_app_name"
android:id=
"@+id/image_app_name"
...
@@ -14,7 +13,7 @@
...
@@ -14,7 +13,7 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
app:layout_constraintEnd_toEndOf=
"parent"
/>
<ImageView
<ImageView
android:layout_width=
"160dp"
android:layout_width=
"160dp"
...
@@ -25,8 +24,7 @@
...
@@ -25,8 +24,7 @@
app:layout_constraintBottom_toTopOf=
"@id/image_app_name"
app:layout_constraintBottom_toTopOf=
"@id/image_app_name"
android:adjustViewBounds=
"true"
android:adjustViewBounds=
"true"
android:scaleX=
"1.5"
android:scaleX=
"1.5"
android:scaleY=
"1.5"
android:scaleY=
"1.5"
/>
/>
<TextView
<TextView
android:id=
"@+id/text_version_name"
android:id=
"@+id/text_version_name"
...
@@ -37,7 +35,7 @@
...
@@ -37,7 +35,7 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/image_app_name"
app:layout_constraintTop_toBottomOf=
"@+id/image_app_name"
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:textColor=
"@color/colorSecondaryText"
/>
android:textColor=
"@color/colorSecondaryText"
/>
<TextView
<TextView
android:id=
"@+id/text_build_number"
android:id=
"@+id/text_build_number"
...
@@ -48,6 +46,6 @@
...
@@ -48,6 +46,6 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/text_version_name"
app:layout_constraintTop_toBottomOf=
"@+id/text_version_name"
android:layout_marginTop=
"8dp"
android:layout_marginTop=
"8dp"
android:textColor=
"@color/colorSecondaryText"
/>
android:textColor=
"@color/colorSecondaryText"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/menu/chatrooms.xml
View file @
a9f3f098
...
@@ -6,13 +6,13 @@
...
@@ -6,13 +6,13 @@
android:id=
"@+id/action_search"
android:id=
"@+id/action_search"
android:icon=
"@drawable/ic_search_white_24px"
android:icon=
"@drawable/ic_search_white_24px"
android:title=
"@string/action_search"
android:title=
"@string/action_search"
a
ndroid
:actionViewClass=
"androidx.appcompat.widget.SearchView"
a
pp
:actionViewClass=
"androidx.appcompat.widget.SearchView"
a
ndroid
:showAsAction=
"ifRoom|collapseActionView"
/>
a
pp
:showAsAction=
"ifRoom|collapseActionView"
/>
<item
<item
android:id=
"@+id/action_sort"
android:id=
"@+id/action_sort"
android:icon=
"@drawable/ic_sort"
android:icon=
"@drawable/ic_sort"
android:title=
"@string/menu_chatroom_sort"
android:title=
"@string/menu_chatroom_sort"
a
ndroid:showAsAction=
"always
"
/>
a
pp:showAsAction=
"ifRoom
"
/>
</menu>
</menu>
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