Skip to content

Commit

Permalink
avoid some re-creation
Browse files Browse the repository at this point in the history
  • Loading branch information
levinli303 committed Mar 27, 2020
1 parent c5cec21 commit 6b7a974
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
android:theme="@style/AppTheme">
<activity
android:name="space.celestia.mobilecelestia.MainActivity"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:screenOrientation="sensorLandscape"
android:launchMode="singleInstance"
tools:ignore="LockedOrientationActivity">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ class CelestiaFragment : Fragment(), GLSurfaceView.Renderer, CelestiaAppCore.Pro
fun celestiaWillStart()
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

retainInstance = true
}

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ class LoadingFragment : Fragment() {
private var loadingLabel: TextView? = null
private var currentText: String? = null

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

retainInstance = true
}

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
Expand Down

0 comments on commit 6b7a974

Please sign in to comment.