コード例 #1
0
  private void initData() {
    // TODO Auto-generated method stub
    mGridViewData1 = new ArrayList<ThemeItemPreview>();
    mGridViewData2 = new ArrayList<ThemeItemPreview>();

    for (int i = 0; i < 15; i++) {
      ThemeItemPreview itemPreview = new ThemeItemPreview();
      if (i % 2 == 0) {
        itemPreview.setPreviewResouceID(R.drawable.a);
      } else {
        itemPreview.setPreviewResouceID(R.drawable.b);
      }
      itemPreview.setThemeName(getResources().getString(R.string.app_name) + i);
      itemPreview.setThemePrice(0.0);
      mGridViewData1.add(itemPreview);
      mGridViewData2.add(itemPreview);
    }

    mHotAdapter = new HotAdapter(this);
    mHotAdapter.setData(mGridViewData1);
    mGridView1.setAdapter(mHotAdapter);
    mClassicAdapter = new ClassicAdapter(this);
    mClassicAdapter.setData(mGridViewData2);
    mGridView2.setAdapter(mClassicAdapter);

    mSortAdapter = new SortAdapter(this);
    mGridView3.setAdapter(mSortAdapter);
  }
コード例 #2
0
 @Override
 public void execute(String url) {
   // TODO Auto-generated method stub
   Toast.makeText(ThemeModuleAcitivy.this, url, 500).show();
   int oldCount = mGridViewData1.size();
   for (int i = oldCount; i < oldCount + 6; i++) {
     ThemeItemPreview itemPreview = new ThemeItemPreview();
     if (i % 2 == 0) {
       itemPreview.setPreviewResouceID(R.drawable.a);
     } else {
       itemPreview.setPreviewResouceID(R.drawable.b);
     }
     itemPreview.setThemeName(getResources().getString(R.string.app_name) + i);
     itemPreview.setThemePrice(0.0);
     mGridViewData1.add(itemPreview);
   }
   mHotAdapter.setData(mGridViewData1);
 }