Ajout de la partie "Liste de cartes" disponible depuis l'accueil.
Avec : - Image - Nb Attaque et Nb PVs - Lien clickable (reste qu'à ajouter une barre de recherche)
This commit is contained in:
@@ -23,6 +23,11 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity android:name=".CardListActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
+10
-5
@@ -10,9 +10,9 @@ import android.os.Bundle;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.DialogFragment;
|
import androidx.fragment.app.DialogFragment;
|
||||||
|
|
||||||
public class DeckPickDialogue extends DialogFragment {
|
public class DeckPickDialogueGame extends DialogFragment {
|
||||||
Context context;
|
Context context;
|
||||||
public DeckPickDialogue(@NonNull Context context) {
|
public DeckPickDialogueGame(@NonNull Context context) {
|
||||||
this.context=context;
|
this.context=context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,14 +26,19 @@ public class DeckPickDialogue extends DialogFragment {
|
|||||||
// of the selected item
|
// of the selected item
|
||||||
String[] mTestArray = getResources().getStringArray(R.array.decks);
|
String[] mTestArray = getResources().getStringArray(R.array.decks);
|
||||||
|
|
||||||
|
startActivity(mTestArray, which);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return builder.create();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startActivity(String[] mTestArray, int which) {
|
||||||
Intent gameActivity = new Intent(context, GameActivity.class);
|
Intent gameActivity = new Intent(context, GameActivity.class);
|
||||||
gameActivity.putExtra("DECK", mTestArray[which]);
|
gameActivity.putExtra("DECK", mTestArray[which]);
|
||||||
gameActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
gameActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||||
|
|
||||||
startActivity(gameActivity);
|
startActivity(gameActivity);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
return builder.create();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -17,9 +17,10 @@ public abstract class Card {
|
|||||||
* @param UID
|
* @param UID
|
||||||
* @param c
|
* @param c
|
||||||
*/
|
*/
|
||||||
public Card(String UID,Context c)
|
public Card(String UID,Context c) {
|
||||||
{
|
if(!(UID == null || c == null)) {
|
||||||
drawableCard = new DrawableCard(this,0,0,UID,c);
|
drawableCard = new DrawableCard(this, 0, 0, UID, c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
package com.iutlaval.myapplication;
|
package com.iutlaval.myapplication;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
@@ -26,15 +22,30 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
playButton.setOnClickListener(new View.OnClickListener() {
|
playButton.setOnClickListener(new View.OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
//Toast.makeText(getApplicationContext(), "click sur button", Toast.LENGTH_LONG).show();
|
//Toast.makeText(getApplicationContext(), "click sur button", Toast.LENGTH_LONG).show();
|
||||||
pickDeck();
|
pickDeckGame();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final Button cardButton = (Button) findViewById(R.id.cardButton);
|
||||||
|
cardButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
public void onClick(View v) {
|
||||||
|
//Toast.makeText(getApplicationContext(), "click sur button", Toast.LENGTH_LONG).show();
|
||||||
|
pickDeckList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String pickDeck() {
|
private String pickDeckGame() {
|
||||||
DialogFragment d = new DeckPickDialogue(this);
|
DialogFragment d = new DeckPickDialogueGame(this);
|
||||||
d.show(getSupportFragmentManager(),"s");
|
d.show(getSupportFragmentManager(),"s");
|
||||||
|
|
||||||
|
return "demodeck";
|
||||||
|
}
|
||||||
|
|
||||||
|
private String pickDeckList() {
|
||||||
|
DialogFragment d = new DeckPickDialogueList(this);
|
||||||
|
d.show(getSupportFragmentManager(),"s");
|
||||||
|
|
||||||
return "demodeck";
|
return "demodeck";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,16 +27,16 @@
|
|||||||
android:layout_width="400dp"
|
android:layout_width="400dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@font/alfa_slab_one"
|
android:fontFamily="@font/alfa_slab_one"
|
||||||
android:text="Info Battlecard"
|
android:text="Le Choc des Histoires"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="#A6FF9800"
|
android:textColor="#A6FF9800"
|
||||||
android:textSize="36sp"
|
android:textSize="30sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
app:layout_constraintHorizontal_bias="0.454"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintVertical_bias="0.702" />
|
app:layout_constraintVertical_bias="0.672" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/playButton"
|
android:id="@+id/playButton"
|
||||||
@@ -46,13 +46,13 @@
|
|||||||
android:textScaleX="1"
|
android:textScaleX="1"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
app:layout_constraintHorizontal_bias="0.501"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintVertical_bias="0.43" />
|
app:layout_constraintVertical_bias="0.409" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/button"
|
android:id="@+id/cardButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">MON JE</string>
|
<string name="app_name">Le Choc des Histoires</string>
|
||||||
<string name="title_item_list">Items</string>
|
<string name="title_item_list">Items</string>
|
||||||
<string name="title_item_detail">Item Detail</string>
|
<string name="title_item_detail">Item Detail</string>
|
||||||
<string name="pickdeck">Choisisez votre deck</string>
|
<string name="pickdeck">Choisissez votre deck</string>
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user