Revision 61420934
Added by Leszek Koltunski over 5 years ago
| src/main/java/org/distorted/examples/generic/GenericActivity.java | ||
|---|---|---|
| 216 | 216 | 
     | 
| 217 | 217 | 
    public void Create(View v)  | 
| 218 | 218 | 
        {
   | 
| 219 | 
    Intent mainInt = new Intent( getApplicationContext(), GenericActivity2.class);  | 
|
| 219 | 
         Intent mainInt = new Intent( getApplicationContext(), GenericActivity2.class);
   | 
|
| 220 | 220 | 
    Bundle b = new Bundle();  | 
| 221 | 221 | 
     | 
| 222 | 
    int rows,cols;  | 
|
| 223 | 
     | 
|
| 224 | 
    switch( GenericMeshList.getDimension(mObjectType) )  | 
|
| 225 | 
          {
   | 
|
| 226 | 
    case 0: rows = 1; // a quad  | 
|
| 227 | 
    cols = 1;  | 
|
| 228 | 
    break;  | 
|
| 229 | 
    case 1: rows = mNumRows; // Triangles, Sphere  | 
|
| 230 | 
    cols = mNumRows;  | 
|
| 231 | 
    break;  | 
|
| 232 | 
    default:rows = mNumRows;  | 
|
| 233 | 
    cols = mNumCols;  | 
|
| 234 | 
    break;  | 
|
| 235 | 
    }  | 
|
| 236 | 
     | 
|
| 237 | 
        b.putInt("type", mObjectType);
   | 
|
| 238 | 
        b.putInt("cols", cols);
   | 
|
| 239 | 
        b.putInt("rows", rows);
   | 
|
| 240 | 
        b.putInt("slices", mNumSlic);
   | 
|
| 222 | 
        b.putInt("type"  , mObjectType);
   | 
|
| 223 | 
        b.putInt("cols"  , GenericMeshList.getCols(mObjectType, mNumCols, mNumRows, mNumSlic) );
   | 
|
| 224 | 
        b.putInt("rows"  , GenericMeshList.getRows(mObjectType, mNumCols, mNumRows, mNumSlic) );
   | 
|
| 225 | 
        b.putInt("slices", GenericMeshList.getSlic(mObjectType, mNumCols, mNumRows, mNumSlic) );
   | 
|
| 241 | 226 | 
        b.putInt("bitmap", mBitmapID);
   | 
| 242 | 227 | 
     | 
| 243 | 
    if( mObjectType==0 ) // cubes  | 
|
| 244 | 
          {
   | 
|
| 245 | 
    String str = "";  | 
|
| 246 | 
     | 
|
| 247 | 
    for(int i=0; i<mNumRows*mNumCols; i++)  | 
|
| 248 | 
    str += mShape[i] ? "1" : "0";  | 
|
| 249 | 
     | 
|
| 250 | 
          b.putString("string", str);
   | 
|
| 251 | 
    }  | 
|
| 252 | 
    else  | 
|
| 253 | 
          {
   | 
|
| 254 | 
          b.putString("string", "");
   | 
|
| 255 | 
    }  | 
|
| 228 | 
        b.putString("string", GenericMeshList.getString(mObjectType, mNumCols, mNumRows, mShape));
   | 
|
| 256 | 229 | 
     | 
| 257 | 230 | 
    mainInt.putExtras(b);  | 
| 258 | 231 | 
    startActivity(mainInt);  | 
Also available in: Unified diff
Prepare Generic for the stretchless API.