Android MaxPicture

项目地址: MaxPicture
简介:GridView 图片放大左右滑动

Can add multiple pictures and with the function of sliding around after click to enlarge the GridView


Demo

image


SDK

SdkVersion
minSdkVersion14
targetSdkVersion24
Compile

compile 'com.github.maxpicture:gridviewimage:1.0.0'


View

<ScrollView
        android:id="@+id/scorll"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <com.example.gridviewimage.view.controls.ImageGridView
            android:id="@+id/image_gridView"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_margin="10dp"
            android:columnWidth="60dp"
            android:gravity="center"
            android:horizontalSpacing="10dp"
            android:numColumns="3"
            android:stretchMode="columnWidth"
            android:verticalSpacing="10dp" />
    </ScrollView>
Annotation
If need to join the ScrollView scroll bars, if you don't need to scroll bar, so you just need to use ImageGridView. 

Avtivity

//Pictures photos can directly into the network address, local address images, and images of drawable 
ArrayList<String> photos = new ArrayList<String>();
//Controls the initialization 
ImageGridView image_gridView = null;
image_gridView=(ImageGridView)findViewById(R.id.image_gridView);
//        OnClick
        image_gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                Intent in = new Intent();
                in.setClass(MainActivity.this, MaxPictureActivity.class);
                //Will pass, I click for the current position 
                in.putExtra("pos", i);
                //Will pass,Photos to show the pictures of the collection address 
                in.putStringArrayListExtra("imageAddress", photos);
                startActivity(in);
            }
        });
/**
 *  MainActivity.this:Context
 *  photos:Photos to show the pictures of the collection address
 * */
        image_gridView.setAdapter(new GridViewImageAdapter(MainActivity.this, photos));
Update
 Later there will be updated to include image amplifier to amplify the full screen after double-click local double refers to the scale, such as single refers to mobile operations
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值