Revision 302c76a0
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/config/ConfigScreen.java | ||
---|---|---|
14 | 14 |
import android.view.Gravity; |
15 | 15 |
import android.view.View; |
16 | 16 |
import android.widget.GridLayout; |
17 |
import android.widget.ImageButton; |
|
17 | 18 |
import android.widget.LinearLayout; |
18 | 19 |
import android.widget.PopupWindow; |
19 | 20 |
import android.widget.ScrollView; |
... | ... | |
25 | 26 |
import org.distorted.helpers.TransparentImageButton; |
26 | 27 |
import org.distorted.main.R; |
27 | 28 |
import org.distorted.main.RubikActivity; |
29 |
import org.distorted.objects.RubikObject; |
|
28 | 30 |
import org.distorted.objects.RubikObjectList; |
29 | 31 |
|
30 | 32 |
import static android.view.View.inflate; |
... | ... | |
67 | 69 |
|
68 | 70 |
for(int child=0; child<numObjects; child++) |
69 | 71 |
{ |
70 |
View button = objectGrid.getChildAt(child); |
|
72 |
final RubikObject obj = RubikObjectList.getObject(child); |
|
73 |
View v = objectGrid.getChildAt(child); |
|
74 |
ImageButton button = PopupCreator.getButton(obj,v); |
|
71 | 75 |
final int ordinal = child; |
72 | 76 |
|
73 | 77 |
button.setOnClickListener( new View.OnClickListener() |
src/main/java/org/distorted/helpers/PopupCreator.java | ||
---|---|---|
67 | 67 |
} |
68 | 68 |
} |
69 | 69 |
|
70 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
71 |
|
|
72 |
public static ImageButton getButton(RubikObject object, View view) |
|
73 |
{ |
|
74 |
return object!=null && object.isFree() ? (ImageButton)view : view.findViewById(R.id.non_free_button); |
|
75 |
} |
|
76 |
|
|
70 | 77 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
71 | 78 |
|
72 | 79 |
private static View createView(Activity act, LayoutInflater inflater, int ordinal, int pad) |
src/main/java/org/distorted/screens/RubikScreenPlay.java | ||
---|---|---|
191 | 191 |
|
192 | 192 |
for(int child=0; child<numObjects; child++) |
193 | 193 |
{ |
194 |
View button = objectGrid.getChildAt(child); |
|
194 |
final RubikObject obj = RubikObjectList.getObject(child); |
|
195 |
View v = objectGrid.getChildAt(child); |
|
196 |
ImageButton button = PopupCreator.getButton(obj,v); |
|
195 | 197 |
final int ordinal = child; |
196 | 198 |
|
197 | 199 |
button.setOnClickListener( new View.OnClickListener() |
Also available in: Unified diff
IAP part 4: further progress with locks in the object popup screen.