Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Add testcase for TwoButton/Information/Toast popup and Radio/ IndexPage #54

Merged
merged 1 commit into from
Jun 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/guide/Radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The following code explains the process of creating `Radio`.

For more information, see [Radio API reference](https://samsung.github.io/Tizen.CircularUI/api/Tizen.Wearable.CircularUI.Forms.Radio.html).

_The code example of this guide uses TCRadio code of WearableUIGallery. The code is available in test\WearableUIGallery\WearableUIGallery\TC\TCRadio.xaml.cs_
_The code example of this guide uses TCRadioStackLayout code of WearableUIGallery. The code is available in test\WearableUIGallery\WearableUIGallery\TC\TCRadioStackLayout.xaml.cs_

**XAML file**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public ToastImplementation()
_control = new ElmSharp.Popup(TForms.NativeParent)
{
Style = DefaultStyle,
AllowEvents = true,
AllowEvents = false,
};

_control.BackButtonPressed += (s, e) => _control.Dismiss();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions test/WearableUIGallery/WearableUIGallery/AppViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public AppViewModel()

// Radio TCs
RadioTCs = new ObservableCollection<TCDescribe>();
RadioTCs.Add(new TCDescribe { Title = "StackLayout", Class = typeof(TCRadio) });
RadioTCs.Add(new TCDescribe { Title = "ListView", Class = typeof(TCRadioGroup) });
RadioTCs.Add(new TCDescribe { Title = "StackLayout", Class = typeof(TCRadioStackLayout) });
RadioTCs.Add(new TCDescribe { Title = "ListView", Class = typeof(TCRadioListView) });
}

public IList<TCDescribe> TCs { get; private set; }
Expand Down
11 changes: 11 additions & 0 deletions test/WearableUIGallery/WearableUIGallery/TC/TCIndexPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,15 @@
<Label HorizontalOptions="CenterAndExpand" Text="Blue" />
</StackLayout>
</ContentPage>
<ContentPage>
<StackLayout>
<BoxView VerticalOptions="FillAndExpand" Color="LightBlue" />
<Button
x:Name="button"
Clicked="OnAddButtonClicked"
HorizontalOptions="CenterAndExpand"
Text="Add"
WidthRequest="200" />
</StackLayout>
</ContentPage>
</w:IndexPage>
38 changes: 35 additions & 3 deletions test/WearableUIGallery/WearableUIGallery/TC/TCIndexPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,41 @@ namespace WearableUIGallery.TC
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class TCIndexPage : IndexPage
{
public TCIndexPage ()
int _index;
IList<ContentPage> _addedContentPages = new List<ContentPage>();
public TCIndexPage ()
{
InitializeComponent ();
}
}

_index = 0;
for (int i = 0; i < 20; i++)
{
var page = new ContentPage
{
Content = new StackLayout
{
Children = {
new BoxView {
Color = Color.Purple,
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand
},
new Label {
Text = "Added Page(" + i + ")",
HorizontalOptions = LayoutOptions.CenterAndExpand
}
}
}
};

_addedContentPages.Add(page);
}
}

private void OnAddButtonClicked(object sender, EventArgs e)
{
if (_index > 19) return;
Children.Add(_addedContentPages[_index++]);
}
}
}
103 changes: 72 additions & 31 deletions test/WearableUIGallery/WearableUIGallery/TC/TCInformationPopup.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,78 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:WearableUIGallery"
xmlns:w="clr-namespace:Tizen.Wearable.CircularUI.Forms;assembly=Tizen.Wearable.CircularUI.Forms">
<ContentPage.Behaviors>
<w:CircleSurfaceEffectBehavior RotaryFocusTargetName="myscroller" />
</ContentPage.Behaviors>
<ContentPage.Content>
<StackLayout Padding="0,30,0,0">
<Label
x:Name="label1"
HorizontalOptions="CenterAndExpand"
Text="Popup is not shown"
VerticalOptions="Start" />
<Button
x:Name="button1"
Clicked="OnButton1Clicked"
HeightRequest="50"
HorizontalOptions="Center"
Text="text"
VerticalOptions="StartAndExpand"
WidthRequest="200" />
<Button
x:Name="button2"
Clicked="OnButton2Clicked"
HeightRequest="50"
HorizontalOptions="Center"
Text="text button"
VerticalOptions="CenterAndExpand"
WidthRequest="200" />
<Button
x:Name="button3"
Clicked="OnButton3Clicked"
HeightRequest="50"
HorizontalOptions="Center"
Text="process text"
VerticalOptions="CenterAndExpand"
WidthRequest="200" />
</StackLayout>
<w:CircleScrollView x:Name="myscroller" Orientation="Vertical">
<StackLayout Padding="0,50,0,50">
<Label
x:Name="label1"
HorizontalOptions="CenterAndExpand"
Text="Popup is not shown"
VerticalOptions="Start" />
<Button
x:Name="button1"
Clicked="OnTextButtonClicked"
FontSize="Small"
HeightRequest="50"
HorizontalOptions="Center"
Text="Text"
VerticalOptions="CenterAndExpand"
WidthRequest="300" />
<Button
x:Name="button2"
Clicked="OnLongTextButtonClicked"
FontSize="Small"
HeightRequest="50"
HorizontalOptions="Center"
Text="Long text"
VerticalOptions="CenterAndExpand"
WidthRequest="300" />
<Button
x:Name="button3"
Clicked="OnTitleTextButtonClicked"
FontSize="Small"
HorizontalOptions="Center"
Text="Title text button(text)"
VerticalOptions="CenterAndExpand"
WidthRequest="300" />
<Button
x:Name="button4"
Clicked="OnIconBottomButtonClicked"
FontSize="Small"
HorizontalOptions="Center"
Text="Long text button(icon)"
VerticalOptions="CenterAndExpand"
WidthRequest="300" />
<Button
x:Name="button5"
Clicked="OnIconAndTextBottomButtonClicked"
FontSize="Small"
HorizontalOptions="Center"
Text="Title text button(icon text)"
VerticalOptions="CenterAndExpand"
WidthRequest="300" />
<Button
x:Name="button6"
Clicked="OnProcessButtonClicked"
FontSize="Small"
HeightRequest="50"
HorizontalOptions="Center"
Text="Process text"
VerticalOptions="CenterAndExpand"
WidthRequest="300" />
<Button
x:Name="button7"
Clicked="OnProcessLongTextButtonClicked"
FontSize="Small"
HeightRequest="50"
HorizontalOptions="Center"
Text="Process long text"
VerticalOptions="CenterAndExpand"
WidthRequest="300" />
</StackLayout>
</w:CircleScrollView>
</ContentPage.Content>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,63 @@ public partial class TCInformationPopup : ContentPage
InformationPopup _textPopUp = null;
InformationPopup _textButtonPopUp = null;
InformationPopup _progressPopUp = null;
MenuItem _textBottomButton;
MenuItem _iconBottomButton;
MenuItem _textIconBottomButton;

