Skip to content

Commit c8f3595

Browse files
committed
better text, smaller gates, table of gates rules
1 parent 5778bb7 commit c8f3595

File tree

13 files changed

+1009
-12
lines changed

13 files changed

+1009
-12
lines changed

app/src/main/java/me/jouin/lionel/tarkigates/MainActivity.java

+16-5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class MainActivity extends AppCompatActivity {
3131
private Informations informations;
3232
private Map<PageName, Page> pages;
3333
private PageName pageActuel;
34+
private PageName previousPage;
3435

3536
private boolean doubleBackToExitPressedOnce = false;
3637

@@ -65,7 +66,8 @@ public void selectLevel(LevelList levelList) {
6566
});
6667
}
6768

68-
changePage(PageName.HOME);
69+
pageActuel = PageName.HOME;
70+
changePage(pageActuel);
6971

7072
Resources.getInstance(this);
7173

@@ -100,10 +102,19 @@ protected void onPause() {
100102

101103
public void changePage(PageName pageName) {
102104
if (pages.containsKey(pageName)) {
103-
pageActuel = pageName;
104-
tx = getSupportFragmentManager().beginTransaction();
105-
tx.replace(R.id.fragment, pages.get(pageName));
106-
tx.commit();
105+
if (pageActuel != PageName.SETTINGS) {
106+
previousPage = pageActuel;
107+
pageActuel = pageName;
108+
tx = getSupportFragmentManager().beginTransaction();
109+
tx.replace(R.id.fragment, pages.get(pageName));
110+
tx.commit();
111+
} else {
112+
pageActuel = previousPage;
113+
previousPage = PageName.SETTINGS;
114+
tx = getSupportFragmentManager().beginTransaction();
115+
tx.replace(R.id.fragment, pages.get(pageActuel));
116+
tx.commit();
117+
}
107118
}
108119
}
109120

app/src/main/java/me/jouin/lionel/tarkigates/pages/Game.java

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class Game extends Page {
3535
private ViewGroup root;
3636
private LinearLayout finishGameMenu;
3737
private LinearLayout pauseMenu;
38+
private TextView resultTextMSG;
3839
private TextView nbClickTextView;
3940
private LinearLayout resultLinearLayout;
4041
private ImageView continuerButton;
@@ -58,6 +59,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
5859
ImageView replayButton = (ImageView) root.findViewById(R.id.replay);
5960
ImageView homeButton2 = (ImageView) root.findViewById(R.id.gotohome2);
6061

62+
resultTextMSG = (TextView) root.findViewById(R.id.resultTextMSG);
6163
nbClickTextView = (TextView) root.findViewById(R.id.nbclick);
6264
resultLinearLayout = (LinearLayout) root.findViewById(R.id.result);
6365

@@ -196,18 +198,22 @@ public void switchLight(boolean state) {
196198
nbClickTextView.setText(""+gameView.getNbClicks());
197199
switch(result) {
198200
case 1:
201+
resultTextMSG.setText(getString(R.string.textBronze));
199202
continuerButton.setVisibility(View.VISIBLE);
200203
resultLinearLayout.setBackgroundColor(ResourcesCompat.getColor(getResources(), R.color.sillBronze, null));
201204
break;
202205
case 2:
206+
resultTextMSG.setText(getString(R.string.textSilver));
203207
continuerButton.setVisibility(View.VISIBLE);
204208
resultLinearLayout.setBackgroundColor(ResourcesCompat.getColor(getResources(), R.color.sillSilver, null));
205209
break;
206210
case 3:
211+
resultTextMSG.setText(getString(R.string.textGold));
207212
continuerButton.setVisibility(View.VISIBLE);
208213
resultLinearLayout.setBackgroundColor(ResourcesCompat.getColor(getResources(), R.color.sillGold, null));
209214
break;
210215
default:
216+
resultTextMSG.setText(getString(R.string.textClear));
211217
continuerButton.setVisibility(View.INVISIBLE);
212218
resultLinearLayout.setBackgroundColor(ResourcesCompat.getColor(getResources(), R.color.sillClear, null));
213219
}

app/src/main/java/me/jouin/lionel/tarkigates/pages/Home.java

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
5656
for (final LevelList levelList : LevelList.values()) {
5757
int levelSaved = sharedPref.getInt(levelList.toString(), 0);
5858
LevelList previousLevel = levelList.previousLevel(levelList);
59-
System.out.println("koukou "+previousLevel);
6059
int previousLevelSaved = 1;
6160
if (previousLevel != null)
6261
previousLevelSaved = sharedPref.getInt(previousLevel.toString(), 0);

app/src/main/res/drawable/and.png

-5.28 KB
Loading

app/src/main/res/drawable/nand.png

-14.6 KB
Loading

app/src/main/res/drawable/nor.png

-12.4 KB
Loading

app/src/main/res/drawable/not.png

-17.6 KB
Loading

app/src/main/res/drawable/or.png

-17.1 KB
Loading

app/src/main/res/drawable/xnor.png

-16.8 KB
Loading

app/src/main/res/drawable/xor.png

-25 KB
Loading

app/src/main/res/layout/fragment_game.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@
7878
android:id="@+id/finishGame"
7979
android:visibility="invisible">
8080
<TextView
81-
android:text="@string/win"
81+
android:text="@string/textClear"
8282
android:textSize="30sp"
8383
android:layout_width="fill_parent"
8484
android:layout_height="wrap_content"
8585
android:layout_marginTop="10dp"
8686
android:layout_marginBottom="15dp"
87-
android:id="@+id/textView2"
87+
android:id="@+id/resultTextMSG"
8888
android:textColor="@color/textPause"
8989
android:textAlignment="center"
9090
android:fontFamily="sans-serif"

0 commit comments

Comments
 (0)