Skip to content
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-13610752: LoginActivity UI appears different in 11.0 #2427

Conversation

JohnsonEricAtSalesforce
Copy link
Contributor

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce commented Jun 21, 2023

🥁 Ready for review 🎸

This updates the SalesforceSDK style so that our MSDK 11 updates using AppCompatActivity will theme exactly as they do in 10.2.0. This applies to both light and dark modes plus all the activities in the sample apps. Also, this ensures the theme is the same API 24 to current.

I tested this side-by-side with 10.2.0 in MobileSyncExplorer in login activity and all the other activities in the sample app.

@mobilesdk-bot
Copy link

1 Warning
⚠️ No Lint Results.

Tests results for

Generated by 🚫 Danger

@@ -2,7 +2,9 @@

<resources xmlns:android="http://schemas.android.com/apk/res/android">

<style name="SalesforceSDK" parent="Theme.AppCompat.DayNight">
<style name="SalesforceSDK" parent="Theme.AppCompat.Light.DarkActionBar">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I really looked over the 10.2 theme for the app bar, it qualifies as "dark" since it always uses white text on blue, regardless of light or dark mode.

@@ -2,7 +2,9 @@

<resources xmlns:android="http://schemas.android.com/apk/res/android">

<style name="SalesforceSDK" parent="Theme.AppCompat.DayNight">
<style name="SalesforceSDK" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/sf__primary_color</item>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppCompat picks up these two colors from a different attribute set, so I is necessary to have both colorPrimary and android:colorPrimary.

@@ -46,7 +47,7 @@
*
* @author bhariharan
*/
public class AccountSwitcherActivity extends Activity {
public class AccountSwitcherActivity extends AppCompatActivity {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was doing another test and realized AccountSwitcherActivity also uses the SalesforceSDK style for its theme. Without being an AppCompatActivity, it wouldn't display the AppCompat provided action bar.

This one seems to reparent without any other issues.

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce marked this pull request as ready for review June 22, 2023 00:26
@JohnsonEricAtSalesforce
Copy link
Contributor Author

We might need to be on the lookout for other activities whose action bar behavior has changed where ever the SalesforceSDK style is used. I'll take another look around before merging.

@JohnsonEricAtSalesforce
Copy link
Contributor Author

For testing records, I verified KeyValueStoreInspectorActivity manages its theme in code, overriding the manifest, and so it is themed in 11.0 as it is in 10.2.

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce merged commit 2c18b1c into forcedotcom:dev Jun 22, 2023
@JohnsonEricAtSalesforce JohnsonEricAtSalesforce deleted the bugfix/w-13610752-app-compat-activity-app-bar-styling branch June 22, 2023 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants