use of com.android.tools.idea.monitor.ui.memory.view.MemoryDetailSegment in project android by JetBrains.
the class MemoryProfilerVisualTest method createComponentsList.
@Override
protected List<Animatable> createComponentsList() {
long startTimeUs = mDataStore.getLatestTimeUs();
Range timeCurrentRangeUs = new Range(startTimeUs - RangeScrollbar.DEFAULT_VIEW_LENGTH_US, startTimeUs);
AnimatedTimeRange animatedTimeRange = new AnimatedTimeRange(timeCurrentRangeUs, 0);
EventDispatcher<ProfilerEventListener> dummyDispatcher = EventDispatcher.create(ProfilerEventListener.class);
mSegment = new MemorySegment(timeCurrentRangeUs, mDataStore, dummyDispatcher);
mRoot = new MemoryInfoTreeNode("Root");
mDetailSegment = new MemoryDetailSegment(timeCurrentRangeUs, mRoot, dummyDispatcher);
List<Animatable> animatables = new ArrayList<>();
animatables.add(animatedTimeRange);
mSegment.createComponentsList(animatables);
mDetailSegment.createComponentsList(animatables);
// Simulate allocation data with stack frames.
mUpdateDataThread = new Thread() {
@Override
public void run() {
try {
while (true) {
updateTree(mRoot);
Thread.sleep(10);
}
} catch (InterruptedException e) {
}
}
};
mUpdateDataThread.start();
return animatables;
}
Aggregations