public TCInformationPopup()
{
InitializeComponent();

_textPopUp = new InformationPopup();
_textPopUp.Text = "This is text popup test";

_textPopUp.BackButtonPressed += (s, e) =>
{
_textPopUp.Dismiss();
label1.Text = "text popup is dismissed";
};

var bottomButton = new MenuItem()
_textBottomButton = new MenuItem()
{
Text = "OK",
Command = new Command(() =>
{
Console.WriteLine("bottom button Command!!");
Console.WriteLine("text bottom button Command!!");
_textButtonPopUp.Dismiss();
})
};

_iconBottomButton = new MenuItem()
{
Icon = new FileImageSource
{
File = "image/tw_ic_popup_btn_delete.png",
},
Command = new Command(() =>
{
Console.WriteLine("icon bottom button Command!!");
_textButtonPopUp.Dismiss();
})
};

_textIconBottomButton = new MenuItem()
{
Text = "OK",
Icon = new FileImageSource
{
File = "image/tw_ic_popup_btn_delete.png",
},
Command = new Command(() =>
{
Console.WriteLine("text&icon bottom button Command!!");
_textButtonPopUp.Dismiss();
})
};

_textButtonPopUp = new InformationPopup();
_textButtonPopUp.Title = "Popup title";
_textButtonPopUp.Text = "This is text and button popup test";
_textButtonPopUp.BottomButton = bottomButton;
_textButtonPopUp.BottomButton = _textBottomButton;

_textButtonPopUp.BackButtonPressed += (s, e) =>
{
Expand All @@ -86,20 +115,58 @@ public TCInformationPopup()

}

private void OnTextButtonClicked(object sender, EventArgs e)
{
_textPopUp.Text = "This is text popup test";
_textPopUp.Show();
}

private void OnButton1Clicked(object sender, EventArgs e)
private void OnLongTextButtonClicked(object sender, EventArgs e)
{
_textPopUp.Text = @"This is scrollable popup text.
This part is made by adding long text in popup.Popup internally added
scroller to this layout when size of text is greater than total popup
height.This has two button in action area and title text in title area";

_textPopUp.Show();
}

private void OnButton2Clicked(object sender, EventArgs e)
private void OnTitleTextButtonClicked(object sender, EventArgs e)
{
_textButtonPopUp.Text = "This is text and button popup test";
_textButtonPopUp.BottomButton = _textBottomButton;
_textButtonPopUp.Show();
}
private void OnIconBottomButtonClicked(object sender, EventArgs e)
{
_textButtonPopUp.Text = @"This is scrollable popup text.
This part is made by adding long text in popup.Popup internally added
scroller to this layout when size of text is greater than total popup
height.This has two button in action area and title text in title area";
_textButtonPopUp.BottomButton = _iconBottomButton;
_textButtonPopUp.Show();
}

private void OnIconAndTextBottomButtonClicked(object sender, EventArgs e)
{
_textButtonPopUp.Text = "This is text and button popup test";
_textButtonPopUp.BottomButton = _textIconBottomButton;
_textButtonPopUp.Show();
}

private void OnButton3Clicked(object sender, EventArgs e)
private void OnProcessButtonClicked(object sender, EventArgs e)
{
_progressPopUp.Show();
}

private void OnProcessLongTextButtonClicked(object sender, EventArgs e)
{
_progressPopUp.Text = @"This is scrollable popup text.
This part is made by adding long text in popup.Popup internally added
scroller to this layout when size of text is greater than total popup
height.This has two button in action area and title text in title area";
_progressPopUp.Show();
}

}
}
56 changes: 0 additions & 56 deletions test/WearableUIGallery/WearableUIGallery/TC/TCRadio.xaml

This file was deleted.

Loading