From 45373f6a1f0038e4c160a18d015889ef1b262d9c Mon Sep 17 00:00:00 2001 From: crazysunj Date: Fri, 21 Sep 2018 14:16:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=BAmodule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../expand/OpenCloseAdapterHelper.java | 8 ++++---- .../helper/ErrorAndEmptyAdapterHelper.java | 10 +++++----- .../helper/RxAdapterHelper.java | 10 +++++----- .../helper/SimpleHelper.java | 10 +++++----- .../switchtype/SwitchTypeAdapterHelper.java | 12 ++++++------ .../testlevel/TestLevelAdapterHelper.java | 8 ++++---- config.gradle | 2 +- .../compiler/AdapterHelperProcessor.java | 4 ++-- .../helper/RecyclerViewAdapterHelper.java | 6 +++--- .../sample/adapter/helper/MyAdapterHelper.java | 10 +++++----- 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/expand/OpenCloseAdapterHelper.java b/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/expand/OpenCloseAdapterHelper.java index 845f63d..eb3ffe2 100644 --- a/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/expand/OpenCloseAdapterHelper.java +++ b/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/expand/OpenCloseAdapterHelper.java @@ -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) @@ -42,7 +42,7 @@ 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) @@ -50,7 +50,7 @@ protected void registerMoudle() { .minSize(2) .register(); - registerMoudle(LEVEL_THIRD) + registerModule(LEVEL_THIRD) .type(ThirdOCEntity.OC_THIRD_TYPE) .layoutResId(R.layout.item_third) .headerResId(R.layout.item_header) diff --git a/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/helper/ErrorAndEmptyAdapterHelper.java b/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/helper/ErrorAndEmptyAdapterHelper.java index b9e1952..11a6d4a 100644 --- a/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/helper/ErrorAndEmptyAdapterHelper.java +++ b/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/helper/ErrorAndEmptyAdapterHelper.java @@ -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) @@ -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) @@ -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) @@ -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) diff --git a/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/helper/RxAdapterHelper.java b/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/helper/RxAdapterHelper.java index ea900de..04c880e 100644 --- a/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/helper/RxAdapterHelper.java +++ b/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/helper/RxAdapterHelper.java @@ -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) @@ -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) @@ -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) @@ -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) diff --git a/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/helper/SimpleHelper.java b/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/helper/SimpleHelper.java index fdc77ac..d4c96d6 100644 --- a/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/helper/SimpleHelper.java +++ b/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/helper/SimpleHelper.java @@ -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) @@ -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) @@ -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) @@ -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) diff --git a/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/switchtype/SwitchTypeAdapterHelper.java b/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/switchtype/SwitchTypeAdapterHelper.java index 80abbbe..31f3db7 100644 --- a/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/switchtype/SwitchTypeAdapterHelper.java +++ b/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/switchtype/SwitchTypeAdapterHelper.java @@ -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) diff --git a/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/testlevel/TestLevelAdapterHelper.java b/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/testlevel/TestLevelAdapterHelper.java index b8f5da0..8e3c990 100644 --- a/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/testlevel/TestLevelAdapterHelper.java +++ b/app/src/main/java/com/crazysunj/multityperecyclerviewadapter/testlevel/TestLevelAdapterHelper.java @@ -25,8 +25,8 @@ public TestLevelAdapterHelper(List 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) @@ -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) @@ -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) diff --git a/config.gradle b/config.gradle index 6afe211..22b6d83 100644 --- a/config.gradle +++ b/config.gradle @@ -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'] diff --git a/multitypeadapter-compiler/src/main/java/com/crazysunj/multitypeadapter/compiler/AdapterHelperProcessor.java b/multitypeadapter-compiler/src/main/java/com/crazysunj/multitypeadapter/compiler/AdapterHelperProcessor.java index a599db2..472e671 100644 --- a/multitypeadapter-compiler/src/main/java/com/crazysunj/multitypeadapter/compiler/AdapterHelperProcessor.java +++ b/multitypeadapter-compiler/src/main/java/com/crazysunj/multitypeadapter/compiler/AdapterHelperProcessor.java @@ -62,7 +62,7 @@ public boolean process(Set 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); @@ -224,7 +224,7 @@ public boolean process(Set 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"); diff --git a/multitypeadapter/src/main/java/com/crazysunj/multitypeadapter/helper/RecyclerViewAdapterHelper.java b/multitypeadapter/src/main/java/com/crazysunj/multitypeadapter/helper/RecyclerViewAdapterHelper.java index 652e4ed..cd7b80e 100644 --- a/multitypeadapter/src/main/java/com/crazysunj/multitypeadapter/helper/RecyclerViewAdapterHelper.java +++ b/multitypeadapter/src/main/java/com/crazysunj/multitypeadapter/helper/RecyclerViewAdapterHelper.java @@ -236,7 +236,7 @@ public RecyclerViewAdapterHelper(List data, @RefreshMode int mode) { mResourcesManager = new ResourcesManager(); mRefreshQueue = new LinkedList<>(); - registerMoudle(); + registerModule(); if (mCurrentMode == MODE_STANDARD && !mData.isEmpty()) { List newData = initStandardNewData(mData); @@ -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); } @@ -1620,7 +1620,7 @@ protected void notifyMoudleChanged(List newData, T newHeader, T newFooter, in /** * 注册资源 */ - protected abstract void registerMoudle(); + protected abstract void registerModule(); /** * 刷新生命周期-开始 diff --git a/sample/src/main/java/com/crazysunj/sample/adapter/helper/MyAdapterHelper.java b/sample/src/main/java/com/crazysunj/sample/adapter/helper/MyAdapterHelper.java index 6bb3c70..c04e14c 100644 --- a/sample/src/main/java/com/crazysunj/sample/adapter/helper/MyAdapterHelper.java +++ b/sample/src/main/java/com/crazysunj/sample/adapter/helper/MyAdapterHelper.java @@ -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) @@ -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) @@ -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)