-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
169 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
app/src/main/java/me/yifeiyuan/flapdev/ComponentMonitor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package me.yifeiyuan.flapdev; | ||
|
||
import android.os.SystemClock; | ||
import android.util.Log; | ||
|
||
import me.yifeiyuan.flap.FlapComponent; | ||
import me.yifeiyuan.flap.extensions.ComponentFlowListener; | ||
import me.yifeiyuan.flap.internal.ComponentProxy; | ||
/** | ||
* Flap Github: <a>https://github.com/AlanCheen/Flap</a> | ||
* | ||
* @author 程序亦非猿 [Follow me](<a> https://github.com/AlanCheen</a>) | ||
* @since 2020/3/24 11:14 PM | ||
* @since 1.0 | ||
*/ | ||
public class ComponentMonitor implements ComponentFlowListener { | ||
|
||
private static final String TAG = "ComponentMonitor"; | ||
|
||
private long createTime; | ||
private long bindTime; | ||
|
||
@Override | ||
public void onStartCreateComponent(final ComponentProxy factory) { | ||
Log.d(TAG, "开始使用 " + factory.getClass().getSimpleName() + " 创建组件"); | ||
createTime = SystemClock.uptimeMillis(); | ||
} | ||
|
||
@Override | ||
public void onComponentCreated(final ComponentProxy factory, final FlapComponent component) { | ||
long timeCost = SystemClock.uptimeMillis() - createTime; | ||
Log.d(TAG, "组件 " + component.getClass().getSimpleName() + " 创建完毕,耗时 " + timeCost + " 毫秒"); | ||
} | ||
|
||
@Override | ||
public void onStartBindComponent(final FlapComponent component, final int position, final Object model) { | ||
Log.d(TAG, "开始绑定组件 [" + component.getClass().getSimpleName() + "], position = [" + position + "], model = [" + model + "]"); | ||
bindTime = SystemClock.uptimeMillis(); | ||
} | ||
|
||
@Override | ||
public void onComponentBound(final FlapComponent component, final int position, final Object model) { | ||
Log.d(TAG, "组件绑定完毕,耗时 " + (SystemClock.uptimeMillis() - bindTime) + " 毫秒"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters