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
64ec3d1a
Commit
64ec3d1a
authored
Jun 02, 2018
by
Divyanshu Bhargava
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SaveInstance on screen rotation
parent
c8fe544a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
DateTimeHelper.kt
app/src/main/java/chat/rocket/android/app/DateTimeHelper.kt
+2
-2
MainActivity.kt
...src/main/java/chat/rocket/android/main/ui/MainActivity.kt
+11
-0
No files found.
app/src/main/java/chat/rocket/android/app/DateTimeHelper.kt
View file @
64ec3d1a
...
@@ -17,8 +17,8 @@ object DateTimeHelper {
...
@@ -17,8 +17,8 @@ object DateTimeHelper {
* @param long The [Long]
* @param long The [Long]
* @return The [LocalDateTime] from a [Long].
* @return The [LocalDateTime] from a [Long].
*/
*/
fun
getLocalDateTime
(
long
:
Long
):
LocalDateTime
{
fun
getLocalDateTime
(
long
:
Long
?
):
LocalDateTime
{
return
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
long
)
,
ZoneId
.
systemDefault
())
return
LocalDateTime
.
ofInstant
(
long
?.
let
{
Instant
.
ofEpochMilli
(
it
)
}
,
ZoneId
.
systemDefault
())
}
}
/**
/**
...
...
app/src/main/java/chat/rocket/android/main/ui/MainActivity.kt
View file @
64ec3d1a
...
@@ -52,6 +52,7 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, HasSupp
...
@@ -52,6 +52,7 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, HasSupp
private
var
expanded
=
false
private
var
expanded
=
false
private
lateinit
var
googleApiClient
:
GoogleApiClient
private
lateinit
var
googleApiClient
:
GoogleApiClient
private
val
headerLayout
by
lazy
{
view_navigation
.
getHeaderView
(
0
)
}
private
val
headerLayout
by
lazy
{
view_navigation
.
getHeaderView
(
0
)
}
private
val
CURRENT_STATE
=
"current_state"
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
AndroidInjection
.
inject
(
this
)
AndroidInjection
.
inject
(
this
)
...
@@ -268,4 +269,14 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, HasSupp
...
@@ -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
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