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-10712] Android: label 'opacity' property won't change for TableVi... #3043

Merged
merged 6 commits into from Oct 2, 2012

Conversation

krowley
Copy link
Contributor

@krowley krowley commented Sep 25, 2012

...ewRows outside the visible screen on touch event

Re-factor code so that view-proxy associations are only made at layout time, but not
during any non-layout passes through getView() (i.e. measurement passes).

Needs review by Opie -- Thanks!

…eViewRows outside the visible screen on touch event
@krowley
Copy link
Contributor Author

krowley commented Sep 25, 2012

I can see that this change breaks "old style" rows -- a fix for that is in progress and will be added here.

…eViewRows outside the visible screen on touch event
@krowley
Copy link
Contributor Author

krowley commented Sep 26, 2012

There's another change for old-style rows coming here.

…eViewRows outside the visible screen on touch event
@@ -124,7 +125,7 @@ protected void refreshControls()
if (view == null) {
// In some cases the TiUIView for this proxy has been reassigned to another proxy
// We don't want to actually release it though, just reassign by creating a new view
view = proxy.forceCreateView();
view = proxy.forceCreateView(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

We could use a comment here as to why it's not setting the model listener.

@billdawson
Copy link
Contributor

Functional test passes. Also tested table view examples in KitchenSink to look for regressions but it seemed fine.

Left comments for review. Also, I'll get a second reviewer on this after the next round of changes. I think any somewhat-major change to TableView should have two reviewers.

@ayeung
Copy link
Contributor

ayeung commented Sep 27, 2012

From what we talked about it seemed like you moved the code to associate a proxy to a view from refreshControls() to onLayout() so that it would not occur during measure passes, but we still have a lot of logic inside refreshControls() like calling processProperties(). Do we still need this during a measure pass, or should that be moved as well?

Also, the test case should include the old style rows test case too since you added logic for that.

@krowley
Copy link
Contributor Author

krowley commented Sep 27, 2012

Yes I agree with your summary of the situation.

refreshControls() is a poorly named method in this
case. What it really does after my change is to
create the child views if needed, and then apply
the properties to each from the corresponding
proxy. It no longer makes the proxy-view
association. So it gets called for both
measurment and layout passes through
getView().

I'm going to rename it to something like
createChildViews() to help clear things up.

Karl

From: ayeung <notifications@github.commailto:notifications@github.com>
Reply-To: appcelerator/titanium_mobile <reply@reply.github.commailto:reply@reply.github.com>
Date: Wed, 26 Sep 2012 17:54:38 -0700
To: appcelerator/titanium_mobile <titanium_mobile@noreply.github.commailto:titanium_mobile@noreply.github.com>
Cc: Karl Rowley <krowley@appcelerator.commailto:krowley@appcelerator.com>
Subject: Re: [titanium_mobile] [TIMOB-10712] Android: label 'opacity' property won't change for TableVi... (#3043)

From what we talked about it seemed like you moved the code to associate a proxy to a view from refreshControls() to onLayout() so that it would not occur during measure passes, but we still have a lot of logic inside refreshControls() like calling processProperties(). Do we still need this during a measure pass, or should that be moved as well?

Also, the test case should include the old style rows test case too since you added logic for that.


Reply to this email directly or view it on GitHubhttps://github.com//pull/3043#issuecomment-8915124.

@krowley
Copy link
Contributor Author

krowley commented Sep 27, 2012

Thanks for the comments, they are all good ones and I'll address them.

I'm looking for more test cases for all of this. Arthur Evans found one by
digging out an old bug that used old-style rows.

Karl

From: Bill Dawson <notifications@github.commailto:notifications@github.com>
Reply-To: appcelerator/titanium_mobile <reply@reply.github.commailto:reply@reply.github.com>
Date: Wed, 26 Sep 2012 14:58:56 -0700
To: appcelerator/titanium_mobile <titanium_mobile@noreply.github.commailto:titanium_mobile@noreply.github.com>
Cc: Karl Rowley <krowley@appcelerator.commailto:krowley@appcelerator.com>
Subject: Re: [titanium_mobile] [TIMOB-10712] Android: label 'opacity' property won't change for TableVi... (#3043)

Functional test passes. Also tested table view examples in KitchenSink to look for regressions but it seemed fine.

Left comments for review. Also, I'll get a second reviewer on this after the next round of changes. I think any somewhat-major change to TableView should have two reviewers.


Reply to this email directly or view it on GitHubhttps://github.com//pull/3043#issuecomment-8907984.

…eViewRows outside the visible screen on touch event
@krowley
Copy link
Contributor Author

krowley commented Sep 27, 2012

OK I've updated code to respond to comments.

// We don't want to actually release it though, just reassign by creating a new view.
// Not setting modelListener from here because this could be a measurement pass or
// a layout pass through getView().
view = proxy.forceCreateView(false); // false means don't set modelListener
Copy link
Contributor

Choose a reason for hiding this comment

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

We could use a more detailed comment regarding why we are not setting the model listener here. Since this is a complex bug, we should probably put some comments in relevant places like getView() to describe the situation.

@ayeung
Copy link
Contributor

ayeung commented Sep 27, 2012

Code reviewed. please address comments.

…eViewRows outside the visible screen on touch event
@krowley
Copy link
Contributor Author

krowley commented Sep 27, 2012

OK, I addressed comments from Allen.

@btknorr
Copy link

btknorr commented Sep 28, 2012

Hi there...I submitted the original bug for GameStop. Now when I build the sdk manually using scons, the bug seems to be fixed, but now the images don't show up...see example code http://jira.appcelerator.org/browse/TIMOB-10712

This is the error I see in logcat:

E/TiDownloadManager( 5900): (pool-3-thread-2) [0,1970] Exception downloading https://github.com/appcelerator/titanium_mobile/raw/master/demos/KitchenSink/Resources/images/custom_tableview/eventsButton.png
E/TiDownloadManager( 5900): java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
E/TiDownloadManager( 5900): at org.appcelerator.titanium.util.TiResponseCache.get(TiResponseCache.java:276)
E/TiDownloadManager( 5900): at libcore.net.http.HttpEngine.initResponseSource(HttpEngine.java:249)
E/TiDownloadManager( 5900): at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:211)
E/TiDownloadManager( 5900): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:273)
E/TiDownloadManager( 5900): at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:168)
E/TiDownloadManager( 5900): at libcore.net.http.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:270)
E/TiDownloadManager( 5900): at java.net.URL.openStream(URL.java:462)
E/TiDownloadManager( 5900): at org.appcelerator.titanium.util.TiDownloadManager$DownloadJob.run(TiDownloadManager.java:157)
E/TiDownloadManager( 5900): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
E/TiDownloadManager( 5900): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
E/TiDownloadManager( 5900): at java.lang.Thread.run(Thread.java:856)
E/TiDownloadManager( 5900): (pool-3-thread-1) [1970,1970] Exception downloading https://github.com/appcelerator/titanium_mobile/raw/master/demos/KitchenSink/Resources/images/custom_tableview/user.png
E/TiDownloadManager( 5900): java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
E/TiDownloadManager( 5900): at org.appcelerator.titanium.util.TiResponseCache.get(TiResponseCache.java:276)
E/TiDownloadManager( 5900): at libcore.net.http.HttpEngine.initResponseSource(HttpEngine.java:249)
E/TiDownloadManager( 5900): at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:211)
E/TiDownloadManager( 5900): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:273)
E/TiDownloadManager( 5900): at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:168)
E/TiDownloadManager( 5900): at libcore.net.http.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:270)
E/TiDownloadManager( 5900): at java.net.URL.openStream(URL.java:462)
E/TiDownloadManager( 5900): at org.appcelerator.titanium.util.TiDownloadManager$DownloadJob.run(TiDownloadManager.java:157)
E/TiDownloadManager( 5900): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
E/TiDownloadManager( 5900): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
E/TiDownloadManager( 5900): at java.lang.Thread.run(Thread.java:856)

