Revision 13a3dfa9
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/bandaged/BandagedCreatorActivity.java | ||
---|---|---|
173 | 173 |
BandagedCreatorView view = findViewById(R.id.bandagedCreatorObjectView); |
174 | 174 |
view.onPause(); |
175 | 175 |
DistortedLibrary.onPause(ACTIVITY_NUMBER); |
176 |
savePreferences(); |
|
176 | 177 |
} |
177 | 178 |
|
178 | 179 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
184 | 185 |
DistortedLibrary.onResume(ACTIVITY_NUMBER); |
185 | 186 |
BandagedCreatorView view = findViewById(R.id.bandagedCreatorObjectView); |
186 | 187 |
view.onResume(); |
188 |
restorePreferences(); |
|
187 | 189 |
|
188 | 190 |
if( mScreen==null ) mScreen = new BandagedCreatorScreen(); |
189 | 191 |
mScreen.onAttachedToWindow(this); |
... | ... | |
208 | 210 |
errDiag.show(getSupportFragmentManager(), null); |
209 | 211 |
} |
210 | 212 |
|
213 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
214 |
|
|
215 |
private void savePreferences() |
|
216 |
{ |
|
217 |
/* |
|
218 |
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); |
|
219 |
SharedPreferences.Editor editor = preferences.edit(); |
|
220 |
|
|
221 |
editor.putBoolean("policyAccepted", mPolicyAccepted); |
|
222 |
editor.putString("appVersion", getAppVers() ); |
|
223 |
|
|
224 |
editor.apply(); |
|
225 |
*/ |
|
226 |
} |
|
227 |
|
|
228 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
229 |
|
|
230 |
private void restorePreferences() |
|
231 |
{ |
|
232 |
/* |
|
233 |
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); |
|
234 |
|
|
235 |
mPolicyAccepted = preferences.getBoolean("policyAccepted", false); |
|
236 |
String oldVersion = preferences.getString("appVersion",""); |
|
237 |
*/ |
|
238 |
} |
|
239 |
|
|
211 | 240 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
212 | 241 |
// PUBLIC API |
213 | 242 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/bandaged/BandagedCreatorRenderer.java | ||
---|---|---|
252 | 252 |
|
253 | 253 |
mScreen.detachAll(); |
254 | 254 |
int len = POSITIONS.length; |
255 |
int touched = mView.getTouched(); |
|
255 | 256 |
|
256 | 257 |
for(int i=0; i<len; i++) |
257 | 258 |
if( mCubits[i].isAttached() ) |
258 | 259 |
{ |
259 | 260 |
mCubits[i].scaleMove(mScaleValue); |
260 |
mCubits[i].setTexture(COLOR_DEFAULT); |
|
261 |
mCubits[i].setTexture( touched==i ? COLOR_MARKED : COLOR_DEFAULT);
|
|
261 | 262 |
DistortedNode node = mCubits[i].getNode(); |
262 | 263 |
mScreen.attach(node); |
263 | 264 |
} |
src/main/java/org/distorted/bandaged/BandagedCreatorView.java | ||
---|---|---|
93 | 93 |
} |
94 | 94 |
} |
95 | 95 |
|
96 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
97 |
|
|
98 |
public int getTouched() |
|
99 |
{ |
|
100 |
return mTouchedIndex1; |
|
101 |
} |
|
102 |
|
|
96 | 103 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
97 | 104 |
|
98 | 105 |
public BandagedCreatorRenderer getRenderer() |
Also available in: Unified diff
Bandaged 3x3 UI: remember touched cubits.