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-16436] Integrate appcompat themes to SDK #5348

Merged
merged 8 commits into from Feb 20, 2014

Conversation

hieupham007
Copy link
Contributor

Testing steps in JIRA.

}

ActionBarActivity activity = (ActionBarActivity) getWrappedActivity();
actionBarProxy = new ActionBarProxy(activity);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we removing the null check. Won't this create a new proxy everytime the method is called?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch

@hieupham007
Copy link
Contributor Author

I've addressed comment and fix a blocker bug for 4.x+ devices. Also added a KitchenSink PR in ticket.

@vishalduggal
Copy link
Contributor

FR failed.
KS->BaseUI->Menu

Otherwise stuff works fine though it looks slightly different from the base HOLO theme

Device - Samsung S3 running 4.3

@vishalduggal
Copy link
Contributor

KS->Controls->ActionBar
None of the menu item clicks are coming through

@farfromrefug
Copy link
Contributor

I have already tried to apply appcompat theme in Ti, and decided to go for actionbarsherlock because i had a lot of problem on android < 3.0
You should test it heavily on < 3.0
Great stuff anyway

@vishalduggal
Copy link
Contributor

Menu Clicks are working now but there are still no graphics displayed on the Menu Items (Text Only).

@vishalduggal
Copy link
Contributor

showAsAction is being ignored on 2X in Menu

@hieupham007
Copy link
Contributor Author

Fixed a few issues on 2.x actionbar. Also updated KS PR.
Martin, do you remember which problems did you run into? If you can tell us which areas we should test heavily om that would be greatly appreciated :)

@farfromrefug
Copy link
Contributor

@hieupham007 I remember actually not getting any actionbar in some cases. And if i remember correctly i had some crashes while changing orientation. But maybe the lib got updated since then. I tested it when it just got released. I will dig into my memory and get back to you ;)

@vishalduggal
Copy link
Contributor

All looks good on this end. KS passed without any issues on the UI side.
Couple of minor problems (mostly to do with themes)

  1. Theme.Titanium (Launch activity) looks different of 2.X(no action bar) than on 4.X (has action bar)
  2. The translucent theme (KS->BaseUI->WindowProperties) has a transparent actionBar now. Previously it did not.

Also left comments on the associated Kitchen Sink PR which need addressing

@@ -287,7 +287,7 @@ private TabProxy handleGetActiveTab() {
@Override
protected void handleOpen(KrollDict options)
{
Activity topActivity = TiApplication.getAppCurrentActivity();
ActionBarActivity topActivity = (ActionBarActivity) TiApplication.getAppCurrentActivity();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to cast this to an ActionBarActivity? We don't do anything specific with ActionBarActivity. Also not sure if TiApplication.getAppCurrentActivity(); may return some other type of activity or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we don't need to cast it here, but since this entire class is using ActionBarActivity, not casting it would require an additional import of android.app.Activity, which would serve no purpose other than saving a cast.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well you would be risking a class cast exception if TiApplication.getAppCurrentActivity(); doesn't return an ActionBarActivity. It may be worth it to not cast instead of saving an import.

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'll add an instanceof check here. If its not ActiionBarActivity, it will crash at a later time.

@ayeung
Copy link
Contributor

ayeung commented Feb 19, 2014

Code reviewed, left comments.

@ayeung
Copy link
Contributor

ayeung commented Feb 20, 2014

Also noticed that there are unused imports in MenuItemProxy and TabGroupProxy, so you may want to clean that up.

@hieupham007
Copy link
Contributor Author

Addressed comments, also added support for more functionalities for 2.x ActionBar

@vishalduggal
Copy link
Contributor

CR + FR ok. There is one discrepancy in the behavior of AppCompat library wrt Window.FEATURE_NO_TITLE

In 4.0 and above it hides the actionBar. In 2.X it does not.

Same issue reported here

Since there is an obvious discrepancy in behavior and navbarHidden is not a native Android property, I am comfortable with dropping support for this property

One caveat that we have not considered is the Android HIG. Specifically with our support for fullscreen. According to the docs here we should never show the action bar in a full screen window, but we have no code enforcing that behavior.

setNavBarHidden(boolean) in TiBaseActivity needs to be refactored for ActionBar. Otherwise looks good.

@ayeung
Copy link
Contributor

ayeung commented Feb 20, 2014

Code reviewed. Also ran anvil on this, and it has fewer errors than the master branch. There will be a separate ticket for removing the navbarHidden property.

Request Accepted.

ayeung pushed a commit that referenced this pull request Feb 20, 2014
[TIMOB-16436] Integrate appcompat themes to SDK
@ayeung ayeung merged commit 37759dc into tidev:master Feb 20, 2014
farfromrefug pushed a commit to Akylas/titanium_mobile that referenced this pull request Aug 15, 2014
[TIMOB-16436] Integrate appcompat themes to SDK
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.

None yet

4 participants