Project

General

Profile

« Previous | Next » 

Revision 34998c9d

Added by Leszek Koltunski about 5 years ago

Port fixes for the memory leak problems from distorted-examples.

View differences:

src/main/java/org/distorted/magic/RubikActivity.java
34 34
public class RubikActivity extends Activity
35 35
{
36 36
            static final int DEFAULT_SIZE  = 3;
37
    private static final int STARTING_SIZE = 2;
37
    private static final int SMALLEST_SIZE = 2;
38 38
    private static final int[] button_ids  = {R.id.rubikSize2, R.id.rubikSize3, R.id.rubikSize4};
39 39

  
40 40
///////////////////////////////////////////////////////////////////////////////////////////////////
......
102 102
      for(int b=0; b<button_ids.length; b++)
103 103
        if( button_ids[b] == id )
104 104
          {
105
          size = b+STARTING_SIZE;
105
          size = b+SMALLEST_SIZE;
106 106
          break;
107 107
          }
108 108

  
......
120 120
       {
121 121
       Drawable d = findViewById(button_ids[b]).getBackground();
122 122

  
123
       if( size == b+STARTING_SIZE )
123
       if( size == b+SMALLEST_SIZE )
124 124
         {
125 125
         d.setColorFilter(ContextCompat.getColor(this,R.color.red), PorterDuff.Mode.MULTIPLY);
126 126
         }

Also available in: Unified diff