diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 9ab58ab..2dd05c8 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -27,5 +27,9 @@
android:name=".activities.MenuMetroActivity"
android:exported="false"
android:screenOrientation="portrait" />
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/jorgecruces/metrometro/activities/MainActivity.java b/app/src/main/java/com/jorgecruces/metrometro/activities/MainActivity.java
index b1c2186..b87c51f 100644
--- a/app/src/main/java/com/jorgecruces/metrometro/activities/MainActivity.java
+++ b/app/src/main/java/com/jorgecruces/metrometro/activities/MainActivity.java
@@ -20,15 +20,15 @@ public class MainActivity extends AppCompatActivity {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
- AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
}
- public void goNextActivity(View view) {
+ public void goToLinesMenuActivity(View view) {
Intent intent = new Intent(this, MenuMetroActivity.class);
startActivity(intent);
}
- public void resetButton(View view) {
+ public void resetSharedPreferences(View view) {
+ // TODO - Add a prompt before deleting
SharedPreferences sharedPref = this.getSharedPreferences(
String.valueOf(R.string.app_name), Context.MODE_PRIVATE);
sharedPref.edit().clear().commit();
diff --git a/app/src/main/java/com/jorgecruces/metrometro/activities/MenuMetroActivity.java b/app/src/main/java/com/jorgecruces/metrometro/activities/MenuMetroActivity.java
index a1c5712..df0a56f 100644
--- a/app/src/main/java/com/jorgecruces/metrometro/activities/MenuMetroActivity.java
+++ b/app/src/main/java/com/jorgecruces/metrometro/activities/MenuMetroActivity.java
@@ -75,7 +75,7 @@ private boolean getLevelStarSharedPreferences(String lineName) {
return sharedPref.getBoolean(lineName,false);
}
- public void goBackMainActivity(View view) {
+ public void goToMainActivity(View view) {
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
}
diff --git a/app/src/main/java/com/jorgecruces/metrometro/activities/MenuMetroRecyclerViewAdapter.java b/app/src/main/java/com/jorgecruces/metrometro/activities/MenuMetroRecyclerViewAdapter.java
index e53db3d..1ee2a35 100644
--- a/app/src/main/java/com/jorgecruces/metrometro/activities/MenuMetroRecyclerViewAdapter.java
+++ b/app/src/main/java/com/jorgecruces/metrometro/activities/MenuMetroRecyclerViewAdapter.java
@@ -14,6 +14,7 @@
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
+import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.jorgecruces.metrometro.R;
@@ -50,7 +51,7 @@ public void onBindViewHolder(@NonNull MenuMetroRecyclerViewAdapter.MyViewHolder
holder.lineaMetroName.setText(lineName);
holder.backgroundMetroMenu.setColorFilter(color);
- holder.cardView.setOnClickListener(view -> {
+ holder.constraintLayoutContainer.setOnClickListener(view -> {
Intent intent = new Intent(this.context.getApplicationContext(), PlayGameActivity.class);
intent.putExtra("LINEA", lineName);
this.context.startActivity(intent);
@@ -60,7 +61,7 @@ public void onBindViewHolder(@NonNull MenuMetroRecyclerViewAdapter.MyViewHolder
SharedPreferences sharedPref = this.context.getSharedPreferences(
String.valueOf(R.string.app_name),Context.MODE_PRIVATE);
if (sharedPref.getBoolean(lineName, false)) {
- holder.starView.setImageResource(R.drawable.ic_mediamodifier_design_2_);
+ holder.starView.setImageTintList(null);
}
}
@@ -73,12 +74,13 @@ public static class MyViewHolder extends RecyclerView.ViewHolder {
// On createMethod
TextView lineaMetroName;
ImageView backgroundMetroMenu, starView;
- CardView cardView;
+ ConstraintLayout constraintLayoutContainer;
public MyViewHolder(@NonNull View itemView) {
super(itemView);
lineaMetroName = itemView.findViewById(R.id.lineaName);
backgroundMetroMenu = itemView.findViewById(R.id.backgroundMetroMenu);
- cardView = itemView.findViewById(R.id.cardViewMenu);
+ constraintLayoutContainer = itemView.findViewById(R.id.contraintLayoutViewContainer);
+
starView = itemView.findViewById(R.id.starView);
}
}
diff --git a/app/src/main/java/com/jorgecruces/metrometro/activities/PlayGameActivity.java b/app/src/main/java/com/jorgecruces/metrometro/activities/PlayGameActivity.java
index 33f6456..55a998b 100644
--- a/app/src/main/java/com/jorgecruces/metrometro/activities/PlayGameActivity.java
+++ b/app/src/main/java/com/jorgecruces/metrometro/activities/PlayGameActivity.java
@@ -284,16 +284,17 @@ private void updateProgressInfo() {
String.valueOf(R.string.app_name),Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
- int lastScore = sharedPref.getInt("score", 0);
-
- // Score
- if (lastScore < 6) {
- editor.putInt("score",lastScore + 1);
+ // Check if we have updated this level before
+ if(!sharedPref.getBoolean(lineName, false)) {
+ int lastScore = sharedPref.getInt("score", 0);
+ // Score
+ if (lastScore < 6) {
+ editor.putInt("score",lastScore + 1);
+ }
+ // Star
+ editor.putBoolean(this.lineName,true);
+ editor.commit();
}
- // Star
- editor.putBoolean(this.lineName,true);
-
- editor.commit();
}
private void showWinningDialog() {
diff --git a/app/src/main/res/drawable-v24/another_container.png b/app/src/main/res/drawable-v24/another_container.png
new file mode 100644
index 0000000..61e852a
Binary files /dev/null and b/app/src/main/res/drawable-v24/another_container.png differ
diff --git a/app/src/main/res/drawable-v24/background_game_line.png b/app/src/main/res/drawable-v24/background_game_line.png
new file mode 100644
index 0000000..a0c0322
Binary files /dev/null and b/app/src/main/res/drawable-v24/background_game_line.png differ
diff --git a/app/src/main/res/drawable-v24/button_metro_color.png b/app/src/main/res/drawable-v24/button_metro_color.png
new file mode 100644
index 0000000..0dd7495
Binary files /dev/null and b/app/src/main/res/drawable-v24/button_metro_color.png differ
diff --git a/app/src/main/res/drawable-v24/gameplay_button_container.png b/app/src/main/res/drawable-v24/gameplay_button_container.png
new file mode 100644
index 0000000..3339d97
Binary files /dev/null and b/app/src/main/res/drawable-v24/gameplay_button_container.png differ
diff --git a/app/src/main/res/drawable-v24/gameplay_container.png b/app/src/main/res/drawable-v24/gameplay_container.png
new file mode 100644
index 0000000..737b210
Binary files /dev/null and b/app/src/main/res/drawable-v24/gameplay_container.png differ
diff --git a/app/src/main/res/drawable-v24/gameplay_container_button_red.png b/app/src/main/res/drawable-v24/gameplay_container_button_red.png
new file mode 100644
index 0000000..933c04d
Binary files /dev/null and b/app/src/main/res/drawable-v24/gameplay_container_button_red.png differ
diff --git a/app/src/main/res/drawable-v24/sorucefiles.png b/app/src/main/res/drawable-v24/sorucefiles.png
new file mode 100644
index 0000000..94e5d6c
Binary files /dev/null and b/app/src/main/res/drawable-v24/sorucefiles.png differ
diff --git a/app/src/main/res/drawable-v24/trythis.png b/app/src/main/res/drawable-v24/trythis.png
new file mode 100644
index 0000000..2c8624a
Binary files /dev/null and b/app/src/main/res/drawable-v24/trythis.png differ
diff --git a/app/src/main/res/drawable/lineas_metro_line_container.png b/app/src/main/res/drawable/lineas_metro_line_container.png
new file mode 100644
index 0000000..67f8f45
Binary files /dev/null and b/app/src/main/res/drawable/lineas_metro_line_container.png differ
diff --git a/app/src/main/res/drawable/lines_metro_background.png b/app/src/main/res/drawable/lines_metro_background.png
new file mode 100644
index 0000000..4152840
Binary files /dev/null and b/app/src/main/res/drawable/lines_metro_background.png differ
diff --git a/app/src/main/res/drawable/lines_metro_button_back.png b/app/src/main/res/drawable/lines_metro_button_back.png
new file mode 100644
index 0000000..8e69c2d
Binary files /dev/null and b/app/src/main/res/drawable/lines_metro_button_back.png differ
diff --git a/app/src/main/res/drawable/lines_metro_star.png b/app/src/main/res/drawable/lines_metro_star.png
new file mode 100644
index 0000000..851ca43
Binary files /dev/null and b/app/src/main/res/drawable/lines_metro_star.png differ
diff --git a/app/src/main/res/drawable/lines_metro_title.png b/app/src/main/res/drawable/lines_metro_title.png
new file mode 100644
index 0000000..42513e6
Binary files /dev/null and b/app/src/main/res/drawable/lines_metro_title.png differ
diff --git a/app/src/main/res/drawable/lll.png b/app/src/main/res/drawable/lll.png
new file mode 100644
index 0000000..61e852a
Binary files /dev/null and b/app/src/main/res/drawable/lll.png differ
diff --git a/app/src/main/res/drawable/logo.png b/app/src/main/res/drawable/logo.png
new file mode 100644
index 0000000..0d0a4e7
Binary files /dev/null and b/app/src/main/res/drawable/logo.png differ
diff --git a/app/src/main/res/drawable/main_menu_background.png b/app/src/main/res/drawable/main_menu_background.png
new file mode 100644
index 0000000..21e836b
Binary files /dev/null and b/app/src/main/res/drawable/main_menu_background.png differ
diff --git a/app/src/main/res/drawable/main_menu_button_information.png b/app/src/main/res/drawable/main_menu_button_information.png
new file mode 100644
index 0000000..44b9d4a
Binary files /dev/null and b/app/src/main/res/drawable/main_menu_button_information.png differ
diff --git a/app/src/main/res/drawable/main_menu_button_play.png b/app/src/main/res/drawable/main_menu_button_play.png
new file mode 100644
index 0000000..14163b0
Binary files /dev/null and b/app/src/main/res/drawable/main_menu_button_play.png differ
diff --git a/app/src/main/res/drawable/main_menu_button_reset.png b/app/src/main/res/drawable/main_menu_button_reset.png
new file mode 100644
index 0000000..d6f8fd9
Binary files /dev/null and b/app/src/main/res/drawable/main_menu_button_reset.png differ
diff --git a/app/src/main/res/drawable/main_menu_configuration.png b/app/src/main/res/drawable/main_menu_configuration.png
new file mode 100644
index 0000000..66ca861
Binary files /dev/null and b/app/src/main/res/drawable/main_menu_configuration.png differ
diff --git a/app/src/main/res/font/titillium_web_extralight.xml b/app/src/main/res/font/titillium_web_extralight.xml
new file mode 100644
index 0000000..df4c0ae
--- /dev/null
+++ b/app/src/main/res/font/titillium_web_extralight.xml
@@ -0,0 +1,7 @@
+
+
+
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index a24147e..879270b 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -4,46 +4,63 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:background="@drawable/main_menu_background"
tools:context=".activities.MainActivity">
-
-
-
+ app:layout_constraintTop_toTopOf="parent"
+ app:srcCompat="@drawable/logo" />
-
+ app:layout_constraintTop_toBottomOf="@+id/imageViewLogo"
+ app:srcCompat="@drawable/main_menu_button_play" />
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_menu_metro.xml b/app/src/main/res/layout/activity_menu_metro.xml
index 5bda588..7408e1f 100644
--- a/app/src/main/res/layout/activity_menu_metro.xml
+++ b/app/src/main/res/layout/activity_menu_metro.xml
@@ -4,23 +4,9 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:background="@drawable/lines_metro_background"
tools:context=".activities.MenuMetroActivity">
-
-
+ app:layout_constraintTop_toBottomOf="@+id/imageViewLineMenuTitle">
-
-
+ app:srcCompat="@drawable/lines_metro_title" />
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_play_game.xml b/app/src/main/res/layout/activity_play_game.xml
index f321b86..9ba1e34 100644
--- a/app/src/main/res/layout/activity_play_game.xml
+++ b/app/src/main/res/layout/activity_play_game.xml
@@ -5,99 +5,113 @@
android:id="@+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:background="@drawable/lines_metro_background"
tools:context=".activities.PlayGameActivity">
+ app:srcCompat="@drawable/lines_metro_button_back" />
+ app:layout_constraintStart_toEndOf="@+id/textViewAlternative2" />
+ app:layout_constraintStart_toEndOf="@+id/textViewAlternative3"
+ tools:background="@drawable/button_metro_color" />
+ android:textSize="30sp" />
+ android:textSize="30sp" />
+ android:textSize="30sp" />
-
-
+
-
-
-
-
-
+
-
+
-
+
-
+
-
-
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..491091c
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..a63ca84
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..343184b
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..2cd4bb8
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..eef868c
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..b21b452
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..be9a153
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..be12ebd
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..aa4998b
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..0f7c5a9
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..f56189c
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..e92bde1
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..3814efc
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..62b701b
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..5743264
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml
index 5d8d044..8dbf7ed 100644
--- a/app/src/main/res/values-night/themes.xml
+++ b/app/src/main/res/values-night/themes.xml
@@ -1,6 +1,8 @@