package org.keyscience.app;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import android.widget.TextView;

import org.keyscience.R;

public class ViewProfileActivity extends AppCompatActivity {

    private ImageView profileImage;

    private TextView userName;
    private TextView userBio;
    private TextView userRank;
    private TextView userTotalPoints;
    private TextView totalHunts;
    private TextView huntsCompleted;

    private String ID;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.profile_layout);

        // Let's load up all the user content with an ID.
        Bundle extras = getIntent().getExtras();
        if (extras != null) {
            ID = extras.getString("ID"); //TODO: This value needs to be passed through from ProfileFragment leaderboard user button
        }

        userName = findViewById(R.id.userName);
        userBio = findViewById(R.id.userBio);
        userRank = findViewById(R.id.userRank);
        userTotalPoints = findViewById(R.id.totalPoints);
        totalHunts = findViewById(R.id.totalHunts);
        huntsCompleted = findViewById(R.id.huntsCompleted);
        profileImage = findViewById(R.id.profile_image);

        loadUserData(ID);
    }

    // TODO: We can load user data with email.
    private void loadUserData(String userID) {
        // Retrieve details, populate fields.
        //TODO: Build Async similar to how LoginAsyncTask sets User details.
    }
}
