Project

General

Profile

« Previous | Next » 

Revision 1237d25d

Added by Leszek Koltunski over 2 years ago

Beginnings of the ConfigActivity.

View differences:

src/main/java/org/distorted/main/RubikActivity.java
42 42

  
43 43
import com.google.firebase.analytics.FirebaseAnalytics;
44 44

  
45
import org.distorted.config.ConfigActivity;
45 46
import org.distorted.dmesh.ObjectMesh;
46 47
import org.distorted.jsons.ObjectJson;
47 48
import org.distorted.library.main.DistortedLibrary;
......
90 91
    public static final int FLAGS2=  View.SYSTEM_UI_FLAG_LAYOUT_STABLE
91 92
                                   | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
92 93

  
94
    private static final int ACTIVITY_NUMBER = 0;
93 95
    private static final float RATIO_BAR  = 0.10f;
94 96
    private static final float RATIO_INSET= 0.08f;
95 97

  
......
106 108
    protected void onCreate(Bundle savedState)
107 109
      {
108 110
      super.onCreate(savedState);
109
      DistortedLibrary.onCreate(0);
111
      DistortedLibrary.onCreate(ACTIVITY_NUMBER);
110 112

  
111 113
      setTheme(R.style.MaterialThemeNoActionBar);
112 114
      setContentView(R.layout.main);
......
225 227
      super.onPause();
226 228
      RubikSurfaceView view = findViewById(R.id.rubikSurfaceView);
227 229
      view.onPause();
228
      DistortedLibrary.onPause(0);
230
      DistortedLibrary.onPause(ACTIVITY_NUMBER);
229 231
      RubikNetwork.onPause();
230 232
      savePreferences();
231 233
      }
......
236 238
    protected void onResume() 
237 239
      {
238 240
      super.onResume();
239
      DistortedLibrary.onResume(0);
241
      DistortedLibrary.onResume(ACTIVITY_NUMBER);
240 242
      RubikSurfaceView view = findViewById(R.id.rubikSurfaceView);
241 243
      view.onResume();
242 244
      restorePreferences();
......
263 265
    @Override
264 266
    protected void onDestroy() 
265 267
      {
266
      DistortedLibrary.onDestroy(0);
268
      DistortedLibrary.onDestroy(ACTIVITY_NUMBER);
267 269
      super.onDestroy();
268 270
      }
269 271

  
......
587 589
      myIntent.putExtra("obj", object.ordinal());
588 590
      startActivity(myIntent);
589 591
      }
592

  
593
///////////////////////////////////////////////////////////////////////////////////////////////////
594

  
595
    public void switchConfig(ObjectType object)
596
      {
597
      Intent myIntent = new Intent(this, ConfigActivity.class);
598
      myIntent.putExtra("obj", object.ordinal());
599
      startActivity(myIntent);
600
      }
590 601
}

Also available in: Unified diff