diff --git a/app/src/main/java/org/ntlab/acanthus_client/views/animation_detail/AnimationDetailActivity.java b/app/src/main/java/org/ntlab/acanthus_client/views/animation_detail/AnimationDetailActivity.java index db03a5e..e8c603c 100644 --- a/app/src/main/java/org/ntlab/acanthus_client/views/animation_detail/AnimationDetailActivity.java +++ b/app/src/main/java/org/ntlab/acanthus_client/views/animation_detail/AnimationDetailActivity.java @@ -3,20 +3,35 @@ import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.os.Bundle; import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.BaseAdapter; import android.widget.Button; import android.widget.EditText; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ListView; import android.widget.TextView; import org.ntlab.acanthus_client.Acanthus; import org.ntlab.acanthus_client.R; import org.ntlab.acanthus_client.entities.Animation; import org.ntlab.acanthus_client.entities.AnimationJson; +import org.ntlab.acanthus_client.views.animation.AnimationActivity; import org.ntlab.acanthus_client.views.animation.AnimationCanvas; +import org.ntlab.acanthus_client.views.main_menu_ui.home.ListAnimationViewAdapter; import org.ntlab.acanthus_client.views.userpage.UserPageActivity; +import org.ntlab.acanthus_client.views.userpage.followerList.FollowerListActivity; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; import java.util.ArrayList; +import java.util.Collection; public class AnimationDetailActivity extends AppCompatActivity { @@ -31,6 +46,12 @@ Intent intent = getIntent(); AnimationJson animationJson = (AnimationJson) intent.getSerializableExtra("AnimationJsonData"); +// View header = (View)getLayoutInflater().inflate(R.layout.animation_home_header,null); + + setContentView((R.layout.activity_animation_detail)); + ListView listView = findViewById(R.id.editorsView); +// listView.addHeaderView(header); + Animation currentAnimation = acanthus.getCurrentAnimation(); setContentView(R.layout.activity_animation_detail); @@ -51,51 +72,57 @@ wordText17.setText(currentAnimation.getCreatedDate().toString()); TextView wordText18 = findViewById(R.id.textView18); - Button editor1Button = findViewById(R.id.button_editor1); - Button editor2Button = findViewById(R.id.button_editor2); - editor1Button.setOnClickListener(new View.OnClickListener(){ - @Override - public void onClick(View v){ + BaseAdapter adapter = new ListEditorsViewAdapter(this, R.layout.animation_detail, animationJson); + listView.setAdapter(adapter); + listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapterView, View view, int position, long id) { +// homeViewModel.setCurrentAnimation(animationJsonSortList.get(position).getAid(), acanthus); +// transitionAnimationActivity(animationJsonSortList.get(position)); + Intent intent = new Intent(getApplication(), UserPageActivity.class); + intent.putExtra("UID", editorsUid.get(position)); + intent.putExtra("NAME", editorsNames.get(position)); + startActivity(intent); } }); - wordButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - // エディットテキストのテキストを取得 - String text = editText.getText().toString(); - // 取得したテキストを TextView に張り付ける - wordText.setText(text); - wordText2.setText(text); - } - }); +// wordButton.setOnClickListener(new View.OnClickListener() { +// @Override +// public void onClick(View v) { +// // エディットテキストのテキストを取得 +// String text = editText.getText().toString(); +// // 取得したテキストを TextView に張り付ける +// wordText.setText(text); +// wordText2.setText(text); +// } +// }); //画面を閉じる Button returnButton = findViewById(R.id.return_button); returnButton.setOnClickListener(v -> finish()); - //作成者のページに移動 - editor1Button.setOnClickListener(new View.OnClickListener(){ - @Override - public void onClick(View v){ - Intent intent = new Intent(getApplication(), UserPageActivity.class); - intent.putExtra("UID", editorsUid.get(0)); - intent.putExtra("NAME", editorsNames.get(0)); - startActivity(intent); - - } - }); - editor2Button.setOnClickListener(new View.OnClickListener(){ - @Override - public void onClick(View v){ - Intent intent = new Intent(getApplication(), UserPageActivity.class); - intent.putExtra("UID", editorsUid.get(1)); - intent.putExtra("NAME", editorsNames.get(1)); - startActivity(intent); - - } - }); +// //作成者のページに移動 +// editor1Button.setOnClickListener(new View.OnClickListener(){ +// @Override +// public void onClick(View v){ +// Intent intent = new Intent(getApplication(), UserPageActivity.class); +// intent.putExtra("UID", editorsUid.get(0)); +// intent.putExtra("NAME", editorsNames.get(0)); +// startActivity(intent); +// +// } +// }); +// editor2Button.setOnClickListener(new View.OnClickListener(){ +// @Override +// public void onClick(View v){ +// Intent intent = new Intent(getApplication(), UserPageActivity.class); +// intent.putExtra("UID", editorsUid.get(1)); +// intent.putExtra("NAME", editorsNames.get(1)); +// startActivity(intent); +// +// } +// }); /* //作成者のページに移動(今は仮でアニメーション画面へ) Button buttonEditor2 = findViewById(R.id.button_editor2);