1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question [solved] CustomView Properties: min/max range reading

Discussion in 'Android Questions' started by udg, May 14, 2019.

  1. udg

    udg Expert Licensed User

    Hi all,
    is there a way to read from code the values for MinRange and MaxRange optional values for a Designer property of type int?
    Or are they used just for limiting the available settings while in the Designer?

    TIA
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    It is not possible. They are only available in the designer.
     
  3. udg

    udg Expert Licensed User

    Thank you, Erel.
    Could it be a subject for a wish or you can anticipate that it will be too complicated to achieve due to the way the Designer is currently made?
    I'm thinking about an additional PropsOptions(Key) returning a map (so to accomodate multiple values and types).
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    It doesn't really fit in the current model where each item has a single value. I also don't see a strong use case here. You are the one who is setting the ranges so it should be simple to set the same values in the custom view code.
     
  5. udg

    udg Expert Licensed User

    The need arises from a CustomView (a wheel selector) where I'd like to construct the list of values based on what the programmer sets as Min/Max (or List) when adding the component in the Designer.
    Anyway, no problem. I already use a "custom" setup for lists passed by code.
    My request was just for some kind of convenience and clearer code. Thanks again.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    MinRange and MaxRange are not user configurable. They are set in the custom view code. I don't see how they can help you here.

    Sounds like you need to add two properties for these values.
     
  7. udg

    udg Expert Licensed User

    You're right.
    I didn't recall that those values aren't visible in the Designer itself.
    Adding two props is one way to solve the problem, but it won't help in case of a list of values (like weekdays, months..).
    For my needs I use a SetList or equivalent public sub to be called as part of the initialization, so no problem.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice