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

[TIMOB-17493] Android: Default Translucent theme overwrites custom themes. #9216

Closed
wants to merge 4 commits into from

Conversation

ypbnv
Copy link
Contributor

@ypbnv ypbnv commented Jul 11, 2017

JIRA: https://jira.appcelerator.org/browse/TIMOB-17493

Description:
The default Translucent theme used for activities with opacity property, modal property and incorrect background color format, overwrites any custom theme's values.

Test case:
Custom theme and case provided in the ticket.

Another test case:

Add the following to tiapp.xml:

<android 
    xmlns:android="http://schemas.android.com/apk/res/android">
    <manifest>
      <application android:theme="@style/Theme.Titanium"/>
    </manifest>
  </android>

app.js

var win = Ti.UI.createWindow({backgroundColor: '#Z68'});
win.open();

As Theme.Titanium has ActionBar disabled I expected to get a translucent window without ActionBar. I got a window with an ActionBar.

Note:
It seems that one of the templates for generating Android manifest file is not used at all. I successfully built and SDK instance and a application without it. Removed it to avoid confusion.

@ypbnv ypbnv added this to the 6.2.0 milestone Jul 11, 2017
@@ -3338,18 +3338,21 @@ AndroidBuilder.prototype.generateTheme = function generateTheme(next) {
this.logger.info(__('Generating %s', themeFile.cyan));

var flags = 'Theme.AppCompat';
var defaultProvidedTheme = '@style/' + flags;
Copy link
Contributor

Choose a reason for hiding this comment

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

You shouldn't need to change anything in this file

@@ -33,7 +33,13 @@
<!-- AppCompat Compatibility -->
<item name="actionBarStyle">@style/Base.Widget.AppCompat.ActionBar.Solid</item>
</style>


<style name="Theme.AppCompat.Translucent.Default" parent="<%- defaultProvidedTheme %>">
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not remove

<item name="android:actionBarStyle">@style/Base.Widget.AppCompat.ActionBar.Solid</item>
<item name="actionBarStyle">@style/Base.Widget.AppCompat.ActionBar.Solid</item>

from Theme.AppCompat.Translucent ?

NOTE: Update the docs

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

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

CR: SEE COMMENTS

@hansemannn hansemannn modified the milestones: 7.0.0, 6.2.0 Aug 15, 2017
@ypbnv ypbnv closed this Aug 25, 2017
@ypbnv
Copy link
Contributor Author

ypbnv commented Aug 25, 2017

Closed due to being out of sync with latest build and themes changes. Will reopen once I get it back on track or I will create a new one for the issue (if it is still relevant).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants