-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@W-17411362: LoginActivity Fit and Finish #2668
Merged
JohnsonEricAtSalesforce
merged 10 commits into
forcedotcom:dev
from
JohnsonEricAtSalesforce:feature/w-17411362_login_activity-fit-and-finish
Feb 14, 2025
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
09ad59d
@W-17411362: LoginActivity Fit and Finish (Correct Status Bar And Nav…
JohnsonEricAtSalesforce 029c94e
@W-17411362: LoginActivity Fit and Finish (Remove Hard-Coded Colors T…
JohnsonEricAtSalesforce 6067faa
@W-17411362: LoginActivity Fit and Finish (Use Existing Salesforce SD…
JohnsonEricAtSalesforce 0ad29a0
@W-17411362: LoginActivity Fit and Finish (Remove sfDarkLoginColors)
JohnsonEricAtSalesforce a9f29fd
@W-17411362: LoginActivity Fit and Finish (Theme Colors For Overflow …
JohnsonEricAtSalesforce 1692930
@W-17411362: LoginActivity Fit and Finish (Navigation Button Content …
JohnsonEricAtSalesforce e785f0c
@W-17411362: LoginActivity Fit and Finish (Migrate Fixed Strings To S…
JohnsonEricAtSalesforce 6736fb2
@W-17411362: LoginActivity Fit and Finish (Update ripple theme for lo…
JohnsonEricAtSalesforce 5b74256
@W-17411362: LoginActivity Fit and Finish (Restore Biometric Authenti…
JohnsonEricAtSalesforce cf16ae5
@W-17411362: LoginActivity Fit and Finish (Show loading indicator in …
JohnsonEricAtSalesforce 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
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -42,7 +42,9 @@ import android.content.res.Configuration.UI_MODE_NIGHT_MASK | |
import android.content.res.Configuration.UI_MODE_NIGHT_YES | ||
import android.os.Build.MODEL | ||
import android.os.Build.VERSION.RELEASE | ||
import android.os.Build.VERSION.SDK_INT | ||
import android.os.Build.VERSION.SECURITY_PATCH | ||
import android.os.Build.VERSION_CODES.R | ||
import android.os.Bundle | ||
import android.os.Handler | ||
import android.os.Looper.getMainLooper | ||
|
@@ -52,6 +54,7 @@ import android.text.TextUtils.isEmpty | |
import android.text.TextUtils.join | ||
import android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR | ||
import android.view.View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | ||
import android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS | ||
import android.webkit.CookieManager | ||
import android.webkit.URLUtil.isHttpsUrl | ||
import androidx.compose.material3.ColorScheme | ||
|
@@ -1498,18 +1501,29 @@ open class SalesforceSDKManager protected constructor( | |
} | ||
|
||
/** | ||
* Sets the system status and navigation bars as visible regardless of style | ||
* and OS dark theme states. | ||
* Sets the system status and navigation bars to the light theme without | ||
* regard to the system theme. This is useful when the background is light | ||
* even when dark theme is enabled. | ||
* | ||
* @param activity The activity used to set style attributes | ||
* @param activity The activity | ||
*/ | ||
open fun setViewNavigationVisibility(activity: Activity) { | ||
if (!isDarkTheme || activity.javaClass.name == loginActivityClass.name) { | ||
/* | ||
* This covers the case where OS dark theme is true, but app has | ||
* disabled. | ||
*/ | ||
activity.window.decorView.systemUiVisibility = SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR or SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | ||
if (SDK_INT > R) { | ||
JohnsonEricAtSalesforce marked this conversation as resolved.
Show resolved
Hide resolved
|
||
runCatching { | ||
activity.window?.insetsController?.setSystemBarsAppearance( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @brandonpage - Here's a modern way to accomplish what this once did with a dandy to-do so we can clean up once API 30 is our minimum. I did some reading, and though the names have changed the overall approach is almost identical. |
||
APPEARANCE_LIGHT_STATUS_BARS, | ||
APPEARANCE_LIGHT_STATUS_BARS | ||
) | ||
} | ||
} else { | ||
// TODO: Remove with minimum API >= 30 | ||
activity.window?.decorView?.systemUiVisibility = SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR or SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | ||
} | ||
} | ||
} | ||
|
||
|
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The leading indentation for this source was pretty mixed, so since we're adding a significant number of lines I thought a gentle reformat to Android Studio's defaults would be helpful.