@krowley
Copy link
Contributor Author

krowley commented Sep 28, 2012

It's working for me right now. I"m wondering if the errors above for kitchen sink images were due to a server problem. Anyway, I"m eager to get this pull request merged.

@btknorr
Copy link

btknorr commented Sep 28, 2012

Are you testing on a device or the emulator? I am on a device, but if the images are showing for you then maybe it is a server issue or something weird with the Ti response cache on my device.

@krowley
Copy link
Contributor Author

krowley commented Sep 28, 2012

I"m testing using a device -- Samsung Galaxy S2 (AT&T), Android 2.3.6

@btknorr
Copy link

btknorr commented Sep 28, 2012

FYI...I just pulled down the latest from timob-10712-2 and built it and the bug fix doesn't work anymore. Should I be pulling from a different branch now?

@btknorr
Copy link

btknorr commented Sep 28, 2012

Nevermind...for some reason Ti Studio changed my Ti SDK back to 2.1.2GA

// Create views for measurement or for layout. For each view, apply the
// properties from the appropriate proxy to the view.
//
protected void createViews()
Copy link
Contributor

Choose a reason for hiding this comment

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

createView seems a little generic for the context of the table view, maybe we can use something like createControls() so it aligns with terminology in this class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem I have with this is that "controls" is confusing here.
The name createViews() describes pretty well what is going on
underneath.

