Android Question sliding panel sliding proble for cosyumlistview

Discussion in 'Android Questions' started by Tayfur, Jun 29, 2015.

  1. Tayfur

    Tayfur Well-Known Member Licensed User

    Hello ;

    I used your sliding panels. it is very good.
    I added in tabs "control list view". so, it is not sliding with tabs.

    1.steps: run app
    2.steps : sliding with tabs cheked . its runnig
    3.steps: click button "create list" on Panel2
    4.steps: sliding with tabs cheked, so list is not move.

    our full sample code is attachemnt.
    where is the problem.


    Note : ı used costum list view links
    http://www.b4x.com/android/forum/th...ew-a-flexible-list-based-on-scrollview.19567/

    i used acrtionbar sliding links:
    http://www.b4x.com/android/forum/threads/actionbar-sliding-pages-tutorial.36865/#post-350067

    full sample project
    You can download it from address: http://s000.tinyupload.com/?file_id=04389155563947391584


    screenshots:

    Screenshot_2015-06-29-10-03-43.png Screenshot_2015-06-29-10-05-56.png

    '*************libraries****************
    ' contetn resolver
    ' CORe
    ' SQL
    ' stdActionbar
    ' stringutils
    '*************libraries****************


    Code:
    Sub Activity_Create(FirstTime As Boolean)
        
    If FirstTime Then
        
    'sh.Initialize
        cu.Initialize
        
    End If

        
    Dim height As Int = CalculateHeight(TrueTrue)
        vp.Initialize(
    "vp"3100%x, height)
        
    Activity.AddView(vp.AsView, 00100%x, height)
        
    'load the pages layouts
        vp.Panels(0).LoadLayout("0")
        vp.Panels(
    1).LoadLayout("1")
        vp.Panels(
    2).LoadLayout("2")
        bar.Initialize(
    "bar")
        
    'bar.Icon = LoadBitmap(File.DirAssets, "giris.png")
        bar.NavigationMode = bar.NAVIGATION_MODE_TABS
        bar.AddTab(
    "panel 0")
        bar.AddTab(
    "panel 1")
        bar.AddTab(
    "panel 2")
        bar.ShowUpIndicator = 
    False' True
        bar.SelectedIndex = currentPage
        
    Activity.Title = "bu ana baslik"
        bar.Subtitle = 
    "alt balikta bu"

        
    Activity.AddMenuItem3("""mnuEdit"LoadBitmap(File.DirAssets, "ic_action_edit.png"), True)
        
    Activity.AddMenuItem3("""mnuNew"LoadBitmap(File.DirAssets, "ic_action_new.png"), True)
        
    Activity.AddMenuItem3("""mnuUndo"LoadBitmap(File.DirAssets, "ic_action_undo.png"), True)
        
    Activity.AddMenuItem3("Home""ActionHome"LoadBitmap(File.DirAssets, "ic_action_undo.png"), True)
        
    Activity.AddMenuItem3("Search""ActionSearch"LoadBitmap(File.DirAssets, "ic_action_undo.png"), True)
    End Sub


    ...

    Code:
    Sub Button1_Click
    ' cretae phobne list
        Rehber_yukleme
    End Sub


    Sub Rehber_yukleme

        
    '********************* SMS GÖNDERME VE ARAMA *****************************************
        'Dim xcall As PhoneCalls
        'Dim xsms As PhoneSms
        'xsms.Send("+905335135121","2 sistemm çalıstı")
        'Dim  sonuc As PhoneEvents
        'sonuc.Initialize("PE")


        
    'StartActivity( xcall.Call("02127711379"))
        '********************* SMS GÖNDERME VE ARAMA *****************************************
        'clv3.Initialize(Me, "clv3")
        clv3.Initialize(Me,"clv3")
        
    'clv3.Initialize(Panel_rehber,"clv3")
        'clv3.Initialize(vp.Panels(1),"clv3")
        Activity.AddView(clv3.AsView,0,Button1.Height , 100%x*0.90,100%y-Button1.Height-10)
        
    Dim reh_list As List
        reh_list.Initialize
        reh_list.Clear
        
    Dim adet As Int=cu.FindAllContacts(True).Size
        
    DoEvents
        
    Log (cu.FindAllContacts(True).Size)
        
    DoEvents
        
    Dim i As Int=0
        
    For Each c As cuContact In cu.FindAllContacts(True)
            reh_list.Clear
            
    For Each phone As cuPhone In cu.GetPhones(c.Id)
            
    'sb.Append(phone.Number & ", " & phone.PhoneType).Append(CRLF)
            reh_list.Add(phone.Number)
            
    Next
            i=i+
    1
            
    'clv3.Add(CreateListItem2( Rehber(i).isim, clv3.AsView.Width, 38dip,Rehber(i).telefon,i), 38dip, Rehber(i).id )
            DoEvents
            clv3.Add(CreateListItem2( c.DisplayName, clv3.AsView.Width, 
    38dip, reh_list,i ), 38dip, c.Id)
            
    'clv3.Add(CreateListItem2( Rehber(i).isim, clv3.AsView.Width, 38dip,Rehber(i).telefon,i), 38dip, Rehber(i).id )
        Next

    End Sub


    Sub CreateListItem2(Text As String, Width As Int, Height As Int, phonelist As List, index As Int) As Panel
        
    Dim p As Panel
        p.Initialize(
    "")
        p.Color = 
    Colors.Black
        
    Dim b As Button
        b.Initialize(
    "button"'all buttons click events will be handled with Sub Button_Click
        Dim chk As CheckBox
        chk.Initialize(
    "chk")
        
    Dim lbl As Label
        lbl.Initialize(
    "etiket")

        
    Dim spn As Spinner
        
    Dim spn2 As Spinner
        spn.Initialize(
    "spn")
        spn2.Initialize(
    "spn2")
        spn.AddAll(phonelist)
        spn2.AddAll(
    Array As String("< YOK >","bey","hanım"))
        lbl.Gravity = 
    Bit.Or(Gravity.CENTER_VERTICAL, Gravity.LEFT)
        lbl.Text = Text
        lbl.TextSize = 
    16
        lbl.TextColor = 
    Colors.White
        b.Text = 
    "Click"
        chk.Tag=index
        spn2.Tag=index
        spn.Tag=index

        p.AddView(chk, 
    5dip2dip50dip, Height - 4dip'view #0
        p.AddView(lbl, 55dip2dip165dip, Height - 4dip'view #1
        p.AddView(spn, 220dip2dip170dip, Height - 4dip'view #2
        p.AddView(spn2, 390dip2dip150dip, Height - 4dip'view #3
        Return p
    end sub
     
  2. eurojam

    eurojam Well-Known Member Licensed User

    Merhaba Tayfur,

    I only took a short look to your project. The problem that your costumlistview is not sliding belongs to your sub Rehber yükleme where you load the listview:
    Code:
    Activity.AddView(clv3.AsView,0,Button1.Height , 100%x*0.90,100%y-Button1.Height-10)
    this means that you add the listview to the Activity and not to the Tab. this should be something like:
    Code:
    vp.Panels(1).AddView(clv3.AsView,0,Button1.Height , 100%x*0.90,100%y-Button1.Height-70)
    if you want to add it to the second panel...

    İyi Şanslar
    stefan
     
    Tayfur and LucaMs like this.
  3. Tayfur

    Tayfur Well-Known Member Licensed User

    thank you stefan it work;
    ( I worked it with diffrenet way last night. So your way is simple )
     
    Last edited: Jun 30, 2015
  4. Tayfur

    Tayfur Well-Known Member Licensed User


    Stefan, Vielen Dank für Ihre Informationen
     
    eurojam likes this.
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