Project

General

Profile

« Previous | Next » 

Revision ac4c7a1d

Added by Leszek Koltunski about 1 year ago

Separate a OSInterface from LibInterface

View differences:

src/main/java/org/distorted/config/ConfigObjectLibInterface.java
1 1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2021 Leszek Koltunski                                                               //
2
// Copyright 2023 Leszek Koltunski                                                               //
3 3
//                                                                                               //
4 4
// This file is part of Magic Cube.                                                              //
5 5
//                                                                                               //
......
9 9

  
10 10
package org.distorted.config;
11 11

  
12
import android.util.DisplayMetrics;
13

  
14 12
import com.google.firebase.crashlytics.FirebaseCrashlytics;
15 13

  
16 14
import org.distorted.library.message.EffectMessageSender;
......
18 16
import org.distorted.objectlib.helpers.BlockController;
19 17
import org.distorted.objectlib.helpers.ObjectLibInterface;
20 18

  
21
import java.lang.ref.WeakReference;
22

  
23 19
///////////////////////////////////////////////////////////////////////////////////////////////////
24 20

  
25 21
public class ConfigObjectLibInterface implements ObjectLibInterface
26 22
{
27
  private final WeakReference<ConfigActivity> mAct;
28

  
29
///////////////////////////////////////////////////////////////////////////////////////////////////
30

  
31 23
  public void onWinEffectFinished(long startTime, long endTime, String debug, int scrambleNum) { }
32 24
  public void onScrambleEffectFinished() { }
33 25
  public void onBeginRotation() { }
......
135 127
      case BlockController.TYPE_THREAD    : reportThreadProblem(place,pause,resume,time); break;
136 128
      }
137 129
    }
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
    }
155 130
}

Also available in: Unified diff