Author Topic: Example 9 with Horizontal Scrollview jumping when clicked.  (Read 12827 times)

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #15 on: May 17, 2014, 09:37:10 PM »
I'm a newbie at NGUI, you are the creator of NGUI.  So my request has been.  How to make a simple ACCORDION with Horizontal scrollers inside.  This is a very basic component in any GUI package.

So, how can this be done with NGUI.  As you can see, I've tried over 5 days with all sorts of headaches and have not managed to do it because of this or that problem.  Can you do me a favor and send me a unity package of an example that works. This component will be dynamically populated so please test it with this in mind.  Everything the app is dynamically populated, nothing is done by hand because all the data is coming from the server.

Edit:  I also own DaikonForge and it takes less than 5 minutes to get this simple component to work and so far it's taken me more than 5 days with NGUI with the same thing.  First we got problems with the dragging to the left due to a NGUI.Math problem, then we run into the UIpanel cannot be tweened,  then when dragging and dropping we have another bug where we cannot get the correct order of the objects due to a hack that didn't get properly tested.  I didn't have any of these problems with the SAME Accordion with Daikon.  I would have to say that this is one component in NGUI that really needs some proper implementation.  FYI, mobile components use a lot of ScrollViews and in the future, more users will discover the same problems with NGUI's scrollviews.

« Last Edit: May 18, 2014, 02:17:40 AM by wallabie »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #16 on: May 18, 2014, 11:16:37 AM »
Here you go. This took me less than a minute to set up, so what does that say? Nothing. Different packages have different strengths and weaknesses, but they are ultimately limited by the knowledge of the person using them.

The key is to not use TweenScale. As I mentioned, scaling a scroll view non-uniformly is a big no-no in NGUI because of a serious limitation in Unity itself (the way it combines scaling, and the lack of transform.scale). Forego that, and everything works peachy. In essence all I did is replace your TweenScale with TweenHeight.

Note that this scene requires Unity 4.3.4 and NGUI 3.6.0.

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #17 on: May 18, 2014, 11:52:31 PM »
Ok, I'm downloading 3.6 and going to try this repo. 
If it took 1 minute, then why didn't you do this earlier and save me the headache of 5 days.  Actually, it took five days because of numerous bugs that had to be fixed.  All I can say that moving forward, I hope you see that the use of scrollView is going to increase so please make this part of NGUI much more Solid so that we do not have to suffer.  Using NGUI is supposed to be a joyful experience.

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #18 on: May 19, 2014, 12:43:24 AM »
Unfortunately there are more problems.

I mentioned before that the ScrollView will be populated Dynamically.  In the first quest, I made all the buttons to have xpos = 0, as you can see, they are all bunched up and not spaced out correctly when played.  As a comparison I made the same scrollView that's not nested at the bottom and it works fine. 


https://dl.dropboxusercontent.com/u/48378123/NestedSV_ItemsAllBunchedUp.unitypackage

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #19 on: May 19, 2014, 12:51:15 PM »
wallabie, if you want faster turn around, you need to obtain a Professional license. I've mentioned this before. Professional version is the same repository I'm working with. It lets you get fixes immediately rather than waiting days for them. So far you have not even provided me with the OR# or your standard license even, let alone Pro.

Alternatively, help me cut down support time by helping others and answering some of the questions. I have only so much time in a given day, and I have to do support, development, and bug fixes. Help me help you. If I simply do all the work for everyone by providing an example for everyone who asks rather than keeping it short and explaining the cause, letting them figure out the issue and solution on their own... how can they expect to learn anything? Haven't you ever heard of the "give the man a fish" expression?

As for your remaining issue... Execute the grid, reset clipping position. I mentioned this before. You need to do this after populating your scroll views as well.
« Last Edit: May 19, 2014, 12:59:40 PM by ArenMook »

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #20 on: May 19, 2014, 02:14:59 PM »
I'm not asking for a fish. 

Of course I did Reposition() and ResetPosition() after populating but still the same problem.  Comes in looking very weird.  Where is your test project that demonstrates that your fix works ?  On the other hand, I sent you a repos that shows how it doesn't work.

All I'm asking is for a simple Bug free Accordion that works...  It's taken now 7 days with a number of bug fixes on your part just to get a semi working accordion that takes 5 minutes to setup in Daikon. 

Let's examine the series of events related to getting the nested accordion to work:

