Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-28406

ListView on a modal with a transparent background is invisible

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 9.3.0
    • Fix Version/s: Release 10.0.0
    • Component/s: Android
    • Environment:

      Android 10. SDK 9.3.0+

    • Story Points:
      8
    • Sprint:
      2021 Sprint 7

      Description

      Hi all, i found a bug on Android when insert a ListView on a window modal with a transparent background.
      If i use SDK 9.2.1- it works fine, but using 9.3.0+ ListView disappears from the modal.

      XML:

      <Alloy>
        <Collection src="defaultRow" id="defaultRow" instance="true" />
        <Window id="win" onClick="exit">
          <View id="container">
            <View id="vSearch" top="5" bubbleParent="false">
              <TextField id="txtSearch" onChange="search"></TextField>
            </View>
       
            <ListView id="list" defaultItemTemplate="defaultItem" separatorColor="transparent" onItemclick="lvClick" top="5" disableBounce="true" backgroundColor="#b3b3b3" bubbleParent="false">
              <SearchBar id="searchBar"/>
              <Templates>
                <ItemTemplate name="defaultItem" backgroundColor="transparent">
                  <View width="Ti.UI.FILL" heighth="Ti.UI.SIZE" backgroundColor="white" bottom="1">
                    <Label bindId="texto" class="lblItem"></Label>
                  </View>
                </ItemTemplate>
              </Templates>
       
              <ListSection dataCollection="$.defaultRow">
                <ListItem
                  texto:text="{texto}"
                  searchableText="{texto}"
       
                  cod="{id}"
                  desc="{descricao}"
                  sigla="{sigla}"
                  />
              </ListSection>
            </ListView>
          </View>
       
        </Window>
      </Alloy>
      

      TSS:

       
      '#win': {
        height: Ti.UI.FILL,
        width: Ti.UI.FILL,
        backgroundColor: "#80000000",
      }
       
      "#win[platform=android]": {
        activityExitTransition: Ti.UI.Android.TRANSITION_FADE_OUT,
        theme: "Theme.Modal",
        modal: true,
        navBarHidden: true
      }
       
      '#list': {
        width: Ti.UI.FILL,
        height: Ti.UI.FILL,
        /* backgroundColor: "#F2F2F2", */
        borderRadius: 6,
        accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_NONE,
        opacity: 1
      }
       
      '#container': {
        width: "90%",
        height: "70%",
        layout: 'vertical',
        backgroundColor: "white",
        borderRadius: 8
      }
       
      '#imgSearch': {
        right: 5,
        top: 5,
        bottom: 5,
        width: Ti.UI.SIZE,
        height: Ti.UI.SIZE
      }
       
      '#vSearch': {
        height: 40,
        width: Ti.UI.FILL,
        left: 5,
        right: 5,
        borderWidth: 1,
        borderRadius: 10,
        borderColor: "gray"
      }
       
      '#txtSearch': {
        font: {
          fontSize: 14,
          fontWeight: "normal"
        },
        color: "black",
        hintText: "Pesquisar...",
        width: Ti.UI.FILL,
        right: 40,
        left: 5,
        backgroundColor: "transparent"
      }
       
      '#searchBar': {
        height: 0,
        width: 0,
        hiddenBehavior: Ti.UI.HIDDEN_BEHAVIOR_GONE,
        visible: false
      }
       
      '.lblItem': {
        font: {
          fontSize: 15,
          fontWeight: "normal"
        },
        color: "black",
        textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,
        left: 10,
        right: 5,
        width: Ti.UI.SIZE,
        height: Ti.UI.SIZE,
        top: 7,
        bottom: 7
      }
      

      JS:

      var args = $.args;
       
      $.defaultRow.add(
        [
          {
            "id": 888,
            "texto": "ADMINISTRADOR"
          },
          {
            "id": 555,
            "texto": "ADVOGADO"
          },
          {
            "id": 111,
            "texto": "ADVOGADO"
          },
          {
            "id": 222,
            "texto": "AGENCIADOR DE PROPAGANDA"
          },
          {
            "id": 333,
            "texto": "AGENTE ADMINISTRATIVO"
          }
        ]
      )
       
      $.win.addEventListener("postlayout", poslay);
       
      function poslay(e) {
        $.txtSearch.focus();
        $.win.removeEventListener("postlayout", poslay);
      }
       
      function lvClick(e){
        var item = e.section.getItemAt(e.itemIndex);
      }
       
      function search(e){
        $.searchBar.value = $.txtSearch.value;
      }
       
      $.win.addEventListener("androidback", function(e) {
        $.win.close();
      });
       
      function exit(e){
        $.win.close();
      }
      
      

        Attachments

          Activity

            People

            • Assignee:
              gmathews Gary Mathews
              Reporter:
              jordanbisato Jórdan Luiz Bisato
              Reviewer:
              Joshua Quick
              Tester:
              Lokesh Choudhary
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration