Android Question Library With Support For Designer Created Custom View

Discussion in 'Android Questions' started by RandomCoder, Jun 15, 2015.

  1. RandomCoder

    RandomCoder Well-Known Member Licensed User

    I'll reword the title if you can suggest a better one!

    I've just created my first ever Library from a Class I wrote, and I'm struggling to get my head around how the base view is supposed to be controlled.

    My Class has one base Panel onto which I load all the other views and then I can control its visibility. This base Panel can be initialised directly onto an Activity or onto another panel if called by code and I have no problems with this.
    BUT, if I create the view in the designer, I am able to set the visibility to False within the designer and my views never get shown because my base panel is added to the designers panel and I'm controlling the visibility of my base panel not that of the designers panel.
    I've worked around this by reading the visibility setting of the designer panel to set my own base panel to match after which I force the designer panel to be visible regardless of how it was set and for the background color to be transparent. Is this just a dirty fudge to get around the problem?
    I'm not sure how to fix it properly as want it to be possible to load my base panel onto either a panel or directly onto an activity if required by the end user.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    It is a good solution. If you don't need the designer base panel then remove it and add your panel instead.
     
    RandomCoder likes this.
Loading...