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
49176f16
Unverified
Commit
49176f16
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 bottomsheet
parents
7b5c276b
0cdd58ee
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
74 additions
and
85 deletions
+74
-85
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
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 @
49176f16
...
...
@@ -79,11 +79,6 @@
android:name=
".settings.password.ui.PasswordActivity"
android:theme=
"@style/AppTheme"
/>
<!-- TODO: Change to fragment -->
<activity
android:name=
".settings.about.ui.AboutActivity"
android:theme=
"@style/AppTheme"
/>
<receiver
android:name=
".push.DirectReplyReceiver"
android:enabled=
"true"
...
...
app/src/main/java/chat/rocket/android/about/ui/AboutFragment.kt
0 → 100644
View file @
49176f16
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 @
49176f16
...
...
@@ -148,7 +148,8 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
inflater
.
inflate
(
R
.
menu
.
chatrooms
,
menu
)
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
?.
setOnQueryTextListener
(
object
:
SearchView
.
OnQueryTextListener
{
override
fun
onQueryTextSubmit
(
query
:
String
?):
Boolean
{
...
...
@@ -176,7 +177,7 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
0
->
R
.
id
.
radio_sort_alphabetical
else
->
R
.
id
.
radio_sort_activity
})
radioGroup
.
setOnCheckedChangeListener
(
{
_
,
checkedId
->
radioGroup
.
setOnCheckedChangeListener
{
_
,
checkedId
->
run
{
SharedPreferenceHelper
.
putInt
(
Constants
.
CHATROOM_SORT_TYPE_KEY
,
when
(
checkedId
)
{
R
.
id
.
radio_sort_alphabetical
->
0
...
...
@@ -184,23 +185,21 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
else
->
1
})
}
}
)
}
groupByTypeCheckBox
.
isChecked
=
groupByType
groupByTypeCheckBox
.
setOnCheckedChangeListener
(
{
_
,
isChecked
->
groupByTypeCheckBox
.
setOnCheckedChangeListener
{
_
,
isChecked
->
SharedPreferenceHelper
.
putBoolean
(
Constants
.
CHATROOM_GROUP_BY_TYPE_KEY
,
isChecked
)
}
)
}
val
dialogSort
=
AlertDialog
.
Builder
(
context
)
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
dialog_sort_title
)
.
setView
(
dialogLayout
)
.
setPositiveButton
(
"Done"
,
{
dialog
,
_
->
.
setPositiveButton
(
"Done"
)
{
dialog
,
_
->
invalidateQueryOnSearch
()
updateSort
()
dialog
.
dismiss
()
})
dialogSort
.
show
()
}.
show
()
}
}
return
super
.
onOptionsItemSelected
(
item
)
...
...
app/src/main/java/chat/rocket/android/settings/about/ui/AboutActivity.kt
deleted
100644 → 0
View file @
7b5c276b
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 @
49176f16
...
...
@@ -9,9 +9,10 @@ import android.view.View
import
android.view.ViewGroup
import
android.widget.AdapterView
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.presentation.SettingsView
import
chat.rocket.android.util.extensions.addFragmentBackStack
import
chat.rocket.android.util.extensions.inflate
import
kotlinx.android.synthetic.main.fragment_settings.*
import
kotlin.reflect.KClass
...
...
@@ -39,7 +40,9 @@ class SettingsFragment : Fragment(), SettingsView, AdapterView.OnItemClickListen
startNewActivity
(
PasswordActivity
::
class
)
}
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 @
7b5c276b
<?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 @
49176f16
<?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: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"
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
android:id=
"@+id/image_app_name"
...
...
@@ -14,7 +13,7 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
app:layout_constraintEnd_toEndOf=
"parent"
/>
<ImageView
android:layout_width=
"160dp"
...
...
@@ -25,8 +24,7 @@
app:layout_constraintBottom_toTopOf=
"@id/image_app_name"
android:adjustViewBounds=
"true"
android:scaleX=
"1.5"
android:scaleY=
"1.5"
/>
android:scaleY=
"1.5"
/>
<TextView
android:id=
"@+id/text_version_name"
...
...
@@ -37,7 +35,7 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/image_app_name"
android:layout_marginTop=
"16dp"
android:textColor=
"@color/colorSecondaryText"
/>
android:textColor=
"@color/colorSecondaryText"
/>
<TextView
android:id=
"@+id/text_build_number"
...
...
@@ -48,6 +46,6 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/text_version_name"
android:layout_marginTop=
"8dp"
android:textColor=
"@color/colorSecondaryText"
/>
android:textColor=
"@color/colorSecondaryText"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
</androidx.constraintlayout.widget.ConstraintLayout>
app/src/main/res/menu/chatrooms.xml
View file @
49176f16
...
...
@@ -6,13 +6,13 @@
android:id=
"@+id/action_search"
android:icon=
"@drawable/ic_search_white_24px"
android:title=
"@string/action_search"
a
ndroid
:actionViewClass=
"androidx.appcompat.widget.SearchView"
a
ndroid
:showAsAction=
"ifRoom|collapseActionView"
/>
a
pp
:actionViewClass=
"androidx.appcompat.widget.SearchView"
a
pp
:showAsAction=
"ifRoom|collapseActionView"
/>
<item
android:id=
"@+id/action_sort"
android:icon=
"@drawable/ic_sort"
android:title=
"@string/menu_chatroom_sort"
a
ndroid:showAsAction=
"always
"
/>
a
pp:showAsAction=
"ifRoom
"
/>
</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