GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — NineGridView/README.md at master · MrWhhh/NineGridView

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
73 lines (57 loc) · 2.03 KB
/

README.md

Copy path

File metadata and controls

73 lines (57 loc) · 2.03 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

NineGridView

微信微博空间相册控件

使用方法很简单,大家可下载demo,根据自己需求更改。喜欢的star......

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
        compile 'com.github.MrWhhh:NineGridView:1.0.0'
}

九宫格样式

image

自定义样式

image

使用方式

    holder.nineGridView.setShowStyle(showStyle);
    holder.nineGridView.setAdapter(new NineGridViewAdapter<TalkInfo.PhotoInfo>() {
        @Override
        public void loadingWayImg(Context context, ImageView imageView, TalkInfo.PhotoInfo data) {
            imageView.setImageDrawable(ContextCompat.getDrawable(context, data.ids));
        }

        @Override
        public void onItemClick(Context context, ImageView imageView, int position, List<TalkInfo.PhotoInfo> list) {
            Toast.makeText(context, "点击图第" + position + "图片", Toast.LENGTH_LONG).show();
        }
    });
    holder.nineGridView.setData(list.get(position).photo);

Adapter说明

 /**
 * 加载图片到ImageView
 *
 * @param context
 * @param imageView
 * @param t
 */
public abstract void loadingWayImg(Context context, ImageView imageView, T t);

/**
 * item点击事件
 *
 * @param context
 * @param imageView
 * @param position
 * @param list
 */
public abstract void onItemClick(Context context, ImageView imageView, int position, List<T> list);

/**
 * 实例化ImageView onTouch事件加了点击效果 也可以自定义
 *
 * @param context
 * @return
 */
public ImageView getImageView(Context context);

使用方法很简单,大家可下载demo,根据自己需求更改。喜欢的star......

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.