LayoutManagerGroup : LayoutManagerGroup is a custom set of views that responsible for measuring and positioning the item views within a RecyclerView as well as determining the policy for when to recycle item views that are no longer visible to the user. This lib allows arrange views like echelon and a special skid right in aligned manner.
The steps to initialize the EchelonLayoutManager and the core component recyclerview is below.
private DirectionalLayout root; recyclerView = new RecyclerView(this); root.addComponent(recyclerView, new ComponentContainer.LayoutConfig(HarmonyConstant.getMaximumWindowMetrics(this).getWidth(), HarmonyConstant.getMaximumWindowMetrics(this).getHeight()));
EchelonLayoutManager echelonLayoutManager = new EchelonLayoutManager(this); recyclerView.setLayoutManager(echelonLayoutManager); AdapterOriginal adapterOriginal = new AdapterOriginal(false); recyclerView.setAdapter(adapterOriginal);
The steps to initialize the SkidRightLayoutManager and the core component recyclerview is below.
SkidRightLayoutManager skidRightLayoutManager = new SkidRightLayoutManager(/* Pass item height width ratio /, / Pass scale */); recyclerView.setLayoutManager(skidRightLayoutManager); SkidRightAdapter skidRightAdapter = new SkidRightAdapter(); recyclerView.setAdapter(skidRightAdapter);
1.For using LayoutManagerGroup module in a sample application, include the below library dependency to generate hap/layoutmanagergroup.har.
Modify entry build.gradle as below :
dependencies {
implementation project(path ':layoutmanagergroup’)
}
2.For using LayoutManagerGroup in a separate application, make sure to add the "layoutmanagergroup.har" in libs folder of "entry" module.
Modify entry build.gradle as below :
dependencies {
implementation fileTree(dir: 'libs', include: ['*.har'])
}
3.For using LayoutManagerGroup from the remote repository, add the below dependency in "entry" build.gradle.
Modify entry build.gradle as below :
allprojects {
repositories {
mavenCentral()
}
}
dependencies {
implementation 'io.openharmony.tpc.thirdlib:LayoutManagerGroup:1.0.3'
}
Copyright (C) 2018 DingMouRen
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型