-2

for image click here

I am a beginner in android development,so can anybody help me create horizontal list of imageview like shown in the picture.It should be such that the image in the middle is in selected state and details about it can be shown and the list can be scrolled horizontally.

loki
  • 9,816
  • 7
  • 56
  • 82
Abhinav422
  • 95
  • 1
  • 11

3 Answers3

0

You could use a RecyclerView a good tutorial for this can be found here: http://stacktips.com/tutorials/android/android-recyclerview-example

To make the RecyclerView horizontal use this lines:

LinearLayoutManager layoutManager
= new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
yourRecyclerView.setLayoutManager(layoutManager);
Katharina
  • 1,612
  • 15
  • 27
  • how can i get the centre imageview to be highlighted?Actually I need to show details of the imageview that is in the center.So can you help me with that? – Abhinav422 Nov 07 '16 at 16:03
0

like what Tanis.7x said in another question here , it's easier to use RecyclerView with LinearLayoutManager set to horizontal, it will be look like google play store grid, hope it help :).

Community
  • 1
  • 1
0

You can use a library just add compile 'com.github.moondroid.coverflow:library:1.0' and in your xml

<it.moondroid.coverflow.components.ui.containers.FeatureCoverFlow
    android:id="@+id/coverflow"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    coverflow:coverHeight="@dimen/cover_height"
    coverflow:coverWidth="@dimen/cover_width"
    coverflow:maxScaleFactor="1.5"
    coverflow:reflectionGap="0px"
    coverflow:rotationThreshold="0.5"
    coverflow:scalingThreshold="0.5"
    coverflow:spacing="0.6" />

and in your java add this

mCoverFlow = (FeatureCoverFlow) findViewById(R.id.coverflow);
    mCoverFlow.setAdapter(mAdapter);

    mCoverFlow.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            //TODO CoverFlow item clicked
        }
    });

    mCoverFlow.setOnScrollPositionListener(new FeatureCoverFlow.OnScrollPositionListener() {
        @Override
        public void onScrolledToPosition(int position) {
            //TODO CoverFlow stopped to position
        }

        @Override
        public void onScrolling() {
            //TODO CoverFlow began scrolling
        }
    });

for more details you can find more lib hear

Neelay Srivastava
  • 1,041
  • 3
  • 15
  • 46