1. Item dragged to the left breaks the component.  Math bug. Had to be fixed. Took 3 days before you saw that it was your code's problem.

2. Nested scrollView cannot be Tweened. Don't use Non-uniform Tween I tell you. Then you came up with a Fix that uses Tween height instead of Tween Scale.  So yes, do not use non-uniform tween.  Took 2 days.

3. Reordering of the items does not work because ... well, "don't trust what unity gives you". Turns out the fix was the hack code forgot to take into account of the sorting.  Hack was not properly tested.  Took 3 days.

4. NOW, there is another problem still with your last 1 minute Fix.

I sent you a repos to show the problem. Instead of screaming that I am demanding your help, it's more like we should get paid for Beta testing. 

Edit:  FYI, most of my request for your "Help" on the forum  has turned out to be request to "Fix Bugs".  The forum is very good because it keeps very good records and it doesn't lie.  Just examine the facts for yourself.   Actually, the BEST HELP you can give is to do better testing and hire someone for QA instead of throwing out beta ware and making us suffer and begging for bug fixes.

P.S. I sent you my OR.




« Last Edit: May 19, 2014, 02:41:44 PM by wallabie »

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #21 on: May 19, 2014, 04:51:17 PM »
The forums do indeed keep a good record and your sense of entitlement is unduly high. Be cool, guy, you're being helped.

Fact is, you're trying to do something quite specific (nested accordion) that NGUI doesn't have built-in. Now, it's possible to make that work, because the components for an accordion are there. Nesting panels is a brand new feature, so it's bound to have kinks and bugs. 1 month ago it would just not have been possible at all and the argument would stop there. So you have the privilege of being one of the first to brave these new waters. We're here to help, with guidance, bug fixes and whatever else we can help with given our limited time.

As for the resistance you've felt, you must realize that there are many users on here saying "X doesn't work", "Y doesn't work as I expected", "I paid this and this, so make my stuff for me now rah rah".

While they are sometimes right, they are often not, and are instead just using it wrong. Answering posts like those is (often) trivial, "use A instead of X", "Y works right if you just use B first", "make your own stuff" etc. Sometimes genuine bugs gets overlooked or thought of as user error or it takes some time to actually fix the bug, that's just how it is when it's a one man operation. Sometimes you'll get some resistance to what you think is a bug, because it didn't break in the simple tests. When you have specific repos that break consistently, they're looked at and fixed if the bug can be identified. It doesn't happen instantly, but that's because there are hundreds of other support requests on here that also requires attention.


Aanyway re the current issue:
If you want your dynamically filled objects to placed correctly, leave the UIGrid enabled. You can have another component disable it again after all your objects are filled in. I just did that in the repo you posted and it seems to work fine on my end. Is there anything else you're doing that might be breaking it?

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #22 on: May 19, 2014, 10:39:36 PM »
"Fact is, you're trying to do something quite specific (nested accordion) that NGUI doesn't have built-in. " NGUI's been here for 2+ years, Daikon is much shorter and their component architecture just works. 

"I paid this and this, so make my stuff for me now rah rah"
I don't think that Nested ScrollViews with a working basic Accordion is a custom demand.  Just look at every other GUI package and see for yourself.  Quite the contrary, Nested ScrollViews are a BASIC functionality so are accordions. 

"1 month ago it would just not have been possible at all and the argument would stop there"
No it did not stop here, I was the one who requested this feature 3 months ago because I was Shocked to find out that NGUI did not support this basic functionality.  It's incredible what NGUI community of users are putting up with.  NGUI is heavily promoting Mobile use. How can this package work on mobile where most of the GUI's are built on nested ScrollViews. Open your phone and see for yourself. This is 2014.

"that's just how it is when it's a one man operation." - This package has grossed over $950,000.  The competitor, Daikon around $400,000 and they have 2 full-time plus extra help.  A business that grosses almost a million and have 10+ thousand customers should NOT be run by one man.  How would you feel if Unity didn't hire programmers for its company and when you ask for bugs to be fixed or features implemented, they tell you, sorry, we only have the 3 founding members as programmers on our staff.  Wouldn't you say that these 3 founders are trying to keep all of the money for themselves.  The reality is that NGUI has become a business in its own right with thousands of customers worldwide, given this scale and revenue, it really needs at least 2 full-time programmers, one full-time QA/support/customer relations.