Karl

From: ayeung <notifications@github.commailto:notifications@github.com>
Reply-To: appcelerator/titanium_mobile <reply@reply.github.commailto:reply@reply.github.com>
Date: Sat, 29 Sep 2012 12:32:26 -0700
To: appcelerator/titanium_mobile <titanium_mobile@noreply.github.commailto:titanium_mobile@noreply.github.com>
Cc: Karl Rowley <krowley@appcelerator.commailto:krowley@appcelerator.com>
Subject: Re: [titanium_mobile] [TIMOB-10712] Android: label 'opacity' property won't change for TableVi... (#3043)

In android/modules/ui/src/java/ti/modules/titanium/ui/widget/tableview/TiTableViewRowProxyItem.java:

@@ -97,7 +98,11 @@ protected TiViewProxy addViewToOldRow(int index, TiUIView titleView, TiViewProxy
return label;
}

  • protected void refreshControls()
    
  • //
    
  • // Create views for measurement or for layout.  For each view, apply the
    
  • // properties from the appropriate proxy to the view.
    
  • //
    
  • protected void createViews()
    

createView seems a little generic for the context of the table view, maybe we can use something like createControls() so it aligns with terminology in this class?


Reply to this email directly or view it on GitHubhttps://github.com//pull/3043/files#r1723800.


public void realizeViews(TiUIView view)
public void realizeViews(TiUIView view, boolean isLayoutPass)
Copy link
Contributor

Choose a reason for hiding this comment

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

rename isLayoutPass

@ayeung
Copy link
Contributor

ayeung commented Sep 29, 2012

Code reviewed, left several comments.

…eViewRows outside the visible screen on touch event -- Address code review comments
@ayeung
Copy link
Contributor

ayeung commented Oct 1, 2012

Code reviewed. Request Accepted

@billdawson
Copy link
Contributor

This PR breaks KitchenSink. (KitchenSink crashes immediately on opening.)

When we make "big" changes to something that is also used in KitchenSink, we also test KS before submitting a PR, as a kind of "smoke test" beyond the test case in the individual JIRA ticket. It's a good habit to get into.

@ghost ghost assigned billdawson Oct 2, 2012
@krowley
Copy link
Contributor Author

krowley commented Oct 2, 2012

I'm not seeing failures in Kitchen Sink so far. What is the stack trace you are seeing for the Kitchen Sink crash?

@billdawson
Copy link
Contributor

Uh oh, hopefully I'm not leading us on a wild goose chase. I'll try again.
And I should have given you the trace last time, sorry about that.

On Tue, Oct 2, 2012 at 7:21 PM, krowley notifications@github.com wrote:

I'm not seeing failures in Kitchen Sink so far. What is the stack trace
you are seeing for the Kitchen Sink crash?


Reply to this email directly or view it on GitHubhttps://github.com//pull/3043#issuecomment-9079098.

Bill Dawson
Platform Engineer
Appcelerator, Inc.

bdawson@appcelerator.com
http://www.appcelerator.com

Appcelerator, Inc.
The Next Generation Mobile Platform

@rusticphilosopher
Copy link
Contributor

Code reviewed without comments. Waiting on further update following Bill's feedback

@billdawson
Copy link
Contributor

KS is fine. I wonder if maybe I accidentally pulled in your "timob-10712" rather than "timob-10712-2" branch yesterday. Not sure what happened.

Resuming review....

@rusticphilosopher
Copy link
Contributor

CR Accepted Leaving FR to Allen and Bill. Merge approved once FR from Bill/Allen passes.

@billdawson
Copy link
Contributor

CR/FR accepted. Thank you especially for the code commenting.

For FR, I re-tested the fail case, went through KS tableview tests and made my own test app to check proxy property values while scrolling through the table.

billdawson added a commit that referenced this pull request Oct 2, 2012
[TIMOB-10712] Android: label 'opacity' property won't change for TableVi...
@billdawson billdawson merged commit 09cbaa3 into tidev:master Oct 2, 2012
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

5 participants