Optimize Dashboard loading
- prevent loading categories twice - add some logging to see the time taken for building the Dashboard titles Change-Id: I31724c0e66fe3b453a87f12476f58db84c73423f
This commit is contained in:
@@ -27,6 +27,7 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -79,6 +80,7 @@ public class DashboardSummary extends Fragment implements OnAccountsUpdateListen
|
||||
}
|
||||
|
||||
private void rebuildUI(Context context) {
|
||||
long start = System.currentTimeMillis();
|
||||
final Resources res = getResources();
|
||||
|
||||
mDashboard.removeAllViews();
|
||||
@@ -116,6 +118,8 @@ public class DashboardSummary extends Fragment implements OnAccountsUpdateListen
|
||||
// Add the category
|
||||
mDashboard.addView(categoryView);
|
||||
}
|
||||
long delta = System.currentTimeMillis() - start;
|
||||
Log.d(LOG_TAG, "rebuildUI took: " + delta + " ms");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user