diff --git a/app/src/main/java/com/majinnaibu/monstercards/ui/editmonster/EditMonsterFragment.java b/app/src/main/java/com/majinnaibu/monstercards/ui/editmonster/EditMonsterFragment.java index b7a0885..fca5960 100644 --- a/app/src/main/java/com/majinnaibu/monstercards/ui/editmonster/EditMonsterFragment.java +++ b/app/src/main/java/com/majinnaibu/monstercards/ui/editmonster/EditMonsterFragment.java @@ -4,6 +4,7 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -11,10 +12,12 @@ import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; import com.majinnaibu.monstercards.R; +import com.majinnaibu.monstercards.utils.Logger; public class EditMonsterFragment extends Fragment { private EditMonsterViewModel mViewModel; + private ViewHolder mHolder; public static EditMonsterFragment newInstance() { return new EditMonsterFragment(); @@ -23,7 +26,20 @@ public class EditMonsterFragment extends Fragment { @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { - return inflater.inflate(R.layout.fragment_edit_monster, container, false); + // TODO: Get our monster from the repo based on the id passed in. + // TODO: Show a loading spinner until we have the monster loaded. + // TODO: If there is an error loading the monster show the error. + + View root = inflater.inflate(R.layout.fragment_edit_monster, container, false); + + mHolder = new ViewHolder(root); + + mHolder.basicInfoButton.setOnClickListener(v -> { + // TODO: Navigate to the EditBasicInfo fragment + Logger.logDebug("Basic Info clicked"); + }); + + return root; } @Override @@ -33,4 +49,12 @@ public class EditMonsterFragment extends Fragment { // TODO: Use the ViewModel } + private static class ViewHolder { + + TextView basicInfoButton; + + ViewHolder(View root) { + basicInfoButton = root.findViewById(R.id.basicInfo); + } + } } \ No newline at end of file