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
e85be350
Commit
e85be350
authored
Jun 29, 2018
by
divyanshu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
About Activity to Fragment
parent
124b8519
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
64 additions
and
73 deletions
+64
-73
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+0
-5
AboutFragment.kt
...c/main/java/chat/rocket/android/about/ui/AboutFragment.kt
+50
-0
ChatRoomsFragment.kt
...ava/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.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
No files found.
app/src/main/AndroidManifest.xml
View file @
e85be350
...
...
@@ -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 @
e85be350
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 @
e85be350
...
...
@@ -148,7 +148,7 @@ 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
?.
maxWidth
=
Integer
.
MAX_VALUE
searchView
?.
setOnQueryTextListener
(
object
:
SearchView
.
OnQueryTextListener
{
override
fun
onQueryTextSubmit
(
query
:
String
?):
Boolean
{
...
...
app/src/main/java/chat/rocket/android/settings/about/ui/AboutActivity.kt
deleted
100644 → 0
View file @
124b8519
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 @
e85be350
...
...
@@ -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 @
124b8519
<?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 @
e85be350
<?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>
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