Search in sources :

Example 1 with MemoryDetailSegment

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;
}
Also used : AnimatedTimeRange(com.android.tools.adtui.AnimatedTimeRange) MemoryInfoTreeNode(com.android.tools.idea.monitor.ui.memory.model.MemoryInfoTreeNode) ArrayList(java.util.ArrayList) Range(com.android.tools.adtui.model.Range) AnimatedTimeRange(com.android.tools.adtui.AnimatedTimeRange) MemorySegment(com.android.tools.idea.monitor.ui.memory.view.MemorySegment) MemoryDetailSegment(com.android.tools.idea.monitor.ui.memory.view.MemoryDetailSegment) Animatable(com.android.tools.adtui.Animatable) ProfilerEventListener(com.android.tools.idea.monitor.tool.ProfilerEventListener)

Aggregations

Animatable (com.android.tools.adtui.Animatable)1 AnimatedTimeRange (com.android.tools.adtui.AnimatedTimeRange)1 Range (com.android.tools.adtui.model.Range)1 ProfilerEventListener (com.android.tools.idea.monitor.tool.ProfilerEventListener)1 MemoryInfoTreeNode (com.android.tools.idea.monitor.ui.memory.model.MemoryInfoTreeNode)1 MemoryDetailSegment (com.android.tools.idea.monitor.ui.memory.view.MemoryDetailSegment)1 MemorySegment (com.android.tools.idea.monitor.ui.memory.view.MemorySegment)1 ArrayList (java.util.ArrayList)1