Revision ce31f774
Added by Leszek Koltunski about 1 year ago
src/main/java/org/distorted/config/ConfigObjectLibInterface.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package org.distorted.config; |
11 | 11 |
|
12 |
import android.util.DisplayMetrics; |
|
13 |
|
|
12 | 14 |
import com.google.firebase.crashlytics.FirebaseCrashlytics; |
13 | 15 |
|
14 | 16 |
import org.distorted.library.message.EffectMessageSender; |
... | ... | |
16 | 18 |
import org.distorted.objectlib.helpers.BlockController; |
17 | 19 |
import org.distorted.objectlib.helpers.ObjectLibInterface; |
18 | 20 |
|
21 |
import java.lang.ref.WeakReference; |
|
22 |
|
|
19 | 23 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
20 | 24 |
|
21 | 25 |
public class ConfigObjectLibInterface implements ObjectLibInterface |
22 | 26 |
{ |
27 |
private final WeakReference<ConfigActivity> mAct; |
|
28 |
|
|
29 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
30 |
|
|
23 | 31 |
public void onWinEffectFinished(long startTime, long endTime, String debug, int scrambleNum) { } |
24 | 32 |
public void onScrambleEffectFinished() { } |
25 | 33 |
public void onBeginRotation() { } |
... | ... | |
127 | 135 |
case BlockController.TYPE_THREAD : reportThreadProblem(place,pause,resume,time); break; |
128 | 136 |
} |
129 | 137 |
} |
138 |
|
|
139 |
|
|
140 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
141 |
|
|
142 |
ConfigObjectLibInterface(ConfigActivity act) |
|
143 |
{ |
|
144 |
mAct = new WeakReference<>(act); |
|
145 |
} |
|
146 |
|
|
147 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
148 |
|
|
149 |
public int getScreenDensity() |
|
150 |
{ |
|
151 |
DisplayMetrics dm = new DisplayMetrics(); |
|
152 |
mAct.get().getWindowManager().getDefaultDisplay().getMetrics(dm); |
|
153 |
return dm.densityDpi; |
|
154 |
} |
|
130 | 155 |
} |
Also available in: Unified diff
remove all references to android.Context and android.Activity from distorted-objectlib