Project

General

Profile

« Previous | Next » 

Revision ce31f774

Added by Leszek Koltunski about 1 year ago

remove all references to android.Context and android.Activity from distorted-objectlib

View differences:

src/main/java/org/distorted/tutorials/TutorialObjectLibInterface.java
9 9

  
10 10
package org.distorted.tutorials;
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;
......
22 24

  
23 25
public class TutorialObjectLibInterface implements ObjectLibInterface
24 26
{
25
   WeakReference<TutorialActivity> mAct;
27
  private final WeakReference<TutorialActivity> mAct;
26 28

  
27 29
///////////////////////////////////////////////////////////////////////////////////////////////////
28 30

  
......
31 33
    mAct = new WeakReference<>(act);
32 34
    }
33 35

  
36
///////////////////////////////////////////////////////////////////////////////////////////////////
37

  
34 38
  public void onWinEffectFinished(long startTime, long endTime, String debug, int scrambleNum) { }
35 39
  public void onScrambleEffectFinished() { }
36 40
  public void onBeginRotation() { }
......
139 143

  
140 144
///////////////////////////////////////////////////////////////////////////////////////////////////
141 145

  
142
   public void onFinishRotation(int axis, int row, int angle)
146
  public void onFinishRotation(int axis, int row, int angle)
143 147
     {
144 148
     TutorialActivity act = mAct.get();
145 149
     TutorialScreen state = act.getState();
......
148 152

  
149 153
///////////////////////////////////////////////////////////////////////////////////////////////////
150 154

  
151
   public void failedToDrag()
155
  public void failedToDrag()
152 156
     {
153 157
     TutorialActivity act = mAct.get();
154 158
     TutorialScreen state = act.getState();
155 159
     state.reddenLock(act);
156 160
     }
161

  
162
///////////////////////////////////////////////////////////////////////////////////////////////////
163

  
164
  public int getScreenDensity()
165
    {
166
    DisplayMetrics dm = new DisplayMetrics();
167
    mAct.get().getWindowManager().getDefaultDisplay().getMetrics(dm);
168
    return dm.densityDpi;
169
    }
157 170
}

Also available in: Unified diff