Project

General

Profile

« Previous | Next » 

Revision d433b50e

Added by Leszek Koltunski over 2 years ago

In the 'magic' app, ObjectType is now only used in RubikObject and RubikObjectList classes and nowhere else.
This is a major step towards being able to download objects from an online repository.

View differences:

src/main/java/org/distorted/dialogs/RubikDialogPattern.java
39 39
import android.widget.ImageView;
40 40
import android.widget.TextView;
41 41

  
42
import org.distorted.objectlib.main.ObjectType;
43

  
44 42
import org.distorted.main.R;
45 43
import org.distorted.main.RubikActivity;
44
import org.distorted.objects.RubikObject;
45
import org.distorted.objects.RubikObjectList;
46 46
import org.distorted.patterns.RubikPatternList;
47 47
import org.distorted.screens.RubikScreenPlay;
48 48
import org.distorted.screens.ScreenList;
......
94 94

  
95 95
    for(int i=0; i< RubikPatternList.NUM_OBJECTS; i++)
96 96
      {
97
      ObjectType type = RubikPatternList.getObject(i);
98
      int iconSize    = RubikActivity.getDrawableSize();
99
      int iconID      = type.getIconID(iconSize);
97
      int ordinal  = RubikPatternList.getObject(i);
98
      RubikObject object = RubikObjectList.getObject(ordinal);
99
      int iconSize= RubikActivity.getDrawableSize();
100
      int iconID  = object==null ? 0 : object.getIconID(iconSize);
100 101

  
101 102
      ImageView imageView = new ImageView(act);
102 103
      imageView.setImageResource(iconID);
......
131 132
  private int getPatternOrdinal()
132 133
    {
133 134
    RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass();
134
    ObjectType obj  = play.getObject();
135
    int obj  = play.getObject();
135 136
    int ret = RubikPatternList.getOrdinal(obj);
136 137

  
137 138
    if( ret<0 )

Also available in: Unified diff