The solution:
"If you want your dynamically filled objects to placed correctly, leave the UIGrid enabled."
Can you post a link to  your working repos, if it works, then surely I will shut-up and know that it's my problem. 
 




« Last Edit: May 20, 2014, 12:11:16 AM by wallabie »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #23 on: May 20, 2014, 01:15:27 PM »
Curious how every time you post about NGUI's grossed sales, which have not been mentioned anywhere, the number seems to grow.

Wallabie, this will be your one and only warning.

Your posts contribute nothing to the community. They only demand things that you deem necessary. It's amusing how you keep quoting some high number, and yet also seem to think that your opinion, your desires, and your issues are the only ones that I have to address. You behave like you paid me a million dollars and now own me, and everyone else's needs and desires simply don't exist.

NGUI's support is a privilege given freely -- at no cost to devs. You aren't paying me for support, are you? The source code provided in NGUI more than makes up for $95 spent. And if it doesn't -- no big deal. There are other UI solutions that you are well aware of and keep mentioning in every post you make. What I don't understand is why you are still here. If XYZ is better, why not use XYZ? Go use it, and don't let someone like me hold you back.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #24 on: May 20, 2014, 04:21:19 PM »
Customers vote with their wallets. If they feel the support (or whatever else) isn't good enough, they won't buy.

Anyway, I just enabled the UIGrid in the exact unitypackage you posted below and manually placed the elements in the grid at 0,0,0. Clicking the "fold open" on the button with those elements in repositioned them just fine. I think that should solve the latest problem, but you might be inserting your elements in a different timing, like say when you open the nested scroll, which would potentially cause a 1 frame delay.

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #25 on: May 20, 2014, 10:38:29 PM »
@ArenMook,

You are correct, You do not Owe anyone anything and I never said I Own you.  It's not about Ownership.  It's about business.

You make a product which has certain Claims...  Mobile support.  Well, it's lacking nested scrollviews which currently mobile users Absolutely need.  If you feel that I am the ONLY one who needs this, then ask your user base.  How many people Vote for Nested ScrollViews and have a Working Accordion. 

"Source is Available"
It's quite common practice for most of the GUI packages to have the source code available.  This is great,  people want the source to study how the package works and make custom things should they need it.  However, what good is the source if the code is not working properly.  We bought the package because it's stable and really no one wants to buy something so that they can spend days pulling their hair out wondering why things don't work.  If it's a car, it's called a lemon.

"NGUI's support is a privilege given freely -- at no cost to devs. You aren't paying me for support, are you?"

There is confusion here between "Bug Report" and "Support",  I'm not asking for support. I'm asking that the Bugs be fixed.  This is very different from you giving me support to help me with MY problem.  A bug is NGUI's problem.   In this nested accordion situation, I have been discovering Bugs in your code, and therefore have served the function of  QA.  Instead of you supporting me, I am giving Free QA support.  Finding the bugs, taking time to make a repos and explaining what the problem is.   I don't understand why you do not see this difference.  Also if you want to continue this kind of thinking that only you are giving away Free Support, why not consider the enormous amount of Free QA support you have received from people who have bought this package and have contributed ideas and bug reports to make the product even a better seller for you.  All for Free and you are the one to receive the monetary benefits.  Compare NGUI 2 yeas to where it is now.  These improvements and ideas are not coming out only of your head.  It's a collective set of ideas from your Paying users and even from Unity.  So let's see things in the correct balance.

Why do I mention the gross sales of this package?  Because it's not a lemonade stand, it's a professional business that's generating real revenues and serving 10+ thousand users.  How do you suppose to go on doing everything yourself, there's not enough time in the day or night.

As for NGUI's revenue: It's not rocket science to get the numbers, we know that it's been on the top Grossing List for over 2 years consistently.  From another top grossing asset like Shader Forge chart we can get a good idea of how many copies NGUI would have sold over the past 2 years.  Added the fact that Everyone Needs a GUI whereas not everyone needs a Shader forge.  NGUI to this day is still number 1 on the Top Grossing chart and it will be a number of months to go before Unity Gui comes out.  More time for more sales.

http://forum.unity3d.com/threads/222049-Shader-Forge-A-visual-node-based-shader-editor/page64



