# FlexLayout **Repository Path**: baijuncheng-open-source/flexlayout ## Basic Information - **Project Name**: FlexLayout - **Description**: A powerful ohos layout component that use java expression in layout params to describe relative positions - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-04-07 - **Last Updated**: 2024-05-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # FlexLayout The idea is simple, use java expressions in layout params like `layout_left="view1.right+10dp"`. It is helpful when DirectionalLayout and DependentLayout is not enough for you. ## Preview ![image](images/image.gif) ## Getting Started ##### Integration remote maven repo integration 1.add mavenCentral dependency at repositories in your project build.gradle ``` allprojects { repositories { mavenCentral() } } ``` 2.add library dependency at your module build.gradle ```xml implementation 'com.gitee.baijuncheng-open-source:FlexLayout:1.0.0' ``` ##### Add FlexLayout to your project 1.Copy the FlexLayout/library folder to the project directory 2.Modify settings.gradle under the project and add the dependency on this module as follows: include ':entry', ':library' 3. Introduce the dependency of the module under the project. Taking the entry module as an example, you need to modify the build.gradle file under the entry module to add the dependency: compile project(path: ':library') or implementation project(':library') Solution 2: local use of har package integration 1. Compile this project, copy the har package generated in the build directory of the FlexLayout/library folder to the project lib folder: directory:\FlexLayout\library\build\outputs\har\debug\library-debug.har 2. Add the following code in the entry's gradle implementation fileTree(dir:'libs', include: ['*.jar','*.har']) More on the configuration can be found in the Project. Or just copy [FlexLayout.java](library/src/main/java/com/github/mmin18/widget/FlexLayout.java) and [ReflectUtil.java](library/src/main/java/com/github/mmin18/widget/ReflectUtil.java ) to your project. ## Layout Params | Horizontal | Vertical | | -------------- | -------------- | | layout_left | layout_top | | layout_right | layout_bottom | | layout_centerX | layout_centerY | | layout_width | layout_height | Remember the `app:layout_width` is different from ` ohos:width`
*xmlns:app="http://schemas.huawei.com/res/ohos-auto"* ## % Percentage