mirror of
https://github.com/Aviortheking/Hangman.git
synced 2024-12-19 18:20:54 +00:00
Update time !
This commit is contained in:
parent
61aa8417f3
commit
743b69261d
@ -3,7 +3,7 @@ android {
|
|||||||
compileSdkVersion 26
|
compileSdkVersion 26
|
||||||
buildToolsVersion "26.0.1"
|
buildToolsVersion "26.0.1"
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "net.DeltaWings.Android.Pendu"
|
applicationId "net.DeltaWings.Android.Hangman"
|
||||||
minSdkVersion 15
|
minSdkVersion 15
|
||||||
targetSdkVersion 26
|
targetSdkVersion 26
|
||||||
versionCode 1
|
versionCode 1
|
||||||
@ -27,7 +27,6 @@ dependencies {
|
|||||||
compile 'com.android.support.constraint:constraint-layout:1.0.2'
|
compile 'com.android.support.constraint:constraint-layout:1.0.2'
|
||||||
compile 'com.android.support:design:26.1.0'
|
compile 'com.android.support:design:26.1.0'
|
||||||
compile 'com.android.support:support-vector-drawable:26.1.0'
|
compile 'com.android.support:support-vector-drawable:26.1.0'
|
||||||
compile 'com.google.android.gms:play-services-ads:11.0.4'
|
|
||||||
testCompile 'junit:junit:4.12'
|
testCompile 'junit:junit:4.12'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
|
|||||||
// Context of the app under test.
|
// Context of the app under test.
|
||||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||||
|
|
||||||
assertEquals("net.DeltaWings.Android.Pendu", appContext.getPackageName());
|
assertEquals("net.DeltaWings.Android.Hangman", appContext.getPackageName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,10 @@
|
|||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme"
|
||||||
|
android:fullBackupContent="@xml/backup_descriptor">
|
||||||
<activity
|
<activity
|
||||||
android:name="net.DeltaWings.Android.Hangman.MainActivity"
|
android:name=".MainActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@ -19,6 +20,10 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity android:name=".GameActivity"
|
||||||
|
android:windowSoftInputMode="stateHidden|adjustResize">
|
||||||
|
|
||||||
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@ -0,0 +1,75 @@
|
|||||||
|
package net.DeltaWings.Android.Hangman;
|
||||||
|
|
||||||
|
import android.animation.ObjectAnimator;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.view.animation.DecelerateInterpolator;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import static net.DeltaWings.Android.Hangman.MainActivity.instance;
|
||||||
|
|
||||||
|
public class GameActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
ProgressBar progressBar;
|
||||||
|
AlertDialog.Builder builder;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onSupportNavigateUp(){
|
||||||
|
builder.show();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
setContentView(R.layout.game_activity);
|
||||||
|
|
||||||
|
ActionBar actionBar = getSupportActionBar();
|
||||||
|
if (actionBar != null) {
|
||||||
|
actionBar.setHomeButtonEnabled(true);
|
||||||
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
|
actionBar.setDisplayShowHomeEnabled(true);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(instance, " There is a problem here let's see what it is", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
progressBar = findViewById(R.id.progressBar);
|
||||||
|
|
||||||
|
DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
switch (which){
|
||||||
|
case DialogInterface.BUTTON_POSITIVE:
|
||||||
|
Toast.makeText(instance, "Selected Yes", Toast.LENGTH_LONG).show();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DialogInterface.BUTTON_NEGATIVE:
|
||||||
|
Toast.makeText(instance, "Selected No", Toast.LENGTH_LONG).show();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
builder = new AlertDialog.Builder(this);
|
||||||
|
|
||||||
|
builder.setMessage("Are you sure?").setPositiveButton("Yes", dialogClickListener)
|
||||||
|
.setNegativeButton("No", dialogClickListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setProgressAnimate(ProgressBar pb, int progressTo)
|
||||||
|
{
|
||||||
|
ObjectAnimator animation = ObjectAnimator.ofInt(pb, "progress", pb.getProgress(), progressTo);
|
||||||
|
animation.setDuration(250);
|
||||||
|
animation.setInterpolator(new DecelerateInterpolator());
|
||||||
|
animation.start();
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,6 @@
|
|||||||
package net.DeltaWings.Android.Hangman;
|
package net.DeltaWings.Android.Hangman;
|
||||||
|
|
||||||
import android.app.ProgressDialog;
|
import android.content.Intent;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
@ -11,59 +10,29 @@ import android.widget.Toast;
|
|||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
public static MainActivity instance;
|
public static MainActivity instance;
|
||||||
public static Boolean test = true;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
instance = this;
|
instance = this;
|
||||||
test = true;
|
|
||||||
final ProgressDialog progressDialog = new ProgressDialog(instance);
|
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
//Multiplayer button
|
//Multiplayer button
|
||||||
findViewById(R.id.multiplayerButton).setOnClickListener(new View.OnClickListener() {
|
findViewById(R.id.multiplayerButton).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
//setContentView(R.layout.activity_multiplayer);
|
startActivity(new Intent(instance, GameActivity.class));
|
||||||
progressDialog.setMessage("Connecting...");
|
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
|
||||||
//progressDialog.setCancelable(false);
|
|
||||||
progressDialog.setOnShowListener(new ProgressDialog.OnShowListener() {
|
|
||||||
@Override
|
|
||||||
public void onShow(DialogInterface dialog) {
|
|
||||||
Toast.makeText(instance, "test", Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
progressDialog.setOnCancelListener(new ProgressDialog.OnCancelListener() {
|
|
||||||
@Override
|
|
||||||
public void onCancel(DialogInterface dialog) {
|
|
||||||
progressDialog.setMessage("Cancelling...");
|
|
||||||
progressDialog.setCancelable(false);
|
|
||||||
|
|
||||||
//wait for canceletion.
|
|
||||||
}
|
|
||||||
});
|
|
||||||
progressDialog.show();
|
|
||||||
//Make Connection
|
|
||||||
|
|
||||||
//
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
findViewById(R.id.singleplayerButton).setOnClickListener(new View.OnClickListener() {
|
findViewById(R.id.singleplayerButton).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
Toast.makeText(instance, "WIP", Toast.LENGTH_LONG).show();
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
findViewById(R.id.progressBar).setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
Toast.makeText(instance, test + "", Toast.LENGTH_LONG).show();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:theme="@style/AppTheme.AppBarOverlay"
|
android:theme="@style/AppTheme.AppBarOverlay"
|
||||||
|
app:expanded="false"
|
||||||
tools:layout_editor_absoluteX="1dp"
|
tools:layout_editor_absoluteX="1dp"
|
||||||
tools:layout_editor_absoluteY="-1dp">
|
tools:layout_editor_absoluteY="-1dp">
|
||||||
|
|
||||||
@ -20,10 +21,10 @@
|
|||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_toEndOf="@+id/relativeLayout"
|
android:layout_toEndOf="@+id/relativeLayout"
|
||||||
|
android:layout_toRightOf="@+id/relativeLayout"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="?attr/colorPrimary"
|
android:background="?attr/colorPrimary"
|
||||||
app:popupTheme="@style/AppTheme.PopupOverlay"
|
app:popupTheme="@style/AppTheme.PopupOverlay"/>
|
||||||
android:layout_toRightOf="@+id/relativeLayout"/>
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
@ -36,15 +37,6 @@
|
|||||||
tools:layout_editor_absoluteX="8dp"
|
tools:layout_editor_absoluteX="8dp"
|
||||||
tools:layout_editor_absoluteY="8dp">
|
tools:layout_editor_absoluteY="8dp">
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/progressBar"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/multiplayerButton"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:layout_marginTop="92dp"
|
|
||||||
android:text="Button" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/multiplayerButton"
|
android:id="@+id/multiplayerButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
104
app/src/main/res/layout/game_activity.xml
Normal file
104
app/src/main/res/layout/game_activity.xml
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.constraint.ConstraintLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context="net.DeltaWings.Android.Hangman.GameActivity"
|
||||||
|
tools:layout_editor_absoluteX="0dp"
|
||||||
|
tools:layout_editor_absoluteY="81dp">
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
style="@android:style/Widget.DeviceDefault.Light.ProgressBar.Horizontal"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:max="100"
|
||||||
|
android:paddingTop="-4dp"
|
||||||
|
android:progress="50"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/guideline"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"/>
|
||||||
|
|
||||||
|
<android.support.constraint.Guideline
|
||||||
|
android:id="@+id/guideline"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintGuide_begin="4dp"
|
||||||
|
tools:layout_editor_absoluteX="0dp"
|
||||||
|
tools:layout_editor_absoluteY="4dp"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="0dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:weightSum="1"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/progressBar">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/lettersTextView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="172dp"
|
||||||
|
android:layout_weight=".50"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textAllCaps="true"
|
||||||
|
android:textSize="36sp"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageView2"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0.50"
|
||||||
|
app:srcCompat="@mipmap/ic_launcher_round"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="sans-serif-condensed"
|
||||||
|
android:text="________________"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="36sp"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="0dp"
|
||||||
|
android:ems="10"
|
||||||
|
android:inputType="textPersonName"
|
||||||
|
android:maxLength="16"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:selectAllOnFocus="false"
|
||||||
|
android:text="Name"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="36sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView3"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="Logs"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
@ -1,5 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Pendu</string>
|
<string name="app_name">Hangman</string>
|
||||||
<string name="action_settings">Settings</string>
|
<string name="action_settings">Settings</string>
|
||||||
<string name="multiplayer">Multiplayer</string>
|
<string name="multiplayer">Multiplayer</string>
|
||||||
<string name="singleplayer">Singleplayer</string>
|
<string name="singleplayer">Singleplayer</string>
|
||||||
|
4
app/src/main/res/xml/backup_descriptor.xml
Normal file
4
app/src/main/res/xml/backup_descriptor.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<full-backup-content>
|
||||||
|
<!-- Exclude specific shared preferences that contain GCM registration Id -->
|
||||||
|
</full-backup-content>
|
Loading…
x
Reference in New Issue
Block a user