FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

refactor: remove ununsed Layout class by manoldonev · Pull Request #6228 · NativeScript/NativeScript · GitHub

refactor: remove ununsed Layout class - #6228

Merged
manoldonev merged 1 commit into
masterfrom
mdonev/refactor-remove-layout
Aug 31, 2018
Merged

manoldonev merged 1 commit into
masterfrom
mdonev/refactor-remove-layout

Conversation

manoldonev commented Aug 29, 2018 •
edited
Loading

Copy link
Copy Markdown
Contributor

I came upon the Layout class by accident and I think it should be removed as it is not used anywhere in NativeScript besides in the unit tests app (where it can and should be replaced by LayoutBase). I could not find any clues or user guidelines that would describe how to use this class so I think it is some kind of legacy that we do not need any more. Code comments note that it is "Base class for all views that supports children positioning in cross platform manner" but that is not (no longer?) true as all built-in layouts inherit from LayoutBase/CustomLayoutView directly.

BREAKING CHANGE:

Layout class (tns-core-modules/ui/layouts/layout) is now removed as it is not used in {N} framework any more.

Before:
Built-in {N} layouts GridLayout, StackLayout, WrapLayout, etc. extended Layout class

After:
Built-in {N} layouts GridLayout, StackLayout, WrapLayout, etc. now extend LayoutBase class

To migrate your code follow the example below:

Before:

import { Layout } from "ui/layouts/layout";
// ...

let wrapLayout: Layout;

export function pageLoaded(args: EventData) {
     const page = <Page>args.object;
     wrapLayout = page.getViewById<Layout>("wrapLayout");
 }

After:

import { LayoutBase } from "ui/layouts/layout-base"; // or import { WrapLayout } from "ui/layouts/wrap-layout;
// ...

let wrapLayout: LayoutBase; // or let wrapLayout: WrapLayout;

export function pageLoaded(args: EventData) {
     const page = <Page>args.object;
     wrapLayout = page.getViewById<LayoutBase>("wrapLayout"); // or wrapLayout = page.getViewById<WrapLayout>("wrapLayout"); 
 }

manoldonev self-assigned this Aug 29, 2018
ghost added the in progress label Aug 29, 2018

Copy link
Copy Markdown
Contributor

Just to note that the class that is "Base class for all views that supports children positioning in cross platform manner" is now CustomLayoutView.

manoldonev force-pushed the mdonev/refactor-remove-layout branch from 2b1c868 to 0177d27 Compare August 30, 2018 12:02
manoldonev force-pushed the mdonev/refactor-remove-layout branch from 0177d27 to 0489cd2 Compare August 30, 2018 13:01
manoldonev merged commit 43f0fd0 into master Aug 31, 2018
ghost removed the in progress label Aug 31, 2018
manoldonev deleted the mdonev/refactor-remove-layout branch August 31, 2018 12:00

lock Bot commented Sep 3, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock Bot locked and limited conversation to collaborators Sep 3, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL