Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
1916076d
Commit
1916076d
authored
Feb 04, 2020
by
ydl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页文章冥想动态剔除完成
parent
7d0db4f6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
44 deletions
+40
-44
PublishQuestionAndTrendFragment.java
m-dynamic/src/main/java/com/yidianling/dynamic/publishTrend/fragment/PublishQuestionAndTrendFragment.java
+21
-21
PublishImageAdapter.java
ydl-platform/src/main/java/com/ydl/ydlcommon/adapter/custom/PublishImageAdapter.java
+19
-23
No files found.
m-dynamic/src/main/java/com/yidianling/dynamic/publishTrend/fragment/PublishQuestionAndTrendFragment.java
View file @
1916076d
...
@@ -40,6 +40,7 @@ import com.ydl.webview.H5Params;
...
@@ -40,6 +40,7 @@ import com.ydl.webview.H5Params;
import
com.ydl.webview.NewH5Activity
;
import
com.ydl.webview.NewH5Activity
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydlcommon.actions.imagepicker.PickerCallback
;
import
com.ydl.ydlcommon.actions.imagepicker.PickerCallback
;
import
com.ydl.ydlcommon.adapter.custom.PublishImageAdapter
;
import
com.ydl.ydlcommon.base.BaseActivity
;
import
com.ydl.ydlcommon.base.BaseActivity
;
import
com.ydl.ydlcommon.base.BaseApp
;
import
com.ydl.ydlcommon.base.BaseApp
;
import
com.ydl.ydlcommon.base.BaseFragment
;
import
com.ydl.ydlcommon.base.BaseFragment
;
...
@@ -49,22 +50,21 @@ import com.ydl.ydlcommon.utils.BuryPointUtils;
...
@@ -49,22 +50,21 @@ import com.ydl.ydlcommon.utils.BuryPointUtils;
import
com.ydl.ydlcommon.utils.MoonUtil
;
import
com.ydl.ydlcommon.utils.MoonUtil
;
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
;
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
;
import
com.ydl.ydlcommon.utils.StringUtils
;
import
com.ydl.ydlcommon.utils.StringUtils
;
import
com.ydl.ydlcommon.view.banner.GlideImageDisplayLoader
;
import
com.ydl.ydlcommon.view.dialog.CommonDialog
;
import
com.ydl.ydlcommon.view.dialog.CommonDialog
;
import
com.ydl.ydlcommon.view.dialog.NormalDialog
;
import
com.ydl.ydlcommon.view.dialog.NormalDialog
;
import
com.yidianling.common.tools.LogUtil
;
import
com.yidianling.common.tools.LogUtil
;
import
com.yidianling.common.tools.RxFileTool
;
import
com.yidianling.common.tools.RxFileTool
;
import
com.yidianling.dynamic.DynamicConstants
;
import
com.yidianling.dynamic.
bean.
DynamicConstants
;
import
com.yidianling.dynamic.R
;
import
com.yidianling.dynamic.R
;
import
com.yidianling.dynamic.adapter.PublishTrendImgAdapter
;
import
com.yidianling.dynamic.common.browsePictures.BrowsePicturesActivity
;
import
com.yidianling.dynamic.common.browsePictures.BrowsePicturesActivity
;
import
com.yidianling.dynamic.common.emoji.EmoticonPickerView
;
import
com.yidianling.dynamic.common.emoji.EmoticonPickerView
;
import
com.yidianling.dynamic.common.emoji.IEmoticonSelectedListener
;
import
com.yidianling.dynamic.common.emoji.IEmoticonSelectedListener
;
import
com.yidianling.dynamic.common.net.DynamicApiUtils
;
import
com.yidianling.dynamic.common.net.DynamicApiUtils
;
import
com.yidianling.dynamic.common.tool.GlideImageLoader
;
import
com.yidianling.dynamic.common.tool.ImageCompress
;
import
com.yidianling.dynamic.common.tool.ImageCompress
;
import
com.yidianling.dynamic.model.Command
;
import
com.yidianling.dynamic.model.Command
;
import
com.yidianling.dynamic.model.PublishTrendResult
;
import
com.yidianling.dynamic.model.PublishTrendResult
;
import
com.y
idianling.dynamic.model.RecommendTrend
Image
;
import
com.y
dl.ydlcommon.ui.Parcelable
Image
;
import
com.yidianling.dynamic.publishTrend.PublishTrendActivity
;
import
com.yidianling.dynamic.publishTrend.PublishTrendActivity
;
import
com.yidianling.dynamic.publishTrend.SelecTopicActivity
;
import
com.yidianling.dynamic.publishTrend.SelecTopicActivity
;
import
com.yidianling.dynamic.router.DynamicIn
;
import
com.yidianling.dynamic.router.DynamicIn
;
...
@@ -125,8 +125,8 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
...
@@ -125,8 +125,8 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
private
String
head_dir
;
//目录
private
String
head_dir
;
//目录
private
String
head_path
;
//路径
private
String
head_path
;
//路径
File
head_filec
;
File
head_filec
;
private
List
<
RecommendTrend
Image
>
publishTrendImgs
,
publishTrendImgBrows
;
private
List
<
Parcelable
Image
>
publishTrendImgs
,
publishTrendImgBrows
;
private
Publish
TrendImg
Adapter
adapter
;
private
Publish
Image
Adapter
adapter
;
String
topic_id
;
String
topic_id
;
String
topic_title
;
String
topic_title
;
...
@@ -198,7 +198,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
...
@@ -198,7 +198,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
public
void
initDataAndEventLazy
()
{
public
void
initDataAndEventLazy
()
{
rxPermissions
=
new
RxPermissions
(
getActivity
());
rxPermissions
=
new
RxPermissions
(
getActivity
());
ImagePicker
imagePicker
=
ImagePicker
.
getInstance
();
ImagePicker
imagePicker
=
ImagePicker
.
getInstance
();
imagePicker
.
setImageLoader
(
new
GlideImageLoader
());
//设置图片加载器
imagePicker
.
setImageLoader
(
new
GlideImage
Display
Loader
());
//设置图片加载器
imagePicker
.
setShowCamera
(
true
);
//显示拍照按钮
imagePicker
.
setShowCamera
(
true
);
//显示拍照按钮
imagePicker
.
setCrop
(
true
);
//允许裁剪(单选才有效)
imagePicker
.
setCrop
(
true
);
//允许裁剪(单选才有效)
imagePicker
.
setSaveRectangle
(
true
);
//是否按矩形区域保存
imagePicker
.
setSaveRectangle
(
true
);
//是否按矩形区域保存
...
@@ -259,16 +259,16 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
...
@@ -259,16 +259,16 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
head_dir
=
RxFileTool
.
getStorageDirectory
(
activity
)
+
"/img/publish_img/"
;
head_dir
=
RxFileTool
.
getStorageDirectory
(
activity
)
+
"/img/publish_img/"
;
if
(
adapter
==
null
)
{
if
(
adapter
==
null
)
{
adapter
=
new
Publish
TrendImg
Adapter
(
publishTrendImgs
,
activity
);
adapter
=
new
Publish
Image
Adapter
(
publishTrendImgs
,
activity
);
}
else
{
}
else
{
adapter
.
notifyDataSetChanged
();
adapter
.
notifyDataSetChanged
();
}
}
publish_trend_img_rcv
.
setLayoutManager
(
new
GridLayoutManager
(
activity
,
4
));
publish_trend_img_rcv
.
setLayoutManager
(
new
GridLayoutManager
(
activity
,
4
));
publish_trend_img_rcv
.
setAdapter
(
adapter
);
publish_trend_img_rcv
.
setAdapter
(
adapter
);
adapter
.
setOnItemClickLister
(
new
Publish
TrendImg
Adapter
.
OnItemClickLister
()
{
adapter
.
setOnItemClickLister
(
new
Publish
Image
Adapter
.
OnItemClickLister
()
{
@Override
@Override
public
void
onItemClick
(
View
view
,
int
position
)
{
public
void
onItemClick
(
View
view
,
int
position
)
{
publishTrendImgBrows
=
new
ArrayList
<
RecommendTrend
Image
>();
publishTrendImgBrows
=
new
ArrayList
<
Parcelable
Image
>();
publishTrendImgBrows
.
clear
();
publishTrendImgBrows
.
clear
();
publishTrendImgBrows
.
addAll
(
publishTrendImgs
);
publishTrendImgBrows
.
addAll
(
publishTrendImgs
);
if
(
publishTrendImgBrows
.
size
()
<
9
)
{
if
(
publishTrendImgBrows
.
size
()
<
9
)
{
...
@@ -304,7 +304,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
...
@@ -304,7 +304,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
}
}
});
});
adapter
.
setOnDeleteClickLister
(
new
Publish
TrendImg
Adapter
.
OnDeleteClickLister
()
{
adapter
.
setOnDeleteClickLister
(
new
Publish
Image
Adapter
.
OnDeleteClickLister
()
{
@Override
@Override
public
void
onDeleteClick
(
View
view
,
int
position
)
{
public
void
onDeleteClick
(
View
view
,
int
position
)
{
DeleteImg
(
position
);
DeleteImg
(
position
);
...
@@ -315,7 +315,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
...
@@ -315,7 +315,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
}
}
});
});
adapter
.
setOnAddClickLister
(
new
Publish
TrendImg
Adapter
.
OnAddClickLister
()
{
adapter
.
setOnAddClickLister
(
new
Publish
Image
Adapter
.
OnAddClickLister
()
{
@Override
@Override
public
void
OnAddClick
(
View
view
,
int
position
)
{
public
void
OnAddClick
(
View
view
,
int
position
)
{
if
(
publishTrendImgs
.
size
()
<
9
)
{
if
(
publishTrendImgs
.
size
()
<
9
)
{
...
@@ -517,7 +517,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
...
@@ -517,7 +517,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
if
(!
""
.
equals
(
Test_url
)
&&
Test_url
!=
null
&&
!
""
.
equals
(
Test_cover
)
&&
Test_cover
!=
null
&&
!
""
.
equals
(
Test_title
)
&&
Test_title
!=
null
)
{
if
(!
""
.
equals
(
Test_url
)
&&
Test_url
!=
null
&&
!
""
.
equals
(
Test_cover
)
&&
Test_cover
!=
null
&&
!
""
.
equals
(
Test_title
)
&&
Test_title
!=
null
)
{
PublishO
(
is_niming
,
topic_id
,
content
,
trend_title
,
null
);
PublishO
(
is_niming
,
topic_id
,
content
,
trend_title
,
null
);
}
else
{
}
else
{
List
<
RecommendTrendImage
>
publishImgs
=
new
ArrayList
<
RecommendTrend
Image
>();
List
<
ParcelableImage
>
publishImgs
=
new
ArrayList
<
Parcelable
Image
>();
publishImgs
.
addAll
(
publishTrendImgs
);
publishImgs
.
addAll
(
publishTrendImgs
);
if
(
publishTrendImgs
.
size
()
<
9
&&
publishTrendImgs
.
size
()
>
1
)
{
if
(
publishTrendImgs
.
size
()
<
9
&&
publishTrendImgs
.
size
()
>
1
)
{
publishImgs
.
remove
(
publishImgs
.
size
()
-
1
);
publishImgs
.
remove
(
publishImgs
.
size
()
-
1
);
...
@@ -651,13 +651,13 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
...
@@ -651,13 +651,13 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
* @param publishTrendImgs 图片附件
* @param publishTrendImgs 图片附件
*/
*/
@SuppressLint
(
"WrongConstant"
)
@SuppressLint
(
"WrongConstant"
)
private
void
DealFile
(
final
int
is_niming
,
final
String
topic_id
,
final
String
content
,
final
String
trend_title
,
final
List
<
RecommendTrend
Image
>
publishTrendImgs
)
{
private
void
DealFile
(
final
int
is_niming
,
final
String
topic_id
,
final
String
content
,
final
String
trend_title
,
final
List
<
Parcelable
Image
>
publishTrendImgs
)
{
imgFiles
=
new
ArrayList
<
File
>();
imgFiles
=
new
ArrayList
<
File
>();
Observable
.
fromIterable
(
publishTrendImgs
)
Observable
.
fromIterable
(
publishTrendImgs
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
.
map
(
recommendTrend
Image
->
{
.
map
(
parcelable
Image
->
{
LogUtil
.
d
(
"url: "
+
recommendTrend
Image
.
getImage_url
());
LogUtil
.
d
(
"url: "
+
parcelable
Image
.
getImage_url
());
return
DealFile2
(
recommendTrend
Image
.
getImage_url
(),
1500
/
publishTrendImgs
.
size
());
return
DealFile2
(
parcelable
Image
.
getImage_url
(),
1500
/
publishTrendImgs
.
size
());
})
})
.
subscribe
(
file
->
{
.
subscribe
(
file
->
{
if
(
file
!=
null
)
{
if
(
file
!=
null
)
{
...
@@ -830,7 +830,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
...
@@ -830,7 +830,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
Bundle
bundle
=
data
.
getBundleExtra
(
"bundle"
);
Bundle
bundle
=
data
.
getBundleExtra
(
"bundle"
);
publishTrendImgs
=
bundle
.
getParcelableArrayList
(
"publish_img"
);
publishTrendImgs
=
bundle
.
getParcelableArrayList
(
"publish_img"
);
if
(
publishTrendImgs
.
size
()
>
0
)
{
if
(
publishTrendImgs
.
size
()
>
0
)
{
publishTrendImgs
.
add
(
new
RecommendTrend
Image
(
"default"
));
publishTrendImgs
.
add
(
new
Parcelable
Image
(
"default"
));
}
}
adapter
.
updateDate
(
publishTrendImgs
);
adapter
.
updateDate
(
publishTrendImgs
);
}
}
...
@@ -865,11 +865,11 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
...
@@ -865,11 +865,11 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
* 添加照片
* 添加照片
*/
*/
private
void
AddImag
(
String
pic_path
)
{
private
void
AddImag
(
String
pic_path
)
{
RecommendTrendImage
trendImage
=
new
RecommendTrend
Image
(
pic_path
);
ParcelableImage
trendImage
=
new
Parcelable
Image
(
pic_path
);
if
(
publishTrendImgs
.
size
()
<
9
&&
publishTrendImgs
.
size
()
>
0
)
{
if
(
publishTrendImgs
.
size
()
<
9
&&
publishTrendImgs
.
size
()
>
0
)
{
publishTrendImgs
.
add
(
publishTrendImgs
.
size
()
-
1
,
trendImage
);
publishTrendImgs
.
add
(
publishTrendImgs
.
size
()
-
1
,
trendImage
);
}
else
if
(
publishTrendImgs
.
size
()
==
0
)
{
}
else
if
(
publishTrendImgs
.
size
()
==
0
)
{
publishTrendImgs
.
add
(
new
RecommendTrend
Image
(
"default"
));
publishTrendImgs
.
add
(
new
Parcelable
Image
(
"default"
));
publishTrendImgs
.
add
(
publishTrendImgs
.
size
()
-
1
,
trendImage
);
publishTrendImgs
.
add
(
publishTrendImgs
.
size
()
-
1
,
trendImage
);
}
else
{
}
else
{
publishTrendImgs
.
remove
(
8
);
publishTrendImgs
.
remove
(
8
);
...
@@ -970,7 +970,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
...
@@ -970,7 +970,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
publishTrendImgs
.
remove
(
position
);
publishTrendImgs
.
remove
(
position
);
}
else
{
}
else
{
publishTrendImgs
.
remove
(
position
);
publishTrendImgs
.
remove
(
position
);
publishTrendImgs
.
add
(
8
,
new
RecommendTrend
Image
(
"default"
));
publishTrendImgs
.
add
(
8
,
new
Parcelable
Image
(
"default"
));
}
}
}
}
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/adapter/PublishTrendImg
Adapter.java
→
ydl-platform/src/main/java/com/ydl/ydlcommon/adapter/custom/PublishImage
Adapter.java
View file @
1916076d
package
com
.
y
idianling
.
dynamic
.
adapter
;
package
com
.
y
dl
.
ydlcommon
.
adapter
.
custom
;
import
android.content.Context
;
import
android.content.Context
;
import
android.net.Uri
;
import
android.net.Uri
;
...
@@ -13,20 +13,16 @@ import android.widget.ImageView;
...
@@ -13,20 +13,16 @@ import android.widget.ImageView;
import
com.miracle.view.imageeditor.utils.FileUtils
;
import
com.miracle.view.imageeditor.utils.FileUtils
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydl_image.transform.GlideRoundTransform
;
import
com.ydl.ydl_image.transform.GlideRoundTransform
;
import
com.y
idianling.dynamic
.R
;
import
com.y
dl.ydlcommon
.R
;
import
com.y
idianling.dynamic.model.RecommendTrend
Image
;
import
com.y
dl.ydlcommon.ui.Parcelable
Image
;
import
java.util.List
;
import
java.util.List
;
/**
public
class
PublishImageAdapter
extends
RecyclerView
.
Adapter
<
PublishImageViewHolder
>
{
* Created by xiongyu on 2017/3/17.
*/
public
class
PublishTrendImgAdapter
extends
RecyclerView
.
Adapter
<
PublishTrendImgViewHolder
>
{
private
static
final
String
TAG
=
"RecommendTrendImgAdapte"
;
private
static
final
String
TAG
=
"RecommendTrendImgAdapte"
;
protected
Context
mContext
;
protected
Context
mContext
;
protected
List
<
RecommendTrend
Image
>
mDatas
;
protected
List
<
Parcelable
Image
>
mDatas
;
protected
LayoutInflater
mInflater
;
protected
LayoutInflater
mInflater
;
public
interface
OnItemClickLister
{
public
interface
OnItemClickLister
{
...
@@ -63,24 +59,24 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
...
@@ -63,24 +59,24 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
this
.
mOnAddClickLister
=
lister
;
this
.
mOnAddClickLister
=
lister
;
}
}
public
Publish
TrendImgAdapter
(
List
<
RecommendTrend
Image
>
mDatas
,
Context
mContext
)
{
public
Publish
ImageAdapter
(
List
<
Parcelable
Image
>
mDatas
,
Context
mContext
)
{
this
.
mContext
=
mContext
;
this
.
mContext
=
mContext
;
this
.
mDatas
=
mDatas
;
this
.
mDatas
=
mDatas
;
mInflater
=
LayoutInflater
.
from
(
mContext
);
mInflater
=
LayoutInflater
.
from
(
mContext
);
}
}
@Override
@Override
public
Publish
TrendImg
ViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
public
Publish
Image
ViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
View
view
=
null
;
View
view
=
null
;
view
=
mInflater
.
inflate
(
R
.
layout
.
dynamic_item_publish_trend
_img
,
parent
,
false
);
view
=
mInflater
.
inflate
(
R
.
layout
.
platform_item_publish
_img
,
parent
,
false
);
Publish
TrendImgViewHolder
viewHolder
=
new
PublishTrendImg
ViewHolder
(
view
);
Publish
ImageViewHolder
viewHolder
=
new
PublishImage
ViewHolder
(
view
);
return
viewHolder
;
return
viewHolder
;
}
}
@RequiresApi
(
api
=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
@RequiresApi
(
api
=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
@Override
@Override
public
void
onBindViewHolder
(
Publish
TrendImg
ViewHolder
holder
,
final
int
position
)
{
public
void
onBindViewHolder
(
Publish
Image
ViewHolder
holder
,
final
int
position
)
{
RecommendTrend
Image
trendImage
=
mDatas
.
get
(
position
);
Parcelable
Image
trendImage
=
mDatas
.
get
(
position
);
String
path
=
trendImage
.
getImage_url
();
String
path
=
trendImage
.
getImage_url
();
if
(
"default"
.
equals
(
path
))
{
if
(
"default"
.
equals
(
path
))
{
...
@@ -94,7 +90,7 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
...
@@ -94,7 +90,7 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
Uri
uriByPath
=
FileUtils
.
INSTANCE
.
getUriByPath
(
mContext
,
path
);
Uri
uriByPath
=
FileUtils
.
INSTANCE
.
getUriByPath
(
mContext
,
path
);
GlideApp
.
with
(
mContext
)
GlideApp
.
with
(
mContext
)
.
load
(
uriByPath
)
.
load
(
uriByPath
)
.
error
(
R
.
drawable
.
dynamic
_default_img
)
.
error
(
R
.
drawable
.
platform
_default_img
)
.
transform
(
new
GlideRoundTransform
(
mContext
,
6
))
.
transform
(
new
GlideRoundTransform
(
mContext
,
6
))
// .centerCrop()
// .centerCrop()
.
into
(
holder
.
item_publish_iv
);
.
into
(
holder
.
item_publish_iv
);
...
@@ -111,7 +107,7 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
...
@@ -111,7 +107,7 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
}
}
public
void
updateDate
(
List
<
RecommendTrend
Image
>
mDatas
)
{
public
void
updateDate
(
List
<
Parcelable
Image
>
mDatas
)
{
this
.
mDatas
=
mDatas
;
this
.
mDatas
=
mDatas
;
notifyDataSetChanged
();
notifyDataSetChanged
();
}
}
...
@@ -122,7 +118,7 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
...
@@ -122,7 +118,7 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
* @param pos 数据添加的位置
* @param pos 数据添加的位置
* @param trendImage 数据
* @param trendImage 数据
*/
*/
public
void
addData
(
int
pos
,
RecommendTrend
Image
trendImage
)
{
public
void
addData
(
int
pos
,
Parcelable
Image
trendImage
)
{
mDatas
.
add
(
trendImage
);
mDatas
.
add
(
trendImage
);
notifyItemInserted
(
pos
);
notifyItemInserted
(
pos
);
}
}
...
@@ -142,7 +138,7 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
...
@@ -142,7 +138,7 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
*
*
* @param holder
* @param holder
*/
*/
protected
void
setUpItemEvent
(
final
Publish
TrendImg
ViewHolder
holder
)
{
protected
void
setUpItemEvent
(
final
Publish
Image
ViewHolder
holder
)
{
if
(
mOnItemClickLister
!=
null
)
{
if
(
mOnItemClickLister
!=
null
)
{
holder
.
item_publish_iv
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
holder
.
item_publish_iv
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
...
@@ -168,7 +164,7 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
...
@@ -168,7 +164,7 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
*
*
* @param holder
* @param holder
*/
*/
protected
void
setUpDeleteEvent
(
final
Publish
TrendImg
ViewHolder
holder
)
{
protected
void
setUpDeleteEvent
(
final
Publish
Image
ViewHolder
holder
)
{
if
(
mOnItemClickLister
!=
null
)
{
if
(
mOnItemClickLister
!=
null
)
{
holder
.
item_publish_cancel_iv
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
holder
.
item_publish_cancel_iv
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
...
@@ -194,7 +190,7 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
...
@@ -194,7 +190,7 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
*
*
* @param holder
* @param holder
*/
*/
protected
void
setUpAddEvent
(
final
Publish
TrendImg
ViewHolder
holder
)
{
protected
void
setUpAddEvent
(
final
Publish
Image
ViewHolder
holder
)
{
if
(
mOnAddClickLister
!=
null
)
{
if
(
mOnAddClickLister
!=
null
)
{
holder
.
bg_iv
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
holder
.
bg_iv
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
...
@@ -218,10 +214,10 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
...
@@ -218,10 +214,10 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
}
}
class
Publish
TrendImg
ViewHolder
extends
RecyclerView
.
ViewHolder
{
class
Publish
Image
ViewHolder
extends
RecyclerView
.
ViewHolder
{
ImageView
item_publish_iv
,
item_publish_cancel_iv
,
bg_iv
;
ImageView
item_publish_iv
,
item_publish_cancel_iv
,
bg_iv
;
public
Publish
TrendImg
ViewHolder
(
View
itemView
)
{
public
Publish
Image
ViewHolder
(
View
itemView
)
{
super
(
itemView
);
super
(
itemView
);
bg_iv
=
(
ImageView
)
itemView
.
findViewById
(
R
.
id
.
item_publish_defult_iv
);
bg_iv
=
(
ImageView
)
itemView
.
findViewById
(
R
.
id
.
item_publish_defult_iv
);
item_publish_iv
=
(
ImageView
)
itemView
.
findViewById
(
R
.
id
.
item_publish_iv
);
item_publish_iv
=
(
ImageView
)
itemView
.
findViewById
(
R
.
id
.
item_publish_iv
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment