현재 이미지뷰에서 사진들이 나오는데 이걸 갤러리뷰로 변경하고싶습니다
고수분들 도와주세요..
int photo0 = intent.getExtras().getInt("cPhoto0");
ImageView imageView0 = findViewById(R.id.Photo1);
ImageView mainView = findViewById(R.id.BigPhoto);
imageView0.setImageResource(photo0);
mainView.setImageResource(photo0);
int photo1 = intent.getExtras().getInt("cPhoto1");
ImageView imageView1 = findViewById(R.id.Photo2);
imageView1.setImageResource(photo1);
int photo2 = intent.getExtras().getInt("cPhoto2");
ImageView imageView2 = findViewById(R.id.Photo3);
imageView2.setImageResource(photo2);
int photo3 = intent.getExtras().getInt("cPhoto3");
ImageView imageView3 = findViewById(R.id.Photo4);
imageView3.setImageResource(photo3);
ImageView line = findViewById(R.id.Line);
xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/cityName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10px"
android:text="City Name"
android:textColorLink="@color/colorPrimary"
android:textSize="20sp"
android:textStyle="normal|bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/Photo1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="5dp"
android:onClick="changePhoto"
android:scaleType="fitXY"
app:srcCompat="@drawable/germany1" />
<ImageView
android:id="@+id/Photo2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="5dp"
android:onClick="changePhoto"
android:scaleType="fitXY"
app:srcCompat="@drawable/germany2" />
<ImageView
android:id="@+id/Photo3"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="5dp"
android:onClick="changePhoto"
android:scaleType="fitXY"
app:srcCompat="@drawable/germany3" />
<ImageView
android:id="@+id/Photo4"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="5dp"
android:onClick="changePhoto"
android:scaleType="fitXY"
app:srcCompat="@drawable/germany4" />
</LinearLayout>
<ImageView
android:id="@+id/Line"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@android:color/black" />
<ImageView
android:id="@+id/BigPhoto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="@drawable/germany1" />
</LinearLayout>