// initializes the girdview of platforms
  public void afterPlatformListGot() {
    PlatformAdapter adapter = new PlatformAdapter(this);
    pager.setAdapter(adapter);
    int pageCount = 0;
    if (platformList != null) {
      int cusSize = customers == null ? 0 : customers.size();
      int platSize = platformList == null ? 0 : platformList.length;
      int hideSize = hiddenPlatforms == null ? 0 : hiddenPlatforms.size();
      platSize = platSize - hideSize;
      int size = platSize + cusSize;
      pageCount = size / PAGE_SIZE;
      if (size % PAGE_SIZE > 0) {
        pageCount++;
      }
    }
    points = new ImageView[pageCount];
    if (points.length <= 0) {
      return;
    }

    Context context = getContext();
    LinearLayout llPoints = new LinearLayout(context);
    // if the total number of pages exceeds 1, we set the page indicators
    llPoints.setVisibility(pageCount > 1 ? View.VISIBLE : View.GONE);
    LayoutParams lpLl = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    lpLl.gravity = Gravity.CENTER_HORIZONTAL;
    llPoints.setLayoutParams(lpLl);
    addView(llPoints);

    int dp_5 = com.mob.tools.utils.R.dipToPx(context, 5);
    int resId = getBitmapRes(getContext(), "light_blue_point");
    if (resId > 0) {
      grayPoint = BitmapFactory.decodeResource(getResources(), resId);
    }
    resId = getBitmapRes(getContext(), "blue_point");
    if (resId > 0) {
      bluePoint = BitmapFactory.decodeResource(getResources(), resId);
    }
    for (int i = 0; i < pageCount; i++) {
      points[i] = new ImageView(context);
      points[i].setScaleType(ScaleType.CENTER_INSIDE);
      points[i].setImageBitmap(grayPoint);
      LayoutParams lpIv = new LayoutParams(dp_5, dp_5);
      lpIv.setMargins(dp_5, dp_5, dp_5, 0);
      points[i].setLayoutParams(lpIv);
      llPoints.addView(points[i]);
    }
    int curPage = pager.getCurrentScreen();
    points[curPage].setImageBitmap(bluePoint);
  }
    private LinearLayout getView(int position, OnClickListener ocL, Context context) {
      Bitmap logo;
      String label;
      OnClickListener listener;
      if (beans[position] instanceof Platform) {
        logo = getIcon((Platform) beans[position]);
        label = getName((Platform) beans[position]);
        listener = ocL;
      } else {
        logo = ((CustomerLogo) beans[position]).enableLogo;
        label = ((CustomerLogo) beans[position]).label;
        listener = ocL;
      }

      LinearLayout ll = new LinearLayout(context);
      ll.setOrientation(LinearLayout.VERTICAL);

      ImageView iv = new ImageView(context);
      int dp_5 = com.mob.tools.utils.R.dipToPx(context, 5);
      iv.setPadding(dp_5, dp_5, dp_5, dp_5);
      iv.setScaleType(ScaleType.CENTER_INSIDE);
      LayoutParams lpIv = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
      lpIv.setMargins(dp_5, dp_5, dp_5, dp_5);
      lpIv.gravity = Gravity.CENTER_HORIZONTAL;
      iv.setLayoutParams(lpIv);
      iv.setImageBitmap(logo);
      ll.addView(iv);

      TextView tv = new TextView(context);
      tv.setTextColor(0xff000000);
      tv.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
      tv.setSingleLine();
      tv.setIncludeFontPadding(false);
      LayoutParams lpTv = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
      lpTv.gravity = Gravity.CENTER_HORIZONTAL;
      lpTv.weight = 1;
      lpTv.setMargins(dp_5, 0, dp_5, dp_5);
      tv.setLayoutParams(lpTv);
      tv.setText(label);
      ll.addView(tv);
      ll.setOnClickListener(listener);

      return ll;
    }
    private void init() {
      int dp_5 = com.mob.tools.utils.R.dipToPx(getContext(), 5);
      setPadding(0, dp_5, 0, dp_5);
      setOrientation(VERTICAL);

      int size = beans == null ? 0 : beans.length;
      int COLUMN_PER_LINE = platformAdapter.platformGridView.COLUMN_PER_LINE;
      int lineSize = size / COLUMN_PER_LINE;
      if (size % COLUMN_PER_LINE > 0) {
        lineSize++;
      }
      LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
      lp.weight = 1;
      for (int i = 0; i < lines; i++) {
        LinearLayout llLine = new LinearLayout(getContext());
        llLine.setLayoutParams(lp);
        llLine.setPadding(dp_5, 0, dp_5, 0);
        addView(llLine);

        if (i >= lineSize) {
          continue;
        }

        for (int j = 0; j < COLUMN_PER_LINE; j++) {
          final int index = i * COLUMN_PER_LINE + j;
          if (index >= size) {
            LinearLayout llItem = new LinearLayout(getContext());
            llItem.setLayoutParams(lp);
            llLine.addView(llItem);
            continue;
          }

          final LinearLayout llItem = getView(index, callback, getContext());
          llItem.setTag(beans[index]);
          llItem.setLayoutParams(lp);
          llLine.addView(llItem);
        }
      }
    }