Skip to content

Commit 7bf5fd1

Browse files
K0170016K0170016
authored andcommitted
代码规范
1 parent c13ce5f commit 7bf5fd1

File tree

20 files changed

+46
-28
lines changed

20 files changed

+46
-28
lines changed

core-arch-processor/src/main/java/com/huyingbao/core/processor/ProcessorUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class ProcessorUtil {
2626
/**
2727
* 框架包名
2828
*/
29-
public static final String PACKAGE_ROOT = "com.huyingbao.core.arch";
29+
static final String PACKAGE_ROOT = "com.huyingbao.core.arch";
3030
/**
3131
* RxApp类名
3232
*/

core-arch/src/main/java/com/huyingbao/core/arch/RxAppLifecycle.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ import androidx.lifecycle.OnLifecycleEvent
1313
*
1414
* Created by liujunfeng on 2019/1/1.
1515
*/
16-
abstract class RxAppLifecycle(protected var application: Application) : LifecycleObserver {
17-
16+
abstract class RxAppLifecycle(
17+
protected var application: Application
18+
) : LifecycleObserver {
1819
@OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
1920
abstract fun onCreate()
2021

core-arch/src/main/java/com/huyingbao/core/arch/RxFlux.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ import javax.inject.Singleton
3131
* Created by liujunfeng on 2019/1/1.
3232
*/
3333
@Singleton
34-
class RxFlux @Inject constructor() :
35-
FragmentManager.FragmentLifecycleCallbacks(),
36-
Application.ActivityLifecycleCallbacks {
34+
class RxFlux @Inject constructor() : FragmentManager.FragmentLifecycleCallbacks(), Application.ActivityLifecycleCallbacks {
3735
/**
3836
* [Inject] 用来标记需要注入的依赖, 被标注的属性不能使用private修饰,否则无法注入
3937
*/

core-arch/src/main/java/com/huyingbao/core/arch/action/RxActionCreator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import java.util.logging.Level
2525
*/
2626
abstract class RxActionCreator(
2727
private val rxDispatcher: RxDispatcher,
28-
private val rxActionManager: RxActionManager) {
29-
28+
private val rxActionManager: RxActionManager
29+
) {
3030
/**
3131
* 创建新的[RxAction]
3232
*

core-arch/src/main/java/com/huyingbao/core/arch/dispatcher/RxDispatcher.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import org.greenrobot.eventbus.EventBus
1515
* Created by liujunfeng on 2019/1/1.
1616
*/
1717
class RxDispatcher {
18-
1918
/**
2019
* [RxStore]注册订阅。
2120
*/

core-arch/src/main/java/com/huyingbao/core/arch/lifecycle/RxActivityLifecycleObserver.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ import com.huyingbao.core.arch.view.RxFluxView
1313
*
1414
* Created by liujunfeng on 2019/1/1.
1515
*/
16-
class RxActivityLifecycleObserver(private val activity: Activity) : LifecycleObserver {
17-
16+
class RxActivityLifecycleObserver(
17+
private val activity: Activity
18+
) : LifecycleObserver {
1819
/**
1920
* 在onCreate(Bundle)完成依赖注入之后调用
2021
*/

core-arch/src/main/java/com/huyingbao/core/arch/lifecycle/RxFragmentLifecycleObserver.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import com.huyingbao.core.arch.view.RxFluxView
1212
*
1313
* Created by liujunfeng on 2019/1/1.
1414
*/
15-
class RxFragmentLifecycleObserver(private val fragment: Fragment) : LifecycleObserver {
16-
15+
class RxFragmentLifecycleObserver(
16+
private val fragment: Fragment
17+
) : LifecycleObserver {
1718
/**
1819
* 在onAttach()完成依赖注入之后调用
1920
*/

core-arch/src/main/java/com/huyingbao/core/arch/model/RxAction.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class RxAction private constructor(
1515
tag: String,
1616
val data: ArrayMap<String, Any>
1717
) : EventBusEvent(tag) {
18-
1918
/**
2019
* 获取ArrayMap中Key对应的Value
2120
*/

core-arch/src/main/java/com/huyingbao/core/arch/model/RxRetry.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import org.greenrobot.eventbus.EventBusEvent
55

66
/**
77
* 操作异常重试通知,发送到[}][com.huyingbao.core.arch.view.RxFluxView]
8+
*
9+
* Created by liujunfeng on 2019/1/1.
810
*/
911
class RxRetry<T> private constructor(
1012
tag: String,

core-arch/src/main/java/com/huyingbao/core/arch/store/RxFragmentStore.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,20 @@ import com.huyingbao.core.arch.model.RxChange
1919
*
2020
* Created by liujunfeng on 2019/1/1.
2121
*/
22-
abstract class RxFragmentStore(private val mRxDispatcher: RxDispatcher) : ViewModel(), LifecycleObserver, RxStore {
22+
abstract class RxFragmentStore(
23+
private val rxDispatcher: RxDispatcher
24+
) : ViewModel(), LifecycleObserver, RxStore {
2325

2426
/**
2527
* 在所关联对象(Fragment)[Lifecycle.Event.ON_CREATE]时,注册到[RxDispatcher]
2628
*/
2729
@OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
2830
fun subscribe() {
29-
if (mRxDispatcher.isSubscribe(this)) {
31+
if (rxDispatcher.isSubscribe(this)) {
3032
return
3133
}
3234
Log.i(RxFlux.TAG, "Subscribe RxFragmentStore : " + javaClass.simpleName)
33-
mRxDispatcher.subscribeRxStore(this)
35+
rxDispatcher.subscribeRxStore(this)
3436
}
3537

3638

@@ -40,10 +42,10 @@ abstract class RxFragmentStore(private val mRxDispatcher: RxDispatcher) : ViewMo
4042
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
4143
fun unsubscribe() {
4244
Log.i(RxFlux.TAG, "Unsubscribe RxFragmentStore : " + javaClass.simpleName)
43-
mRxDispatcher.unsubscribeRxStore(this)
45+
rxDispatcher.unsubscribeRxStore(this)
4446
}
4547

4648
override fun postChange(rxChange: RxChange) {
47-
mRxDispatcher.postRxChange(rxChange)
49+
rxDispatcher.postRxChange(rxChange)
4850
}
4951
}

0 commit comments

Comments
 (0)