« Last Edit: May 21, 2014, 04:43:24 AM by wallabie »

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #26 on: May 20, 2014, 11:08:27 PM »
Also as I mentioned before, why I'm using NGUI is because  mobile performance is still better than any of the other packages.  Daikon is catching quickly but still not yet there.  Like you said before, there are advantages and disadvantages to each package.  Luckily NGUI still has the performance edge, otherwise everyone would be using Daikon.  Where NGUI is lacking is solid support for Nested ScrollViews and more built-in components. 

If you think that my requests have only been for me, then  look back at my previous postings and you will see that my requests have been in the past 3 months have been:

1. Data Bindings
2. Parameterized Events.
3. Nested ScrollViews.
4. More built-in components to match Daikon.

As it turns out, you yourself have added these most of these features and NGUI users have benefited greatly. 
If you've added most of these features then what's the problem?

Problem is that Nested Scrollviews implementation did not go through QA, it was well, half-baked.  It took a number of bugs to get fixed and days to get the thing working.  From your postings, you seem to place a lot of emphasis on your time being very valuable, well, my time to me is also very valuable and I do not want to spend it finding and submitting bug reports.  How would you feel if you were making a project and put in a Daikon Accordion which works in 5 minutes and then try to do the same with NGUI and it takes 5 days.  I had to suffer through this painful experience so that the rest of NGUI users do not have to in the future. 

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #27 on: May 21, 2014, 12:44:14 AM »
@Nicki,

Thanks for getting to the point of the problem. I tested your finding in the app with dynamic data and it works.
Finally, it's working.  Let's go and celebrate.  At least now NGUI now has a working nested Accordion -- fingers crossed until the next bug.   This could be added to the NGUI example scenes.  I'm sure that many people would like to see and use this component.

Edit:  Spoke too soon, it's correctly displaying the items but when scrolling up and down, the inner scrollView items are not being clipped.  I have to first open and close the accordion item then the inner scrollView items gets clipped properly.  Note: The component works perfectly fine when the items have been created before hand, the problem appears when it's dynamically populated.

Here's a link to the video:

https://dl.dropboxusercontent.com/u/48378123/NestedNotClipping.mp4

I don't have time to make another repos at the moment.  Can you do me a favour and do more testing on your end.  I have a feeling that this is not the end of the nested scrollView story.
« Last Edit: May 21, 2014, 05:15:08 AM by wallabie »

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #28 on: May 21, 2014, 05:24:00 AM »
I'll take a look when I get home, it seems like the panels aren't talking together properly.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Example 9 with Horizontal Scrollview jumping when clicked.
« Reply #29 on: May 21, 2014, 12:02:32 PM »
@wallabie: I vaguely remember there being a similar post in the last ~3 days about dynamically instantiated items within nested scroll views not being clipped properly. That was indeed a bug that I've looked into and fixed. Nicki won't see it because he's on the latest Pro version which had it fixed on the 18th.

The fix was to delete the UIPanel.OnEnable function then change ParentHasChanged and OnInit functions to these:
  1.         /// <summary>
  2.         /// Find the parent panel, if we have one.
  3.         /// </summary>
  4.  
  5.         void FindParent ()
  6.         {
  7.                 Transform parent = cachedTransform.parent;
  8.                 mParentPanel = (parent != null) ? NGUITools.FindInParents<UIPanel>(parent.gameObject) : null;
  9.         }
  10.  
  11.         /// <summary>
  12.         /// Find the parent panel, if we have one.
  13.         /// </summary>
  14.  
  15.         public override void ParentHasChanged ()
  16.         {
  17.                 base.ParentHasChanged();
  18.                 FindParent();
  19.         }
  20.  
  21.         /// <summary>
  22.         /// Mark all widgets as having been changed so the draw calls get re-created.
  23.         /// </summary>
  24.  
  25.         protected override void OnInit ()
  26.         {
  27.                 base.OnInit();
  28.  
  29.                 // Apparently having a rigidbody helps
  30.                 if (rigidbody == null)
  31.                 {
  32.                         Rigidbody rb = gameObject.AddComponent<Rigidbody>();
  33.                         rb.isKinematic = true;
  34.                         rb.useGravity = false;
  35.                 }
  36.  
  37.                 FindParent();
  38.                 mRebuild = true;
  39.                 mAlphaFrameID = -1;
  40.                 mMatrixFrame = -1;
  41.  
  42.                 list.Add(this);
  43.                 list.Sort(CompareFunc);
  44.         }