Revision 6918030e
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/magic/RubikActivity.java | ||
---|---|---|
22 | 22 |
import android.content.SharedPreferences; |
23 | 23 |
import android.os.Bundle; |
24 | 24 |
import android.preference.PreferenceManager; |
25 |
import android.support.v4.app.FragmentManager; |
|
26 | 25 |
import android.support.v7.app.AppCompatActivity; |
27 | 26 |
import android.view.View; |
28 | 27 |
|
... | ... | |
43 | 42 |
super.onCreate(savedState); |
44 | 43 |
setTheme(R.style.CustomActivityThemeNoActionBar); |
45 | 44 |
setContentView(R.layout.main); |
46 |
|
|
47 |
if( savedState==null ) |
|
48 |
{ |
|
49 |
RubikDialogMain diag = new RubikDialogMain(); |
|
50 |
diag.show(getSupportFragmentManager(), RubikDialogMain.getDialogTag() ); |
|
51 |
} |
|
52 | 45 |
} |
53 | 46 |
|
54 | 47 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
113 | 106 |
{ |
114 | 107 |
RubikSurfaceView view = findViewById(R.id.rubikSurfaceView); |
115 | 108 |
view.enterState(this, mCurrentState); |
116 |
|
|
117 |
RubikDialogMain diag = new RubikDialogMain(); |
|
118 |
diag.show(getSupportFragmentManager(), RubikDialogMain.getDialogTag() ); |
|
119 | 109 |
} |
120 | 110 |
else |
121 | 111 |
{ |
... | ... | |
169 | 159 |
|
170 | 160 |
public void Play(View v) |
171 | 161 |
{ |
172 |
FragmentManager mana = getSupportFragmentManager(); |
|
173 |
RubikDialogMain diag = (RubikDialogMain) mana.findFragmentByTag(RubikDialogMain.getDialogTag()); |
|
174 |
|
|
175 |
if( diag!=null ) |
|
176 |
{ |
|
177 |
diag.dismiss(); |
|
178 |
} |
|
179 |
else |
|
180 |
{ |
|
181 |
android.util.Log.e("act", "cannot find main dialog!"); |
|
182 |
} |
|
183 |
|
|
184 | 162 |
mCurrentState = RubikState.PLAY; |
185 | 163 |
RubikSurfaceView view = findViewById(R.id.rubikSurfaceView); |
186 | 164 |
view.enterState(this,mCurrentState); |
Also available in: Unified diff
Major rearrangement of the UI.