Project

General

Profile

« Previous | Next » 

Revision e91771e4

Added by Leszek Koltunski 9 months ago

progress with configurable stickers

View differences:

src/main/java/org/distorted/config/ConfigActivity.java
164 164
      }
165 165

  
166 166
///////////////////////////////////////////////////////////////////////////////////////////////////
167
    
167

  
168
    void repaintPuzzleFace(int cubit, int face)
169
      {
170
      if( mPane!=null )
171
        {
172
        int color = mPane.getCurrentColor();
173
        ConfigSurfaceView view = findViewById(R.id.configSurfaceView);
174
        ObjectControl control = view.getObjectControl();
175
        control.repaintPuzzleFace(cubit,face,color);
176
        }
177
      }
178

  
179
///////////////////////////////////////////////////////////////////////////////////////////////////
180

  
168 181
    @Override
169 182
    protected void onDestroy() 
170 183
      {
src/main/java/org/distorted/config/ConfigObjectLibInterface.java
15 15
import org.distorted.main.BuildConfig;
16 16
import org.distorted.objectlib.helpers.BlockController;
17 17
import org.distorted.objectlib.helpers.ObjectLibInterface;
18
import org.distorted.objectlib.main.ObjectControl;
19
import org.distorted.solvers.SolverMain;
20
import org.distorted.solverui.ScreenList;
21
import org.distorted.solverui.ScreenSolver;
22
import org.distorted.solverui.SolverActivity;
18

  
19
import java.lang.ref.WeakReference;
23 20

  
24 21
///////////////////////////////////////////////////////////////////////////////////////////////////
25 22

  
26 23
public class ConfigObjectLibInterface implements ObjectLibInterface
27 24
{
25
  private final WeakReference<ConfigActivity> mAct;
26

  
27
///////////////////////////////////////////////////////////////////////////////////////////////////
28

  
29
  ConfigObjectLibInterface(ConfigActivity act)
30
    {
31
    mAct = new WeakReference<>(act);
32
    }
33

  
34
///////////////////////////////////////////////////////////////////////////////////////////////////
35

  
28 36
  public void onWinEffectFinished(long startTime, long endTime, String debug, int scrambleNum) { }
29 37
  public void onScrambleEffectFinished() { }
30 38
  public void onBeginRotation() { }
......
132 140
    }
133 141

  
134 142
///////////////////////////////////////////////////////////////////////////////////////////////////
135
// TODO
136 143

  
137 144
  public void onReplaceModeDown(int cubit, int face)
138 145
    {
139

  
146
    ConfigActivity act = mAct.get();
147
    act.repaintPuzzleFace(cubit,face);
140 148
    }
141 149

  
142 150
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/config/ConfigSurfaceView.java
87 87
      if(!isInEditMode())
88 88
        {
89 89
        ConfigActivity act = (ConfigActivity)context;
90
        ConfigObjectLibInterface ref = new ConfigObjectLibInterface();
90
        ConfigObjectLibInterface ref = new ConfigObjectLibInterface(act);
91 91
        mInterface = new OSInterface(act,ref);
92 92
        mObjectController = new ObjectControl(mInterface);
93 93
        mObjectController.setRotateOnCreation(true);

Also available in: Unified diff