1.在项目根目录下的build.gradle文件中,
allprojects {
repositories {
maven {
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
}
}
}
2.在entry模块的build.gradle文件中,
dependencies {
implementation('com.gitee.chinasoft_ohos:AsymmetricGridview:1.0.0')
......
}
在sdk6,DevEco Studio2.2 beta1下项目可直接运行 如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下
In your layout xml:
<com.felipecsl.lib.AsymmetricRecyclerView
xmlns:ohos="http://schemas.huawei.com/res/ohos"
ohos:id="$+id:recyclerView"
ohos:height="match_parent"
ohos:width="match_parent"/>
In your activity class:
@Override
public void onStart(Intent intent) {
super.onStart(intent);
super.setUIContent(ResourceTable.Layout_ability_main);
AsymmetricRecyclerView recyclerView = (AsymmetricRecyclerView) findComponentById(ResourceTable.Id_recyclerView);
RecyclerViewAdapter adapter = new RecyclerViewAdapter(demoUtils.moarItems(50));
recyclerView.setRequestedColumnCount(3);
recyclerView.setDebugging(true);
recyclerView.setRequestedHorizontalSpacing(Utils.vpToPx(this, 3));
recyclerView.setItemProvider(new AsymmetricRecyclerViewAdapter<>(this, recyclerView, adapter));
}
Whenever your adapter changes (add or remove items), the grid will automatically reflect those changes by subscribing to your adapter changes.
Toggle to enable/disable reordering of elements to better fill the grid
// Setting to true will move items up and down to better use the space
// Defaults to false.
listView.setAllowReordering(true);
listView.isAllowReordering(); // true
CodeCheck代码测试无异常 `` CloudTest代码测试无异常
病毒安全检测通过
当前版本demo功能与原组件基本无差异
The MIT License (MIT)
Copyright (c) 2011-2014 Felipe Lima
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, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Комментарии ( 0 )