diff --git a/app/src/main/java/org/ntlab/acanthus_client/views/userpage/UserPageActivity.java b/app/src/main/java/org/ntlab/acanthus_client/views/userpage/UserPageActivity.java index 4ce2f5c..f805a0a 100644 --- a/app/src/main/java/org/ntlab/acanthus_client/views/userpage/UserPageActivity.java +++ b/app/src/main/java/org/ntlab/acanthus_client/views/userpage/UserPageActivity.java @@ -1,17 +1,22 @@ package org.ntlab.acanthus_client.views.userpage; import android.os.Bundle; +import android.view.View; import android.widget.Button; import android.widget.TextView; +import org.ntlab.acanthus_client.Acanthus; import org.ntlab.acanthus_client.R; import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.ViewModelProvider; public class UserPageActivity extends AppCompatActivity { private UserPageViewModel userPageViewModel; + private Acanthus acanthus; @Override protected void onCreate(Bundle savedInstanceState){ @@ -19,15 +24,80 @@ setContentView(R.layout.activity_userpage); userPageViewModel = new ViewModelProvider(this).get(UserPageViewModel.class); + acanthus = (Acanthus) getApplication(); - TextView userName = findViewById(R.id.userNameText); + TextView userNameText = findViewById(R.id.userNameText); +// userNameText.setText(); + TextView profileText = findViewById(R.id.profileText); Button returnButton = findViewById(R.id.returnButton); + + //前の画面に戻る処理 + returnButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + finish(); + } + }); + Button followUserButton = findViewById(R.id.followUserButton); - Button followButton = findViewById(R.id.followButton); - Button followerButton = findViewById(R.id.followerButton); - Button animationListButton = findViewById(R.id.animationListButton); + //ログインしているユーザーがフォローしているかの有無で画面表示時のボタンの文字を変更する +// if () { +// followUserButton.setText("フォロー解除"); +// }else{ +// followUserButton.setText("フォローする"); +// } + + //ユーザーのフォロー及びフォロー解除の処理 + followUserButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { +// if () { +// //userPageViewModel.addFollow(); +// followUserButton.setText("フォロー解除"); +// }else{ +// //userPageViewModel.releaseFollow(); +// followUserButton.setText("フォローする"); +// } + } + }); + + //ユーザーのフォロー一覧への画面遷移の処理 + Button followListButton = findViewById(R.id.followListButton); + followListButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + FragmentManager fragmentManager = getSupportFragmentManager(); + FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); +// fragmentTransaction.replace(R.id.container, new ); + fragmentTransaction.commit(); + } + }); + + //ユーザーのフォロワー一覧への画面遷移の処理 + Button followerListButton = findViewById(R.id.followerListButton); + followerListButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + FragmentManager fragmentManager = getSupportFragmentManager(); + FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); +// fragmentTransaction.replace(R.id.container, new ); + fragmentTransaction.commit(); + } + }); + + //ユーザーの作品一覧への画面遷移の処理 + Button workListButton = findViewById(R.id.workListButton); + workListButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + FragmentManager fragmentManager = getSupportFragmentManager(); + FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); +// fragmentTransaction.replace(R.id.container, new ); + fragmentTransaction.commit(); + } + }); }