Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NUI guides problems #1226

Closed
pkalota opened this issue Sep 3, 2020 · 5 comments
Closed

NUI guides problems #1226

pkalota opened this issue Sep 3, 2020 · 5 comments

Comments

@pkalota
Copy link
Contributor

pkalota commented Sep 3, 2020

FlexContainer

  • FlexContainer is marked as deprecated
  • Copied code from guide doesn't display components as expected (toolbar takes whole free space instead of 0.1)

Source: https://docs.tizen.org/application/dotnet/guides/nui/flexcontainer/

TableView

for( int row = 0; row < 4; ++row )
{
  for( int col = 0; col < 4; ++col )
  {
    TextLabel textLabel = new TextLabel();
    textLabel.Focusable = true;
    textLabel.BackgroundColor = Color.White;
    tableView.AddChild( textLabel, new TableView.CellPosition(row, col));
  }
}
  • In tableView.AddChild( textLabel, new TableView.CellPosition(row, col)); there is required conversion row and col to uint type
  • Result of code from guide is black window. We can avoid this by adding some text to added TextLabels, then user is able to see how TableView works

Source: https://docs.tizen.org/application/dotnet/guides/nui/tableview/

PropertyMap - FontStyle

image
image

  • App throws errors (attached above) during building. Source of these errors is part of code (attached above) provided by guide.
PropertyMap shadow = new PropertyMap();  
shadow.Add("offset", new PropertyValue(new Vector2(10, 10))); 
shadow.Add("color", new PropertyValue(Color.Red));
label1.Shadow = shadow;
  • Adding shadow PropertyMap to label's FontStyle have no affect

Source: https://docs.tizen.org/application/dotnet/guides/nui/text/

TextField

Window window = Window.Instance;
TextField field = new TextField();
PropertyMap propertyMap = new PropertyMap();
propertyMap.Add("placeholderText", new PropertyValue("Unknown Name"));
propertyMap.Add("placeholderTextFocused", new PropertyValue("Enter Name."));
field.Placeholder = propertyMap;
window.Add(field);
  • Result of above code from guide is black window. Adding white background make typing in TextField visible (cause of black letters on white background instead of black letters on black background).
  • Setting placeholders strings have no affect, in focused and unfocused state TextField doesn't display placeholders

Source: https://docs.tizen.org/application/dotnet/guides/nui/text/

Popup

Window window = Window.Instance;

Popup popup = new Popup();

NPatchVisual nvisual = new NPatchVisual();
nvisual.URL = "popup_background.png";
nvisual.Border = new Rectangle(0, 0, 81, 81);
popup.MinimumSize = new Size(1032, 184);
popup.Size = new Size(1032, 400);
popup.Position = new Position(200, 100);

//set Popup title property
popup.TitlePointSize = 25;
popup.TitleTextColor = Color.Black;
popup.TitleHeight = 68;
popup.TitleTextHorizontalAlignment = HorizontalAlignment.Begin;
popup.TitleTextPosition = new Position(64, 52);
popup.TitleText = "Popup Title";

popup.ButtonTextColor = new Color(0.05f, 0.63f, 0.9f, 1);
popup.ButtonHeight = 132;
popup.ButtonCount = 2;
popup.SetButtonText(0, "Yes");
popup.SetButtonText(1, "Exit");

window.Add(popup);
  • Emulator is not able to run installed app until we change popup.MinimumSize = new Size(1032, 184); to popup.MinimumSize = new Size2D(1032, 184);, dlogutil says:

System.MissingMethodException: Method not found: 'Tizen.NUI.Size2D Tizen.NUI.Size2D.op_Implicit(Tizen.NUI.Size)'

  • Popup is marked as deprecated
  • Even if we get rid of errors from first point Popup doesn't display properly

Source: https://docs.tizen.org/application/dotnet/guides/nui/nui-components/Popup/

Progress

Window window = Window.Instance;

Progress utilityBasicProgress = new Progress();
utilityBasicProgress.MaxValue = 100;
utilityBasicProgress.MinValue = 0;
utilityBasicProgress.CurrentValue = 45;
utilityBasicProgress.TrackColor = Color.Green;
utilityBasicProgress.ProgressColor = Color.White;

window.Add(utilityBasicProgress);
  • Code from guide display only black window

Source: https://docs.tizen.org/application/dotnet/guides/nui/nui-components/Progress/

Slider

Window window = Window.Instance;

Slider utilityBasicSlider = new Slider();

