Revision 7654a99d
Added by Leszek Koltunski over 1 year ago
src/main/java/org/distorted/purchase/PurchaseActivity.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package org.distorted.purchase; |
11 | 11 |
|
12 |
import android.content.SharedPreferences; |
|
12 | 13 |
import android.os.Build; |
13 | 14 |
import android.os.Bundle; |
15 |
import android.preference.PreferenceManager; |
|
14 | 16 |
import android.util.DisplayMetrics; |
15 | 17 |
import android.view.View; |
16 | 18 |
import android.view.ViewGroup; |
... | ... | |
19 | 21 |
import androidx.appcompat.app.AppCompatActivity; |
20 | 22 |
|
21 | 23 |
import org.distorted.dialogs.RubikDialogError; |
24 |
import org.distorted.external.RubikScores; |
|
22 | 25 |
import org.distorted.library.main.DistortedLibrary; |
23 | 26 |
import org.distorted.main.R; |
24 | 27 |
import org.distorted.objectlib.main.ObjectControl; |
... | ... | |
165 | 168 |
PurchaseSurfaceView view = findViewById(R.id.purchaseSurfaceView); |
166 | 169 |
view.onPause(); |
167 | 170 |
DistortedLibrary.onPause(ACTIVITY_NUMBER); |
171 |
savePreferences(); |
|
168 | 172 |
} |
169 | 173 |
|
170 | 174 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
196 | 200 |
DistortedLibrary.onDestroy(ACTIVITY_NUMBER); |
197 | 201 |
} |
198 | 202 |
|
203 |
|
|
204 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
205 |
|
|
206 |
private void savePreferences() |
|
207 |
{ |
|
208 |
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); |
|
209 |
SharedPreferences.Editor editor = preferences.edit(); |
|
210 |
RubikScores scores = RubikScores.getInstance(); |
|
211 |
|
|
212 |
scores.savePreferencesMinimal(editor); |
|
213 |
RubikObjectList.savePreferencesMinimal(editor); |
|
214 |
|
|
215 |
boolean success = editor.commit(); |
|
216 |
if( !success ) android.util.Log.e("D", "Failed to save preferences"); |
|
217 |
} |
|
218 |
|
|
199 | 219 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
200 | 220 |
|
201 | 221 |
void OpenGLError() |
... | ... | |
252 | 272 |
return view.getRenderer(); |
253 | 273 |
} |
254 | 274 |
|
275 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
276 |
|
|
277 |
void blockUI() |
|
278 |
{ |
|
279 |
mScreen.blockUI(); |
|
280 |
} |
|
281 |
|
|
255 | 282 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
256 | 283 |
|
257 | 284 |
public static int getDrawableSize() |
Also available in: Unified diff
Purchase Pane: further progress.