Project

General

Profile

« Previous | Next » 

Revision 9b739a74

Added by Leszek Koltunski about 11 hours ago

minor

View differences:

src/main/java/org/distorted/config/ConfigActivity.java
24 24
import org.distorted.objectlib.main.TwistyObject;
25 25
import org.distorted.objects.RubikObject;
26 26
import org.distorted.objects.RubikObjectList;
27
import org.distorted.os.OSInterface;
28 27

  
29 28
import java.io.InputStream;
30 29

  
......
38 37
    private int mObjectOrdinal;
39 38
    private boolean mSupportsAdjColors;
40 39
    private boolean mDisplayMessageDialog;
40
    private float mBorders, mCorners;
41 41

  
42 42
///////////////////////////////////////////////////////////////////////////////////////////////////
43 43

  
......
96 96
        }
97 97

  
98 98
      SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
99
      OSInterface os = view.getInterface();
100
      restorePreferences(preferences);
99
      restorePreferences(key,preferences);
101 100

  
102 101
      if( mScreen==null ) mScreen = new ConfigScreen();
103 102
      mScreen.onAttachedToWindow(this,mObjectOrdinal);
104 103

  
105
      mPane = new ConfigScreenPane(this,key,os,mSupportsAdjColors);
104
      mPane = new ConfigScreenPane(this,mSupportsAdjColors,mBorders,mCorners);
106 105
      }
107 106

  
108 107
///////////////////////////////////////////////////////////////////////////////////////////////////
......
168 167

  
169 168
///////////////////////////////////////////////////////////////////////////////////////////////////
170 169

  
171
    private void restorePreferences(SharedPreferences preferences)
170
    private void restorePreferences(String key, SharedPreferences preferences)
172 171
      {
173 172
      ConfigSurfaceView view = findViewById(R.id.configSurfaceView);
174 173
      view.getObjectControl().restoreStickers();
175 174

  
176 175
      mDisplayMessageDialog = preferences.getBoolean("configDisplayDialog",true);
176
      mBorders              = preferences.getFloat(key+"_border",1.0f);
177
      mCorners              = preferences.getFloat(key+"_corner",1.0f);
177 178

  
178 179
      if( mDisplayMessageDialog )
179 180
        {
src/main/java/org/distorted/config/ConfigScreenPane.java
199 199

  
200 200
///////////////////////////////////////////////////////////////////////////////////////////////////
201 201

  
202
  ConfigScreenPane(final ConfigActivity act, String key, OSInterface os, boolean supportsAdjColors)
202
  ConfigScreenPane(final ConfigActivity act, boolean supportsAdjColors, float borders, float corners)
203 203
    {
204 204
    mRow = 0;
205 205
    mCol = 0;
......
208 208
    float textSize = height*TEXT_RATIO;
209 209
    int padding = (int)(height*PADDING_RATIO);
210 210

  
211
    float borders = os.getFloat(key+"_border",1.0f);
212
    float corners = os.getFloat(key+"_corner",1.0f);
213

  
214 211
    ///// UPPER LAYOUT /////////////////////////////////
215 212
    LinearLayout configLayoutU = act.findViewById(R.id.configLayoutUpper);
216 213
    configLayoutU.setPadding(padding,padding,padding,padding);

Also available in: Unified diff