-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New version, revamp add bottom nav bar
- Loading branch information
Showing
17 changed files
with
509 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
146 changes: 146 additions & 0 deletions
146
app/src/main/java/net/sourceforge/solitaire_cg_re/Modes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
package net.sourceforge.solitaire_cg_re; | ||
|
||
|
||
import android.app.Activity; | ||
import android.content.SharedPreferences; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Button; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
public class Modes extends Activity { | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
setContentView(R.layout.modes); | ||
View modesView = findViewById(R.id.modes_view); | ||
modesView.setFocusable(true); | ||
modesView.setFocusableInTouchMode(true); | ||
|
||
SolitaireView view = SolitaireViewManager.getInstance(); | ||
|
||
Button buttonBlackWidow = modesView.findViewById(R.id.button_blackwidow); | ||
Button buttonBakersGame = modesView.findViewById(R.id.button_bakersgame); | ||
Button buttonFreecell = modesView.findViewById(R.id.button_freecell); | ||
Button buttonFortyThieves = modesView.findViewById(R.id.button_fortythieves); | ||
Button buttonGolf = modesView.findViewById(R.id.button_golf); | ||
Button buttonKlondikeDealOne = modesView.findViewById(R.id.button_klondike_dealone); | ||
Button buttonKlondikeDealThree = modesView.findViewById(R.id.button_klondike_dealthree); | ||
Button buttonSpider = modesView.findViewById(R.id.button_spider); | ||
Button buttonTarantula = modesView.findViewById(R.id.button_tarantula); | ||
Button buttonTripeaks = modesView.findViewById(R.id.button_tripeaks); | ||
Button buttonTripeaksWrapcards = modesView.findViewById(R.id.button_tripeaks_wrapcards); | ||
Button buttonVegasDealOne = modesView.findViewById(R.id.button_vegas_dealone); | ||
Button buttonVegasDealThree = modesView.findViewById(R.id.button_vegas_dealthree); | ||
Button buttonGolfWrapcards = modesView.findViewById(R.id.button_golf_wrapcards); | ||
|
||
|
||
final SharedPreferences settings = getSharedPreferences("YourPreferences", MODE_PRIVATE); | ||
final SharedPreferences.Editor editor = settings.edit(); | ||
|
||
|
||
buttonBlackWidow.setOnClickListener(v -> { | ||
editor.putInt("SpiderSuits", 1); | ||
editor.apply(); | ||
view.resetGameState(); | ||
view.InitGame(Rules.SPIDER); | ||
finish(); | ||
}); | ||
|
||
buttonBakersGame.setOnClickListener(v -> { | ||
editor.putBoolean("FreecellBuildBySuit", true); | ||
editor.apply(); | ||
view.InitGame(Rules.FREECELL); | ||
finish(); | ||
}); | ||
|
||
buttonFreecell.setOnClickListener(v -> { | ||
editor.putBoolean("FreecellBuildBySuit", false); | ||
editor.apply(); | ||
view.InitGame(Rules.FREECELL); | ||
finish(); | ||
}); | ||
|
||
buttonFortyThieves.setOnClickListener(v -> { | ||
view.InitGame(Rules.FORTYTHIEVES); | ||
finish(); | ||
}); | ||
|
||
buttonGolf.setOnClickListener(v -> { | ||
editor.putBoolean("GolfWrapCards", false); | ||
editor.apply(); | ||
view.InitGame(Rules.GOLF); | ||
finish(); | ||
}); | ||
|
||
buttonKlondikeDealOne.setOnClickListener(v -> { | ||
editor.putBoolean("KlondikeDealThree", false); | ||
editor.putBoolean("KlondikeStyleNormal", true); | ||
editor.apply(); | ||
view.InitGame(Rules.KLONDIKE); | ||
finish(); | ||
}); | ||
|
||
buttonKlondikeDealThree.setOnClickListener(v -> { | ||
editor.putBoolean("KlondikeDealThree", true); | ||
editor.putBoolean("KlondikeStyleNormal", true); | ||
editor.apply(); | ||
view.InitGame(Rules.KLONDIKE); | ||
finish(); | ||
}); | ||
|
||
buttonSpider.setOnClickListener(v -> { | ||
editor.putInt("SpiderSuits", 4); | ||
editor.apply(); | ||
view.InitGame(Rules.SPIDER); | ||
finish(); | ||
}); | ||
|
||
buttonTarantula.setOnClickListener(v -> { | ||
editor.putInt("SpiderSuits", 2); | ||
editor.apply(); | ||
view.InitGame(Rules.SPIDER); | ||
finish(); | ||
}); | ||
|
||
buttonTripeaks.setOnClickListener(v -> { | ||
editor.putBoolean("GolfWrapCards", false); | ||
editor.apply(); | ||
view.InitGame(Rules.TRIPEAKS); | ||
finish(); | ||
}); | ||
|
||
buttonTripeaksWrapcards.setOnClickListener(v -> { | ||
editor.putBoolean("GolfWrapCards", true); | ||
editor.apply(); | ||
view.InitGame(Rules.TRIPEAKS); | ||
finish(); | ||
}); | ||
|
||
buttonVegasDealOne.setOnClickListener(v -> { | ||
editor.putBoolean("KlondikeDealThree", false); | ||
editor.putBoolean("KlondikeStyleNormal", false); | ||
editor.apply(); | ||
view.InitGame(Rules.KLONDIKE); | ||
finish(); | ||
}); | ||
|
||
buttonVegasDealThree.setOnClickListener(v -> { | ||
editor.putBoolean("KlondikeDealThree", true); | ||
editor.putBoolean("KlondikeStyleNormal", false); | ||
editor.apply(); | ||
view.InitGame(Rules.KLONDIKE); | ||
finish(); | ||
}); | ||
|
||
buttonGolfWrapcards.setOnClickListener(v -> { | ||
editor.putBoolean("GolfWrapCards", true); | ||
editor.apply(); | ||
view.InitGame(Rules.GOLF); | ||
finish(); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
app/src/main/java/net/sourceforge/solitaire_cg_re/SolitaireViewManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package net.sourceforge.solitaire_cg_re; | ||
|
||
public class SolitaireViewManager { | ||
private static SolitaireView instance; | ||
|
||
public static void setInstance(SolitaireView view) { | ||
instance = view; | ||
} | ||
|
||
public static SolitaireView getInstance() { | ||
return instance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="800dp" | ||
android:height="800dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:pathData="M12,20H12.01" | ||
android:strokeLineJoin="round" | ||
android:strokeWidth="2" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#000000" | ||
android:strokeLineCap="round"/> | ||
<path | ||
android:pathData="M7,9C7,7.874 7.372,6.836 8,6C8.912,4.786 10.364,4 12,4C14.761,4 17,6.239 17,9C17,11.421 15.279,13.441 12.994,13.901C12.452,14.01 12,14.448 12,15V15V16" | ||
android:strokeWidth="2" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#000000" | ||
android:strokeLineCap="round"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="800dp" | ||
android:height="800dp" | ||
android:viewportWidth="48" | ||
android:viewportHeight="48"> | ||
<path | ||
android:pathData="M0,0h48v48h-48z" | ||
android:fillColor="#ffffff" | ||
android:fillAlpha="0.01"/> | ||
<path | ||
android:pathData="M18,31H38V5" | ||
android:strokeLineJoin="round" | ||
android:strokeWidth="4" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#000000" | ||
android:strokeLineCap="round"/> | ||
<path | ||
android:pathData="M30,21H10V43" | ||
android:strokeLineJoin="round" | ||
android:strokeWidth="4" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#000000" | ||
android:strokeLineCap="round"/> | ||
<path | ||
android:pathData="M44,11L38,5L32,11" | ||
android:strokeLineJoin="round" | ||
android:strokeWidth="4" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#000000" | ||
android:strokeLineCap="round"/> | ||
<path | ||
android:pathData="M16,37L10,43L4,37" | ||
android:strokeLineJoin="round" | ||
android:strokeWidth="4" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#000000" | ||
android:strokeLineCap="round"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="128dp" | ||
android:height="128dp" | ||
android:viewportWidth="128" | ||
android:viewportHeight="128"> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="m63.98,18.16c-11.73,0 -23.46,4.49 -32.41,13.44 -17.9,17.9 -17.9,46.91 0,64.81 17.9,17.9 46.94,17.9 64.84,0 17.9,-17.9 17.9,-46.91 0,-64.81 -8.95,-8.95 -20.7,-13.44 -32.44,-13.44zM55.58,36.35 L72.39,36.35 72.39,55.6 91.64,55.6 91.64,72.41 72.39,72.41 72.39,91.66 55.58,91.66 55.58,72.41 36.33,72.41 36.33,55.6 55.58,55.6 55.58,36.35z"/> | ||
</vector> |
Oops, something went wrong.