Skip to content

Commit

Permalink
better text, smaller gates, table of gates rules
Browse files Browse the repository at this point in the history
  • Loading branch information
LionelJouin committed Nov 21, 2016
1 parent 5778bb7 commit c8f3595
Show file tree
Hide file tree
Showing 13 changed files with 1,009 additions and 12 deletions.
21 changes: 16 additions & 5 deletions app/src/main/java/me/jouin/lionel/tarkigates/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class MainActivity extends AppCompatActivity {
private Informations informations;
private Map<PageName, Page> pages;
private PageName pageActuel;
private PageName previousPage;

private boolean doubleBackToExitPressedOnce = false;

Expand Down Expand Up @@ -65,7 +66,8 @@ public void selectLevel(LevelList levelList) {
});
}

changePage(PageName.HOME);
pageActuel = PageName.HOME;
changePage(pageActuel);

Resources.getInstance(this);

Expand Down Expand Up @@ -100,10 +102,19 @@ protected void onPause() {

public void changePage(PageName pageName) {
if (pages.containsKey(pageName)) {
pageActuel = pageName;
tx = getSupportFragmentManager().beginTransaction();
tx.replace(R.id.fragment, pages.get(pageName));
tx.commit();
if (pageActuel != PageName.SETTINGS) {
previousPage = pageActuel;
pageActuel = pageName;
tx = getSupportFragmentManager().beginTransaction();
tx.replace(R.id.fragment, pages.get(pageName));
tx.commit();
} else {
pageActuel = previousPage;
previousPage = PageName.SETTINGS;
tx = getSupportFragmentManager().beginTransaction();
tx.replace(R.id.fragment, pages.get(pageActuel));
tx.commit();
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions app/src/main/java/me/jouin/lionel/tarkigates/pages/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class Game extends Page {
private ViewGroup root;
private LinearLayout finishGameMenu;
private LinearLayout pauseMenu;
private TextView resultTextMSG;
private TextView nbClickTextView;
private LinearLayout resultLinearLayout;
private ImageView continuerButton;
Expand All @@ -58,6 +59,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
ImageView replayButton = (ImageView) root.findViewById(R.id.replay);
ImageView homeButton2 = (ImageView) root.findViewById(R.id.gotohome2);

resultTextMSG = (TextView) root.findViewById(R.id.resultTextMSG);
nbClickTextView = (TextView) root.findViewById(R.id.nbclick);
resultLinearLayout = (LinearLayout) root.findViewById(R.id.result);

Expand Down Expand Up @@ -196,18 +198,22 @@ public void switchLight(boolean state) {
nbClickTextView.setText(""+gameView.getNbClicks());
switch(result) {
case 1:
resultTextMSG.setText(getString(R.string.textBronze));
continuerButton.setVisibility(View.VISIBLE);
resultLinearLayout.setBackgroundColor(ResourcesCompat.getColor(getResources(), R.color.sillBronze, null));
break;
case 2:
resultTextMSG.setText(getString(R.string.textSilver));
continuerButton.setVisibility(View.VISIBLE);
resultLinearLayout.setBackgroundColor(ResourcesCompat.getColor(getResources(), R.color.sillSilver, null));
break;
case 3:
resultTextMSG.setText(getString(R.string.textGold));
continuerButton.setVisibility(View.VISIBLE);
resultLinearLayout.setBackgroundColor(ResourcesCompat.getColor(getResources(), R.color.sillGold, null));
break;
default:
resultTextMSG.setText(getString(R.string.textClear));
continuerButton.setVisibility(View.INVISIBLE);
resultLinearLayout.setBackgroundColor(ResourcesCompat.getColor(getResources(), R.color.sillClear, null));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
for (final LevelList levelList : LevelList.values()) {
int levelSaved = sharedPref.getInt(levelList.toString(), 0);
LevelList previousLevel = levelList.previousLevel(levelList);
System.out.println("koukou "+previousLevel);
int previousLevelSaved = 1;
if (previousLevel != null)
previousLevelSaved = sharedPref.getInt(previousLevel.toString(), 0);
Expand Down
Binary file modified app/src/main/res/drawable/and.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable/nand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable/nor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable/not.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable/or.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable/xnor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable/xor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app/src/main/res/layout/fragment_game.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@
android:id="@+id/finishGame"
android:visibility="invisible">
<TextView
android:text="@string/win"
android:text="@string/textClear"
android:textSize="30sp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="15dp"
android:id="@+id/textView2"
android:id="@+id/resultTextMSG"
android:textColor="@color/textPause"
android:textAlignment="center"
android:fontFamily="sans-serif"
Expand Down
Loading

0 comments on commit c8f3595

Please sign in to comment.