File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
app/src/main/java/com/itsaky/androidide Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -130,26 +130,28 @@ class FullscreenManager(
130130
131131 fun bind () {
132132 if (isBound) return
133- isBound = true
134133
135134 defaultSkipCollapsed = bottomSheetBehavior.skipCollapsed
136135 bottomSheetBehavior.skipCollapsed = false
137136 setupScrollFlags()
138137 topBar.addOnOffsetChangedListener(offsetListener)
139138 bottomSheetBehavior.addBottomSheetCallback(bottomSheetCallback)
140139 fullscreenToggle.setOnClickListener { onFullscreenToggleRequested() }
140+
141+ isBound = true
141142 }
142143
143144 fun destroy () {
144145 if (! isBound) return
145- isBound = false
146146
147147 fullscreenToggle.setOnClickListener(null )
148148 topBar.removeOnOffsetChangedListener(offsetListener)
149149 bottomSheetBehavior.removeBottomSheetCallback(bottomSheetCallback)
150150 bottomSheetBehavior.skipCollapsed = defaultSkipCollapsed
151151 fullscreenToggle.removeCallbacks(clearTransitioningRunnable)
152152 isTransitioning = false
153+
154+ isBound = false
153155 }
154156
155157 fun render (isFullscreen : Boolean , animate : Boolean ) {
Original file line number Diff line number Diff line change @@ -107,8 +107,15 @@ fun ContentEditorBinding.applyImmersiveModeInsets(systemBars: Insets) {
107107}
108108
109109/* *
110- * Allows the bottom sheet to expand fully while relying on top insets to stay clear of system bars.
110+ * Anchors the bottom sheet below the app bar in portrait, but allows it to expand
111+ * fully in landscape to save vertical screen real estate.
111112 */
112113fun ContentEditorBinding.applyBottomSheetAnchorForOrientation (orientation : Int ) {
113- bottomSheet.resetOffsetAnchor()
114+ root.post {
115+ if (orientation == Configuration .ORIENTATION_LANDSCAPE ) {
116+ bottomSheet.resetOffsetAnchor()
117+ } else {
118+ bottomSheet.setOffsetAnchor(editorAppBarLayout)
119+ }
120+ }
114121}
Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ class EditorViewModel : ViewModel() {
5959
6060 internal val _filesModified = MutableLiveData (false )
6161 internal val _filesSaving = MutableLiveData (false )
62- internal val _isFullscreen = MutableLiveData (false )
6362
6463 private val _openedFiles = MutableLiveData <OpenedFilesCache >()
6564 private val _isBoundToBuildService = MutableLiveData (false )
@@ -160,7 +159,6 @@ class EditorViewModel : ViewModel() {
160159 current.copy(isFullscreen = value)
161160 }
162161 }
163- _isFullscreen .value = value
164162 }
165163
166164 fun toggleFullscreen () {
You can’t perform that action at this time.
0 commit comments