Merge branch 'dev_20221020'
@ -19,11 +19,15 @@ import com.faceunity.core.enumeration.FUInputTextureEnum;
|
|||||||
import com.faceunity.core.enumeration.FUTransformMatrixEnum;
|
import com.faceunity.core.enumeration.FUTransformMatrixEnum;
|
||||||
import com.faceunity.core.faceunity.FUAIKit;
|
import com.faceunity.core.faceunity.FUAIKit;
|
||||||
import com.faceunity.core.utils.CameraUtils;
|
import com.faceunity.core.utils.CameraUtils;
|
||||||
|
import com.yunbao.faceunity.data.FaceBeautyDataFactory;
|
||||||
import com.yunbao.faceunity.data.FaceUnityDataFactory;
|
import com.yunbao.faceunity.data.FaceUnityDataFactory;
|
||||||
|
import com.yunbao.faceunity.entity.FaceBeautyBean;
|
||||||
|
import com.yunbao.faceunity.entity.FaceBeautyFilterBean;
|
||||||
import com.yunbao.faceunity.listener.FURendererListener;
|
import com.yunbao.faceunity.listener.FURendererListener;
|
||||||
import com.yunbao.faceunity.ui.FaceUnityView;
|
import com.yunbao.faceunity.ui.FaceUnityView;
|
||||||
import com.yunbao.faceunity.utils.CSVUtils;
|
import com.yunbao.faceunity.utils.CSVUtils;
|
||||||
import com.yunbao.faceunity.utils.FURenderer;
|
import com.yunbao.faceunity.utils.FURenderer;
|
||||||
|
import com.yunbao.faceunity.utils.FaceSPUtils;
|
||||||
import com.yunbao.faceunity.utils.FaceUnityData;
|
import com.yunbao.faceunity.utils.FaceUnityData;
|
||||||
import com.yunbao.faceunity.utils.net.OkHttpUtils;
|
import com.yunbao.faceunity.utils.net.OkHttpUtils;
|
||||||
|
|
||||||
@ -31,6 +35,8 @@ import java.io.File;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import cn.rongcloud.rtc.api.RCRTCEngine;
|
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||||
import cn.rongcloud.rtc.api.callback.IRCRTCVideoOutputFrameListener;
|
import cn.rongcloud.rtc.api.callback.IRCRTCVideoOutputFrameListener;
|
||||||
@ -83,6 +89,7 @@ public class FaceManager implements SensorEventListener {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册长按对比键事件
|
* 注册长按对比键事件
|
||||||
|
*
|
||||||
* @param faceUnityView
|
* @param faceUnityView
|
||||||
*/
|
*/
|
||||||
public void setFaceUnityView(FaceUnityView faceUnityView) {
|
public void setFaceUnityView(FaceUnityView faceUnityView) {
|
||||||
@ -98,6 +105,44 @@ public class FaceManager implements SensorEventListener {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
public void loadConfig(){
|
||||||
|
initFaceBeauty();
|
||||||
|
}
|
||||||
|
public void initFaceBeauty() {
|
||||||
|
FaceBeautyDataFactory faceBeautyDataFactory;
|
||||||
|
faceBeautyDataFactory = new FaceBeautyDataFactory();
|
||||||
|
Map<String, ?> configMap = FaceSPUtils.getInstance().getAll();
|
||||||
|
for (String key : configMap.keySet()) {
|
||||||
|
if ("FilterViewHolder_".equals(key)) {
|
||||||
|
for (FaceBeautyFilterBean filter : faceBeautyDataFactory.getBeautyFilters()) {
|
||||||
|
if (filter.getKey().equals(configMap.get(key))&&!"origin".equals(configMap.get(key))) {
|
||||||
|
faceBeautyDataFactory.onFilterSelected(filter.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get("FilterViewHolder_" + configMap.get(key) + "_val")))/100, filter.getDesRes());
|
||||||
|
Log.i(TAG, "test: 设置滤镜 ="+filter.getKey()+" val = "+configMap.get("FilterViewHolder_" + configMap.get(key) + "_val"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (key.startsWith("BeautySkinViewHolder_")) {
|
||||||
|
String name = key.replace("BeautySkinViewHolder_", "");
|
||||||
|
for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) {
|
||||||
|
if (bean.getKey().equals(name)) {
|
||||||
|
faceBeautyDataFactory.updateParamIntensity(bean.getKey(),Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||||
|
Log.i(TAG, "test: 设置美颜 = "+bean.getKey()+" val = "+configMap.get(key));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if(key.startsWith("BeautyShapeViewHolder")){
|
||||||
|
String name = key.replace("BeautyShapeViewHolder_", "");
|
||||||
|
for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) {
|
||||||
|
if (bean.getKey().equals(name)) {
|
||||||
|
faceBeautyDataFactory.updateParamIntensity(bean.getKey(),Double.parseDouble((String) Objects.requireNonNull(configMap.get(key))));
|
||||||
|
Log.i(TAG, "test: 设置美肤 = "+bean.getKey()+" val = "+configMap.get(key));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监听人脸识别个数
|
* 监听人脸识别个数
|
||||||
|
@ -4,7 +4,6 @@ import android.content.Context;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
@ -66,7 +66,7 @@ public class AnimojiViewHolder extends BaseViewHolder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset(List<? extends BaseBean> list) {
|
public void reset(List<? extends BaseBean> list) {
|
||||||
adapter.del(getName(this));
|
adapter.save(getName(this),"0");
|
||||||
adapter.getAnimojiDataFactory().onAnimojiSelected((AnimojiBean) list.get(0));
|
adapter.getAnimojiDataFactory().onAnimojiSelected((AnimojiBean) list.get(0));
|
||||||
adapter.setSelectPosition(0);
|
adapter.setSelectPosition(0);
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ public class BigHeadViewHolder extends BaseViewHolder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset(List<? extends BaseBean> list) {
|
public void reset(List<? extends BaseBean> list) {
|
||||||
adapter.del(getName(this));
|
adapter.save(getName(this),list.get(0).getKey());
|
||||||
adapter.getPropDataFactory().setPropType(FunctionEnum.BIG_HEAD);
|
adapter.getPropDataFactory().setPropType(FunctionEnum.BIG_HEAD);
|
||||||
adapter.getPropDataFactory().onItemSelected((PropBean) list.get(0));
|
adapter.getPropDataFactory().onItemSelected((PropBean) list.get(0));
|
||||||
adapter.setSelectPosition(0);
|
adapter.setSelectPosition(0);
|
||||||
|
@ -9,6 +9,8 @@ import androidx.annotation.NonNull;
|
|||||||
import com.yunbao.faceunity.R;
|
import com.yunbao.faceunity.R;
|
||||||
import com.yunbao.faceunity.entity.BaseBean;
|
import com.yunbao.faceunity.entity.BaseBean;
|
||||||
import com.yunbao.faceunity.entity.FaceBeautyFilterBean;
|
import com.yunbao.faceunity.entity.FaceBeautyFilterBean;
|
||||||
|
import com.yunbao.faceunity.seekbar.DiscreteSeekBar;
|
||||||
|
import com.yunbao.faceunity.utils.SeekBarUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -18,6 +20,7 @@ import java.util.List;
|
|||||||
public class FilterViewHolder extends BaseViewHolder {
|
public class FilterViewHolder extends BaseViewHolder {
|
||||||
private ImageView icon;
|
private ImageView icon;
|
||||||
private TextView title;
|
private TextView title;
|
||||||
|
private String KEY_VAL;
|
||||||
|
|
||||||
public FilterViewHolder(@NonNull View itemView) {
|
public FilterViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
@ -28,6 +31,28 @@ public class FilterViewHolder extends BaseViewHolder {
|
|||||||
adapter.getFaceBeautyDataFactory().onFilterSelected(bean.getKey(), bean.getIntensity(), bean.getDesRes());
|
adapter.getFaceBeautyDataFactory().onFilterSelected(bean.getKey(), bean.getIntensity(), bean.getDesRes());
|
||||||
setSelectPosition(getAdapterPosition());
|
setSelectPosition(getAdapterPosition());
|
||||||
saveData();
|
saveData();
|
||||||
|
if("origin".equals(bean.getKey())){
|
||||||
|
adapter.hideSeekBar();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
adapter.showSeekBar();
|
||||||
|
adapter.getSeekBar().setMax(100);
|
||||||
|
adapter.getSeekBar().setTag(bean);
|
||||||
|
adapter.getSeekBar().setOnProgressChangeListener(new DiscreteSeekBar.OnSimpleProgressChangeListener(){
|
||||||
|
@Override
|
||||||
|
public void onProgressChanged(DiscreteSeekBar seekBar, int value, boolean fromUser) {
|
||||||
|
super.onProgressChanged(seekBar, value, fromUser);
|
||||||
|
KEY_VAL=getName(FilterViewHolder.this)+((BaseBean)seekBar.getTag()).getKey()+"_val";
|
||||||
|
double toValue = SeekBarUtils.Companion.seekToValue(1, value, seekBar.getMin());
|
||||||
|
adapter.getFaceBeautyDataFactory().updateFilterIntensity(toValue);
|
||||||
|
adapter.save(KEY_VAL,value+"");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if(adapter.getString(KEY_VAL)==null) {
|
||||||
|
adapter.getSeekBar().setProgress((int) (bean.getIntensity() * 100));
|
||||||
|
}else{
|
||||||
|
adapter.getSeekBar().setProgress(Integer.parseInt(adapter.getString(KEY_VAL)));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,6 +72,7 @@ public class FilterViewHolder extends BaseViewHolder {
|
|||||||
@Override
|
@Override
|
||||||
public boolean loadData() {
|
public boolean loadData() {
|
||||||
FaceBeautyFilterBean bean = (FaceBeautyFilterBean) itemView.getTag();
|
FaceBeautyFilterBean bean = (FaceBeautyFilterBean) itemView.getTag();
|
||||||
|
KEY_VAL=getName(FilterViewHolder.this)+bean.getKey()+"_val";
|
||||||
String val = adapter.getString(getName(this));
|
String val = adapter.getString(getName(this));
|
||||||
if (val == null) {
|
if (val == null) {
|
||||||
return false;
|
return false;
|
||||||
@ -56,6 +82,9 @@ public class FilterViewHolder extends BaseViewHolder {
|
|||||||
}
|
}
|
||||||
icon.setSelected(true);
|
icon.setSelected(true);
|
||||||
title.setSelected(true);
|
title.setSelected(true);
|
||||||
|
if(adapter.getString(KEY_VAL)!=null) {
|
||||||
|
bean.setIntensity(Double.parseDouble(adapter.getString(KEY_VAL))/100);
|
||||||
|
}
|
||||||
adapter.getFaceBeautyDataFactory().onFilterSelected(bean.getKey(), bean.getIntensity(), bean.getDesRes());
|
adapter.getFaceBeautyDataFactory().onFilterSelected(bean.getKey(), bean.getIntensity(), bean.getDesRes());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -68,8 +97,14 @@ public class FilterViewHolder extends BaseViewHolder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset(List<? extends BaseBean> list) {
|
public void reset(List<? extends BaseBean> list) {
|
||||||
adapter.del(getName(this));
|
FaceBeautyFilterBean bean = (FaceBeautyFilterBean) list.get(0);
|
||||||
itemView.callOnClick();
|
for (BaseBean baseBean : list) {
|
||||||
|
String key=getName(this)+baseBean.getKey()+"_val";
|
||||||
|
adapter.save(key,"40");
|
||||||
|
}
|
||||||
|
adapter.hideSeekBar();
|
||||||
|
adapter.save(getName(this),bean.getKey());
|
||||||
|
adapter.getFaceBeautyDataFactory().onFilterSelected(bean.getKey(), bean.getIntensity(), bean.getDesRes());
|
||||||
adapter.setSelectPosition(0);
|
adapter.setSelectPosition(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ public class FineStickerViewHolder extends BaseViewHolder implements StickerDown
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset(List<? extends BaseBean> list) {
|
public void reset(List<? extends BaseBean> list) {
|
||||||
adapter.del(getName(this));
|
adapter.save(getName(this),list.get(0).getKey());
|
||||||
itemView.callOnClick();
|
itemView.callOnClick();
|
||||||
adapter.setSelectPosition(0);
|
adapter.setSelectPosition(0);
|
||||||
}
|
}
|
||||||
|
@ -115,11 +115,10 @@ public class MakeupCustomItemViewHolder extends BaseViewHolder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset(List<? extends BaseBean> list) {
|
public void reset(List<? extends BaseBean> list) {
|
||||||
adapter.del(getName(this));
|
adapter.save(getName(this),list.get(0).getKey());
|
||||||
for (BaseBean bean : list) {
|
for (BaseBean bean : list) {
|
||||||
adapter.del(getName(this) + bean.getKey() + "_val");
|
adapter.del(getName(this) + bean.getKey() + "_val");
|
||||||
}
|
}
|
||||||
itemView.callOnClick();
|
|
||||||
adapter.setSelectPosition(0);
|
adapter.setSelectPosition(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ public class MakeupViewHolder extends BaseViewHolder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset(List<? extends BaseBean>list) {
|
public void reset(List<? extends BaseBean>list) {
|
||||||
adapter.del(getName(this));
|
adapter.save(getName(this),list.get(0).getKey());
|
||||||
FaceSPUtils.getInstance().delStart("MakeupCustomItemViewHolder");
|
FaceSPUtils.getInstance().delStart("MakeupCustomItemViewHolder");
|
||||||
adapter.getMakeupDataFactory().onMakeupCombinationSelected((MakeupCombinationBean) list.get(0));
|
adapter.getMakeupDataFactory().onMakeupCombinationSelected((MakeupCombinationBean) list.get(0));
|
||||||
adapter.getMakeupDataFactory().clearAll();
|
adapter.getMakeupDataFactory().clearAll();
|
||||||
|
@ -70,7 +70,7 @@ public class StickerViewHolder extends BaseViewHolder{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset(List<? extends BaseBean> list) {
|
public void reset(List<? extends BaseBean> list) {
|
||||||
adapter.del(getName(this));
|
adapter.save(getName(this),list.get(0).getKey());
|
||||||
adapter.getPropDataFactory().setPropType(FunctionEnum.STICKER);
|
adapter.getPropDataFactory().setPropType(FunctionEnum.STICKER);
|
||||||
adapter.getPropDataFactory().onItemSelected((PropBean) list.get(0));
|
adapter.getPropDataFactory().onItemSelected((PropBean) list.get(0));
|
||||||
adapter.setSelectPosition(0);
|
adapter.setSelectPosition(0);
|
||||||
|
@ -46,7 +46,9 @@ public class StyleViewHolder extends BaseViewHolder{
|
|||||||
BaseBean bean= (BaseBean) itemView.getTag();
|
BaseBean bean= (BaseBean) itemView.getTag();
|
||||||
String val = adapter.getString(getName(this));
|
String val = adapter.getString(getName(this));
|
||||||
if(val==null){
|
if(val==null){
|
||||||
return false;
|
icon.setSelected(false);
|
||||||
|
title.setSelected(false);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
if(!val.equals(bean.getKey())){
|
if(!val.equals(bean.getKey())){
|
||||||
return false;
|
return false;
|
||||||
@ -66,8 +68,9 @@ public class StyleViewHolder extends BaseViewHolder{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset(List<? extends BaseBean> list) {
|
public void reset(List<? extends BaseBean> list) {
|
||||||
adapter.del(getName(this));
|
// adapter.save(getName(this),list.get(0).getKey());
|
||||||
itemView.callOnClick();
|
|
||||||
adapter.setSelectPosition(0);
|
adapter.setSelectPosition(0);
|
||||||
|
adapter.del(getName(this));
|
||||||
|
adapter.getFaceBeautyDataFactory().onStyleSelected(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,19 @@ public class FaceBeautyDataFactory extends AbstractFaceBeautyDataFactory {
|
|||||||
public FaceBeautyDataFactory(FaceBeautyListener listener) {
|
public FaceBeautyDataFactory(FaceBeautyListener listener) {
|
||||||
mFaceBeautyListener = listener;
|
mFaceBeautyListener = listener;
|
||||||
}
|
}
|
||||||
|
public FaceBeautyDataFactory(){
|
||||||
|
mFaceBeautyListener=new FaceBeautyListener() {
|
||||||
|
@Override
|
||||||
|
public void onFilterSelected(int res) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFaceBeautyEnable(boolean enable) {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,7 +4,6 @@ import android.content.Context;
|
|||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@ -15,10 +14,12 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
|||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.google.android.material.tabs.TabLayout;
|
import com.google.android.material.tabs.TabLayout;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.faceunity.R;
|
import com.yunbao.faceunity.R;
|
||||||
import com.yunbao.faceunity.adapters.ContainerRecyclerAdapter;
|
import com.yunbao.faceunity.adapters.ContainerRecyclerAdapter;
|
||||||
import com.yunbao.faceunity.adapters.MenuGroupRecyclerAdapter;
|
import com.yunbao.faceunity.adapters.MenuGroupRecyclerAdapter;
|
||||||
|
import com.yunbao.faceunity.adapters.vh.StyleViewHolder;
|
||||||
import com.yunbao.faceunity.data.FaceParam;
|
import com.yunbao.faceunity.data.FaceParam;
|
||||||
import com.yunbao.faceunity.data.FineStickerDataFactory;
|
import com.yunbao.faceunity.data.FineStickerDataFactory;
|
||||||
import com.yunbao.faceunity.entity.BaseBean;
|
import com.yunbao.faceunity.entity.BaseBean;
|
||||||
@ -33,6 +34,7 @@ import com.yunbao.faceunity.repo.FaceBeautySource;
|
|||||||
import com.yunbao.faceunity.repo.MakeupSource;
|
import com.yunbao.faceunity.repo.MakeupSource;
|
||||||
import com.yunbao.faceunity.repo.PropSource;
|
import com.yunbao.faceunity.repo.PropSource;
|
||||||
import com.yunbao.faceunity.seekbar.DiscreteSeekBar;
|
import com.yunbao.faceunity.seekbar.DiscreteSeekBar;
|
||||||
|
import com.yunbao.faceunity.utils.FaceSPUtils;
|
||||||
import com.yunbao.faceunity.utils.net.StickerDownloadHelper;
|
import com.yunbao.faceunity.utils.net.StickerDownloadHelper;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -57,6 +59,7 @@ public class FaceUnityView extends LinearLayout implements StickerDownloadHelper
|
|||||||
private DiscreteSeekBar seekBar;
|
private DiscreteSeekBar seekBar;
|
||||||
private IFaceUnityInter iFaceUnityInter;
|
private IFaceUnityInter iFaceUnityInter;
|
||||||
private ConstraintLayout titleLayout;
|
private ConstraintLayout titleLayout;
|
||||||
|
private static final String TAG = "美颜";
|
||||||
|
|
||||||
public FaceUnityView(Context context) {
|
public FaceUnityView(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@ -104,6 +107,7 @@ public class FaceUnityView extends LinearLayout implements StickerDownloadHelper
|
|||||||
initMenuGroup();
|
initMenuGroup();
|
||||||
setContainerRecycler(new ArrayList<>());
|
setContainerRecycler(new ArrayList<>());
|
||||||
initViewClick();
|
initViewClick();
|
||||||
|
gotoFaceBeauty();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -168,6 +172,25 @@ public class FaceUnityView extends LinearLayout implements StickerDownloadHelper
|
|||||||
menuDiy.setVisibility(GONE);
|
menuDiy.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目前只需要美颜功能,进入后直奔美颜
|
||||||
|
*/
|
||||||
|
private void gotoFaceBeauty() {
|
||||||
|
LinkedHashMap<Integer, Integer> map = new LinkedHashMap<>();
|
||||||
|
map.put(R.string.beauty_radio_skin_beauty, FaceParam.FACE_BEAUTY_SKIN);
|
||||||
|
map.put(R.string.beauty_radio_face_shape, FaceParam.FACE_BEAUTY_SHAPE);
|
||||||
|
map.put(R.string.beauty_radio_filter, FaceParam.FACE_BEAUTY_FILTER);
|
||||||
|
map.put(R.string.beauty_radio_style, FaceParam.FACE_BEAUTY_STYLE);
|
||||||
|
setContainerRecycler(FaceBeautySource.buildSkinParams());
|
||||||
|
changeRecyclerItemCount(2);
|
||||||
|
setTab(createTabs(map));
|
||||||
|
menuGroup.setVisibility(GONE);
|
||||||
|
titleLayout.setVisibility(GONE);
|
||||||
|
back.setVisibility(GONE);
|
||||||
|
menu2Back.setVisibility(GONE);
|
||||||
|
menu2.setVisibility(VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置主菜单
|
* 配置主菜单
|
||||||
*/
|
*/
|
||||||
@ -287,12 +310,26 @@ public class FaceUnityView extends LinearLayout implements StickerDownloadHelper
|
|||||||
tabLayout.removeAllTabs();
|
tabLayout.removeAllTabs();
|
||||||
for (TabLayout.Tab tab : tabs) {
|
for (TabLayout.Tab tab : tabs) {
|
||||||
tabLayout.addTab(tab);
|
tabLayout.addTab(tab);
|
||||||
|
if (tab.getTag() instanceof Integer) {
|
||||||
|
if (FaceSPUtils.getInstance().getString(StyleViewHolder.class.getSimpleName() + "_") != null && (int) tab.getTag() == FaceParam.FACE_BEAUTY_STYLE) {
|
||||||
|
ToastUtil.show("请先重置风格推荐");
|
||||||
|
tab.select();
|
||||||
|
changeRecyclerItemCount(5);
|
||||||
|
setContainerRecycler(FaceBeautySource.buildStylesParams());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onTabSelected(TabLayout.Tab tab) {
|
public void onTabSelected(TabLayout.Tab tab) {
|
||||||
Object tabTag = tab.getTag();
|
Object tabTag = tab.getTag();
|
||||||
if (tabTag instanceof Integer) {
|
if (tabTag instanceof Integer) {
|
||||||
|
if (FaceSPUtils.getInstance().getString(StyleViewHolder.class.getSimpleName() + "_") != null && (int) tab.getTag() < FaceParam.FACE_BEAUTY_STYLE) {
|
||||||
|
ToastUtil.show("请先重置风格推荐");
|
||||||
|
tabLayout.getTabAt(3).select();
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch ((int) tab.getTag()) {
|
switch ((int) tab.getTag()) {
|
||||||
case FaceParam.FACE_BEAUTY_SKIN:
|
case FaceParam.FACE_BEAUTY_SKIN:
|
||||||
changeRecyclerItemCount(2);
|
changeRecyclerItemCount(2);
|
||||||
@ -407,7 +444,8 @@ public class FaceUnityView extends LinearLayout implements StickerDownloadHelper
|
|||||||
containerRecycler.setLayoutManager(new GridLayoutManager(mContext, 2));
|
containerRecycler.setLayoutManager(new GridLayoutManager(mContext, 2));
|
||||||
containerRecycler.setAdapter(containerAdapter);
|
containerRecycler.setAdapter(containerAdapter);
|
||||||
}
|
}
|
||||||
titleLayout.setVisibility(title.getVisibility()==GONE?INVISIBLE:VISIBLE);
|
// titleLayout.setVisibility(title.getVisibility()==GONE?INVISIBLE:VISIBLE);
|
||||||
|
// Log.i(TAG, "setContainerRecycler: " + list.size());
|
||||||
containerAdapter.setList(list);
|
containerAdapter.setList(list);
|
||||||
containerAdapter.notifyDataSetChanged();
|
containerAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ public class FURenderer extends IFURenderer {
|
|||||||
private FURenderKit mFURenderKit;
|
private FURenderKit mFURenderKit;
|
||||||
|
|
||||||
/* AI道具*/
|
/* AI道具*/
|
||||||
private String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor.bundle";
|
private String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor_lite.bundle";
|
||||||
private String BUNDLE_AI_HUMAN = "model" + File.separator + "ai_human_processor.bundle";
|
private String BUNDLE_AI_HUMAN = "model" + File.separator + "ai_human_processor.bundle";
|
||||||
|
|
||||||
/* GL 线程 ID */
|
/* GL 线程 ID */
|
||||||
@ -87,8 +87,8 @@ public class FURenderer extends IFURenderer {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setup(Context context) {
|
public void setup(Context context) {
|
||||||
FURenderManager.setKitDebug(FULogger.LogLevel.OFF);
|
FURenderManager.setKitDebug(FULogger.LogLevel.INFO);
|
||||||
FURenderManager.setCoreDebug(FULogger.LogLevel.OFF);
|
FURenderManager.setCoreDebug(FULogger.LogLevel.INFO);
|
||||||
FURenderManager.registerFURender(context, Authpack.A(), new OperateCallback() {
|
FURenderManager.registerFURender(context, Authpack.A(), new OperateCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int i, @NotNull String s) {
|
public void onSuccess(int i, @NotNull String s) {
|
||||||
|
@ -5,6 +5,8 @@ import android.content.SharedPreferences;
|
|||||||
|
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class FaceSPUtils {
|
public class FaceSPUtils {
|
||||||
private static FaceSPUtils utils;
|
private static FaceSPUtils utils;
|
||||||
private SharedPreferences mSharedPreferences;
|
private SharedPreferences mSharedPreferences;
|
||||||
@ -38,4 +40,7 @@ public class FaceSPUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public Map<String, ?> getAll(){
|
||||||
|
return mSharedPreferences.getAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public class FaceUnityConfig {
|
|||||||
|
|
||||||
/************************** 算法Model ******************************/
|
/************************** 算法Model ******************************/
|
||||||
// 人脸识别
|
// 人脸识别
|
||||||
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor.bundle";
|
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor_lite.bundle";
|
||||||
// 手势
|
// 手势
|
||||||
public static String BUNDLE_AI_HAND = "model" + File.separator + "ai_hand_processor.bundle";
|
public static String BUNDLE_AI_HAND = "model" + File.separator + "ai_hand_processor.bundle";
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@
|
|||||||
android:id="@+id/titleLayout"
|
android:id="@+id/titleLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
>
|
>
|
||||||
|
|
||||||
@ -178,11 +179,11 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility="gone">
|
android:visibility="visible">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="25dp"
|
android:layout_height="35dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
@ -202,7 +203,7 @@
|
|||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
@ -214,6 +215,8 @@
|
|||||||
app:tabMaxWidth="100dp"
|
app:tabMaxWidth="100dp"
|
||||||
app:tabMode="scrollable"
|
app:tabMode="scrollable"
|
||||||
app:tabSelectedTextColor="#F6F7FB"
|
app:tabSelectedTextColor="#F6F7FB"
|
||||||
|
app:tabIndicatorColor="#F6F7FB"
|
||||||
|
app:tabIndicatorFullWidth="false"
|
||||||
app:tabTextColor="#9A9A9A" />
|
app:tabTextColor="#9A9A9A" />
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 422 B After Width: | Height: | Size: 390 B |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 276 KiB After Width: | Height: | Size: 276 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 128 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 3.8 KiB |