34 |
34 |
|
35 |
35 |
class GenericViewPager
|
36 |
36 |
{
|
37 |
|
// Add here a new row to create another tab serving effects of a given type (you would also need to create
|
38 |
|
// the three layouts to fill the first 3 values of the row )
|
39 |
|
// Comment out a row to remove the tab.
|
40 |
|
//
|
41 |
37 |
static final int[] TABS =
|
42 |
|
|
43 |
|
// LAYOUT //////////// INNER LAYOUT //////// SPINNER ////////////// EffectType ///////////////////// SHOW CENTER // SHOW REGION
|
44 |
|
{ R.layout.effects3dtab0, R.id.effects3dlayout0, R.id.effects3dspinner0, EffectType.MATRIX .ordinal() , 1, 0 ,
|
45 |
|
R.layout.effects3dtab1, R.id.effects3dlayout1, R.id.effects3dspinner1, EffectType.VERTEX .ordinal() , 1, 1 ,
|
46 |
|
R.layout.effects3dtab2, R.id.effects3dlayout2, R.id.effects3dspinner2, EffectType.FRAGMENT .ordinal() , 1, 0 ,
|
47 |
|
R.layout.effects3dtab3, R.id.effects3dlayout3, R.id.effects3dspinner3, EffectType.POSTPROCESS.ordinal() , 0, 0 };
|
|
38 |
{
|
|
39 |
// Add here a new row to create another tab serving effects of a given type (you would also need to
|
|
40 |
// create a new layout to fill the first 3 values of the row ). Comment out a row to remove the tab.
|
|
41 |
//
|
|
42 |
// LAYOUT //////////// INNER LAYOUT //////// SPINNER ////////////// EFFECT_TYPE //////////////////// SHOW CENTER // SHOW REGION
|
|
43 |
R.layout.effects3dtab0, R.id.effects3dlayout0, R.id.effects3dspinner0, EffectType.MATRIX .ordinal() , 1, 0 ,
|
|
44 |
R.layout.effects3dtab1, R.id.effects3dlayout1, R.id.effects3dspinner1, EffectType.VERTEX .ordinal() , 1, 1 ,
|
|
45 |
R.layout.effects3dtab2, R.id.effects3dlayout2, R.id.effects3dspinner2, EffectType.FRAGMENT .ordinal() , 1, 0 ,
|
|
46 |
R.layout.effects3dtab3, R.id.effects3dlayout3, R.id.effects3dspinner3, EffectType.POSTPROCESS.ordinal() , 0, 0
|
|
47 |
};
|
48 |
48 |
|
49 |
49 |
static final int NUM = 6; // 6 ints required to describe 1 tab
|
50 |
50 |
private static final int NUM_TABS = TABS.length/NUM;
|
Further improvement for the Generic app.