mirror of
https://github.com/Aviortheking/Hangman.git
synced 2024-12-19 18:20:54 +00:00
Updating time
This commit is contained in:
parent
9aba2c63fe
commit
a56725c310
2
.idea/modules.xml
generated
2
.idea/modules.xml
generated
@ -2,8 +2,8 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/Hangman-game.iml" filepath="$PROJECT_DIR$/Hangman-game.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/hangman-game.iml" filepath="$PROJECT_DIR$/hangman-game.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -17,6 +17,7 @@ import android.widget.TextView;
|
||||
import net.DeltaWings.Android.Hangman.Util.ConnectionUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@ -25,7 +26,7 @@ public class GameActivity extends AppCompatActivity {
|
||||
|
||||
private AlertDialog.Builder builder;
|
||||
private ConnectionUtil co;
|
||||
private TextView textView;
|
||||
private TextView word;
|
||||
private List<String> letters = new ArrayList<>();
|
||||
private Context context = this;
|
||||
|
||||
@ -47,7 +48,7 @@ public class GameActivity extends AppCompatActivity {
|
||||
MainActivity.setTheme(this);
|
||||
setContentView(R.layout.game_activity);
|
||||
|
||||
textView = findViewById(R.id.textView2);
|
||||
word = findViewById(R.id.letters);
|
||||
ProgressBar progressBar = findViewById(R.id.progressBar);
|
||||
EditText input = findViewById(R.id.input);
|
||||
|
||||
@ -112,6 +113,7 @@ public class GameActivity extends AppCompatActivity {
|
||||
|
||||
//get result
|
||||
HashMap<String, String> result = co.getDatas();
|
||||
word.setText(result.get("newWord"));
|
||||
if(Objects.equals(result.get("status"), "won")) { //check if player won
|
||||
//Game Won
|
||||
|
||||
@ -142,6 +144,9 @@ public class GameActivity extends AppCompatActivity {
|
||||
.setPositiveButton("Restart", clickListener)
|
||||
.setNegativeButton("Quit", clickListener)
|
||||
.show();
|
||||
} else {
|
||||
letters = Arrays.asList(result.get("lettersUsed"));
|
||||
log(letters.toString());
|
||||
}
|
||||
//Send Letter
|
||||
txt.setText("", TextView.BufferType.EDITABLE);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.DeltaWings.Android.Hangman.Util;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
@ -29,8 +30,6 @@ public class GameUtil {
|
||||
returning.clear();
|
||||
String query = datas.get("query");
|
||||
if(Objects.equals(query, "letter")) {
|
||||
Log.v(tag, "1");
|
||||
Log.v(tag, "1");
|
||||
String letter = datas.get("letter");
|
||||
if(word.contains(letter)) {
|
||||
Log.v(tag, "2");
|
||||
@ -43,8 +42,12 @@ public class GameUtil {
|
||||
//winner
|
||||
returning.put("status", "won");
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
returning.put("newWord", res.toString());
|
||||
letters.add(letter);
|
||||
returning.put("newWord", TextUtils.join("", res));
|
||||
returning.put("lettersUsed", TextUtils.join(",", letters));
|
||||
} else if (Objects.equals(query, "word")) {
|
||||
if(Objects.equals(datas.get("word"), word)) {
|
||||
returning.put("status", "won");
|
||||
|
@ -35,7 +35,6 @@ public class SettingActivity extends PreferenceActivity {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
MainActivity.setTheme(this);
|
||||
|
||||
LinearLayout root = (LinearLayout)findViewById(android.R.id.list).getParent().getParent().getParent();
|
||||
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/ripple" />
|
||||
</layer-list>
|
@ -2,9 +2,7 @@
|
||||
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
android:color="?attr/colorAccent"
|
||||
android:min
|
||||
>
|
||||
android:color="?android:attr/colorAccent">
|
||||
|
||||
<item>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
@ -12,7 +10,7 @@
|
||||
|
||||
<corners android:radius="6dp"/>
|
||||
|
||||
<solid android:color="?attr/colorPrimary"/>
|
||||
<solid android:color="?android:attr/colorPrimary"/>
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
8
app/src/main/res/drawable/people.xml
Normal file
8
app/src/main/res/drawable/people.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="?android:attr/textColorPrimary" android:pathData="M16.5,6.5A2,2 0 0,1 18.5,8.5A2,2 0 0,1 16.5,10.5A2,2 0 0,1 14.5,8.5A2,2 0 0,1 16.5,6.5M16.5,12A3.5,3.5 0 0,0 20,8.5A3.5,3.5 0 0,0 16.5,5A3.5,3.5 0 0,0 13,8.5A3.5,3.5 0 0,0 16.5,12M7.5,6.5A2,2 0 0,1 9.5,8.5A2,2 0 0,1 7.5,10.5A2,2 0 0,1 5.5,8.5A2,2 0 0,1 7.5,6.5M7.5,12A3.5,3.5 0 0,0 11,8.5A3.5,3.5 0 0,0 7.5,5A3.5,3.5 0 0,0 4,8.5A3.5,3.5 0 0,0 7.5,12M21.5,17.5H14V16.25C14,15.79 13.8,15.39 13.5,15.03C14.36,14.73 15.44,14.5 16.5,14.5C18.94,14.5 21.5,15.71 21.5,16.25M12.5,17.5H2.5V16.25C2.5,15.71 5.06,14.5 7.5,14.5C9.94,14.5 12.5,15.71 12.5,16.25M16.5,13C15.3,13 13.43,13.34 12,14C10.57,13.33 8.7,13 7.5,13C5.33,13 1,14.08 1,16.25V19H23V16.25C23,14.08 18.67,13 16.5,13Z" />
|
||||
</vector>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#000"
|
||||
android:pathData="M16.5,6.5A2,2 0 0,1 18.5,8.5A2,2 0 0,1 16.5,10.5A2,2 0 0,1 14.5,8.5A2,2 0 0,1 16.5,6.5M16.5,12A3.5,3.5 0 0,0 20,8.5A3.5,3.5 0 0,0 16.5,5A3.5,3.5 0 0,0 13,8.5A3.5,3.5 0 0,0 16.5,12M7.5,6.5A2,2 0 0,1 9.5,8.5A2,2 0 0,1 7.5,10.5A2,2 0 0,1 5.5,8.5A2,2 0 0,1 7.5,6.5M7.5,12A3.5,3.5 0 0,0 11,8.5A3.5,3.5 0 0,0 7.5,5A3.5,3.5 0 0,0 4,8.5A3.5,3.5 0 0,0 7.5,12M21.5,17.5H14V16.25C14,15.79 13.8,15.39 13.5,15.03C14.36,14.73 15.44,14.5 16.5,14.5C18.94,14.5 21.5,15.71 21.5,16.25M12.5,17.5H2.5V16.25C2.5,15.71 5.06,14.5 7.5,14.5C9.94,14.5 12.5,15.71 12.5,16.25M16.5,13C15.3,13 13.43,13.34 12,14C10.57,13.33 8.7,13 7.5,13C5.33,13 1,14.08 1,16.25V19H23V16.25C23,14.08 18.67,13 16.5,13Z" />
|
||||
</vector>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#fff"
|
||||
android:pathData="M16.5,6.5A2,2 0 0,1 18.5,8.5A2,2 0 0,1 16.5,10.5A2,2 0 0,1 14.5,8.5A2,2 0 0,1 16.5,6.5M16.5,12A3.5,3.5 0 0,0 20,8.5A3.5,3.5 0 0,0 16.5,5A3.5,3.5 0 0,0 13,8.5A3.5,3.5 0 0,0 16.5,12M7.5,6.5A2,2 0 0,1 9.5,8.5A2,2 0 0,1 7.5,10.5A2,2 0 0,1 5.5,8.5A2,2 0 0,1 7.5,6.5M7.5,12A3.5,3.5 0 0,0 11,8.5A3.5,3.5 0 0,0 7.5,5A3.5,3.5 0 0,0 4,8.5A3.5,3.5 0 0,0 7.5,12M21.5,17.5H14V16.25C14,15.79 13.8,15.39 13.5,15.03C14.36,14.73 15.44,14.5 16.5,14.5C18.94,14.5 21.5,15.71 21.5,16.25M12.5,17.5H2.5V16.25C2.5,15.71 5.06,14.5 7.5,14.5C9.94,14.5 12.5,15.71 12.5,16.25M16.5,13C15.3,13 13.43,13.34 12,14C10.57,13.33 8.7,13 7.5,13C5.33,13 1,14.08 1,16.25V19H23V16.25C23,14.08 18.67,13 16.5,13Z" />
|
||||
</vector>
|
8
app/src/main/res/drawable/person.xml
Normal file
8
app/src/main/res/drawable/person.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="?android:attr/textColorPrimary" android:pathData="M12,13C9.33,13 4,14.33 4,17V20H20V17C20,14.33 14.67,13 12,13M12,4A4,4 0 0,0 8,8A4,4 0 0,0 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4M12,14.9C14.97,14.9 18.1,16.36 18.1,17V18.1H5.9V17C5.9,16.36 9,14.9 12,14.9M12,5.9A2.1,2.1 0 0,1 14.1,8A2.1,2.1 0 0,1 12,10.1A2.1,2.1 0 0,1 9.9,8A2.1,2.1 0 0,1 12,5.9Z" />
|
||||
</vector>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#000"
|
||||
android:pathData="M12,13C9.33,13 4,14.33 4,17V20H20V17C20,14.33 14.67,13 12,13M12,4A4,4 0 0,0 8,8A4,4 0 0,0 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4M12,14.9C14.97,14.9 18.1,16.36 18.1,17V18.1H5.9V17C5.9,16.36 9,14.9 12,14.9M12,5.9A2.1,2.1 0 0,1 14.1,8A2.1,2.1 0 0,1 12,10.1A2.1,2.1 0 0,1 9.9,8A2.1,2.1 0 0,1 12,5.9Z" />
|
||||
</vector>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#fff"
|
||||
android:pathData="M12,13C9.33,13 4,14.33 4,17V20H20V17C20,14.33 14.67,13 12,13M12,4A4,4 0 0,0 8,8A4,4 0 0,0 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4M12,14.9C14.97,14.9 18.1,16.36 18.1,17V18.1H5.9V17C5.9,16.36 9,14.9 12,14.9M12,5.9A2.1,2.1 0 0,1 14.1,8A2.1,2.1 0 0,1 12,10.1A2.1,2.1 0 0,1 9.9,8A2.1,2.1 0 0,1 12,5.9Z" />
|
||||
</vector>
|
@ -40,12 +40,11 @@
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="64dp"
|
||||
android:layout_weight="1"
|
||||
android:background='@drawable/ripple'
|
||||
android:elevation="0dp"
|
||||
android:background="@drawable/button"
|
||||
android:text="@string/singleplayer"
|
||||
android:textColor="@color/White"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView"
|
||||
android:stateListAnimator="@null"
|
||||
tools:layout_editor_absoluteX="142dp"/>
|
||||
|
||||
<Button
|
||||
@ -56,9 +55,8 @@
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="64dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/button"
|
||||
android:text="@string/multiplayer"
|
||||
android:background='@drawable/ripple'
|
||||
android:textColor="@color/White"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat"
|
||||
app:layout_constraintTop_toBottomOf="@+id/singleplayerButton"
|
||||
tools:layout_editor_absoluteX="146dp"/>
|
||||
|
@ -69,7 +69,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:id="@+id/letters"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-condensed"
|
||||
|
@ -10,9 +10,10 @@
|
||||
<item name="hard">hard</item>
|
||||
</string-array>
|
||||
<string-array name="theme">
|
||||
<item name="color">Color</item>
|
||||
<item name="light">Light</item>
|
||||
<item name="dark">Dark</item>
|
||||
<item name="color">Color</item>
|
||||
|
||||
</string-array>
|
||||
<!--
|
||||
Settings
|
||||
|
@ -1,11 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="Blue">#2196f3</color>
|
||||
<color name="DarkBlue">#0d47a1</color>
|
||||
<color name="Indigo">#3f51b5</color>
|
||||
<color name="Blue500">#2196f3</color>
|
||||
<color name="Blue900">#0D47A1</color>
|
||||
|
||||
<color name="Indigo500">#3f51b5</color>
|
||||
|
||||
<color name="Grey50">#fafafa</color>
|
||||
<color name="Grey800">#424242</color>
|
||||
<color name="Grey900">#212121</color>
|
||||
<color name="White">#ffffff</color>
|
||||
|
||||
<color name="BlueGrey50">#ECEFF1</color>
|
||||
<color name="BlueGrey500">#607D8B</color>
|
||||
|
||||
|
||||
<color name="White">#fff</color>
|
||||
<color name="Black">#000</color>
|
||||
</resources>
|
||||
|
@ -1,34 +1,63 @@
|
||||
<resources>
|
||||
|
||||
<style name="DeltaWings.Dark" parent="Theme.AppCompat">
|
||||
<item name="drawable_people">@drawable/people_white</item>
|
||||
<item name="drawable_person">@drawable/person_white</item>
|
||||
|
||||
<!-- Drawables -->
|
||||
<item name="drawable_people">@drawable/people</item>
|
||||
<item name="drawable_person">@drawable/person</item>
|
||||
|
||||
<!-- Custom Elements -->
|
||||
|
||||
<!-- Android -->
|
||||
<item name="android:colorBackground">@color/Grey800</item>
|
||||
<item name="android:windowBackground">@color/Grey800</item>
|
||||
<item name="android:textColorPrimary">@color/White</item>
|
||||
<item name="colorAccent">@color/Blue500</item>
|
||||
<item name="colorPrimary">@color/Blue900</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="DeltaWings.Light" parent="Theme.AppCompat.Light">
|
||||
<item name="drawable_people">@drawable/people_black</item>
|
||||
<item name="drawable_person">@drawable/person_black</item>
|
||||
|
||||
<!-- Drawables -->
|
||||
<item name="drawable_people">@drawable/people</item>
|
||||
<item name="drawable_person">@drawable/person</item>
|
||||
|
||||
<!-- Custom Elements -->
|
||||
|
||||
<!-- Android -->
|
||||
<item name="android:colorBackground">@color/Grey50</item>
|
||||
<item name="android:windowBackground">@color/Grey50</item>
|
||||
<item name="android:colorAccent">@color/BlueGrey500</item>
|
||||
<item name="android:textColorPrimary">@color/Grey900</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="DeltaWings.Color" parent="Theme.AppCompat.Light">
|
||||
<item name="drawable_people">@drawable/people_black</item>
|
||||
<item name="drawable_person">@drawable/person_black</item>
|
||||
<item name="colorPrimary">@color/Blue</item>
|
||||
<item name="android:textColorPrimary">@color/Grey900</item>
|
||||
<item name="colorPrimaryDark">@color/DarkBlue</item>
|
||||
<item name="colorAccent">@color/Indigo</item>
|
||||
|
||||
<!-- Drawables -->
|
||||
<item name="drawable_people">@drawable/people</item>
|
||||
<item name="drawable_person">@drawable/person</item>
|
||||
|
||||
<!-- Custom Elements -->
|
||||
|
||||
|
||||
<!-- Android -->
|
||||
<item name="android:colorPrimary">@color/Blue500</item>
|
||||
<item name="android:colorPrimaryDark">@color/Blue900</item>
|
||||
<item name="android:colorAccent">@color/Indigo500</item>
|
||||
<item name="android:colorBackground">@color/Grey50</item>
|
||||
<item name="android:colorForeground">@color/Grey900</item>
|
||||
<item name="android:textColorPrimaryInverse">@color/White</item>
|
||||
<item name="android:textColorPrimary">@color/White</item>
|
||||
<item name="android:textColorPrimaryInverse">@color/Black</item>
|
||||
<item name="android:textColorSecondary">@color/Grey900</item>
|
||||
<item name="android:textColorSecondaryInverse">@color/White</item>
|
||||
<item name="android:windowBackground">@color/Grey50</item>
|
||||
<item name="android:navigationBarColor">@color/Blue500</item>
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<attr name="drawable_people" format="reference"/>
|
||||
<attr name="colorPrimary" format="reference"/>
|
||||
<attr name="drawable_person" format="reference"/>
|
||||
|
||||
</resources>
|
||||
|
Loading…
x
Reference in New Issue
Block a user