Skip to content

Commit

Permalink
增加返回getAdapter出去
Browse files Browse the repository at this point in the history
  • Loading branch information
陈力 committed Jan 25, 2024
1 parent c1acc7e commit a2521aa
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "com.cl.xdialog"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
versionCode 313
versionName "3.1.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -34,9 +34,9 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
// implementation project(':xdialog')
implementation project(':xdialog')

implementation 'com.github.cl-6666:xDialog:v3.1.0'
// implementation 'com.github.cl-6666:xDialog:v3.1.0'

//内存泄漏检测
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ protected void onBind(BindViewHolder holder, int position, String s) {
public void onItemClick(BindViewHolder holder, int position, String item, XDialog tDialog) {
Toast.makeText(DiffentDialogActivity.this, item, Toast.LENGTH_SHORT).show();
tDialog.dismiss();

}
})
.create()
Expand Down
8 changes: 8 additions & 0 deletions xdialog/src/main/java/com/cl/xdialog/XDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.cl.xdialog.adapter.TParams;
import com.cl.xdialog.base.BaseDialogFragment;
import com.cl.xdialog.base.BindViewHolder;
import com.cl.xdialog.base.XBaseAdapter;
import com.cl.xdialog.base.XController;
import com.cl.xdialog.listener.OnBindViewListener;
import com.cl.xdialog.listener.OnViewClickListener;
Expand Down Expand Up @@ -148,6 +149,13 @@ public XDialog show() {
}
return this;
}
/**
* 返回getAdapter出去,方便外部调用notifyDataSetChanged()
*/
public XBaseAdapter getAdapter() {
return xController.getAdapter();
}


/*********************************************************************
* 使用Builder模式实现
Expand Down
1 change: 0 additions & 1 deletion xdialog/src/main/java/com/cl/xdialog/base/XBaseAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ abstract class XBaseAdapter<T>(
holder.itemView.setOnClickListener {
adapterItemClickListener?.onItemClick(holder, position, datas[position], dialog)
}

}

override fun getItemCount(): Int {
Expand Down
6 changes: 0 additions & 6 deletions xdialog/src/main/java/com/cl/xdialog/list/XListDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ class XListDialog : XDialog() {
}
}

/**
* 返回getAdapter出去,方便外部调用notifyDataSetChanged()
*/
val adapter: XBaseAdapter<*>?
get() = xController.adapter


/*********************************************************************
* 使用Builder模式实现
Expand Down

0 comments on commit a2521aa

Please sign in to comment.