Unverified Commit 3858b3fe authored by Mathieu Féry (Mathius)'s avatar Mathieu Féry (Mathius)
Browse files

Merge branch 'front' into api

parents 3a1ac719 9d1dd626
......@@ -26,7 +26,7 @@ public class DisplayResultActivity extends AppCompatActivity {
public static final int GIF_RESULT_CODE = 42;
private int m_index;
private DnDSheet m_sheet;
private TextView lbl_displayResult_class, lbl_displayResult_description, lbl_displayResult_system,
private TextView lbl_displayResult_name, lbl_displayResult_class, lbl_displayResult_description, lbl_displayResult_system,
lbl_displayResult_personality, lbl_displayResult_skills, lbl_displayResult_spells,
lbl_displayResult_saves, lbl_displayResult_str, lbl_displayResult_dex,
lbl_displayResult_int, lbl_displayResult_con, lbl_displayResult_wis,
......@@ -39,6 +39,7 @@ public class DisplayResultActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_display_result);
lbl_displayResult_name = findViewById(R.id.lbl_displayResult_name);
lbl_displayResult_class = findViewById(R.id.lbl_displayResult_class);
lbl_displayResult_description = findViewById(R.id.lbl_displayResult_description);
lbl_displayResult_system = findViewById(R.id.lbl_displayResult_system);
......@@ -103,6 +104,7 @@ public class DisplayResultActivity extends AppCompatActivity {
v_hp = "No HP";
}
lbl_displayResult_name.setText(m_sheet.name);
lbl_displayResult_class.setText(m_sheet.caracterClass.toString());
lbl_displayResult_description.setText(m_sheet.appearance);
lbl_displayResult_system.setText(m_sheet.system.longName);
......
package fr.iutnantes.miar.dndgenerator.adapter;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -16,19 +13,14 @@ import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import fr.iutnantes.miar.dndgenerator.DisplayGIFActivity;
import fr.iutnantes.miar.dndgenerator.DisplayResultActivity;
import fr.iutnantes.miar.dndgenerator.R;
import fr.iutnantes.miar.dndgenerator.ResearchResultsActivity;
import fr.iutnantes.miar.dndgenerator.api.dnd.DnDAttr;
import fr.iutnantes.miar.dndgenerator.api.dnd.DnDSheet;
import fr.iutnantes.miar.dndgenerator.api.tenor.GIFFormat;
import fr.iutnantes.miar.dndgenerator.api.tenor.MediaObject;
/**
* Adapter that extend RecyclerViewAdapter to provide data of list of DnDSheet in a RecycleView
......@@ -44,7 +36,7 @@ public class ListResultsAdapter extends RecyclerView.Adapter<ListResultsAdapter.
* Class to set the view of one result
*/
public static class ViewHolder extends RecyclerView.ViewHolder {
private final TextView m_lbl_scpecie, m_lbl_description, m_lbl_system;
private final TextView m_lbl_name, m_lbl_scpecie, m_lbl_description, m_lbl_system;
private final ImageView m_imgGif;
/**
......@@ -54,6 +46,7 @@ public class ListResultsAdapter extends RecyclerView.Adapter<ListResultsAdapter.
public ViewHolder(View p_view) {
super(p_view);
m_lbl_name = p_view.findViewById(R.id.lbl_rclr_name);
m_lbl_scpecie = p_view.findViewById(R.id.lbl_rclr_specie);
m_lbl_description = p_view.findViewById(R.id.lbl_rclr_decription);
m_lbl_system = p_view.findViewById(R.id.lbl_rclr_system);
......@@ -91,6 +84,14 @@ public class ListResultsAdapter extends RecyclerView.Adapter<ListResultsAdapter.
public ImageView getM_imgGif() {
return m_imgGif;
}
/**
* Getter
* @return : Name
*/
public TextView getM_lbl_name() {
return m_lbl_name;
}
}
/**
......@@ -124,6 +125,7 @@ public class ListResultsAdapter extends RecyclerView.Adapter<ListResultsAdapter.
*/
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
holder.getM_lbl_name().setText(m_data.get(position).name);
holder.getM_lbl_scpecie().setText(m_data.get(position).caracterClass.toString());
holder.getM_lbl_description().setText(m_data.get(position).appearance);
holder.getM_lbl_system().setText(m_data.get(position).system.longName);
......
......@@ -58,18 +58,33 @@
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/lbl_displayResult_class"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="TextView"
android:textAppearance="@style/AppTextTitle"
android:textSize="22sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.3"
app:layout_constraintStart_toEndOf="@+id/img_displayResult_gif"
app:layout_constraintTop_toTopOf="@+id/img_displayResult_gif" />
android:layout_height="wrap_content">
<TextView
android:id="@+id/lbl_displayResult_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:text="TextView"
android:textSize="22sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/lbl_displayResult_class"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/lbl_displayResult_class"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:textAppearance="@style/AppTextTitle"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/lbl_displayResult_description"
......
......@@ -58,15 +58,32 @@
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/lbl_displayResult_class"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:layout_marginBottom="16dp"
android:text="TextView"
android:textAppearance="@style/AppTextTitle"
android:textSize="22sp" />
android:layout_height="match_parent">
<TextView
android:id="@+id/lbl_displayResult_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="TextView"
android:textSize="22sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/lbl_displayResult_class"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/lbl_displayResult_class"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:textAppearance="@style/AppTextTitle"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/lbl_displayResult_description"
......
......@@ -21,13 +21,34 @@
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/lbl_rclr_specie"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="TextView"
android:textSize="24sp" />
android:layout_height="match_parent"
android:layout_weight="1">
<TextView
android:id="@+id/lbl_rclr_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:text="TextView"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/lbl_rclr_specie"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/lbl_rclr_specie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="TextView"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/lbl_rclr_decription"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment