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
d46037d4
Unverified
Commit
d46037d4
authored
Jun 05, 2018
by
Filipe de Lima Brito
Committed by
GitHub
Jun 05, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1337 from divyanshub024/screen-orientation
[BUG] SaveInstanceState on orientation change
parents
45f52fb7
fe793f40
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
MainActivity.kt
...src/main/java/chat/rocket/android/main/ui/MainActivity.kt
+11
-0
ProfileFragment.kt
...in/java/chat/rocket/android/profile/ui/ProfileFragment.kt
+2
-2
SettingsFragment.kt
.../java/chat/rocket/android/settings/ui/SettingsFragment.kt
+1
-3
No files found.
app/src/main/java/chat/rocket/android/main/ui/MainActivity.kt
View file @
d46037d4
...
...
@@ -52,6 +52,7 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, HasSupp
private
var
expanded
=
false
private
lateinit
var
googleApiClient
:
GoogleApiClient
private
val
headerLayout
by
lazy
{
view_navigation
.
getHeaderView
(
0
)
}
private
val
CURRENT_STATE
=
"current_state"
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
AndroidInjection
.
inject
(
this
)
...
...
@@ -268,4 +269,14 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, HasSupp
}
}
}
override
fun
onSaveInstanceState
(
outState
:
Bundle
?)
{
super
.
onSaveInstanceState
(
outState
)
outState
?.
putBoolean
(
CURRENT_STATE
,
isFragmentAdded
)
}
override
fun
onRestoreInstanceState
(
savedInstanceState
:
Bundle
?)
{
super
.
onRestoreInstanceState
(
savedInstanceState
)
isFragmentAdded
=
savedInstanceState
?.
getBoolean
(
CURRENT_STATE
)
?:
false
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/profile/ui/ProfileFragment.kt
View file @
d46037d4
...
...
@@ -4,6 +4,7 @@ import DrawableHelper
import
android.os.Build
import
android.os.Bundle
import
android.support.v4.app.Fragment
import
android.support.v7.app.AppCompatActivity
import
android.support.v7.view.ActionMode
import
android.view.*
import
chat.rocket.android.R
...
...
@@ -14,7 +15,6 @@ import chat.rocket.android.util.extensions.*
import
dagger.android.support.AndroidSupportInjection
import
io.reactivex.disposables.CompositeDisposable
import
io.reactivex.rxkotlin.Observables
import
kotlinx.android.synthetic.main.app_bar.*
import
kotlinx.android.synthetic.main.avatar_profile.*
import
kotlinx.android.synthetic.main.fragment_profile.*
import
javax.inject.Inject
...
...
@@ -135,7 +135,7 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback {
}
private
fun
setupToolbar
()
{
(
activity
as
MainActivity
).
toolbar
.
title
=
getString
(
R
.
string
.
title_profile
)
(
activity
as
AppCompatActivity
?)
?.
supportActionBar
?
.
title
=
getString
(
R
.
string
.
title_profile
)
}
private
fun
tintEditTextDrawableStart
()
{
...
...
app/src/main/java/chat/rocket/android/settings/ui/SettingsFragment.kt
View file @
d46037d4
...
...
@@ -9,12 +9,10 @@ import android.view.View
import
android.view.ViewGroup
import
android.widget.AdapterView
import
chat.rocket.android.R
import
chat.rocket.android.main.ui.MainActivity
import
chat.rocket.android.settings.about.ui.AboutActivity
import
chat.rocket.android.settings.password.ui.PasswordActivity
import
chat.rocket.android.settings.presentation.SettingsView
import
chat.rocket.android.util.extensions.inflate
import
kotlinx.android.synthetic.main.app_bar.*
import
kotlinx.android.synthetic.main.fragment_settings.*
import
kotlin.reflect.KClass
...
...
@@ -47,7 +45,7 @@ class SettingsFragment: Fragment(), SettingsView, AdapterView.OnItemClickListene
}
private
fun
setupToolbar
()
{
(
activity
as
MainActivity
).
toolbar
.
title
=
getString
(
R
.
string
.
title_settings
)
(
activity
as
AppCompatActivity
?)
?.
supportActionBar
?
.
title
=
getString
(
R
.
string
.
title_settings
)
}
private
fun
startNewActivity
(
classType
:
KClass
<
out
AppCompatActivity
>)
{
...
...
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