﻿B4A=true
Group=Default Group
ModulesStructureVersion=1
Type=Class
Version=12.5
@EndOfDesignText@
#DesignerProperty: Key: BooleanExample, DisplayName: Show Seconds, FieldType: Boolean, DefaultValue: True
#DesignerProperty: Key: TextColor, DisplayName: Text Color, FieldType: Color, DefaultValue: 0xFFFFFFFF, Description: Text color

Sub Class_Globals
	Private mEventName As String 'ignore
	Private mCallBack As Object 'ignore
	Public mBase As B4XView
	Private xui As XUI 'ignore
	Public Tag As Object
	
	Private ListView1 As ListView
	Private DLGResult As String
	
	Dim dialog As B4XDialog
	
End Sub

Public Sub Initialize (Callback As Object, EventName As String)
	mEventName = EventName
	mCallBack = Callback

End Sub

'Base type must be Object
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
	mBase = Base
    Tag = mBase.Tag
    mBase.Tag = Me 
	
		
	dialog.Initialize(mBase.Parent)
End Sub

Private Sub Base_Resize (Width As Double, Height As Double)
  
End Sub

public Sub showDLG
	
	' customize graphics
	dialog.BackgroundColor = Colors.White
	dialog.ButtonsColor = Colors.White
	dialog.BorderColor = Colors.Gray
	dialog.ButtonsTextColor = 0xFF007DC3
	dialog.BodyTextColor = Colors.Black
	dialog.BorderCornersRadius = 10dip
	dialog.BorderWidth = 2dip
	dialog.TitleBarColor= 0xFF11B3D0 ' Türkise
	dialog.TitleBarHeight= 40dip
	dialog.TitleBarTextColor = Colors.white
	' position
	dialog.PutAtTop = True
	' set title
	dialog.title="title"
	' panel

	Dim p As B4XView = xui.CreatePanel("")
	p.SetLayoutAnimated(0, 0, 0, 75%x, 50%y)
	p.LoadLayout("dlg")
	' values
	ListView1.Color =  0xFF007DC3
	ListView1.AddSingleLine("Eintrag1")
	ListView1.AddSingleLine("Eintrag2")
	

	Wait For (dialog.ShowCustom(p, "OK", "", "CANCEL")) Complete (Result As Int)
	If Result = xui.DialogResponse_Positive Then
		Log(DLGResult)
	End If
End Sub

Private Sub ListView1_ItemClick (Position As Int, Value As Object)
	DLGResult=Value
End Sub