Exemplo n.º 1
0
  public View getContentView(LocalAccount account) {
    BaseAdapter adapter = initAdapter(account);
    GridView gvApp;

    View contentView = null;
    if (refView != null) {
      contentView = refView.get();
      if (Constants.DEBUG && contentView == null) {
        Log.v("AppChangeListener", "HomePage_App View recycle");
      }
    }
    if (contentView != null) {
      gvApp = (GridView) contentView.findViewById(R.id.gvApp);
    } else {
      LayoutInflater inflater =
          (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      contentView = inflater.inflate(R.layout.home_page_content_app, null);
      ThemeUtil.setContentBackground(contentView);
      // refView = new WeakReference<View>(contentView);

      gvApp = (GridView) contentView.findViewById(R.id.gvApp);
      View emptyView = contentView.findViewById(R.id.llLoadingView);
      gvApp.setOnItemClickListener(itemClickListener);
      gvApp.setEmptyView(emptyView);
      if (Constants.DEBUG) {
        Log.v("AppChangeListener", "reclaim:" + this.getClass().getCanonicalName());
      }
    }
    gvApp.setAdapter(adapter);
    gvApp.setFastScrollEnabled(yibo.isSliderEnabled());

    return contentView;
  }