Revision b600ccd9
Added by Leszek Koltunski almost 4 years ago
| src/main/java/org/distorted/helpers/LockController.java | ||
|---|---|---|
| 154 | 154 |
{
|
| 155 | 155 |
boolean locked = control.retLocked(); |
| 156 | 156 |
final int icon = getLockIcon(locked,false); |
| 157 |
mLockButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT,TransparentImageButton.GRAVITY_MIDDLE); |
|
| 157 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 158 |
mLockButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params); |
|
| 158 | 159 |
|
| 159 | 160 |
mLockButton.setOnClickListener( new View.OnClickListener() |
| 160 | 161 |
{
|
| src/main/java/org/distorted/helpers/MovesController.java | ||
|---|---|---|
| 166 | 166 |
public void setupButton(final Activity act, ObjectControl control) |
| 167 | 167 |
{
|
| 168 | 168 |
final int icon = getPrevIcon( !mMoves.isEmpty() ); |
| 169 |
mPrevButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE); |
|
| 169 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 170 |
mPrevButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params); |
|
| 170 | 171 |
|
| 171 | 172 |
mPrevButton.setOnClickListener( new View.OnClickListener() |
| 172 | 173 |
{
|
| src/main/java/org/distorted/helpers/TransparentImageButton.java | ||
|---|---|---|
| 37 | 37 |
|
| 38 | 38 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 39 | 39 |
|
| 40 |
public TransparentImageButton(Context context, int icon, int butWidth, int gravity)
|
|
| 40 |
public TransparentImageButton(Context context, int icon, int gravity, LinearLayout.LayoutParams params)
|
|
| 41 | 41 |
{
|
| 42 | 42 |
super(context); |
| 43 | 43 |
|
| 44 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(butWidth,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 45 |
|
|
| 46 | 44 |
setLayoutParams(params); |
| 47 | 45 |
setPadding(0,0,0,0); |
| 48 | 46 |
setIconResource(icon); |
| src/main/java/org/distorted/screens/RubikScreenDone.java | ||
|---|---|---|
| 87 | 87 |
private void setupBackButton(final RubikActivity act) |
| 88 | 88 |
{
|
| 89 | 89 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_back,R.drawable.ui_medium_back, R.drawable.ui_big_back, R.drawable.ui_huge_back); |
| 90 |
mBackButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE); |
|
| 90 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 91 |
mBackButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params); |
|
| 91 | 92 |
|
| 92 | 93 |
mBackButton.setOnClickListener( new View.OnClickListener() |
| 93 | 94 |
{
|
| src/main/java/org/distorted/screens/RubikScreenPattern.java | ||
|---|---|---|
| 144 | 144 |
private void setupBackButton(final RubikActivity act) |
| 145 | 145 |
{
|
| 146 | 146 |
final int icon = RubikActivity.getDrawable(R.drawable.ui_small_back,R.drawable.ui_medium_back, R.drawable.ui_big_back, R.drawable.ui_huge_back); |
| 147 |
mBackButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE); |
|
| 147 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 148 |
mBackButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params); |
|
| 148 | 149 |
|
| 149 | 150 |
mBackButton.setOnClickListener( new View.OnClickListener() |
| 150 | 151 |
{
|
| ... | ... | |
| 163 | 164 |
private void setupPrevButton(final RubikActivity act) |
| 164 | 165 |
{
|
| 165 | 166 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_left,R.drawable.ui_medium_left, R.drawable.ui_big_left, R.drawable.ui_huge_left); |
| 166 |
mPrevButton = new TransparentImageButton(act,icon,0,TransparentImageButton.GRAVITY_MIDDLE); |
|
| 167 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 168 |
mPrevButton = new TransparentImageButton(act,icon,TransparentImageButton.GRAVITY_MIDDLE,params); |
|
| 167 | 169 |
|
| 168 | 170 |
mPrevButton.setOnClickListener( new View.OnClickListener() |
| 169 | 171 |
{
|
| ... | ... | |
| 184 | 186 |
private void setupNextButton(final RubikActivity act) |
| 185 | 187 |
{
|
| 186 | 188 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_right,R.drawable.ui_medium_right, R.drawable.ui_big_right, R.drawable.ui_huge_right); |
| 187 |
mNextButton = new TransparentImageButton(act,icon,0,TransparentImageButton.GRAVITY_MIDDLE); |
|
| 189 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 190 |
mNextButton = new TransparentImageButton(act,icon,TransparentImageButton.GRAVITY_MIDDLE,params); |
|
| 188 | 191 |
|
| 189 | 192 |
mNextButton.setOnClickListener( new View.OnClickListener() |
| 190 | 193 |
{
|
| src/main/java/org/distorted/screens/RubikScreenPlay.java | ||
|---|---|---|
| 21 | 21 |
|
| 22 | 22 |
import android.content.Context; |
| 23 | 23 |
import android.content.SharedPreferences; |
| 24 |
import android.content.res.Resources; |
|
| 24 | 25 |
import android.graphics.drawable.BitmapDrawable; |
| 25 | 26 |
import android.os.Build; |
| 26 | 27 |
import android.os.Bundle; |
| ... | ... | |
| 33 | 34 |
import android.widget.ImageButton; |
| 34 | 35 |
import android.widget.LinearLayout; |
| 35 | 36 |
import android.widget.PopupWindow; |
| 36 |
import android.widget.ScrollView; |
|
| 37 | 37 |
|
| 38 | 38 |
import org.distorted.objectlib.main.ObjectControl; |
| 39 | 39 |
import org.distorted.objectlib.main.ObjectType; |
| ... | ... | |
| 48 | 48 |
import org.distorted.helpers.TransparentImageButton; |
| 49 | 49 |
import org.distorted.network.RubikScores; |
| 50 | 50 |
|
| 51 |
import static android.view.View.inflate; |
|
| 51 | 52 |
import static org.distorted.objectlib.main.ObjectType.NUM_OBJECTS; |
| 52 | 53 |
|
| 53 | 54 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 69 | 70 |
private static final float LAST_BUTTON = 1.5f; |
| 70 | 71 |
private static final int[] mLocation = new int[2]; |
| 71 | 72 |
|
| 72 |
private TransparentImageButton mObjButton, mMenuButton, mSolveButton, mScrambleButton; |
|
| 73 |
private TransparentImageButton mObjButton, mMenuButton, mSolveButton, mScrambleButton, mDetailsButton;
|
|
| 73 | 74 |
private TransparentButton mPlayButton; |
| 74 | 75 |
private PopupWindow mObjectPopup, mMenuPopup, mPlayPopup; |
| 75 | 76 |
private ObjectType mObject = DEF_OBJECT; |
| ... | ... | |
| 140 | 141 |
{
|
| 141 | 142 |
final int margin = (int)(width*RubikActivity.MARGIN); |
| 142 | 143 |
final int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_menu,R.drawable.ui_medium_cube_menu, R.drawable.ui_big_cube_menu, R.drawable.ui_huge_cube_menu); |
| 143 |
|
|
| 144 |
mObjButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE);
|
|
| 144 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 145 |
mObjButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params);
|
|
| 145 | 146 |
|
| 146 | 147 |
mObjButton.setOnClickListener( new View.OnClickListener() |
| 147 | 148 |
{
|
| ... | ... | |
| 207 | 208 |
{
|
| 208 | 209 |
final int margin = (int)(width*RubikActivity.MARGIN); |
| 209 | 210 |
final int icon = RubikActivity.getDrawable(R.drawable.ui_small_menu,R.drawable.ui_medium_menu, R.drawable.ui_big_menu, R.drawable.ui_huge_menu); |
| 210 |
|
|
| 211 |
mMenuButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE);
|
|
| 211 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 212 |
mMenuButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params);
|
|
| 212 | 213 |
|
| 213 | 214 |
mMenuButton.setOnClickListener( new View.OnClickListener() |
| 214 | 215 |
{
|
| ... | ... | |
| 237 | 238 |
{
|
| 238 | 239 |
int icon = RubikActivity.getDrawable(R.drawable.cube_2s,R.drawable.cube_2m, R.drawable.cube_2b, R.drawable.cube_2h); |
| 239 | 240 |
|
| 240 |
BitmapDrawable bd = (BitmapDrawable) act.getResources().getDrawable(icon); |
|
| 241 |
Resources res = act.getResources(); |
|
| 242 |
BitmapDrawable bd = (BitmapDrawable)res.getDrawable(icon); |
|
| 241 | 243 |
int cubeWidth = bd.getIntrinsicWidth(); |
| 242 | 244 |
int margin = (int)(width*RubikActivity.LARGE_MARGIN); |
| 243 | 245 |
mObjectSize = (int)(cubeWidth + 2*margin + 0.5f); |
| 244 |
mMaxRowCount = (int)(0.9f*(height-mUpperBarHeight)/mObjectSize); |
|
| 245 |
GridLayout objectGrid = new GridLayout(act); |
|
| 246 |
mObjectPopup = new PopupWindow(act); |
|
| 247 |
mObjectPopup.setFocusable(true); |
|
| 246 |
mMaxRowCount = (int)((height-2.0f*mUpperBarHeight)/mObjectSize); |
|
| 248 | 247 |
|
| 249 |
if( mMaxRowCount<mRowCount ) |
|
| 250 |
{
|
|
| 251 |
ScrollView scrollView = new ScrollView(act); |
|
| 252 |
scrollView.addView(objectGrid); |
|
| 253 |
mObjectPopup.setContentView(scrollView); |
|
| 254 |
} |
|
| 255 |
else |
|
| 256 |
{
|
|
| 257 |
mObjectPopup.setContentView(objectGrid); |
|
| 258 |
} |
|
| 248 |
int viewID = mMaxRowCount<mRowCount ? R.layout.popup_object_withscroll : R.layout.popup_object_scrollless; |
|
| 249 |
View view = inflate( act, viewID, null); |
|
| 250 |
GridLayout objectGrid = view.findViewById(R.id.objectGrid); |
|
| 259 | 251 |
|
| 260 | 252 |
GridLayout.Spec[] rowSpecs = new GridLayout.Spec[mRowCount]; |
| 261 | 253 |
GridLayout.Spec[] colSpecs = new GridLayout.Spec[mColCount]; |
| ... | ... | |
| 263 | 255 |
objectGrid.setColumnCount(mColCount); |
| 264 | 256 |
objectGrid.setRowCount(mRowCount); |
| 265 | 257 |
|
| 258 |
LinearLayout bottomLayout = view.findViewById(R.id.bottomLayout); |
|
| 259 |
setupDetailsButton(act); |
|
| 260 |
bottomLayout.addView(mDetailsButton); |
|
| 261 |
|
|
| 262 |
mObjectPopup = new PopupWindow(act); |
|
| 263 |
mObjectPopup.setFocusable(true); |
|
| 264 |
mObjectPopup.setContentView(view); |
|
| 265 |
|
|
| 266 | 266 |
int[] nextInRow = new int[mRowCount]; |
| 267 | 267 |
|
| 268 | 268 |
for(int row=0; row<mRowCount; row++) |
| ... | ... | |
| 398 | 398 |
} |
| 399 | 399 |
} |
| 400 | 400 |
|
| 401 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 402 |
|
|
| 403 |
void setupDetailsButton(final RubikActivity act) |
|
| 404 |
{
|
|
| 405 |
int butWidth = 100; |
|
| 406 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_solve_new,R.drawable.ui_medium_cube_solve_new, R.drawable.ui_big_cube_solve_new, R.drawable.ui_huge_cube_solve_new); |
|
| 407 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(butWidth,LinearLayout.LayoutParams.MATCH_PARENT); |
|
| 408 |
mDetailsButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params); |
|
| 409 |
|
|
| 410 |
mDetailsButton.setOnClickListener( new View.OnClickListener() |
|
| 411 |
{
|
|
| 412 |
@Override |
|
| 413 |
public void onClick(View v) |
|
| 414 |
{
|
|
| 415 |
android.util.Log.e("D", "DETAILS CLICKED!!");
|
|
| 416 |
} |
|
| 417 |
}); |
|
| 418 |
} |
|
| 419 |
|
|
| 401 | 420 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 402 | 421 |
|
| 403 | 422 |
void setupSolveButton(final RubikActivity act) |
| 404 | 423 |
{
|
| 405 | 424 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_solve_new,R.drawable.ui_medium_cube_solve_new, R.drawable.ui_big_cube_solve_new, R.drawable.ui_huge_cube_solve_new); |
| 406 |
mSolveButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_END); |
|
| 425 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 426 |
mSolveButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_END,params); |
|
| 407 | 427 |
|
| 408 | 428 |
mSolveButton.setOnClickListener( new View.OnClickListener() |
| 409 | 429 |
{
|
| ... | ... | |
| 421 | 441 |
private void setupScrambleButton(final RubikActivity act) |
| 422 | 442 |
{
|
| 423 | 443 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_scramble_new,R.drawable.ui_medium_cube_scramble_new, R.drawable.ui_big_cube_scramble_new, R.drawable.ui_huge_cube_scramble_new); |
| 424 |
mScrambleButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_START); |
|
| 444 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 445 |
mScrambleButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_START, params); |
|
| 425 | 446 |
|
| 426 | 447 |
mScrambleButton.setOnClickListener( new View.OnClickListener() |
| 427 | 448 |
{
|
| src/main/java/org/distorted/screens/RubikScreenReady.java | ||
|---|---|---|
| 68 | 68 |
private void setupBackButton(final RubikActivity act) |
| 69 | 69 |
{
|
| 70 | 70 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_back,R.drawable.ui_medium_back, R.drawable.ui_big_back, R.drawable.ui_huge_back); |
| 71 |
mBackButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE); |
|
| 71 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 72 |
mBackButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params); |
|
| 72 | 73 |
|
| 73 | 74 |
mBackButton.setOnClickListener( new View.OnClickListener() |
| 74 | 75 |
{
|
| src/main/java/org/distorted/screens/RubikScreenSolution.java | ||
|---|---|---|
| 112 | 112 |
private void setupPrevButton(final RubikActivity act) |
| 113 | 113 |
{
|
| 114 | 114 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_left,R.drawable.ui_medium_left, R.drawable.ui_big_left, R.drawable.ui_huge_left); |
| 115 |
mPrevButton = new TransparentImageButton(act,icon,0,TransparentImageButton.GRAVITY_MIDDLE); |
|
| 115 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 116 |
mPrevButton = new TransparentImageButton(act,icon,TransparentImageButton.GRAVITY_MIDDLE,params); |
|
| 116 | 117 |
|
| 117 | 118 |
mPrevButton.setOnClickListener( new View.OnClickListener() |
| 118 | 119 |
{
|
| ... | ... | |
| 131 | 132 |
private void setupNextButton(final RubikActivity act) |
| 132 | 133 |
{
|
| 133 | 134 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_right,R.drawable.ui_medium_right, R.drawable.ui_big_right, R.drawable.ui_huge_right); |
| 134 |
mNextButton = new TransparentImageButton(act,icon,0,TransparentImageButton.GRAVITY_MIDDLE); |
|
| 135 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 136 |
mNextButton = new TransparentImageButton(act,icon,TransparentImageButton.GRAVITY_MIDDLE,params); |
|
| 135 | 137 |
|
| 136 | 138 |
mNextButton.setOnClickListener( new View.OnClickListener() |
| 137 | 139 |
{
|
| ... | ... | |
| 171 | 173 |
private void setupBackButton(final RubikActivity act) |
| 172 | 174 |
{
|
| 173 | 175 |
final int icon = RubikActivity.getDrawable(R.drawable.ui_small_back,R.drawable.ui_medium_back, R.drawable.ui_big_back, R.drawable.ui_huge_back); |
| 174 |
mBackButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE); |
|
| 176 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 177 |
mBackButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE,params); |
|
| 175 | 178 |
|
| 176 | 179 |
mBackButton.setOnClickListener( new View.OnClickListener() |
| 177 | 180 |
{
|
| src/main/java/org/distorted/screens/RubikScreenSolver.java | ||
|---|---|---|
| 212 | 212 |
private void setupSolveButton(final RubikActivity act) |
| 213 | 213 |
{
|
| 214 | 214 |
final int icon = RubikActivity.getDrawable(R.drawable.ui_small_solve,R.drawable.ui_medium_solve, R.drawable.ui_big_solve, R.drawable.ui_huge_solve); |
| 215 |
mSolveButton = new TransparentImageButton(act,icon,LinearLayout.LayoutParams.MATCH_PARENT,TransparentImageButton.GRAVITY_MIDDLE); |
|
| 215 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 216 |
mSolveButton = new TransparentImageButton(act,icon,TransparentImageButton.GRAVITY_MIDDLE,params); |
|
| 216 | 217 |
|
| 217 | 218 |
mSolveButton.setOnClickListener( new View.OnClickListener() |
| 218 | 219 |
{
|
| ... | ... | |
| 235 | 236 |
private void setupBackButton(final RubikActivity act) |
| 236 | 237 |
{
|
| 237 | 238 |
final int icon = RubikActivity.getDrawable(R.drawable.ui_small_back,R.drawable.ui_medium_back, R.drawable.ui_big_back, R.drawable.ui_huge_back); |
| 238 |
mBackButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE); |
|
| 239 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 240 |
mBackButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params); |
|
| 239 | 241 |
|
| 240 | 242 |
mBackButton.setOnClickListener( new View.OnClickListener() |
| 241 | 243 |
{
|
| src/main/java/org/distorted/screens/RubikScreenSolving.java | ||
|---|---|---|
| 93 | 93 |
private void setupBackButton(final RubikActivity act) |
| 94 | 94 |
{
|
| 95 | 95 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_back,R.drawable.ui_medium_back, R.drawable.ui_big_back, R.drawable.ui_huge_back); |
| 96 |
mBackButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE); |
|
| 96 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 97 |
mBackButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params); |
|
| 97 | 98 |
|
| 98 | 99 |
mBackButton.setOnClickListener( new View.OnClickListener() |
| 99 | 100 |
{
|
| src/main/java/org/distorted/tutorials/TutorialScreen.java | ||
|---|---|---|
| 46 | 46 |
private void setupSolveButton(final TutorialActivity act) |
| 47 | 47 |
{
|
| 48 | 48 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_solve,R.drawable.ui_medium_cube_solve, R.drawable.ui_big_cube_solve, R.drawable.ui_huge_cube_solve); |
| 49 |
mSolveButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE); |
|
| 49 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 50 |
mSolveButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params); |
|
| 50 | 51 |
|
| 51 | 52 |
mSolveButton.setOnClickListener( new View.OnClickListener() |
| 52 | 53 |
{
|
| ... | ... | |
| 64 | 65 |
private void setupScrambleButton(final TutorialActivity act) |
| 65 | 66 |
{
|
| 66 | 67 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_scramble,R.drawable.ui_medium_cube_scramble, R.drawable.ui_big_cube_scramble, R.drawable.ui_huge_cube_scramble); |
| 67 |
mScrambleButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE); |
|
| 68 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 69 |
mScrambleButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params); |
|
| 68 | 70 |
|
| 69 | 71 |
mScrambleButton.setOnClickListener( new View.OnClickListener() |
| 70 | 72 |
{
|
| ... | ... | |
| 83 | 85 |
private void setupBackButton(final TutorialActivity act) |
| 84 | 86 |
{
|
| 85 | 87 |
int icon = RubikActivity.getDrawable(R.drawable.ui_small_smallback,R.drawable.ui_medium_smallback, R.drawable.ui_big_smallback, R.drawable.ui_huge_smallback); |
| 86 |
mBackButton = new TransparentImageButton(act, icon, LinearLayout.LayoutParams.MATCH_PARENT, TransparentImageButton.GRAVITY_MIDDLE); |
|
| 88 |
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f); |
|
| 89 |
mBackButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params); |
|
| 87 | 90 |
|
| 88 | 91 |
mBackButton.setOnClickListener( new View.OnClickListener() |
| 89 | 92 |
{
|
| src/main/res/layout/popup_object_scrollless.xml | ||
|---|---|---|
| 1 |
<?xml version="1.0" encoding="utf-8"?> |
|
| 2 |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
| 3 |
android:layout_width="match_parent" |
|
| 4 |
android:layout_height="match_parent" |
|
| 5 |
android:orientation="vertical"> |
|
| 6 |
|
|
| 7 |
<GridLayout |
|
| 8 |
android:id="@+id/objectGrid" |
|
| 9 |
android:layout_width="match_parent" |
|
| 10 |
android:layout_height="match_parent" |
|
| 11 |
android:layout_weight="1"> |
|
| 12 |
</GridLayout> |
|
| 13 |
|
|
| 14 |
<LinearLayout |
|
| 15 |
android:id="@+id/bottomLayout" |
|
| 16 |
android:background="@color/grey" |
|
| 17 |
android:layout_width="match_parent" |
|
| 18 |
android:layout_height="100dp" |
|
| 19 |
android:layout_weight="1" |
|
| 20 |
android:paddingEnd="5dp" |
|
| 21 |
android:paddingStart="5dp" |
|
| 22 |
android:gravity="end" |
|
| 23 |
android:orientation="horizontal"> |
|
| 24 |
|
|
| 25 |
</LinearLayout> |
|
| 26 |
|
|
| 27 |
</LinearLayout> |
|
| src/main/res/layout/popup_object_withscroll.xml | ||
|---|---|---|
| 1 |
<?xml version="1.0" encoding="utf-8"?> |
|
| 2 |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
| 3 |
android:layout_width="match_parent" |
|
| 4 |
android:layout_height="match_parent" |
|
| 5 |
android:orientation="vertical"> |
|
| 6 |
|
|
| 7 |
<ScrollView |
|
| 8 |
android:id="@+id/objectScroll" |
|
| 9 |
android:layout_width="match_parent" |
|
| 10 |
android:layout_height="match_parent" |
|
| 11 |
android:layout_weight="1"> |
|
| 12 |
|
|
| 13 |
<GridLayout |
|
| 14 |
android:id="@+id/objectGrid" |
|
| 15 |
android:layout_width="match_parent" |
|
| 16 |
android:layout_height="wrap_content"> |
|
| 17 |
</GridLayout> |
|
| 18 |
|
|
| 19 |
</ScrollView> |
|
| 20 |
|
|
| 21 |
<LinearLayout |
|
| 22 |
android:id="@+id/bottomLayout" |
|
| 23 |
android:background="@color/grey" |
|
| 24 |
android:layout_width="match_parent" |
|
| 25 |
android:layout_height="100dp" |
|
| 26 |
android:layout_weight="1" |
|
| 27 |
android:paddingEnd="5dp" |
|
| 28 |
android:paddingStart="5dp" |
|
| 29 |
android:gravity="end" |
|
| 30 |
android:orientation="horizontal"> |
|
| 31 |
|
|
| 32 |
</LinearLayout> |
|
| 33 |
|
|
| 34 |
</LinearLayout> |
|
Also available in: Unified diff
Add info pane: part 1.