Search Unity

New UI Widgets

Discussion in 'Assets and Asset Store' started by ilih, Feb 11, 2015.

  1. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    The difference in speed is done intentionally.
    You should change gameobjects order in a hierarchy: the Header should be last.
    upload_2021-5-12_21-55-5.png

    But if you need the same speed then
    • delete ListView.ScrollRectHeader component
    • make Header gameobject as the first child of ListView.Container. upload_2021-5-12_21-58-46.png
    Add following code to the
    SetData()
    method of GroupedTileViewComponent.cs
    Code (CSharp):
    1.             // disable empty group
    2.             gameObject.SetActive(!(Item.IsEmpty && Item.IsGroup));
    3.  
    4.             // stretch group item
    5.             var width = Item.IsGroup
    6.                 ? (Layout.transform as RectTransform).rect.width - Layout.MarginFullHorizontal
    7.                 : 80f;
    8.             RectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, width);
     
    jGate99 likes this.
  2. Gladyon

    Gladyon

    Joined:
    Sep 10, 2015
    Posts:
    334
    Hi,

    I have some problems with the auto-complete feature.
    I need to be able to choose a string item using auto-complete, or to choose one which isn't in the list, and with a button to display/hide the list of existing texts.

    In fact, it is a mix of your 'Autocomplete' and your 'ComboboxIcons + Autocomplete' examples.

    Here are my problems:
    - when I click on the button to display/hide the list it can only display it, not hide it
    - in some situation the listview displaying the possibilities will stay open even if you click on any button of the UI
    - I haven't been able to make the fading option work as the standard combobox to display/hide smoothly the listview (but maybe your widgets do not having a fading option, so it may be normal)

    When I click on the button to display/hide the list, it calls the 'ShowAllOptions()' method, so it won't hide the list when it is already displayed (in fact it is hidden because of the 'onDeselect' event, and then re-opened because of the call to 'ShowAllOptions()').

    When there's only a few possibilities, the listview doesn't resize (as the standard ComboBox does), so there's empty room at the bottom, if you click on that empty room, you will deselect the input field without calling the 'onDeselect' event which closes the listview.
    You can see the problem by tyiping 'af' in order to display only 'Afghanistan', then you click on the empty part of the listview, then you click on the 'Combobox' button in the 'Collections' sections.
    You'll see that the listview is still displayed.
     
  3. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Hi @ilih
    I want to make a vertical list view with max height limit. For example if each item is 100pixel, and there is only 1 item then listview height will be 100 px.
    But if it has 10 items, list view will be 100 pixels

    BUT if it has 15 items, then max height will triggered and height remains 1000px and scrollbars appear.

    Please advise
     
  4. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    In v14.0 was added AutoCombobox, it was exactly the mix of Autocomplete and ComboboxIcons + Autocomplete.
    Currently, it does not have all mentioned features, I'll add them later and release a new beta verison.

    You can use the
    ListViewAutoResize
    component, to make the scrollbar appear and hide you need to change ScrollRect Scrollbar visibility to
    Auto Hide
    or
    Auto Hide and Expand Viewport
     
  5. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    Added AutoComboboxString in v1.14.2b6, please check it.
    All features should be available except
    • fading option is not available
    • ListView resize can be done with
      ListViewAutoResize
      component
     
    Gladyon and jGate99 like this.
  6. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Hi @ilih

    I'm using ListViewAutoResize (but i havnt yet updated to latest beta)

    I'm getting some errors on my own list view which appear inside scrollviews or a list inside listview cases:

    Please advise

    Code (CSharp):
    1. InvalidOperationException: Collection was modified; enumeration operation may not execute.
    2. System.ThrowHelper.ThrowInvalidOperationException (System.ExceptionResource resource) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    3. System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () (at <695d1cc93cca45069c528c15c9fdd749>:0)
    4. System.Collections.Generic.List`1+Enumerator[T].MoveNext () (at <695d1cc93cca45069c528c15c9fdd749>:0)
    5. EasyLayoutNS.EasyLayoutBaseType.SetSizes () (at Assets/New UI Widgets/Scripts/EasyLayout/EasyLayoutBaseType.cs:146)
    6. EasyLayoutNS.EasyLayoutBaseType.PerformLayout (System.Collections.Generic.List`1[T] elements, System.Boolean setPositions) (at Assets/New UI Widgets/Scripts/EasyLayout/EasyLayoutBaseType.cs:62)
    7. EasyLayoutNS.EasyLayout.PerformLayout (System.Boolean setPositions) (at Assets/New UI Widgets/Scripts/EasyLayout/EasyLayout.cs:1345)
    8. EasyLayoutNS.EasyLayout.CalculateLayoutSize () (at Assets/New UI Widgets/Scripts/EasyLayout/EasyLayout.cs:1138)
    9. EasyLayoutNS.EasyLayout.CalculateLayoutInputVertical () (at Assets/New UI Widgets/Scripts/EasyLayout/EasyLayout.cs:1120)
    10. UnityEngine.UI.LayoutRebuilder+<>c.<Rebuild>b__12_2 (UnityEngine.Component e) (at D:/Program Files/2020.3.7f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Layout/LayoutRebuilder.cs:86)
    11. UnityEngine.UI.LayoutRebuilder.PerformLayoutCalculation (UnityEngine.RectTransform rect, UnityEngine.Events.UnityAction`1[T0] action) (at D:/Program Files/2020.3.7f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Layout/LayoutRebuilder.cs:159)
    12. UnityEngine.UI.LayoutRebuilder.Rebuild (UnityEngine.UI.CanvasUpdate executing) (at D:/Program Files/2020.3.7f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Layout/LayoutRebuilder.cs:86)
    13. UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate (UnityEngine.RectTransform layoutRoot) (at D:/Program Files/2020.3.7f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Layout/LayoutRebuilder.cs:71)
    14. UIWidgets.ListViewBase+ListViewComponentPool`2[TComponent,TItem].DisplayedIndicesUpdate (System.Collections.Generic.List`1[T] newIndices, System.Action`1[T] action) (at Assets/New UI Widgets/Scripts/ListView/ListViewComponentPool.cs:362)
    15. UIWidgets.ListViewCustom`2[TComponent,TItem].SetDisplayedIndices (System.Boolean isNewData) (at Assets/New UI Widgets/Scripts/ListView/ListViewCustom.cs:1298)
    16. UIWidgets.ListViewCustom`2+ListViewTypeBase[TComponent,TItem].UpdateView () (at Assets/New UI Widgets/Scripts/ListView/ListViewType/ListViewTypeBase.cs:241)
    17. UIWidgets.ListViewCustom`2+ListViewTypeRectangle[TComponent,TItem].OnScroll (UnityEngine.Vector2 unused) (at Assets/New UI Widgets/Scripts/ListView/ListViewType/ListViewTypeRectangle.cs:126)
    18. UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) (at <c7864a0eaeb24b2a999fb177623d54b4>:0)
    19. UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <c7864a0eaeb24b2a999fb177623d54b4>:0)
    20. UnityEngine.UI.ScrollRect.LateUpdate () (at D:/Program Files/2020.3.7f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/ScrollRect.cs:863)
    21.  

    Another error

    Code (CSharp):
    1. InvalidOperationException: Collection was modified; enumeration operation may not execute.
    2. System.ThrowHelper.ThrowInvalidOperationException (System.ExceptionResource resource) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    3. System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () (at <695d1cc93cca45069c528c15c9fdd749>:0)
    4. System.Collections.Generic.List`1+Enumerator[T].MoveNext () (at <695d1cc93cca45069c528c15c9fdd749>:0)
    5. EasyLayoutNS.EasyLayoutBaseType.SetSizes () (at Assets/New UI Widgets/Scripts/EasyLayout/EasyLayoutBaseType.cs:146)
    6. EasyLayoutNS.EasyLayoutBaseType.PerformLayout (System.Collections.Generic.List`1[T] elements, System.Boolean setPositions) (at Assets/New UI Widgets/Scripts/EasyLayout/EasyLayoutBaseType.cs:62)
    7. EasyLayoutNS.EasyLayout.PerformLayout (System.Boolean setPositions) (at Assets/New UI Widgets/Scripts/EasyLayout/EasyLayout.cs:1345)
    8. EasyLayoutNS.EasyLayout.CalculateLayoutSize () (at Assets/New UI Widgets/Scripts/EasyLayout/EasyLayout.cs:1138)
    9. EasyLayoutNS.EasyLayout.CalculateLayoutInputHorizontal () (at Assets/New UI Widgets/Scripts/EasyLayout/EasyLayout.cs:1112)
    10. UnityEngine.UI.LayoutRebuilder+<>c.<Rebuild>b__12_0 (UnityEngine.Component e) (at D:/Program Files/2020.3.7f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Layout/LayoutRebuilder.cs:84)
    11. UnityEngine.UI.LayoutRebuilder.PerformLayoutCalculation (UnityEngine.RectTransform rect, UnityEngine.Events.UnityAction`1[T0] action) (at D:/Program Files/2020.3.7f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Layout/LayoutRebuilder.cs:159)
    12. UnityEngine.UI.LayoutRebuilder.Rebuild (UnityEngine.UI.CanvasUpdate executing) (at D:/Program Files/2020.3.7f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Layout/LayoutRebuilder.cs:84)
    13. UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate (UnityEngine.RectTransform layoutRoot) (at D:/Program Files/2020.3.7f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Layout/LayoutRebuilder.cs:71)
    14. UIWidgets.ListViewBase+ListViewComponentPool`2[TComponent,TItem].DisplayedIndicesSet (System.Collections.Generic.List`1[T] newIndices, System.Action`1[T] action) (at Assets/New UI Widgets/Scripts/ListView/ListViewComponentPool.cs:210)
    15. UIWidgets.ListViewCustom`2[TComponent,TItem].SetDisplayedIndices (System.Boolean isNewData) (at Assets/New UI Widgets/Scripts/ListView/ListViewCustom.cs:1294)
    16. UIWidgets.ListViewCustom`2[TComponent,TItem].UpdateView () (at Assets/New UI Widgets/Scripts/ListView/ListViewCustom.cs:1343)
    17. UIWidgets.ListViewCustom`2[TComponent,TItem].Resize () (at Assets/New UI Widgets/Scripts/ListView/ListViewCustom.cs:747)
    18. UIWidgets.ListViewCustom`2[TComponent,TItem].OnEnable () (at Assets/New UI Widgets/Scripts/ListView/ListViewCustom.cs:1823)
    19. UnityEngine.GameObject:SetActive(Boolean)
    20. UIWidgets.ListViewTypeSize:CalculateItemsSizes(ObservableList`1, Boolean) (at Assets/New UI Widgets/Scripts/ListView/ListViewType/ListViewTypeSize.cs:302)
    21. UIWidgets.ListViewTypeSize:CalculateMaxVisibleItems() (at Assets/New UI Widgets/Scripts/ListView/ListViewType/ListViewTypeSize.cs:39)
    22. UIWidgets.ListViewCustom`2:CalculateMaxVisibleItems() (at Assets/New UI Widgets/Scripts/ListView/ListViewCustom.cs:729)
    23. UIWidgets.ListViewCustom`2:SetNewItems(ObservableList`1, Boolean) (at Assets/New UI Widgets/Scripts/ListView/ListViewCustom.cs:1386)
    24. UIWidgets.ListViewCustom`2:set_DataSource(ObservableList`1) (at Assets/New UI Widgets/Scripts/ListView/ListViewCustom.cs:105)
     
  7. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    It should be already fixed in beta.
    Fix:
    Scripts\ListView\ListViewType\ListViewTypeSize.cs,
    UpdateItemSize()
    method
    replaced old lines:
    Code (CSharp):
    1.                 if (CalculateMaxVisibleItems(Owner.DataSource) > MaxVisibleItems)
    2.                 {
    3.                     Owner.SetNeedResize();
    4.                 }
    5.                 else
    6.                 {
    7.                     UpdateView();
    8.                 }
    with new line:
    Code (CSharp):
    1. Owner.SetNeedResize();
     
    jGate99 likes this.
  8. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Im gonna install latest beta then.
     
  9. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Hi @ilih

    I have installed latest beta, and ListViewAutoResize works fine if there are 4-5 items, however if there is single item then i'm seeing this blinking effect where item appear , disappear, appear, disapper
    Please advise
    https://we.tl/t-U8sa2S0tEV
     
  10. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    What ListView.ListType is used?
    Is ListView under any LayoutGroup control or some other component that also changes size?
    The problem only with this ListView or happens with ListViewIcons and any other also?
     
    jGate99 likes this.
  11. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    It is inside a vertical layout group with contentsize fitter prefered for height.

    This is only happens in my nested layouts situation
     
  12. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    You need to add the LayoutElement component to the ListView.
    ListViewAutoResize will set LayoutElement values, so should no problem with LayoutGroup height control.
    Maybe you will be also need to set LayoutElement.flexibleHeight = 0.
     
    jGate99 likes this.
  13. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    This didnt solve the probelm, even with min height set to 50.

    Parent List View
    ==== Default Item (Easy Layout) > Vertical Layout > Vertical

    ============Child List View
    ============ Default Item (Easy Layout) > Vertical Layout > Vertical (this item gets hidden, appear, hidden appear)
     
  14. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    Please make sure you disabled VerticalLayoutGroup.ChildForceExpand Height.
    If it does not help then try to update to v1.14.2b7.

    If the problem still not solved then please send me a scene with this bug, I cannot reproduce it.
     
    jGate99 likes this.
  15. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,581
    I tried running the Text Mesh Pro converter on the sample scenes and most of the text vanishes. any way to fix that?

    upload_2021-5-18_12-4-8.png
     
  16. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    • try to disable and enable back Canvas gameobject, sometimes scene view does not properly updated
    • also, the problem may be with missing font or font size if the font size is larger than the RectTransform size then the text will not be displayed (not cut as can be expected)
     
    Last edited: May 18, 2021
  17. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,581
    Yes Text Mesh Pro is enabled
    upload_2021-5-18_12-30-6.png

    Font is just set to the defaults, this is all being tested in a clean project using URP
    upload_2021-5-18_12-31-42.png
    upload_2021-5-18_12-32-56.png
     
  18. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,581
    Ok the issue seems to be that the non Text Mesh Pro version had Overflow all set to Truncate and for whatever reason when it's convert the text all gets much bigger and is too big for the current box sizes and so is hidden,
    Maybe the convert tool needs options to change that to Overflow or reduce the font size by some percentage?

    The other fix seems to be to toggle on Auto size
     
  19. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    What Unity version and TextMeshPro package are you use? I just now tested again with 2020.3.0f1 and 2021.1.0f1 and cannot reproduce the problem.
    Also, please check if font sizes are the same for the original Text component and TextMeshPro component after conversion.
     
  20. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Still happening, ill prepare a seperate reproduce able scene
     
  21. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,581
    Unity version is 2020.3.0f1 , New UI Widgets is 1.14.1 and Text Mesh Pro is 3.0.6

    Looks like the original Text size is set to 14 but once converted it became 36

    upload_2021-5-18_14-18-52.png

    upload_2021-5-18_14-20-27.png
     
  22. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,581
    Ok I've found the issue.
    Because I was testing this from a fresh[project it didn't have Text Mesh Pro assets already added, even though it was installed it hadn't been used.
    So if that part of the process hasn't been done first then it fails.
     
  23. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    OK.
    I'll try to add a check when the converter started to ensure Text Mesh Pro assets added and display a warning if not.
     
  24. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Hi @ilih
    So i finally understand the issue.

    Reason is, I built a generic list view component which when item is set , based on item , request data from server and then creates its children.

    So when this function gets called on your side, this process happens again, a new default item is created data is reset and its stay in that loop

    I dont know how should i solve this , only solution for now is to not use autolistviewheight for now.

    im mentioning it in case you have some better idea.

    upload_2021-5-20_16-41-30.png
     
  25. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    You should cache the server response.
    Add field to the item class to save server response and check it in SetData().
    Something like this:
    Code (CSharp):
    1.         public void SetData(YourItem item)
    2.         {
    3.             Item = item;
    4.  
    5.             if (Item.ServerResponse != null) // if data from served already loaded
    6.             {
    7.                 UpdateView(); // display data
    8.             }
    9.             else // data not loaded
    10.             {
    11.                 StartCoroutine(ServerRequest()); // request data from server
    12.             }
    13.         }
    14.  
    15.         System.Collections.IEnumerator ServerRequest()
    16.         {
    17.             using (var request = UnityWebRequest.Get(Item.Url))
    18.             {
    19.                 yield return request.SendWebRequest();
    20.  
    21.                 Item.ServerResponse = ...; // save data
    22.                 UpdateView(); // display data
    23.             }
    24.         }
    25.  
    26.         void UpdateView()
    27.         {
    28.             // ...
    29.         }
     
    jGate99 likes this.
  26. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Hi @ilih,

    I'm using Dialog with Custom Content, however i dont want to show any buttons of the dialog (optional, some cases ill have some cases i wont have them at all ) because custom content itself will have buttons.

    How should i achieve that?
    Please advise
     
  27. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    You can use an empty array or do not specify buttons at all:
    Code (CSharp):
    1. DialogTemplate.Clone().Show(
    2.    title: "Dialog without Buttons",
    3.    buttons: new DialogButton[] { }
    4. );
    5.  
    Code (CSharp):
    1. DialogTemplate.Clone().Show(
    2.    title: "Dialog without Buttons"
    3. );
    4.  
     
    jGate99 likes this.
  28. gkfls2206_unity

    gkfls2206_unity

    Joined:
    Aug 19, 2020
    Posts:
    5
    Doesn't Tree View support multiline?
     
  29. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    It is supported.

    You need to change some settings:
    • TreeView.DefaultItem.Text: enable vertical overflow
    • TreeView.DefaultItem.EasyLayout: change ChildrenHeight to SetPreferred
    • TreeView.Container.EasyLayout: change ChildrenHeight to SetPreferred
    • Change TreeView.ListType with script:
      TreeView.ListType = ListViewType.ListViewWithVariableSize;
     
  30. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    Added in v1.14.2b12

    Also added in v1.14.2b12
     
    jGate99 likes this.
  31. KBSMediaDevTeam

    KBSMediaDevTeam

    Joined:
    Jun 15, 2020
    Posts:
    2
    Hi. @ilih

    I was making timelineview based trackview in the asset samples, but I am in stuggle to limit scrolling view if first element is specific value(ex. min value)

    Is there way to do this?

    Thanks.
     
  32. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
  33. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    Added "AllowIncrease" and "AllowDecrease" fields to the ScrollBlock in v1.14.2b14.

    You need to update to that version and specify
    AllowDecrease
    to limit scroll by min value and override
    Position2Point(float position)
    to limit start position on item drag at class derived from
    TracksViewCustom
    .

    Example:
    Code (CSharp):
    1.         // ScheduleView.cs
    2.         protected override void EnablePointsView(ScrollBlock pointsView)
    3.         {
    4.             base.EnablePointsView(pointsView);
    5.  
    6.             if (pointsView != null)
    7.             {
    8.                 pointsView.AllowDecrease = AllowDecrease;
    9.             }
    10.         }
    11.  
    12.         bool AllowDecrease()
    13.         {
    14.             var first_column_value = ChangeValue(-PointsNamesView.Count / 2);
    15.             var min = new DateTime(2021, 06, 01);
    16.             return first_column_value.Date >= min;
    17.         }
    18.  
    19.         public override DateTime Position2Point(float position)
    20.         {
    21.             var min = new DateTime(2021, 06, 01);
    22.             var dt = base.Position2Point(position);
    23.             if (dt < min)
    24.             {
    25.                 dt = min;
    26.             }
    27.  
    28.             return dt;
    29.         }
     
  34. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Hi @ilih
    I'm having a weird behavior with Switch inside a nested prefab, where it keep changing its switch animamtion state when i select it in editor.
    Now i explicitly set isOn for all, however when i run it then its selected isOn but its animation is in Off state
    Can you please check it?
     
  35. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    Is Group specified for the Switch? Only one Switch in Group can have IsOn enabled.

    upload_2021-6-12_10-43-53.png
     
    jGate99 likes this.
  36. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Group is null, as each item is individual
    Problem is Switch isOn is turned on but when i run state is off
     
  37. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    Please try to add this code to the Switch.cs
    Code (CSharp):
    1.         protected override void OnRectTransformDimensionsChange()
    2.         {
    3.             base.OnRectTransformDimensionsChange();
    4.  
    5.             if (!IsActive())
    6.             {
    7.                 return;
    8.             }
    9.  
    10.             SetMarkPosition(false);
    11.             SetBackgroundColor();
    12.             SetMarkColor();
    13.         }
    14.  
    15.         protected override void OnEnable()
    16.         {
    17.             base.OnEnable();
    18.  
    19.             SetMarkPosition(false);
    20.             SetBackgroundColor();
    21.             SetMarkColor();
    22.         }
    If this does not help then add the following line to the
    Switch.SetMarkPosition()
    method to check where the state is changed to off.
    Code (CSharp):
    1. Debug.Log(Time.frameCount + " SetMarkPosition: IsOn = " + IsOn + "; animate: " + animate + " // " + name, this);
     
    jGate99 likes this.
  38. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    for now i solved it by setting it false, then true in awake to get final state properly
     
  39. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    Version 1.14.2 released:

    Changelog:
    • added CircularSlider widget
    • added SliderScale widget
    • added TimeAnalog widget
    • Accordion: added OnStartToggleAnimation and OnDataSourceChanged events
    • Accordion: added AccordionHighlight component
    • AutoComplete: added OnItemNotFound and OnCancelInput events
    • AutoCombobox: added AddItems option (requires overridden Input2Item method)
    • CenteredSlider: event OnValuesChange renamed to OnValueChanged
    • Connectors: fixed bug related to “Scale With Screen Size”
    • Connectors: added rectangular lines support
    • Cursor: fixed flickering
    • DatePicker and DateTimePicker: fixed initial date
    • DirectoryTreeView: nested nodes are automatically loaded on node expand from a script
    • DirectoryTreeView: added ExpandPath(), Path2Node(), Path2NearestNode(), RefreshDirectories() methods
    • ListView: fixed highlight coloring on navigation
    • ListView: fixed unstoppable auto-scroll bug
    • ListView Drop Support: added ReceiveOnlyEmptyNode option
    • RangeSlider: event OnValuesChange renamed to OnValuesChanged
    • Resizable: fixed position change
    • ScrollBlock: added AllowIncrease and AllowDecrease fields
    • Spinner: added SetValue() method to change value without OnChangeEvent invocation
    • Styles: fixed error when creating a new style
    • Styles: added PixelsPerUnitMultiplier property to the Image styles
    • TreeGraph: small performance improvement
    • TreeGraph: added LineThickness, LineType, LineMargin options
    • TreeView: added ScrollWithIndent option
    • Widgets Generation: improved localization support


     
    jGate99 and hopeful like this.
  40. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Amazing Release
     
    ilih likes this.
  41. cgrow67

    cgrow67

    Joined:
    May 31, 2016
    Posts:
    27
    I'm still on 1.14.0... I noticed a new issue with the ListView control.
    When a list view has a small amount of content without any scroll bars.
    If you move the scroll wheel it scrolls the view up and down.
    All unto its own this isn't a big deal.
    However, it does create situations when the data you click on is not what the code gets.

    I'll add a picture of what this looks like.



    I think its just a matter of disabling the scroll wheel input.
    If this is fixed already in 1.14.2 let me know please.

    Thank you for any help you may have to offer.
     
    Last edited: Jun 25, 2021
  42. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    If I understand the problem right, this is caused by ScrollRect.MovementType = Elastic.
    Changing MovementType to Clamped should solve it.
     
    hopeful likes this.
  43. cgrow67

    cgrow67

    Joined:
    May 31, 2016
    Posts:
    27
    As always, thank you very much for the assist!
     
  44. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Hi @ilih
    upload_2021-7-6_0-0-48.png

    If you notice combobox list appears behind the canvas, due to my original canvas using nested canvases with different sort orders

    To solve it i'd deally prefer to have a setting where i can set a recttransform which im already using for alerts and custom dialogs and always appear on top of everything

    Please provide this, in combobox we provide arectransform and this is where it draws the modal + list
     
  45. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    OK, I'll add an option to specify parent RectTransform for open combobox
     
    jGate99 likes this.
  46. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Thanks, really appreciate
     
  47. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Hi @ilih,

    I need 2 functions
    1- returns me all the DefaultItems of ListView including inactive Default Items
    upload_2021-7-6_8-11-34.png

    2- which function to override which create these defaultitem copies so i can further set some stuff.

    Please advise
     
  48. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,004
    Added field ParentCanvas in v1.15.0b3, it used as ListView and modal parent when Combobox opened.

    You can use this code to get list of DefaultItem instances:
    Code (CSharp):
    1. var instances = new List<TComponent>();
    2. ListView.ForEachComponent(instances.Add);
    You can override the method
    ComponentCreated(TComponent item)
    , it was added in v1.15.0b3.
    In previous versions, you can override
    AddCallback(ListViewItem item)
    , but it is called more than one time for the created instance.
     
    jGate99 likes this.
  49. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Thank you for your prompt support,
    and thanks for adding ComponentCreated because of its "only once called" like awake nature
     
  50. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,423
    Hi @ilih,

    Few questions regarding most recent update



    upload_2021-7-7_0-38-10.png
    Paginator scrolling animation/feel is not as smooth as this one
    https://github.com/daniellochner/Simple-Scroll-Snap/

    I want to use yours due to virtualization


    =====

    upload_2021-7-7_0-30-37.png

    A ListView Circle Layout where selected item always remains perfectly horizontally aligned just like datetime scroller
     

    Attached Files:

unityunity