Revision 5601acdd
Added by Leszek Koltunski about 1 year ago
src/main/java/org/distorted/os/OSInterface.java | ||
---|---|---|
10 | 10 |
package org.distorted.os; |
11 | 11 |
|
12 | 12 |
import android.app.Activity; |
13 |
import android.content.SharedPreferences; |
|
13 | 14 |
import android.content.res.Resources; |
14 | 15 |
import android.util.DisplayMetrics; |
15 | 16 |
import android.view.MotionEvent; |
... | ... | |
29 | 30 |
private final WeakReference<Activity> mAct; |
30 | 31 |
private MotionEvent mEvent; |
31 | 32 |
private int mPointer1, mPointer2; |
33 |
SharedPreferences.Editor mEditor; |
|
34 |
SharedPreferences mPreferences; |
|
32 | 35 |
|
33 | 36 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
34 | 37 |
|
... | ... | |
186 | 189 |
return res!=null ? res.openRawResource(id) : null; |
187 | 190 |
} |
188 | 191 |
|
192 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
193 |
// PREFERENCES |
|
194 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
195 |
|
|
196 |
public void remove(String key) |
|
197 |
{ |
|
198 |
mEditor.remove(key); |
|
199 |
} |
|
200 |
|
|
201 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
202 |
|
|
203 |
public void putInt(String key, int value) |
|
204 |
{ |
|
205 |
mEditor.putInt(key,value); |
|
206 |
} |
|
207 |
|
|
208 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
209 |
|
|
210 |
public int getInt(String key, int def) |
|
211 |
{ |
|
212 |
return mPreferences.getInt(key,def); |
|
213 |
} |
|
189 | 214 |
} |
Also available in: Unified diff
Start moving the SharedPreferences to the OSInterface