SkillAgentSearch skills...

JustUiKit

iOS UI Kit With Android-Style Tools. JustUiKit contains JustLinearLayout, JustFrameLayout and so on. It is designed to make Android developers build iOS UI easily. Also for iOS developers, it provides a new way to build UI.

Install / Use

/learn @lfkdsk/JustUiKit
About this skill

Quality Score

0/100

Category

Design

Supported Platforms

Universal

README

JustUiKit

iOS UI Kit With Android-Style Tools. JustUiKit contains JustLinearLayout, JustFrameLayout and so on. It is designed to make Android developers build iOS UI easily. Also for iOS developers, it provides a new way to build UI.

GitHub license CocoaPods

中文请参阅

How To Install?

  • Copy to your project

​ Copy JustUiKit folder from the demo project to your project

  • Installation with CocoaPods

    CocoaPods is a dependency manager for Objective-C/Swift, which automates and simplifies the process of using 3rd-party libraries like JustUiKit in your projects. You can install it with the following command:

    $ sudo gem install cocoapods

    To integrate JustUiKit into your Xcode project using CocoaPods, specify it in your Podfile:

    platform :ios, '8.0'
    pod 'JustUiKit', '~> 0.2.1'
    

    ​Then, run the following command:

    $ pod install

Quick Start

JustLinearLayout

A Layout that arranges its children in a single column or a single row. The direction of the row can be set by orientation. You can also specify gravity, which specifies the alignment of all the child elements by set gravity or specify that specific children grow to fill up any remaining space in the layout by setting the weight member of LinearLayoutParams. The default orientation is horizontal.

Gravity & Margin & Orientation

Vertical

You can set Gravity to make Views be layouted at a specify space of parentView. Also set Margin will remain spaces in the four directions of the View. In default, LinearLayout layout children in Horizontal direction, and you can change it to Veritcal.

Example:

let parentView = JustLinearLayout(frame: UIScreen.main.bounds, orientation: .Vertical)
let params = LinearLayoutParams(
                width: LayoutParams.WRAP_CONTENT,
                height: LayoutParams.WRAP_CONTENT)
let centerParams = LinearLayoutParams(params)
centerParams.layoutGravity = Gravity.Horizontal.getValue()

let marginParams = LinearLayoutParams(params)
marginParams.topMargin = 10

parentView.addView(createView(), centerParams)
parentView.addView(createView(), marginParams)

Padding & weight

Horizontal

With the Padding in four directions, you can remain inner space of the view. And Weight describes how the child views are positioned. Defaults to Gravity.TOP | Gravity.LEFT. If this layout has a VERTICAL orientation, this controls where all the child views are placed if there is extra vertical space. If this layout has a HORIZONTAL orientation, this controls the alignment of the children.

See Gravity to get more details.

Example:

let parentView = JustLinearLayout(frame: UIScreen.main.bounds, orientation: .Vertical)
let params = LinearLayoutParams(
                width: LayoutParams.WRAP_CONTENT,
                height: LayoutParams.WRAP_CONTENT)
params.weight = 1
let paddingParams = LinearLayoutParams(params)
paddingParams.paddingTop = 10
parentView.addView(createView(), params)
parentView.addView(createView(), paddingParams)

JustFrameLayout

FrameLayout is designed to block out an area on the screen to display a single item. Generally, FrameLayout should be used to hold a single child view, because it can be difficult to organize child views in a way that's scalable to different screen sizes without the children overlapping each other. You can, however, add multiple children to a FrameLayout and control their position within the FrameLayout by assigning gravity to each child, using the layoutGravity.

Overlap on left

Frame1

if don't use any Margin or Padding to change view's position. All the Views will be add like stack and overlap on the left|top of the screen.

Example:

let parentView: JustFrameLayout = JustFrameLayout(width:MATCH_PARENT, height:MATCH_PARENT)
let params: FrameLayoutParams = JustFrameLayoutParams(width: WRAP_CONTENT, height: WRAP_CONTENT)
parentView.addView(createView(rgb:0xE4E1D8), params)
parentView.addView(createView(rgb:0x89A49D), params)
parentView.addView(createView(rgb:0x877B6B), params)

Layout With Gravity

Frame2

You can use horizontal and vertical gravity. Also You can use like left|bottom, center_horizontal|center_vertical to use them at the same time.

See Gravity to get more details.

Example:

let parentView: FrameLayout = FrameLayout(width:MATCH_PARENT, height:MATCH_PARENT)
let params: FrameLayoutParams = FrameLayoutParams(width: WRAP_CONTENT, height: WRAP_CONTENT)

let b_l = FrameLayoutParams(params)
b_l.layoutGravity = Gravity.BOTTOM | Gravity.TOP
let c_r = FrameLayoutParams(params)
c_r.layoutGravity = Gravity.CENTER_HORIZONTAL | Gravity.RIGHT
parentView.addView(createView(rgb:0xE4E1D8), b_l)
parentView.addView(createView(rgb:0x89A49D), c_r)
parentView.addView(createView(rgb:0x877B6B), params)

JustRelativeLayout

A Layout where the positions of the children can be described in relation to each other or to the parent.

Note that you cannot have a circular dependency between the size of the RelativeLayout and the position of its children. For example, you cannot have a RelativeLayout whose height is set to WRAP_CONTENT and a child set to ALIGN_PARENT_BOTTOM.

