1
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2
|
// Copyright 2023 Leszek Koltunski //
|
3
|
// //
|
4
|
// This file is part of Magic Cube. //
|
5
|
// //
|
6
|
// Magic Cube is proprietary software licensed under an EULA which you should have received //
|
7
|
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html //
|
8
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
9
|
|
10
|
package org.distorted.tutorials;
|
11
|
|
12
|
import android.util.DisplayMetrics;
|
13
|
|
14
|
import org.distorted.objectlib.helpers.OperatingSystemInterface;
|
15
|
|
16
|
import java.lang.ref.WeakReference;
|
17
|
|
18
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
19
|
|
20
|
public class TutorialOSInterface implements OperatingSystemInterface
|
21
|
{
|
22
|
private final WeakReference<TutorialActivity> mAct;
|
23
|
|
24
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
25
|
|
26
|
TutorialOSInterface(TutorialActivity act)
|
27
|
{
|
28
|
mAct = new WeakReference<>(act);
|
29
|
}
|
30
|
|
31
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
32
|
|
33
|
public int getScreenDensity()
|
34
|
{
|
35
|
DisplayMetrics dm = new DisplayMetrics();
|
36
|
mAct.get().getWindowManager().getDefaultDisplay().getMetrics(dm);
|
37
|
return dm.densityDpi;
|
38
|
}
|
39
|
}
|