Skip to content

Commit

Permalink
修正为module
Browse files Browse the repository at this point in the history
  • Loading branch information
crazysunj committed Sep 21, 2018
1 parent 32422c3 commit 45373f6
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public OpenCloseAdapterHelper() {
}

@Override
protected void registerMoudle() {
protected void registerModule() {

registerMoudle(LEVEL_FIRST)
registerModule(LEVEL_FIRST)
.type(FirstOCEntity.OC_FIRST_TYPE)
.layoutResId(R.layout.item_first)
.headerResId(R.layout.item_header)
Expand All @@ -42,15 +42,15 @@ protected void registerMoudle() {
.emptyLayoutResId(R.layout.layout_empty)
.register();

registerMoudle(LEVEL_SECOND)
registerModule(LEVEL_SECOND)
.type(SecondOCEntity.OC_SECOND_TYPE)
.layoutResId(R.layout.item_second)
.headerResId(R.layout.item_header)
.footerResId(R.layout.item_footer)
.minSize(2)
.register();

registerMoudle(LEVEL_THIRD)
registerModule(LEVEL_THIRD)
.type(ThirdOCEntity.OC_THIRD_TYPE)
.layoutResId(R.layout.item_third)
.headerResId(R.layout.item_header)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ protected void onEnd() {
}

@Override
protected void registerMoudle() {
registerMoudle(LEVEL_FIRST)
protected void registerModule() {
registerModule(LEVEL_FIRST)
.type(TYPE_ONE)
.layoutResId(R.layout.item_first)
.headerResId(R.layout.item_header)
Expand All @@ -85,7 +85,7 @@ protected void registerMoudle() {
.loadingHeaderResId(R.layout.layout_default_shimmer_header_view)
.register();

registerMoudle(LEVEL_THIRD)
registerModule(LEVEL_THIRD)
.type(TYPE_FOUR)
.layoutResId(R.layout.item_third)
.headerResId(R.layout.item_header_img)
Expand All @@ -96,7 +96,7 @@ protected void registerMoudle() {
.emptyLayoutResId(R.layout.layout_empty)
.register();

registerMoudle(LEVEL_FOURTH)
registerModule(LEVEL_FOURTH)
.type(TYPE_TWO)
.layoutResId(R.layout.item_fourth)
.headerResId(R.layout.item_header_img)
Expand All @@ -107,7 +107,7 @@ protected void registerMoudle() {
.errorLayoutResId(R.layout.layout_error_two)
.register();

registerMoudle(LEVEL_SENCOND)
registerModule(LEVEL_SENCOND)
.type(TYPE_THREE)
.layoutResId(R.layout.item_second)
.headerResId(R.layout.item_header_img)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ protected void onEnd() {
}

@Override
protected void registerMoudle() {
registerMoudle(LEVEL_FIRST)
protected void registerModule() {
registerModule(LEVEL_FIRST)
.type(TYPE_ONE)
.layoutResId(R.layout.item_first)
.headerResId(R.layout.item_header)
Expand All @@ -85,7 +85,7 @@ protected void registerMoudle() {
.loadingHeaderResId(R.layout.layout_default_shimmer_header_view)
.register();

registerMoudle(LEVEL_THIRD)
registerModule(LEVEL_THIRD)
.type(TYPE_FOUR)
.layoutResId(R.layout.item_third)
.headerResId(R.layout.item_header_img)
Expand All @@ -96,7 +96,7 @@ protected void registerMoudle() {
.emptyLayoutResId(R.layout.layout_empty)
.register();

registerMoudle(LEVEL_FOURTH)
registerModule(LEVEL_FOURTH)
.type(TYPE_TWO)
.layoutResId(R.layout.item_fourth)
.headerResId(R.layout.item_header_img)
Expand All @@ -107,7 +107,7 @@ protected void registerMoudle() {
.errorLayoutResId(R.layout.layout_error_two)
.register();

registerMoudle(LEVEL_SENCOND)
registerModule(LEVEL_SENCOND)
.type(TYPE_THREE)
.layoutResId(R.layout.item_second)
.headerResId(R.layout.item_header_img)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public SimpleHelper() {
}

@Override
protected void registerMoudle() {
registerMoudle(LEVEL_FIRST)
protected void registerModule() {
registerModule(LEVEL_FIRST)
.type(TYPE_ONE)
.layoutResId(R.layout.item_first)
.headerResId(R.layout.item_header)
Expand All @@ -37,7 +37,7 @@ protected void registerMoudle() {
.register();


registerMoudle(LEVEL_FOURTH)
registerModule(LEVEL_FOURTH)
.type(TYPE_TWO)
.layoutResId(R.layout.item_fourth)
.headerResId(R.layout.item_header_img)
Expand All @@ -46,7 +46,7 @@ protected void registerMoudle() {
.loadingHeaderResId(R.layout.layout_default_shimmer_header_view)
.register();

registerMoudle(LEVEL_SENCOND)
registerModule(LEVEL_SENCOND)
.type(TYPE_THREE)
.layoutResId(R.layout.item_second)
.headerResId(R.layout.item_header_img)
Expand All @@ -55,7 +55,7 @@ protected void registerMoudle() {
.loadingHeaderResId(R.layout.layout_default_shimmer_header_view)
.register();

registerMoudle(LEVEL_THIRD)
registerModule(LEVEL_THIRD)
.type(TYPE_FOUR)
.layoutResId(R.layout.item_third)
.headerResId(R.layout.item_header_img)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@ public SwitchTypeAdapterHelper() {
}

@Override
protected void registerMoudle() {
registerMoudle(LEVEL_FIRST)
protected void registerModule() {
registerModule(LEVEL_FIRST)
.type(FirstType.TYPE_1)
.layoutResId(R.layout.item_first)
.register();

registerMoudle(LEVEL_SECOND)
registerModule(LEVEL_SECOND)
.type(SecondType.TYPE_2)
.layoutResId(R.layout.item_second)
.register();

registerMoudle(LEVEL_THIRD)
registerModule(LEVEL_THIRD)
.type(ThirdType.TYPE_3)
.layoutResId(R.layout.item_third)
.register();

registerMoudle(LEVEL_FOURTH)
registerModule(LEVEL_FOURTH)
.type(FourthType.TYPE_4)
.layoutResId(R.layout.item_fourth)
.register();

registerMoudle(LEVEL_SWITCH)
registerModule(LEVEL_SWITCH)
.type(SwtichType.TYPE_A)
.layoutResId(R.layout.item_switch_type)
.type(SwtichType.TYPE_B)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public TestLevelAdapterHelper(List<MultiTypeTitleEntity> data) {
}

@Override
protected void registerMoudle() {
registerMoudle(LEVEL_FIRST)
protected void registerModule() {
registerModule(LEVEL_FIRST)
.type(TypeOneItem.TYPE_ONE)
.layoutResId(R.layout.item_first)
.type(TypeTwoItem.TYPE_TWO)
Expand All @@ -38,7 +38,7 @@ protected void registerMoudle() {
.loadingLayoutResId(R.layout.layout_default_shimmer_view)
.register();

registerMoudle(LEVEL_SECOND)
registerModule(LEVEL_SECOND)
.type(TypeThreeItem.TYPE_THREE)
.layoutResId(R.layout.item_third)
.headerResId(R.layout.item_header)
Expand All @@ -47,7 +47,7 @@ protected void registerMoudle() {
.loadingLayoutResId(R.layout.layout_default_shimmer_view)
.register();

registerMoudle(LEVEL_THIRD)
registerModule(LEVEL_THIRD)
.type(TypeFourItem.TYPE_FOUR)
.layoutResId(R.layout.item_fourth)
.type(TypeFiveItem.TYPE_FIVE)
Expand Down
2 changes: 1 addition & 1 deletion config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ext {
userOrg : 'twsunj',
groupId : 'com.crazysunj',
uploadName : 'MultiTypeRecyclerViewAdapter',
publishVersion: '2.2.0',
publishVersion: '2.3.0',
desc : 'MultiTypeRecyclerViewAdapter For Android',
website : 'https://github.com/crazysunj/MultiTypeRecyclerViewAdapter',
licences : ['Apache-2.0']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public boolean process(Set<? extends TypeElement> set, RoundEnvironment roundEnv
ClassName entityClassName = ClassName.bestGuess(helperAnno.entity());
ParameterizedTypeName entityList = ParameterizedTypeName.get(listClassName, entityClassName);

MethodSpec.Builder registerMoudleBuilder = MethodSpec.methodBuilder("registerMoudle")
MethodSpec.Builder registerMoudleBuilder = MethodSpec.methodBuilder("registerModule")
.addAnnotation(Override.class)
.addModifiers(Modifier.PROTECTED)
.returns(void.class);
Expand Down Expand Up @@ -224,7 +224,7 @@ public boolean process(Set<? extends TypeElement> set, RoundEnvironment roundEnv
for (String level : levels.keySet()) {
StringBuilder sb = new StringBuilder();
sb.append("\n");
sb.append("registerMoudle(")
sb.append("registerModule(")
.append(level)
.append(")\n");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public RecyclerViewAdapterHelper(List<T> data, @RefreshMode int mode) {
mResourcesManager = new ResourcesManager();
mRefreshQueue = new LinkedList<>();

registerMoudle();
registerModule();

if (mCurrentMode == MODE_STANDARD && !mData.isEmpty()) {
List<T> newData = initStandardNewData(mData);
Expand Down Expand Up @@ -327,7 +327,7 @@ public T getItem(int position) {
* @param level 数据类型等级
* @return LevelsManager
*/
public ResourcesManager.LevelsManager registerMoudle(@IntRange(from = 0, to = 999) int level) {
public ResourcesManager.LevelsManager registerModule(@IntRange(from = 0, to = 999) int level) {
return mResourcesManager.level(level);
}

Expand Down Expand Up @@ -1620,7 +1620,7 @@ protected void notifyMoudleChanged(List<T> newData, T newHeader, T newFooter, in
/**
* 注册资源
*/
protected abstract void registerMoudle();
protected abstract void registerModule();

/**
* 刷新生命周期-开始
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public MyAdapterHelper() {
}

@Override
protected void registerMoudle() {
protected void registerModule() {

registerMoudle(LEVEL_1)
registerModule(LEVEL_1)
.type(ItemEntity1.TYPE_1)
.layoutResId(R.layout.item_1)
.headerResId(R.layout.header_common)
Expand All @@ -45,7 +45,7 @@ protected void registerMoudle() {
.loadingLayoutResId(R.layout.layout_loading)
.register();

registerMoudle(LEVEL_2)
registerModule(LEVEL_2)
.type(ItemEntity2.TYPE_2)
.layoutResId(R.layout.item_2)
.headerResId(R.layout.header_common)
Expand All @@ -54,14 +54,14 @@ protected void registerMoudle() {
.loadingLayoutResId(R.layout.layout_loading)
.register();

registerMoudle(LEVEL_3)
registerModule(LEVEL_3)
.type(ItemEntity3.TYPE_3)
.layoutResId(R.layout.item_3)
.loading()
.loadingLayoutResId(R.layout.layout_loading)
.register();

registerMoudle(LEVEL_4)
registerModule(LEVEL_4)
.type(ItemEntity4.TYPE_4)
.layoutResId(R.layout.item_4)
.headerResId(R.layout.header_common)
Expand Down

0 comments on commit 45373f6

Please sign in to comment.