Project

General

Profile

« Previous | Next » 

Revision 280dc794

Added by Leszek Koltunski over 2 years ago

Improve the behaviour of the Config and Tutorial activities when in the 'PopUpMode'. Also, remember the current object in the COnfig activity so that when we put it to the background and resume - the object stays.

View differences:

src/main/java/org/distorted/config/ConfigActivity.java
35 35
import org.distorted.dmesh.ObjectMesh;
36 36
import org.distorted.jsons.ObjectJson;
37 37
import org.distorted.library.main.DistortedLibrary;
38
import org.distorted.library.type.Static4D;
39 38
import org.distorted.main.R;
40 39
import org.distorted.objectlib.main.ObjectControl;
41
import org.distorted.objectlib.main.ShapeDodecahedron;
42
import org.distorted.objectlib.main.ShapeHexahedron;
43
import org.distorted.objectlib.main.ShapeOctahedron;
44
import org.distorted.objectlib.main.ShapeTetrahedron;
45 40
import org.distorted.objects.RubikObject;
46 41
import org.distorted.objects.RubikObjectList;
47 42

  
......
138 133
        }
139 134
      }
140 135

  
141
///////////////////////////////////////////////////////////////////////////////////////////////////
142

  
143
    @Override
144
    public void onAttachedToWindow()
145
      {
146
      super.onAttachedToWindow();
147

  
148
      if( mScreen==null ) mScreen = new ConfigScreen();
149
      mScreen.onAttachedToWindow(this,mObjectOrdinal);
150
      }
151

  
152 136
///////////////////////////////////////////////////////////////////////////////////////////////////
153 137
// do not avoid cutouts
154 138

  
......
194 178
      ConfigSurfaceView view = findViewById(R.id.configSurfaceView);
195 179
      view.onResume();
196 180

  
181
      if( mScreen==null ) mScreen = new ConfigScreen();
182
      mScreen.onAttachedToWindow(this,mObjectOrdinal);
183

  
197 184
      if( mObjectOrdinal>=0 && mObjectOrdinal< RubikObjectList.getNumObjects() )
198 185
        {
199 186
        RubikObject object = RubikObjectList.getObject(mObjectOrdinal);
......
240 227
// PUBLIC API
241 228
///////////////////////////////////////////////////////////////////////////////////////////////////
242 229

  
243
    public void changeObject(RubikObject object)
230
    public void changeObject(int ordinal)
244 231
      {
232
      mObjectOrdinal = ordinal;
233
      RubikObject object = RubikObjectList.getObject(ordinal);
245 234
      ConfigSurfaceView view = findViewById(R.id.configSurfaceView);
246 235
      ObjectControl control = view.getObjectControl();
247 236
      changeIfDifferent(object,control);

Also available in: Unified diff