Skip to content

Commit

Permalink
release v1.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
LwkCoder committed Nov 4, 2019
1 parent 2a84d67 commit 70a06bb
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public void onClick(View view)
{
if (mListener != null)
{
mListener.onNineGirdAddMoreClick(mMaxNum - mDataList.size());
mListener.onNineGirdAddMoreClick(getDiffValue());
}
}
});
Expand Down Expand Up @@ -509,6 +509,10 @@ public List<NineGridBean> getDataList()
public void setIcAddMoreResId(int resId)
{
this.mIcAddMoreResId = resId;
if (mImgAddData != null)
{
mImgAddData.setImageResource(resId);
}
}

/**
Expand All @@ -517,6 +521,22 @@ public void setIcAddMoreResId(int resId)
public void setIcDeleteResId(int resId)
{
this.mIcDelete = resId;
// for (int i = 0, count = getChildCount(); i < count; i++)
// {
// View child = getChildAt(i);
// if (child instanceof NineGirdImageContainer)
// {
// ((NineGirdImageContainer) child).setDeleteIcon(resId);
// }
// }
}

/**
* Return the diff value between current data number displayed and maximum number
*/
public int getDiffValue()
{
return mMaxNum - mDataList.size();
}

/**
Expand All @@ -532,9 +552,9 @@ public interface onItemClickListener
/**
* Callback when clcik plus button be clicked
*
* @param cha the diff value between current data number displayed and maximum number
* @param dValue the diff value between current data number displayed and maximum number
*/
void onNineGirdAddMoreClick(int cha);
void onNineGirdAddMoreClick(int dValue);

/**
* Callback when image be clicked
Expand Down
183 changes: 92 additions & 91 deletions app/proguardMapping.txt

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions app/src/main/java/com/lwk/libsample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ protected void onCreate(Bundle savedInstanceState)
//设置图片显示间隔大小,默认3dp
mNineGridView.setSpcaeSize(4);
//设置删除图片
// mNineGridView.setIcDeleteResId(R.drawable.ic_block_black_24dp);
mNineGridView.setIcDeleteResId(R.drawable.ic_delete);
//设置删除图片与父视图的大小比例,默认0.25f
mNineGridView.setRatioOfDeleteIcon(0.3f);
mNineGridView.setRatioOfDeleteIcon(0.35f);
//设置“+”号的图片
mNineGridView.setIcAddMoreResId(R.drawable.ic_ngv_add_pic);
mNineGridView.setIcAddMoreResId(R.drawable.ic_plus);
//设置各类点击监听
mNineGridView.setOnItemClickListener(this);
}
Expand All @@ -65,14 +65,14 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean b)
}

@Override
public void onNineGirdAddMoreClick(int cha)
public void onNineGirdAddMoreClick(int dValue)
{
//编辑模式下,图片展示数量尚未达到最大数量时,会显示一个“+”号,点击后回调这里
new ImagePicker()
.cachePath(Environment.getExternalStorageDirectory().getAbsolutePath())
.pickType(ImagePickType.MULTI)
.displayer(new ImagePickerLoader())
.maxNum(cha)
.maxNum(dValue)
.start(this, REQUEST_CODE_PICKER);
}

Expand Down
Binary file not shown.
Binary file added app/src/main/res/drawable-xxhdpi/ic_delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xxhdpi/ic_plus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'

Expand Down
5 changes: 4 additions & 1 deletion config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ ext {
maven : 'com.github.dcendents.android-maven',
bintray: 'com.jfrog.bintray'
]
//依次执行:
//gradlew clean install
//gradle2 bintrayUpload
bintray = [
version : "1.2.5", // 指定库的版本号
version : "1.2.6", // 指定库的版本号
group : "com.lwkandroid.widget", // 库的group名,确定好之后不能修改
libName : 'NineGridView',// 库的名称

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue May 07 13:41:58 CST 2019
#Mon Nov 04 11:17:39 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

0 comments on commit 70a06bb

Please sign in to comment.