relative

In RelativeLayout, you can use all the Margin,Padding and Gravity. Also You can use some Align functions. Such as, if a view is alignLeftTo, its left edge will be set equal to the anchor view. You can use a set of functions like leftOf, rightOf, bottomOf set the current view to the left of anchor view.

// view1 view2 view3 view4 view5
let params = RelativeLayoutParams.generateDefaultParams()
let params1 = RelativeLayoutParams(params)
params1.centerInHorizontal()
let params2 = RelativeLayoutParams(params)
params2.bottomTo(view4)
params2.topMargin = xxx
let params3 = RelativeLayoutParams(params)
param3.alignRightTo(view1)
let params4 = RelativeLayoutParams(params)
params4.centerInParent()
let params5 = RelativeLayoutParams(params)
params5.alignParentBottom()
// add view to parent

Rule in RelativeLayout

| Constants | Description | | ------------------- | ---------------------------------------- | | ABOVE | Rule that aligns a child's bottom edge with another child's top edge. | | ALIGN_BASELINE | Rule that aligns a child's baseline with another child's baseline. | | ALIGN_BOTTOM | Rule that aligns a child's bottom edge with another child's bottom edge. | | ALIGN_LEFT | Rule that aligns a child's left edge with another child's left edge. | | ALIGN_PARENT_BOTTOM | Rule that aligns the child's bottom edge with its RelativeLayout parent's bottom edge. | | ALIGN_PARENT_LEFT | Rule that aligns the child's left edge with its RelativeLayout parent's left edge. | | ALIGN_PARENT_RIGHT | Rule that aligns the child's right edge with its RelativeLayout parent's right edge. | | ALIGN_PARENT_TOP | Rule that aligns the child's top edge with its RelativeLayout parent's top edge. | | ALIGN_RIGHT | Rule that aligns a child's right edge with another child's right edge. | | ALIGN_TOP | Rule that aligns a child's top edge with another child's top edge. | | BELOW | Rule that aligns a child's top edge with another child's bottom edge. | | CENTER_HORIZONTAL | Rule that centers the child horizontally with respect to the bounds of its RelativeLayout parent. | | CENTER_IN_PARENT | Rule that centers the child with respect to the bounds of its RelativeLayout parent. | | CENTER_VERTICAL | Rule that centers the child vertically with respect to the bounds of its RelativeLayout parent. | | END_OF | Rule that aligns a child's start edge with another child's end edge. | | LEFT_OF | Rule that aligns a child's right edge with another child's left edge. | | RIGHT_OF | Rule that aligns a child's left edge with another child's right edge. |

Gravity

Must be one or more (separated by '|') of the following constant values.

| Constant | Value | Description | | :---------------- | ----- | ---------------------------------------- | | top | 0x30 | Push object to the top of its container, not changing its size. | | bottom | 0x50 | Push object to the bottom of its container, not changing its size. | | right | 0x05 | Push object to the right of its container, not changing its size. | | center_vertical | 0x10 | Place object in the vertical center of its container, not changing its size. | | center_horizontal | 0x01 | Place object in the horizontal center of its container, not changing its size. | | center | 0x11 | Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. |

Feedback

Please send your feedback as long as there occurs any inconvenience or problem. You can contact me with:

License


    MIT License

    Copyright (c) 2017 JustWe

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, includi

Related Skills

openpencil

2.1k

The world's first open-source AI-native vector design tool and the first to feature concurrent Agent Teams. Design-as-Code. Turn prompts into UI directly on the live canvas. A modern alternative to Pencil.

openpencil

2.1k

The world's first open-source AI-native vector design tool and the first to feature concurrent Agent Teams. Design-as-Code. Turn prompts into UI directly on the live canvas. A modern alternative to Pencil.

ui-ux-designer

Use this agent when you need to design, implement, or improve user interface components and user experience flows. Examples include: creating new pages or components, improving existing UI layouts, implementing responsive designs, optimizing user interactions, building forms or dashboards, analyzing existing UI through browser snapshots, or when you need to ensure UI components follow design system standards and shadcn/ui best practices.\n\n<example>\nContext: User needs to create a new dashboard page for team management.\nuser: "I need to create a team management dashboard where users can view team members, invite new members, and manage roles"\nassistant: "I'll use the ui-ux-designer agent to design and implement this dashboard with proper UX considerations, using shadcn/ui components and our design system tokens."\n</example>\n\n<example>\nContext: User wants to improve the user experience of an existing form.\nuser: "The signup form feels clunky and users are dropping off. Can you improve it?"\nassistant: "Let me use the ui-ux-designer agent to analyze the current form UX and implement improvements using our design system and shadcn/ui components."\n</example>\n\n<example>\nContext: User wants to evaluate and improve existing UI.\nuser: "Can you take a look at our pricing page and see how we can make it more appealing and user-friendly?"\nassistant: "I'll use the ui-ux-designer agent to take a snapshot of the current pricing page, analyze the UX against Notion-inspired design principles, and implement improvements using our design tokens."\n</example>

ui-ux-pro-max-skill

61.5k

An AI SKILL that provide design intelligence for building professional UI/UX multiple platforms

View on GitHub
GitHub Stars37
CategoryDesign
Updated1y ago
Forks4

Languages

Swift

Security Score

80/100

Audited on Jul 10, 2024

No findings