This repository was archived by the owner on Oct 18, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 418
Various design improvements #1023
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
656e787
refactor: A bunch of (mostly XML) styling
Smooth-E 63dc6c6
fix(Main Activity): Make use of a dedicated Splash Activity to enable…
Smooth-E 58acfec
feat(edge-to-edge): Ground work to support edge-to-edge experiences t…
Smooth-E a5b4ec9
Merge barnch dev into design improvements
Smooth-E 6aecfd0
fix(edge-to-edge): Manually set bottom padding for fragment containment
Smooth-E 2349b09
feat(edge-to-edge): Allow full activity rebuild on configuration chan…
Smooth-E 9ae9ad9
fix: Finish the Splash Activity after launching the Main one
Smooth-E 8a766f3
fix(templates): The list of templates no longer disappears after an a…
Smooth-E 4cac02a
fix(templates): Keep OnGlobalLayoutListener attached while the View i…
Smooth-E 8ca6841
feat(design): Custom layout for MainActivity's main fragment in lands…
Smooth-E f3b8687
feat(edge-to-edge): Implement edge-to-edge for PreferencesActivity, m…
Smooth-E 8133c5d
refactor(IDEPreferencesFragment.kt): Comply with the line-length rule…
Smooth-E 14a45d4
refactor(edge-to-edge): Remove PaddingUtils.kt
Smooth-E c944efd
feat(edge-to-edge): Create a BottomInsetHeightDistributor view
Smooth-E a5a103c
fix(templates/design): Use OutlinedButton style for the *Exit* button…
Smooth-E edbcba6
refactor: Comply with AndroidIDE's code style
Smooth-E c0996d1
refactor: Make use of helper methods. Optimize XML
Smooth-E a232d62
fix(edge-to-edge): Wrong system bar coloring in Dark Mode
Smooth-E File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(edge-to-edge): Implement edge-to-edge for PreferencesActivity, m…
…ove InsetUtils outside of the LimitlessIDEActivity.
- Loading branch information
commit f3b868775c62dbad74ee26415f3dc8081f12409f
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
common/src/main/java/com/itsaky/androidide/utils/InsetUtils.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* This file is part of AndroidIDE. | ||
* | ||
* AndroidIDE is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* AndroidIDE is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.itsaky.androidide.utils | ||
|
||
import android.graphics.Insets | ||
import android.graphics.Rect | ||
import android.os.Build | ||
import android.view.View | ||
import android.view.WindowInsets | ||
|
||
/** | ||
* Acquires screen insets | ||
* | ||
* @param view Any View that is currently attached to a Window | ||
* | ||
* @return [Rect] containing acquired insets | ||
* | ||
* @author Smooth E | ||
*/ | ||
fun getInsets(view: View): Rect { | ||
val insets: Rect | ||
val rootWindowInsets = view.rootWindowInsets | ||
|
||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { | ||
|
||
val receivedInsets: Insets = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { | ||
val typeMask = WindowInsets.Type.systemBars() or WindowInsets.Type.displayCutout() | ||
rootWindowInsets.getInsetsIgnoringVisibility(typeMask) | ||
} else { | ||
view.rootWindowInsets.stableInsets | ||
} | ||
|
||
insets = Rect( | ||
receivedInsets.left, | ||
receivedInsets.top, | ||
receivedInsets.right, | ||
receivedInsets.bottom | ||
) | ||
} else { | ||
insets = Rect( | ||
rootWindowInsets.stableInsetLeft, | ||
rootWindowInsets.stableInsetTop, | ||
rootWindowInsets.stableInsetRight, | ||
rootWindowInsets.stableInsetBottom | ||
) | ||
} | ||
|
||
return insets | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.