1
This commit is contained in:
@@ -60,5 +60,4 @@ dependencies {
|
||||
api(name: 'ti-sdk', ext: 'aar')
|
||||
//common
|
||||
implementation project(':common')
|
||||
implementation project(path: ':lib_beauty360')
|
||||
}
|
||||
|
||||
@@ -12,16 +12,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewParent;
|
||||
|
||||
import com.by.lib_beauty360.AppConfig;
|
||||
import com.by.lib_beauty360.ItemData4LvJing;
|
||||
import com.by.lib_beauty360.ItemData4TieZhi;
|
||||
import com.by.lib_beauty360.RecycleView.HomeItemCell4LvJing;
|
||||
import com.by.lib_beauty360.RecycleView.HomeItemCell4Tiezhi;
|
||||
import com.by.lib_beauty360.RecycleView.IRecycleCell;
|
||||
import com.by.lib_beauty360.RecycleView.MyItemClickListener;
|
||||
import com.by.lib_beauty360.RecycleView.MyItemClickListener4Tiezhi;
|
||||
import com.by.lib_beauty360.RecycleView.MyRecycleAdapter4LvJing;
|
||||
import com.by.lib_beauty360.RecycleView.MyRecycleAdapter4Tiezhi;
|
||||
|
||||
import com.yunbao.beauty.R;
|
||||
import com.yunbao.beauty.adapter.RockAdapter;
|
||||
import com.yunbao.beauty.custom.ItemDecoration2;
|
||||
@@ -47,7 +38,7 @@ import cn.tillusory.sdk.bean.TiRockEnum;
|
||||
*/
|
||||
|
||||
public class Beauty360ViewHolder extends AbsViewHolder implements
|
||||
View.OnClickListener, BeautyViewHolder, MyItemClickListener , MyItemClickListener4Tiezhi {
|
||||
View.OnClickListener, BeautyViewHolder {
|
||||
|
||||
private SparseArray<View> mSparseArray;
|
||||
private int mCurKey;
|
||||
@@ -55,13 +46,11 @@ public class Beauty360ViewHolder extends AbsViewHolder implements
|
||||
private Beauty360EffectListener mEffectListener;
|
||||
private VisibleListener mVisibleListener;
|
||||
private boolean mShowed;
|
||||
private List<IRecycleCell> mListData4LvJing;
|
||||
private List<IRecycleCell> mListData4TieZhi;
|
||||
|
||||
private String mCurFilterStrength;
|
||||
private String mCurTiezhiName;
|
||||
private int mFilterValue = 100;
|
||||
private MyRecycleAdapter4LvJing mAdapter4LvJing;
|
||||
private MyRecycleAdapter4Tiezhi mAdapter4Tiezhi;
|
||||
|
||||
Activity mActivity;
|
||||
|
||||
public Beauty360ViewHolder(Context context, ViewGroup parentView) {
|
||||
@@ -189,8 +178,7 @@ public class Beauty360ViewHolder extends AbsViewHolder implements
|
||||
|
||||
ConstructList4TieZhi();
|
||||
|
||||
mAdapter4Tiezhi = new MyRecycleAdapter4Tiezhi(mActivity, mListData4TieZhi);
|
||||
tieZhiRecyclerView.setAdapter(mAdapter4Tiezhi);
|
||||
|
||||
tieZhiRecyclerView.setItemAnimator(new DefaultItemAnimator());
|
||||
|
||||
|
||||
@@ -216,8 +204,7 @@ public class Beauty360ViewHolder extends AbsViewHolder implements
|
||||
mFilterRecycleView.setLayoutManager(mLayoutManager);
|
||||
ConstructList4LvJing();
|
||||
|
||||
mAdapter4LvJing = new MyRecycleAdapter4LvJing(mActivity, mListData4LvJing);
|
||||
mFilterRecycleView.setAdapter(mAdapter4LvJing);
|
||||
|
||||
mFilterRecycleView.setItemAnimator(new DefaultItemAnimator());
|
||||
|
||||
//抖动
|
||||
@@ -242,17 +229,9 @@ public class Beauty360ViewHolder extends AbsViewHolder implements
|
||||
|
||||
|
||||
private void ConstructList4LvJing() {
|
||||
mListData4LvJing = new ArrayList<>();
|
||||
for (int i = 0; i < AppConfig.mFilterName.length; ++i) {
|
||||
ItemData4LvJing itemData = new ItemData4LvJing();
|
||||
itemData.filterName = AppConfig.mFilterNameAll[i];
|
||||
itemData.filterType = AppConfig.mFilterTypeAll[i];
|
||||
itemData.filterPictrue=AppConfig.mFilterPictrueAll[i];
|
||||
mListData4LvJing.add(new HomeItemCell4LvJing(mActivity, itemData, this));
|
||||
}
|
||||
|
||||
}
|
||||
private void ConstructList4TieZhi() {
|
||||
mListData4TieZhi = new ArrayList<>();
|
||||
|
||||
//遍历解压缩后的文件夹,获取所有贴纸列表
|
||||
String path= CommonAppConfig.VIDEO_TIE_ZHI_PATH+CommonAppConfig.TIEZHI_360_NAME
|
||||
@@ -267,16 +246,11 @@ public class Beauty360ViewHolder extends AbsViewHolder implements
|
||||
tiezhiArray[i] = fileList[i].getName();
|
||||
}
|
||||
|
||||
//单独添加第一个取消图片
|
||||
ItemData4TieZhi itemData0 = new ItemData4TieZhi();
|
||||
itemData0.tieZhiName="无";
|
||||
mListData4TieZhi.add(new HomeItemCell4Tiezhi(mActivity, itemData0, this));
|
||||
|
||||
//如果压缩包来自Mac电脑,需要去掉.DS_Store文件
|
||||
for (int i = 0; i < len; ++i) {
|
||||
if (!tiezhiArray[i].contains("DS_Store")){
|
||||
ItemData4TieZhi itemData = new ItemData4TieZhi();
|
||||
itemData.tieZhiName=tiezhiArray[i];
|
||||
mListData4TieZhi.add(new HomeItemCell4Tiezhi(mActivity, itemData, this));
|
||||
|
||||
}
|
||||
}
|
||||
}else {
|
||||
@@ -395,7 +369,6 @@ public class Beauty360ViewHolder extends AbsViewHolder implements
|
||||
mVisibleListener = visibleListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(String filtertype) {
|
||||
//点击某个滤镜
|
||||
if (TextUtils.isEmpty(filtertype))
|
||||
@@ -408,15 +381,14 @@ public class Beauty360ViewHolder extends AbsViewHolder implements
|
||||
if (mEffectListener != null) {
|
||||
mEffectListener.onFilterChanged(filtertype);
|
||||
}
|
||||
mAdapter4LvJing.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public String getCurFilterType() {
|
||||
return mCurFilterStrength;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void onTiezhiItemClick(String name) {
|
||||
//点击某个贴纸
|
||||
if (TextUtils.isEmpty(name))
|
||||
@@ -429,11 +401,9 @@ public class Beauty360ViewHolder extends AbsViewHolder implements
|
||||
if (mEffectListener != null) {
|
||||
mEffectListener.onTieZhiChanged(name);
|
||||
}
|
||||
mAdapter4Tiezhi.notifyDataSetChanged();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCurTiezhiName() {
|
||||
return mCurTiezhiName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user