utilityBasicSlider.TrackThickness = 4;
utilityBasicSlider.BgTrackColor = new Color(0, 0, 0, 0.1f);
utilityBasicSlider.SlidedTrackColor = new Color(0.05f, 0.63f, 0.9f, 1);
utilityBasicSlider.ThumbImageURLSelector = new StringSelector
{
      Normal = "controller_btn_slide_handler_normal.png",
      Pressed = "controller_btn_slide_handler_press.png",
};
utilityBasicSlider.ThumbSize = new Size(60, 60);
utilityBasicSlider.Direction = Slider.DirectionType.Horizontal;
utilityBasicSlider.MinValue = 0;
utilityBasicSlider.MaxValue = 100;
utilityBasicSlider.CurrentValue = 10;
window.Add(utilityBasicSlider);

window.Add(utilityBasicSlider);
  • Cannot run installed app from tutorial (code above), dlogutil says:

Could not load type 'Tizen.NUI.BaseComponents.Selector`1' from assembly 'Tizen.NUI, Version=4.0.0.0, Culture=neutral, PublicKeyToken=eba370b203a2e242'

Source: https://docs.tizen.org/application/dotnet/guides/nui/nui-components/Slider/

Tab

Window window = Window.Instance;

Tab utilityBasicTab = new Tab();

utilityBasicTab.IsSelectable = true;
utilityBasicTab.Size = new Size(700, 108);
utilityBasicTab.Position = new Position(100, 300);
utilityBasicTab.BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 0.5f);
utilityBasicTab.UseTextNaturalSize = true;
utilityBasicTab.ItemSpace = 40;
utilityBasicTab.Space = new Extents(56, 56, 1, 0);
utilityBasicTab.UnderLineSize = new Size(1, 3);
utilityBasicTab.UnderLineBackgroundColor = color[0];
utilityBasicTab.PointSize = 25;
utilityBasicTab.TextColorSelector = new ColorSelector
{
    Normal = Color.Black,
    Selected = color[0],
};
window.Add(tab);

for (int i = 0; i < 3; i++)
{
    Tab.TabItemData item = new Tab.TabItemData();
    item.Text = "Tab " + i;
    if(i == 1)
    {
        item.Text = "Long Tab " + i;
    }
    utilityBasicTab.AddItem(item);
}
utilityBasicTab.SelectedItemIndex = 0;
  • line window.Add(tab); use undeclared variable tab
  • utilityBasicTab.IsSelectable = true; Tab class doesn't contain IsSelectable property
  • utilityBasicTab.UnderLineBackgroundColor = color[0]; and Selected = color[0], use undeclared array color
  • Cannot run installed app, dlogutil says:

System.TypeLoadException: Could not load type 'Tizen.NUI.BaseComponents.Selector`1' from assembly 'Tizen.NUI, Version=4.0.0.0, Culture=neutral, PublicKeyToken=eba370b203a2e242'

  • Tab is marked as deprecated
  • After fixing errors from first four subpoints, final result is not proper, PointSize have to large value for default resolution

Source: https://docs.tizen.org/application/dotnet/guides/nui/nui-components/Tab/

Toast

  • Toast is marked as deprecated
  • Final result is not proper, PointSize have to large value for default resolution
NPatchVisual nvisual = new NPatchVisual();
nvisual.URL = "Poptoast_background.png";
nvisual.Border = new Rectangle(64, 64, 4, 4);
  • Created nvisual is not used

Source: https://docs.tizen.org/application/dotnet/guides/nui/nui-components/Toast/

@mijin85cho
Copy link
Contributor

Hello, @Seoyeon2Kim, @JoogabYun

Today I got these issue reports for nui guide pages.
I remember some of the reported pages were updated by you, so I'd like to ask your support.
Would you please check these issues and update the guides if needed?
If there is someone who is proper to handle these issue, please let that person know this report, too.

@Seoyeon2Kim
Copy link
Contributor

Hi, I'll handle these problems.

@pkalota
Copy link
Contributor Author

pkalota commented Sep 9, 2020

Hi, @Seoyeon2Kim

As you can see, lots of guides use deprecated API and I can't find good alternatives in the newest API (for Popup, Tab etc.). In this case is it better to modify guide to work properly (get rid of errors - for example Tab guide) with deprecated API or maybe don't modify it and leave it as it is?

@Seoyeon2Kim
Copy link
Contributor

Hi @pkalota ,
I think the deprecated classes, like Tab, should be removed on Tizen public docs.
You don't need to fix some examples that are not working correctly.

@mijin85cho
Copy link
Contributor

mijin85cho commented Sep 16, 2020

The PR #1234 for these issues was merged into master branch.

If the fix is synced into live branch, the docs.tizen.org will be updated, too.
Thanks for the report.

@pkalota pkalota closed this as completed Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants