안녕하세요.
switch문에 따라서, 벨 이미지 커스텀 다이얼로그에 뜨는 이미지뷰(imageView2) 에 저장되는 이미지들을 각각 다르게 만들어주고 싶은데 그 방법을 잘 모르겠습니다..
각각 저장되어야 하는 이미지들은 a1,a2,a3,a4,a5로 되어있고, 아래의 Three.Java 파일의
버튼이벤트 부분을, 어떻게 만들어 주어야.. 각각 다른 이미지가 뜰까요 ㅠ 도움이 필요합니다.
아래의 소스가 추가되는 부분은 덧붙여 보겠습니다.
< 벨 이미지가 있는 Three.Java 파일 >
Bell = (ImageView) findViewById(R.id.bell_image);
Bell.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(null == dialog)
{
// dialog = new Bell_Image_Custom_Dialog();
}
else if(dialog.isShowing())
{
dialog.dismiss();
}
else {
switch (position)
{
case 0:
// 이 부분을 어떻게 해야할지..
}
// Bell_Image_Custom_Dialog dialog = new Bell_Image_Custom_Dialog(First_Movie.this);
// dialog.show();
}
}
});
< 벨 이미지 커스텀 다이얼로그. xml 파일>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_bell__image__custom__dialog"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@drawable/icon_12" />
<Button
android:id="@+id/Bell_Image_Custom_TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/imageView2"
android:background="@drawable/white_round_button"
android:layout_alignParentRight="true"
android:text="확인" />
</RelativeLayout>
</RelativeLayout>