1 |
211b48f2
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2020 Leszek Koltunski //
|
3 |
|
|
// //
|
4 |
|
|
// This file is part of Magic Cube. //
|
5 |
|
|
// //
|
6 |
3782bd44
|
Leszek Koltunski
|
// Magic Cube is proprietary software licensed under an EULA which you should have received //
|
7 |
|
|
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html //
|
8 |
211b48f2
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
9 |
|
|
|
10 |
fcd5b990
|
Leszek Koltunski
|
package org.distorted.screens;
|
11 |
211b48f2
|
Leszek Koltunski
|
|
12 |
179f7189
|
Leszek Koltunski
|
import java.lang.ref.WeakReference;
|
13 |
|
|
|
14 |
|
|
import android.app.Activity;
|
15 |
4c0cd600
|
Leszek Koltunski
|
import android.content.Context;
|
16 |
211b48f2
|
Leszek Koltunski
|
import android.content.SharedPreferences;
|
17 |
be65535e
|
Leszek Koltunski
|
import android.content.res.ColorStateList;
|
18 |
8a47642f
|
Leszek Koltunski
|
import android.content.res.Resources;
|
19 |
255492a0
|
Leszek Koltunski
|
import android.os.Build;
|
20 |
e03e0352
|
Leszek Koltunski
|
import android.os.Bundle;
|
21 |
e3c74c0f
|
Leszek Koltunski
|
import android.util.TypedValue;
|
22 |
255492a0
|
Leszek Koltunski
|
import android.view.Gravity;
|
23 |
211b48f2
|
Leszek Koltunski
|
import android.view.LayoutInflater;
|
24 |
|
|
import android.view.View;
|
25 |
|
|
import android.widget.Button;
|
26 |
e07c48a2
|
Leszek Koltunski
|
import android.widget.GridLayout;
|
27 |
211b48f2
|
Leszek Koltunski
|
import android.widget.ImageButton;
|
28 |
|
|
import android.widget.LinearLayout;
|
29 |
4c0cd600
|
Leszek Koltunski
|
import android.widget.PopupWindow;
|
30 |
d6e7c7fb
|
Leszek Koltunski
|
import android.widget.RelativeLayout;
|
31 |
10373dc7
|
Leszek Koltunski
|
import android.widget.TextView;
|
32 |
211b48f2
|
Leszek Koltunski
|
|
33 |
5f3801d3
|
Leszek Koltunski
|
import org.distorted.dialogs.RubikDialogUpdates;
|
34 |
acabdd83
|
Leszek Koltunski
|
import org.distorted.external.RubikNetwork;
|
35 |
1088a219
|
Leszek Koltunski
|
import org.distorted.external.RubikScores;
|
36 |
acabdd83
|
Leszek Koltunski
|
import org.distorted.external.RubikUpdates;
|
37 |
3f7a4363
|
Leszek Koltunski
|
|
38 |
|
|
import org.distorted.main.R;
|
39 |
|
|
import org.distorted.main.RubikActivity;
|
40 |
e03e0352
|
Leszek Koltunski
|
import org.distorted.dialogs.RubikDialogAbout;
|
41 |
a8576d91
|
Leszek Koltunski
|
import org.distorted.dialogs.RubikDialogPattern;
|
42 |
e03e0352
|
Leszek Koltunski
|
import org.distorted.dialogs.RubikDialogScores;
|
43 |
234a7582
|
Leszek Koltunski
|
import org.distorted.dialogs.RubikDialogTutorial;
|
44 |
55e6be1d
|
Leszek Koltunski
|
import org.distorted.helpers.TransparentImageButton;
|
45 |
4f3e2d90
|
Leszek Koltunski
|
import org.distorted.objectlib.main.ObjectControl;
|
46 |
15adc102
|
Leszek Koltunski
|
import org.distorted.objects.MainEntry;
|
47 |
|
|
import org.distorted.objects.MainEntryList;
|
48 |
d433b50e
|
Leszek Koltunski
|
import org.distorted.objects.RubikObject;
|
49 |
|
|
import org.distorted.objects.RubikObjectList;
|
50 |
211b48f2
|
Leszek Koltunski
|
|
51 |
b600ccd9
|
Leszek Koltunski
|
import static android.view.View.inflate;
|
52 |
88d28110
|
Leszek Koltunski
|
|
53 |
211b48f2
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
54 |
|
|
|
55 |
63dd19c4
|
Leszek Koltunski
|
public class RubikScreenPlay extends RubikScreenBase implements RubikNetwork.Updatee
|
56 |
211b48f2
|
Leszek Koltunski
|
{
|
57 |
6e3fcb91
|
Leszek Koltunski
|
public static final int NUM_COLUMNS = 5;
|
58 |
adbd16d9
|
Leszek Koltunski
|
public static final int LEVELS_SHOWN = 8;
|
59 |
0b458a90
|
Leszek Koltunski
|
private static final int NUM_BUTTONS = 5;
|
60 |
dc78f395
|
Leszek Koltunski
|
private static final int[] mLocation = new int[2];
|
61 |
e03e0352
|
Leszek Koltunski
|
|
62 |
756f152c
|
Leszek Koltunski
|
private TransparentImageButton mObjButton, mMenuButton, mSolveButton, mScrambleButton;
|
63 |
4f3e2d90
|
Leszek Koltunski
|
private PopupWindow mObjectPopup, mMenuPopup;
|
64 |
|
|
private WeakReference<RubikActivity> mWeakAct;
|
65 |
10373dc7
|
Leszek Koltunski
|
private TextView mBubbleUpdates;
|
66 |
1088a219
|
Leszek Koltunski
|
private Button[] mLevel;
|
67 |
369a0fce
|
Leszek Koltunski
|
private int mObjectSize, mMenuLayoutWidth, mMenuLayoutHeight, mMenuButtonHeight, mMenuTextSize;
|
68 |
85b09df4
|
Leszek Koltunski
|
private int mLevelValue;
|
69 |
598de3ee
|
Leszek Koltunski
|
private int mColCount, mRowCount, mMaxRowCount;
|
70 |
255492a0
|
Leszek Koltunski
|
private int mUpperBarHeight;
|
71 |
dd874ae8
|
Leszek Koltunski
|
private boolean mShouldReactToEndOfScrambling;
|
72 |
9c39179e
|
Leszek Koltunski
|
private float mScreenWidth;
|
73 |
255492a0
|
Leszek Koltunski
|
|
74 |
211b48f2
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
75 |
|
|
|
76 |
f5da732a
|
Leszek Koltunski
|
void leaveScreen(RubikActivity act)
|
77 |
211b48f2
|
Leszek Koltunski
|
{
|
78 |
85b09df4
|
Leszek Koltunski
|
|
79 |
211b48f2
|
Leszek Koltunski
|
}
|
80 |
|
|
|
81 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
82 |
|
|
|
83 |
f5da732a
|
Leszek Koltunski
|
void enterScreen(final RubikActivity act)
|
84 |
211b48f2
|
Leszek Koltunski
|
{
|
85 |
179f7189
|
Leszek Koltunski
|
mWeakAct = new WeakReference<>(act);
|
86 |
9c39179e
|
Leszek Koltunski
|
mScreenWidth = act.getScreenWidthInPixels();
|
87 |
255492a0
|
Leszek Koltunski
|
mUpperBarHeight = act.getHeightUpperBar();
|
88 |
a8576d91
|
Leszek Koltunski
|
|
89 |
0b458a90
|
Leszek Koltunski
|
mMenuButtonHeight = (int)(mScreenWidth*RubikActivity.MENU_BUTTON_HEIGHT);
|
90 |
3c27ff9e
|
Leszek Koltunski
|
mMenuTextSize = (int)(mScreenWidth*RubikActivity.MENU_MAIN_TEXT_SIZE);
|
91 |
e3c74c0f
|
Leszek Koltunski
|
|
92 |
ac1900c3
|
Leszek Koltunski
|
mObjectPopup = null;
|
93 |
e07c48a2
|
Leszek Koltunski
|
|
94 |
211b48f2
|
Leszek Koltunski
|
// TOP ////////////////////////////
|
95 |
7289fd6c
|
Leszek Koltunski
|
LinearLayout layoutTop = act.findViewById(R.id.upperBar);
|
96 |
211b48f2
|
Leszek Koltunski
|
layoutTop.removeAllViews();
|
97 |
85b09df4
|
Leszek Koltunski
|
|
98 |
c1df05fa
|
Leszek Koltunski
|
setupSolveButton(act);
|
99 |
|
|
layoutTop.addView(mSolveButton);
|
100 |
9c39179e
|
Leszek Koltunski
|
setupMenuButton(act,mScreenWidth);
|
101 |
0254cfd7
|
Leszek Koltunski
|
layoutTop.addView(mMenuButton);
|
102 |
756f152c
|
Leszek Koltunski
|
setupScrambleButton(act);
|
103 |
c1df05fa
|
Leszek Koltunski
|
layoutTop.addView(mScrambleButton);
|
104 |
|
|
|
105 |
|
|
// BOTTOM /////////////////////////
|
106 |
|
|
setupObjectButton(act,mScreenWidth);
|
107 |
|
|
createBottomPane(act,mObjButton,null);
|
108 |
769d7b9f
|
Leszek Koltunski
|
}
|
109 |
211b48f2
|
Leszek Koltunski
|
|
110 |
8ab435b9
|
Leszek Koltunski
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
111 |
4c0cd600
|
Leszek Koltunski
|
|
112 |
ad0c8e0e
|
Leszek Koltunski
|
private void setupObjectButton(final RubikActivity act, final float width)
|
113 |
769d7b9f
|
Leszek Koltunski
|
{
|
114 |
c651024f
|
Leszek Koltunski
|
final int margin = (int)(width*RubikActivity.SMALL_MARGIN);
|
115 |
e07c48a2
|
Leszek Koltunski
|
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);
|
116 |
b600ccd9
|
Leszek Koltunski
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
|
117 |
|
|
mObjButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params);
|
118 |
769d7b9f
|
Leszek Koltunski
|
|
119 |
|
|
mObjButton.setOnClickListener( new View.OnClickListener()
|
120 |
|
|
{
|
121 |
|
|
@Override
|
122 |
|
|
public void onClick(View view)
|
123 |
4c0cd600
|
Leszek Koltunski
|
{
|
124 |
2da68298
|
Leszek Koltunski
|
if( mObjectPopup==null )
|
125 |
|
|
{
|
126 |
|
|
float width = act.getScreenWidthInPixels();
|
127 |
|
|
float height= act.getScreenHeightInPixels();
|
128 |
|
|
setupObjectWindow(act,width,height);
|
129 |
|
|
}
|
130 |
|
|
|
131 |
|
|
if( act.getControl().isUINotBlocked())
|
132 |
a42e25a6
|
Leszek Koltunski
|
{
|
133 |
598de3ee
|
Leszek Koltunski
|
int rowCount = Math.min(mMaxRowCount,mRowCount);
|
134 |
c5b4af4a
|
Leszek Koltunski
|
View popupView = mObjectPopup.getContentView();
|
135 |
|
|
popupView.setSystemUiVisibility(RubikActivity.FLAGS);
|
136 |
c1df05fa
|
Leszek Koltunski
|
displayPopup(act,view,mObjectPopup,mObjectSize*mColCount,mObjectSize*rowCount+5*margin,margin,margin);
|
137 |
c5b4af4a
|
Leszek Koltunski
|
}
|
138 |
769d7b9f
|
Leszek Koltunski
|
}
|
139 |
|
|
});
|
140 |
|
|
}
|
141 |
4c0cd600
|
Leszek Koltunski
|
|
142 |
e31abc1e
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
143 |
|
|
|
144 |
ad0c8e0e
|
Leszek Koltunski
|
private void setupMenuButton(final RubikActivity act, final float width)
|
145 |
e31abc1e
|
Leszek Koltunski
|
{
|
146 |
0254cfd7
|
Leszek Koltunski
|
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);
|
147 |
b600ccd9
|
Leszek Koltunski
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
|
148 |
|
|
mMenuButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params);
|
149 |
e31abc1e
|
Leszek Koltunski
|
|
150 |
e03e0352
|
Leszek Koltunski
|
mMenuButton.setOnClickListener( new View.OnClickListener()
|
151 |
e31abc1e
|
Leszek Koltunski
|
{
|
152 |
|
|
@Override
|
153 |
|
|
public void onClick(View view)
|
154 |
|
|
{
|
155 |
2da68298
|
Leszek Koltunski
|
if( mMenuPopup==null )
|
156 |
|
|
{
|
157 |
|
|
float width = act.getScreenWidthInPixels();
|
158 |
|
|
setupMenuWindow(act,width);
|
159 |
|
|
}
|
160 |
|
|
|
161 |
|
|
if( act.getControl().isUINotBlocked())
|
162 |
e03e0352
|
Leszek Koltunski
|
{
|
163 |
c5b4af4a
|
Leszek Koltunski
|
View popupView = mMenuPopup.getContentView();
|
164 |
|
|
popupView.setSystemUiVisibility(RubikActivity.FLAGS);
|
165 |
8a47642f
|
Leszek Koltunski
|
setupLevelColors(act);
|
166 |
3c27ff9e
|
Leszek Koltunski
|
displayPopup(act,view,mMenuPopup,mMenuLayoutWidth,mMenuLayoutHeight,(int)(-mMenuLayoutWidth/2 + width/6),0);
|
167 |
6fad862b
|
Leszek Koltunski
|
}
|
168 |
e31abc1e
|
Leszek Koltunski
|
}
|
169 |
|
|
});
|
170 |
|
|
}
|
171 |
|
|
|
172 |
4c0cd600
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
173 |
|
|
|
174 |
598de3ee
|
Leszek Koltunski
|
private void setupObjectWindow(final RubikActivity act, final float width, final float height)
|
175 |
4c0cd600
|
Leszek Koltunski
|
{
|
176 |
ac1900c3
|
Leszek Koltunski
|
MainEntryList list = MainEntryList.getInstance();
|
177 |
|
|
int numEntries = list.getNumOfEntries();
|
178 |
|
|
mRowCount = (numEntries + NUM_COLUMNS-1) / NUM_COLUMNS;
|
179 |
|
|
mColCount = NUM_COLUMNS;
|
180 |
|
|
|
181 |
adbd16d9
|
Leszek Koltunski
|
int cubeSize = (int)(width/9);
|
182 |
|
|
int margin = (int)(width*RubikActivity.LARGE_MARGIN);
|
183 |
|
|
mObjectSize = (int)(cubeSize + 2*margin + 0.5f);
|
184 |
0b162619
|
Leszek Koltunski
|
mMaxRowCount = (int)((height-1.8f*mUpperBarHeight)/mObjectSize);
|
185 |
598de3ee
|
Leszek Koltunski
|
|
186 |
8d1da3f1
|
Leszek Koltunski
|
LinearLayout view = (LinearLayout)inflate( act, R.layout.popup_object, null);
|
187 |
b600ccd9
|
Leszek Koltunski
|
GridLayout objectGrid = view.findViewById(R.id.objectGrid);
|
188 |
e07c48a2
|
Leszek Koltunski
|
|
189 |
|
|
GridLayout.Spec[] rowSpecs = new GridLayout.Spec[mRowCount];
|
190 |
|
|
GridLayout.Spec[] colSpecs = new GridLayout.Spec[mColCount];
|
191 |
|
|
|
192 |
92843d3b
|
Leszek Koltunski
|
objectGrid.setColumnCount(mColCount);
|
193 |
|
|
objectGrid.setRowCount(mRowCount);
|
194 |
e07c48a2
|
Leszek Koltunski
|
|
195 |
d6e7c7fb
|
Leszek Koltunski
|
RelativeLayout bottomLayout = view.findViewById(R.id.bottomLayout);
|
196 |
|
|
setupBottomLayout(act,bottomLayout);
|
197 |
0b162619
|
Leszek Koltunski
|
|
198 |
b600ccd9
|
Leszek Koltunski
|
mObjectPopup = new PopupWindow(act);
|
199 |
|
|
mObjectPopup.setFocusable(true);
|
200 |
|
|
mObjectPopup.setContentView(view);
|
201 |
|
|
|
202 |
0501a4b8
|
Leszek Koltunski
|
int[] nextInRow = new int[mRowCount];
|
203 |
fa679111
|
Leszek Koltunski
|
|
204 |
e07c48a2
|
Leszek Koltunski
|
for(int row=0; row<mRowCount; row++)
|
205 |
|
|
{
|
206 |
|
|
rowSpecs[row] = GridLayout.spec(row);
|
207 |
0501a4b8
|
Leszek Koltunski
|
nextInRow[row]= 0;
|
208 |
e07c48a2
|
Leszek Koltunski
|
}
|
209 |
|
|
for(int col=0; col<mColCount; col++)
|
210 |
|
|
{
|
211 |
|
|
colSpecs[col] = GridLayout.spec(col);
|
212 |
|
|
}
|
213 |
769d7b9f
|
Leszek Koltunski
|
|
214 |
15adc102
|
Leszek Koltunski
|
for(int entry=0; entry<numEntries; entry++)
|
215 |
769d7b9f
|
Leszek Koltunski
|
{
|
216 |
15adc102
|
Leszek Koltunski
|
final MainEntry mainEntry = list.getEntry(entry);
|
217 |
|
|
int row = entry/NUM_COLUMNS;
|
218 |
7ac0ee88
|
Leszek Koltunski
|
ImageButton button = new ImageButton(act);
|
219 |
15adc102
|
Leszek Koltunski
|
if( mainEntry!=null ) mainEntry.setIconTo(act,button);
|
220 |
314e9ff0
|
Leszek Koltunski
|
|
221 |
7ac0ee88
|
Leszek Koltunski
|
button.setOnClickListener( new View.OnClickListener()
|
222 |
769d7b9f
|
Leszek Koltunski
|
{
|
223 |
7ac0ee88
|
Leszek Koltunski
|
@Override
|
224 |
|
|
public void onClick(View v)
|
225 |
769d7b9f
|
Leszek Koltunski
|
{
|
226 |
2afc6754
|
Leszek Koltunski
|
if( act.getControl().isUINotBlocked() && ScreenList.getCurrentScreen()== ScreenList.PLAY )
|
227 |
769d7b9f
|
Leszek Koltunski
|
{
|
228 |
15adc102
|
Leszek Koltunski
|
int type = mainEntry!=null ? mainEntry.getType() : -1;
|
229 |
|
|
|
230 |
|
|
if( type==MainEntry.TYPE_OBJECT )
|
231 |
|
|
{
|
232 |
|
|
int ordinal = mainEntry.getOrdinal();
|
233 |
1088a219
|
Leszek Koltunski
|
RubikObjectList.setCurrObject(ordinal);
|
234 |
15adc102
|
Leszek Koltunski
|
act.changeObject(ordinal,true);
|
235 |
8a47642f
|
Leszek Koltunski
|
if( mMenuPopup!=null ) setupLevelColors(act);
|
236 |
15adc102
|
Leszek Koltunski
|
mMovesController.clearMoves(act);
|
237 |
|
|
}
|
238 |
|
|
else if( type==MainEntry.TYPE_CREATOR )
|
239 |
|
|
{
|
240 |
|
|
act.switchToBandagedCreator();
|
241 |
|
|
}
|
242 |
769d7b9f
|
Leszek Koltunski
|
}
|
243 |
|
|
|
244 |
1f3bc259
|
Leszek Koltunski
|
if( mObjectPopup!=null ) mObjectPopup.dismiss();
|
245 |
7ac0ee88
|
Leszek Koltunski
|
}
|
246 |
|
|
});
|
247 |
e07c48a2
|
Leszek Koltunski
|
|
248 |
7ac0ee88
|
Leszek Koltunski
|
GridLayout.LayoutParams params = new GridLayout.LayoutParams(rowSpecs[row],colSpecs[nextInRow[row]]);
|
249 |
|
|
params.bottomMargin = margin;
|
250 |
|
|
params.topMargin = margin;
|
251 |
|
|
params.leftMargin = margin;
|
252 |
|
|
params.rightMargin = margin;
|
253 |
fa679111
|
Leszek Koltunski
|
|
254 |
adbd16d9
|
Leszek Koltunski
|
params.width = cubeSize;
|
255 |
|
|
params.height= cubeSize;
|
256 |
6e3fcb91
|
Leszek Koltunski
|
|
257 |
7ac0ee88
|
Leszek Koltunski
|
nextInRow[row]++;
|
258 |
|
|
|
259 |
|
|
objectGrid.addView(button, params);
|
260 |
769d7b9f
|
Leszek Koltunski
|
}
|
261 |
4c0cd600
|
Leszek Koltunski
|
}
|
262 |
|
|
|
263 |
8d1da3f1
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
264 |
|
|
|
265 |
d6e7c7fb
|
Leszek Koltunski
|
private void setupBottomLayout(final RubikActivity act, final RelativeLayout layout)
|
266 |
8d1da3f1
|
Leszek Koltunski
|
{
|
267 |
|
|
int iconT = RubikActivity.getDrawable(R.drawable.ui_small_tutorial,R.drawable.ui_medium_tutorial, R.drawable.ui_big_tutorial, R.drawable.ui_huge_tutorial);
|
268 |
d6e7c7fb
|
Leszek Koltunski
|
int iconD = RubikActivity.getDrawable(R.drawable.ui_small_download,R.drawable.ui_medium_download, R.drawable.ui_big_download, R.drawable.ui_huge_download);
|
269 |
|
|
int iconI = RubikActivity.getDrawable(R.drawable.ui_small_info,R.drawable.ui_medium_info, R.drawable.ui_big_info, R.drawable.ui_huge_info);
|
270 |
8d1da3f1
|
Leszek Koltunski
|
|
271 |
|
|
ImageButton buttonTut = layout.findViewById(R.id.buttonTut);
|
272 |
d6e7c7fb
|
Leszek Koltunski
|
ImageButton buttonDow = layout.findViewById(R.id.buttonDow);
|
273 |
|
|
ImageButton buttonInf = layout.findViewById(R.id.buttonInf);
|
274 |
8d1da3f1
|
Leszek Koltunski
|
|
275 |
|
|
buttonTut.setImageResource(iconT);
|
276 |
d6e7c7fb
|
Leszek Koltunski
|
buttonDow.setImageResource(iconD);
|
277 |
|
|
buttonInf.setImageResource(iconI);
|
278 |
8d1da3f1
|
Leszek Koltunski
|
|
279 |
|
|
TypedValue outValue = new TypedValue();
|
280 |
|
|
act.getTheme().resolveAttribute(android.R.attr.selectableItemBackgroundBorderless, outValue, true);
|
281 |
|
|
buttonTut.setBackgroundResource(outValue.resourceId);
|
282 |
d6e7c7fb
|
Leszek Koltunski
|
buttonDow.setBackgroundResource(outValue.resourceId);
|
283 |
|
|
buttonInf.setBackgroundResource(outValue.resourceId);
|
284 |
8d1da3f1
|
Leszek Koltunski
|
|
285 |
|
|
buttonTut.setOnClickListener( new View.OnClickListener()
|
286 |
|
|
{
|
287 |
|
|
@Override
|
288 |
|
|
public void onClick(View v)
|
289 |
|
|
{
|
290 |
|
|
if( mObjectPopup!=null ) mObjectPopup.dismiss();
|
291 |
|
|
RubikDialogTutorial tDiag = new RubikDialogTutorial();
|
292 |
|
|
tDiag.show( act.getSupportFragmentManager(), RubikDialogTutorial.getDialogTag() );
|
293 |
|
|
}
|
294 |
|
|
});
|
295 |
|
|
|
296 |
d6e7c7fb
|
Leszek Koltunski
|
buttonDow.setOnClickListener( new View.OnClickListener()
|
297 |
|
|
{
|
298 |
|
|
@Override
|
299 |
|
|
public void onClick(View v)
|
300 |
|
|
{
|
301 |
5f3801d3
|
Leszek Koltunski
|
if( mObjectPopup!=null ) mObjectPopup.dismiss();
|
302 |
|
|
RubikDialogUpdates uDiag = new RubikDialogUpdates();
|
303 |
|
|
uDiag.show( act.getSupportFragmentManager(), RubikDialogUpdates.getDialogTag() );
|
304 |
d6e7c7fb
|
Leszek Koltunski
|
}
|
305 |
|
|
});
|
306 |
|
|
|
307 |
|
|
buttonInf.setOnClickListener( new View.OnClickListener()
|
308 |
8d1da3f1
|
Leszek Koltunski
|
{
|
309 |
|
|
@Override
|
310 |
|
|
public void onClick(View v)
|
311 |
|
|
{
|
312 |
f12e4de9
|
Leszek Koltunski
|
if( mObjectPopup!=null ) mObjectPopup.dismiss();
|
313 |
400ff34d
|
Leszek Koltunski
|
int currObject = RubikObjectList.getCurrObject();
|
314 |
|
|
act.switchConfig(currObject);
|
315 |
8d1da3f1
|
Leszek Koltunski
|
}
|
316 |
|
|
});
|
317 |
d6e7c7fb
|
Leszek Koltunski
|
|
318 |
10373dc7
|
Leszek Koltunski
|
mBubbleUpdates = layout.findViewById(R.id.bubbleUpdates);
|
319 |
|
|
mBubbleUpdates.setVisibility(View.INVISIBLE);
|
320 |
|
|
|
321 |
d6e7c7fb
|
Leszek Koltunski
|
RubikNetwork network = RubikNetwork.getInstance();
|
322 |
|
|
network.signUpForUpdates(this);
|
323 |
8d1da3f1
|
Leszek Koltunski
|
}
|
324 |
|
|
|
325 |
c1df05fa
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
326 |
|
|
|
327 |
|
|
void setupSolveButton(final RubikActivity act)
|
328 |
|
|
{
|
329 |
|
|
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);
|
330 |
|
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
|
331 |
|
|
mSolveButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE,params);
|
332 |
|
|
|
333 |
|
|
mSolveButton.setOnClickListener( new View.OnClickListener()
|
334 |
|
|
{
|
335 |
|
|
@Override
|
336 |
|
|
public void onClick(View v)
|
337 |
|
|
{
|
338 |
|
|
act.getControl().solveObject();
|
339 |
|
|
mMovesController.clearMoves(act);
|
340 |
|
|
}
|
341 |
|
|
});
|
342 |
|
|
}
|
343 |
|
|
|
344 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
345 |
|
|
|
346 |
|
|
private void setupScrambleButton(final RubikActivity act)
|
347 |
|
|
{
|
348 |
|
|
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);
|
349 |
|
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
|
350 |
|
|
mScrambleButton = new TransparentImageButton(act, icon, TransparentImageButton.GRAVITY_MIDDLE, params);
|
351 |
|
|
|
352 |
|
|
mScrambleButton.setOnClickListener( new View.OnClickListener()
|
353 |
|
|
{
|
354 |
|
|
@Override
|
355 |
|
|
public void onClick(View v)
|
356 |
|
|
{
|
357 |
|
|
mShouldReactToEndOfScrambling = false;
|
358 |
1ba56d95
|
Leszek Koltunski
|
act.getControl().fastScrambleObject(RubikObject.FAST_SCRAMBLES);
|
359 |
c1df05fa
|
Leszek Koltunski
|
}
|
360 |
|
|
});
|
361 |
|
|
}
|
362 |
|
|
|
363 |
e03e0352
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
364 |
|
|
|
365 |
ad0c8e0e
|
Leszek Koltunski
|
private void setupMenuWindow(final RubikActivity act, final float width)
|
366 |
e03e0352
|
Leszek Koltunski
|
{
|
367 |
|
|
LayoutInflater layoutInflater = (LayoutInflater)act.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
368 |
e07c48a2
|
Leszek Koltunski
|
final View layout = layoutInflater.inflate(R.layout.popup_menu, null);
|
369 |
e03e0352
|
Leszek Koltunski
|
|
370 |
|
|
mMenuPopup = new PopupWindow(act);
|
371 |
|
|
mMenuPopup.setContentView(layout);
|
372 |
|
|
mMenuPopup.setFocusable(true);
|
373 |
0b458a90
|
Leszek Koltunski
|
int padding = (int)(width*RubikActivity.MEDIUM_MARGIN);
|
374 |
0254cfd7
|
Leszek Koltunski
|
|
375 |
0b458a90
|
Leszek Koltunski
|
mMenuLayoutWidth = (int)(width*0.6f);
|
376 |
b61c66ad
|
Leszek Koltunski
|
mMenuLayoutHeight= padding + NUM_BUTTONS*(mMenuButtonHeight+padding) + 4*mMenuButtonHeight+6*padding;
|
377 |
e03e0352
|
Leszek Koltunski
|
|
378 |
0b458a90
|
Leszek Koltunski
|
layout.setPadding(padding,0,padding,0);
|
379 |
e03e0352
|
Leszek Koltunski
|
|
380 |
0b458a90
|
Leszek Koltunski
|
Button highScores = layout.findViewById(R.id.menuHighScores);
|
381 |
369a0fce
|
Leszek Koltunski
|
highScores.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
|
382 |
0b458a90
|
Leszek Koltunski
|
highScores.setOnClickListener( new View.OnClickListener()
|
383 |
e03e0352
|
Leszek Koltunski
|
{
|
384 |
|
|
@Override
|
385 |
|
|
public void onClick(View v)
|
386 |
|
|
{
|
387 |
|
|
mMenuPopup.dismiss();
|
388 |
0b458a90
|
Leszek Koltunski
|
Bundle sBundle = new Bundle();
|
389 |
|
|
int currObject = RubikObjectList.getCurrObject();
|
390 |
|
|
sBundle.putInt("tab", currObject );
|
391 |
|
|
sBundle.putBoolean("submitting", false);
|
392 |
|
|
RubikDialogScores scores = new RubikDialogScores();
|
393 |
|
|
scores.setArguments(sBundle);
|
394 |
|
|
scores.show(act.getSupportFragmentManager(), null);
|
395 |
e03e0352
|
Leszek Koltunski
|
}
|
396 |
|
|
});
|
397 |
|
|
|
398 |
0b458a90
|
Leszek Koltunski
|
Button prettyPatterns = layout.findViewById(R.id.menuPrettyPatterns);
|
399 |
369a0fce
|
Leszek Koltunski
|
prettyPatterns.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
|
400 |
0b458a90
|
Leszek Koltunski
|
prettyPatterns.setOnClickListener( new View.OnClickListener()
|
401 |
|
|
{
|
402 |
|
|
@Override
|
403 |
|
|
public void onClick(View v)
|
404 |
|
|
{
|
405 |
|
|
mMenuPopup.dismiss();
|
406 |
|
|
RubikDialogPattern pDiag = new RubikDialogPattern();
|
407 |
|
|
pDiag.show( act.getSupportFragmentManager(), RubikDialogPattern.getDialogTag() );
|
408 |
|
|
}
|
409 |
|
|
});
|
410 |
0254cfd7
|
Leszek Koltunski
|
|
411 |
0b458a90
|
Leszek Koltunski
|
Button solver = layout.findViewById(R.id.menuSolver);
|
412 |
369a0fce
|
Leszek Koltunski
|
solver.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
|
413 |
0b458a90
|
Leszek Koltunski
|
solver.setOnClickListener( new View.OnClickListener()
|
414 |
|
|
{
|
415 |
|
|
@Override
|
416 |
|
|
public void onClick(View v)
|
417 |
|
|
{
|
418 |
|
|
mMenuPopup.dismiss();
|
419 |
|
|
ScreenList.switchScreen(act, ScreenList.SVER);
|
420 |
|
|
}
|
421 |
|
|
});
|
422 |
e03e0352
|
Leszek Koltunski
|
|
423 |
0b458a90
|
Leszek Koltunski
|
Button tutorials = layout.findViewById(R.id.menuTutorials);
|
424 |
369a0fce
|
Leszek Koltunski
|
tutorials.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
|
425 |
0b458a90
|
Leszek Koltunski
|
tutorials.setOnClickListener( new View.OnClickListener()
|
426 |
|
|
{
|
427 |
|
|
@Override
|
428 |
|
|
public void onClick(View v)
|
429 |
|
|
{
|
430 |
|
|
mMenuPopup.dismiss();
|
431 |
|
|
RubikDialogTutorial tDiag = new RubikDialogTutorial();
|
432 |
|
|
tDiag.show( act.getSupportFragmentManager(), RubikDialogTutorial.getDialogTag() );
|
433 |
|
|
}
|
434 |
|
|
});
|
435 |
e03e0352
|
Leszek Koltunski
|
|
436 |
0b458a90
|
Leszek Koltunski
|
Button about = layout.findViewById(R.id.menuAbout);
|
437 |
369a0fce
|
Leszek Koltunski
|
about.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
|
438 |
0b458a90
|
Leszek Koltunski
|
about.setOnClickListener( new View.OnClickListener()
|
439 |
|
|
{
|
440 |
|
|
@Override
|
441 |
|
|
public void onClick(View v)
|
442 |
|
|
{
|
443 |
|
|
mMenuPopup.dismiss();
|
444 |
|
|
RubikDialogAbout aDiag = new RubikDialogAbout();
|
445 |
|
|
aDiag.show(act.getSupportFragmentManager(), null);
|
446 |
|
|
}
|
447 |
|
|
});
|
448 |
4f3e2d90
|
Leszek Koltunski
|
|
449 |
369a0fce
|
Leszek Koltunski
|
TextView levels = layout.findViewById(R.id.menuLevels);
|
450 |
|
|
levels.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
|
451 |
|
|
|
452 |
4f3e2d90
|
Leszek Koltunski
|
setupLevelButtons(act,layout,padding);
|
453 |
|
|
}
|
454 |
|
|
|
455 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
456 |
|
|
|
457 |
|
|
private void setupLevelButtons(RubikActivity act, View layout, int padding)
|
458 |
|
|
{
|
459 |
|
|
int sizeW = (mMenuLayoutWidth-4*padding)/3;
|
460 |
3c27ff9e
|
Leszek Koltunski
|
int sizeH = (int)(sizeW*0.8f);
|
461 |
4f3e2d90
|
Leszek Koltunski
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(sizeW,sizeH);
|
462 |
|
|
params.setMargins(padding/2,0,padding/2,0);
|
463 |
|
|
|
464 |
1088a219
|
Leszek Koltunski
|
mLevel = new Button[LEVELS_SHOWN+1];
|
465 |
4f3e2d90
|
Leszek Koltunski
|
|
466 |
1088a219
|
Leszek Koltunski
|
mLevel[0] = layout.findViewById(R.id.level1);
|
467 |
|
|
mLevel[1] = layout.findViewById(R.id.level2);
|
468 |
|
|
mLevel[2] = layout.findViewById(R.id.level3);
|
469 |
|
|
mLevel[3] = layout.findViewById(R.id.level4);
|
470 |
|
|
mLevel[4] = layout.findViewById(R.id.level5);
|
471 |
|
|
mLevel[5] = layout.findViewById(R.id.level6);
|
472 |
|
|
mLevel[6] = layout.findViewById(R.id.level7);
|
473 |
|
|
mLevel[7] = layout.findViewById(R.id.level8);
|
474 |
|
|
mLevel[8] = layout.findViewById(R.id.levelM);
|
475 |
4f3e2d90
|
Leszek Koltunski
|
|
476 |
1088a219
|
Leszek Koltunski
|
for(int i=0; i<=LEVELS_SHOWN; i++)
|
477 |
|
|
{
|
478 |
|
|
final int ii = i;
|
479 |
|
|
mLevel[i].setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
|
480 |
|
|
mLevel[i].setLayoutParams(params);
|
481 |
|
|
mLevel[i].setOnClickListener( new View.OnClickListener()
|
482 |
4f3e2d90
|
Leszek Koltunski
|
{
|
483 |
|
|
@Override
|
484 |
|
|
public void onClick(View v)
|
485 |
|
|
{
|
486 |
|
|
ObjectControl control = act.getControl();
|
487 |
|
|
|
488 |
|
|
if(control.isUINotBlocked())
|
489 |
|
|
{
|
490 |
|
|
if( mMenuPopup!=null ) mMenuPopup.dismiss();
|
491 |
|
|
|
492 |
|
|
int currObject = RubikObjectList.getCurrObject();
|
493 |
|
|
RubikObject object = RubikObjectList.getObject(currObject);
|
494 |
1088a219
|
Leszek Koltunski
|
final int scrambles = ii<LEVELS_SHOWN ? ii+1 : (object==null ? 0 : object.getNumScramble());
|
495 |
|
|
mLevelValue = ii+1;
|
496 |
4f3e2d90
|
Leszek Koltunski
|
mShouldReactToEndOfScrambling = true;
|
497 |
|
|
control.scrambleObject(scrambles);
|
498 |
|
|
}
|
499 |
|
|
}
|
500 |
|
|
});
|
501 |
1088a219
|
Leszek Koltunski
|
}
|
502 |
|
|
}
|
503 |
|
|
|
504 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
505 |
|
|
|
506 |
8a47642f
|
Leszek Koltunski
|
private void setupLevelColors(RubikActivity act)
|
507 |
1088a219
|
Leszek Koltunski
|
{
|
508 |
|
|
int currObject = RubikObjectList.getCurrObject();
|
509 |
|
|
RubikScores scores = RubikScores.getInstance();
|
510 |
8a47642f
|
Leszek Koltunski
|
Resources res = act.getResources();
|
511 |
be65535e
|
Leszek Koltunski
|
ColorStateList colorG = ColorStateList.valueOf(res.getColor(R.color.green));
|
512 |
|
|
ColorStateList colorD = ColorStateList.valueOf(res.getColor(R.color.dark_grey));
|
513 |
1088a219
|
Leszek Koltunski
|
|
514 |
83018ac4
|
Leszek Koltunski
|
for(int level=0; level<=LEVELS_SHOWN; level++)
|
515 |
1088a219
|
Leszek Koltunski
|
{
|
516 |
|
|
boolean isSolved = scores.isSolved(currObject,level);
|
517 |
83018ac4
|
Leszek Koltunski
|
mLevel[level].setBackgroundTintList( isSolved ? colorG : colorD);
|
518 |
1088a219
|
Leszek Koltunski
|
}
|
519 |
e03e0352
|
Leszek Koltunski
|
}
|
520 |
|
|
|
521 |
211b48f2
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
522 |
3398a606
|
Leszek Koltunski
|
// This is necessary! Otherwise the ObjectPopup will not be re-created next time and we will still
|
523 |
|
|
// hold a reference to the old instance of the RubikActivity class (because setupObjectWindow is not
|
524 |
|
|
// going to be called)
|
525 |
|
|
// An reference to the old instance of RubikActivity will cause all sorts of strange issues.
|
526 |
211b48f2
|
Leszek Koltunski
|
|
527 |
|
|
public void savePreferences(SharedPreferences.Editor editor)
|
528 |
|
|
{
|
529 |
d38a302b
|
Leszek Koltunski
|
editor.putInt("play_LevelValue", mLevelValue );
|
530 |
|
|
|
531 |
3398a606
|
Leszek Koltunski
|
if( mObjectPopup!=null )
|
532 |
|
|
{
|
533 |
|
|
mObjectPopup.dismiss();
|
534 |
|
|
mObjectPopup = null;
|
535 |
|
|
}
|
536 |
87d86e5f
|
Leszek Koltunski
|
|
537 |
3398a606
|
Leszek Koltunski
|
if( mMenuPopup!=null )
|
538 |
|
|
{
|
539 |
|
|
mMenuPopup.dismiss();
|
540 |
|
|
mMenuPopup = null;
|
541 |
|
|
}
|
542 |
69b66386
|
Leszek Koltunski
|
}
|
543 |
|
|
|
544 |
211b48f2
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
545 |
|
|
|
546 |
|
|
public void restorePreferences(SharedPreferences preferences)
|
547 |
|
|
{
|
548 |
1088a219
|
Leszek Koltunski
|
mLevelValue = preferences.getInt("play_LevelValue", 0);
|
549 |
7b7d65ce
|
Leszek Koltunski
|
}
|
550 |
|
|
|
551 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
552 |
255492a0
|
Leszek Koltunski
|
// work around lame bugs in Android's version <= 10 pop-up and split-screen modes
|
553 |
|
|
|
554 |
|
|
private void displayPopup(RubikActivity act, View view, PopupWindow window, int w, int h, int xoff, int yoff)
|
555 |
|
|
{
|
556 |
|
|
View topLayout = act.findViewById(R.id.relativeLayout);
|
557 |
7ac0ee88
|
Leszek Koltunski
|
boolean isFullScreen;
|
558 |
00aa398a
|
Leszek Koltunski
|
|
559 |
|
|
if( topLayout!=null )
|
560 |
|
|
{
|
561 |
|
|
topLayout.getLocationOnScreen(mLocation);
|
562 |
7ac0ee88
|
Leszek Koltunski
|
isFullScreen = (mLocation[1]==0);
|
563 |
00aa398a
|
Leszek Koltunski
|
}
|
564 |
|
|
else
|
565 |
|
|
{
|
566 |
7ac0ee88
|
Leszek Koltunski
|
isFullScreen = true;
|
567 |
00aa398a
|
Leszek Koltunski
|
}
|
568 |
255492a0
|
Leszek Koltunski
|
|
569 |
69a271f3
|
Leszek Koltunski
|
try
|
570 |
255492a0
|
Leszek Koltunski
|
{
|
571 |
69a271f3
|
Leszek Koltunski
|
// if on Android 11 or we are fullscreen
|
572 |
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R || isFullScreen )
|
573 |
|
|
{
|
574 |
|
|
window.showAsDropDown(view, xoff, yoff, Gravity.CENTER);
|
575 |
|
|
window.update(view, w, h);
|
576 |
|
|
}
|
577 |
|
|
else // Android 10 or below in pop-up mode or split-screen mode
|
578 |
|
|
{
|
579 |
|
|
view.getLocationOnScreen(mLocation);
|
580 |
|
|
int width = view.getWidth();
|
581 |
|
|
int height = view.getHeight();
|
582 |
|
|
int x = mLocation[0]+(width-w)/2;
|
583 |
|
|
int y = mLocation[1]+height+yoff;
|
584 |
|
|
|
585 |
|
|
window.showAsDropDown(view);
|
586 |
|
|
window.update(x,y,w,h);
|
587 |
|
|
}
|
588 |
255492a0
|
Leszek Koltunski
|
}
|
589 |
69a271f3
|
Leszek Koltunski
|
catch( IllegalArgumentException iae )
|
590 |
255492a0
|
Leszek Koltunski
|
{
|
591 |
69a271f3
|
Leszek Koltunski
|
// ignore, this means window is 'not attached to window manager' -
|
592 |
|
|
// which most probably is because we are already exiting the app.
|
593 |
255492a0
|
Leszek Koltunski
|
}
|
594 |
|
|
}
|
595 |
|
|
|
596 |
211b48f2
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
597 |
|
|
|
598 |
dca3888a
|
Leszek Koltunski
|
public int getLevel()
|
599 |
211b48f2
|
Leszek Koltunski
|
{
|
600 |
85b09df4
|
Leszek Koltunski
|
return mLevelValue;
|
601 |
211b48f2
|
Leszek Koltunski
|
}
|
602 |
|
|
|
603 |
84d746d7
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
604 |
|
|
|
605 |
|
|
public void recreatePopup()
|
606 |
|
|
{
|
607 |
|
|
mObjectPopup = null;
|
608 |
|
|
}
|
609 |
|
|
|
610 |
dd874ae8
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
611 |
|
|
|
612 |
|
|
public boolean shouldReactToEndOfScrambling()
|
613 |
|
|
{
|
614 |
|
|
return mShouldReactToEndOfScrambling;
|
615 |
|
|
}
|
616 |
63dd19c4
|
Leszek Koltunski
|
|
617 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
618 |
|
|
|
619 |
|
|
public void receiveUpdate(RubikUpdates updates)
|
620 |
|
|
{
|
621 |
179f7189
|
Leszek Koltunski
|
Activity act = mWeakAct.get();
|
622 |
10373dc7
|
Leszek Koltunski
|
|
623 |
179f7189
|
Leszek Koltunski
|
if( act!=null )
|
624 |
903c7bbc
|
Leszek Koltunski
|
{
|
625 |
179f7189
|
Leszek Koltunski
|
act.runOnUiThread(new Runnable()
|
626 |
|
|
{
|
627 |
|
|
@Override
|
628 |
|
|
public void run()
|
629 |
|
|
{
|
630 |
2c9ab085
|
Leszek Koltunski
|
int num = updates.getCompletedNumber();
|
631 |
179f7189
|
Leszek Koltunski
|
|
632 |
|
|
if( num>0 )
|
633 |
|
|
{
|
634 |
|
|
String shownNum = String.valueOf(num);
|
635 |
|
|
mBubbleUpdates.setText(shownNum);
|
636 |
|
|
mBubbleUpdates.setVisibility(View.VISIBLE);
|
637 |
|
|
int height = (int)(0.05f*mScreenWidth);
|
638 |
|
|
mBubbleUpdates.setTextSize(TypedValue.COMPLEX_UNIT_PX,height);
|
639 |
|
|
}
|
640 |
|
|
else
|
641 |
|
|
{
|
642 |
|
|
mBubbleUpdates.setVisibility(View.INVISIBLE);
|
643 |
|
|
}
|
644 |
|
|
}
|
645 |
|
|
});
|
646 |
903c7bbc
|
Leszek Koltunski
|
}
|
647 |
63dd19c4
|
Leszek Koltunski
|
}
|
648 |
|
|
|
649 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
650 |
|
|
|
651 |
|
|
public void errorUpdate()
|
652 |
|
|
{
|
653 |
c99db493
|
Leszek Koltunski
|
android.util.Log.e("D", "Screen: Error receiving update");
|
654 |
63dd19c4
|
Leszek Koltunski
|
}
|
655 |
211b48f2
|
Leszek Koltunski
|
}
|