Compare commits
151 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee5d3bb028 | ||
|
|
1346a1de52 | ||
|
|
9fa0109c2e | ||
| 94a96ba91a | |||
|
|
5006b8414e | ||
|
|
5eac127142 | ||
|
|
8e89fdfa65 | ||
| 5f210af804 | |||
|
|
574d93d608 | ||
| 09687fb318 | |||
|
|
64bfc37bd7 | ||
|
|
a632e48d38 | ||
|
|
5570d29f32 | ||
|
|
c440b58981 | ||
|
|
6efd2898d7 | ||
|
|
a7c48675af | ||
|
|
7e9d2917b6 | ||
|
|
cb118e4a9f | ||
|
|
6e582829b2 | ||
| 30902825d6 | |||
| a4c56c7e28 | |||
| 26db1514d8 | |||
| 40cd824389 | |||
| fd687ab2d5 | |||
|
|
bab377a202 | ||
| f1554f8201 | |||
| 81933f0ad7 | |||
|
|
a16ae482a8 | ||
|
|
b688e671c1 | ||
| 476caa4be3 | |||
| d04a44044c | |||
| b394a8f9b5 | |||
| 07ae094bed | |||
|
|
4be0148324 | ||
| 025c8d74aa | |||
| f60aeaa35e | |||
| bf8e6de236 | |||
| 2c74fb78d9 | |||
| 78c4c455a8 | |||
| 135f8f5be3 | |||
| 32832654ef | |||
| 92ec8a3044 | |||
| cccde7a3f8 | |||
| 6efcb75c31 | |||
|
|
2e2e5c7ec0 | ||
|
|
c8ab6ffa15 | ||
|
|
8b180ce664 | ||
| fb0e35196c | |||
| 92233e1298 | |||
|
|
2891c3bf14 | ||
| 0f236f743d | |||
| 1d8cdf250d | |||
| 875fa33625 | |||
| 9c629937da | |||
| 38d2e0df57 | |||
|
|
c725be7bbc | ||
|
|
787d50c5b4 | ||
|
|
af7a8965a7 | ||
|
|
d8d29dd2ad | ||
| 22225eece6 | |||
| dad3f85864 | |||
| c83db0ec77 | |||
|
|
0b601738f7 | ||
| 2eba951ad1 | |||
| 0d6bf8adaa | |||
| bc87e143c8 | |||
|
|
92dfe89213 | ||
|
|
b0ba5b7d57 | ||
|
|
1959a7933b | ||
|
|
1ce5ac2c5f | ||
| 003f6622b9 | |||
|
|
7e00a5e71e | ||
|
|
172b37ece2 | ||
| b4e048bf74 | |||
| a0bff8a019 | |||
| 5db1021ecc | |||
|
|
7fabc4f1b6 | ||
| 6b7fd4d53e | |||
|
|
ab6e578336 | ||
|
|
e0861ff7eb | ||
| f9fd849ce0 | |||
|
|
60a132489a | ||
| a82d3984fa | |||
| ed97955d90 | |||
| 3be5f8b0cd | |||
| d2977fae85 | |||
| be0f81e059 | |||
|
|
099cc0d83d | ||
|
|
90e249e2d7 | ||
| 38a269ae1c | |||
| 77f5d89f28 | |||
|
|
1ecad0f89f | ||
|
|
c2d2687441 | ||
| f51237f04a | |||
|
|
5f27031620 | ||
|
|
e0a398a9fd | ||
|
|
05d4b29991 | ||
| dedb30d297 | |||
| c9743f28a3 | |||
| 512708284c | |||
|
|
d4d101843b | ||
|
|
11aeb95fd7 | ||
| 99e07bf861 | |||
| be735d9ca6 | |||
| 3dd9f3f551 | |||
|
|
f25f61b78c | ||
| 461a23a790 | |||
| 3c6b4d13a9 | |||
| 231ffcac84 | |||
|
|
845be4d795 | ||
| 6f40ff969d | |||
| 5559dd7eb2 | |||
|
|
5ec6a14ba1 | ||
| 1e2d146e74 | |||
|
|
217c5f3115 | ||
|
|
a09cbf4776 | ||
| 4330ee9d57 | |||
|
|
ad785f2b39 | ||
| 1501858a7d | |||
|
|
a49db975b1 | ||
| 79aadad668 | |||
| e4ba0b7f80 | |||
| ca03a8f23e | |||
|
|
4b5f3a9560 | ||
| 97fc07db0c | |||
| 28137615df | |||
| 00dfd38be5 | |||
| 99d32c03b2 | |||
|
|
80f23f4cc3 | ||
|
|
234756149c | ||
| ec1656fbbd | |||
|
|
baa596158d | ||
|
|
94c5f4b809 | ||
|
|
91743ecd3d | ||
| 0d12df93ab | |||
| 4070c7717b | |||
|
|
5bf95c28d2 | ||
| 09f74c3881 | |||
|
|
5f44473c49 | ||
|
|
842ef05dc7 | ||
| 814e45952c | |||
|
|
0eb6b68b5c | ||
|
|
47b6f9b45f | ||
| 780f9a3328 | |||
| fd038da6d7 | |||
| 9503f4a6c7 | |||
|
|
b8ff6d56ae | ||
| e352db3ced | |||
| 2cbc018764 | |||
|
|
9e02ad5119 | ||
|
|
2d122a93b7 |
@@ -19,11 +19,15 @@ import com.faceunity.core.enumeration.FUInputTextureEnum;
|
||||
import com.faceunity.core.enumeration.FUTransformMatrixEnum;
|
||||
import com.faceunity.core.faceunity.FUAIKit;
|
||||
import com.faceunity.core.utils.CameraUtils;
|
||||
import com.yunbao.faceunity.data.FaceBeautyDataFactory;
|
||||
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.ui.FaceUnityView;
|
||||
import com.yunbao.faceunity.utils.CSVUtils;
|
||||
import com.yunbao.faceunity.utils.FURenderer;
|
||||
import com.yunbao.faceunity.utils.FaceSPUtils;
|
||||
import com.yunbao.faceunity.utils.FaceUnityData;
|
||||
import com.yunbao.faceunity.utils.net.OkHttpUtils;
|
||||
|
||||
@@ -31,6 +35,8 @@ import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||
import cn.rongcloud.rtc.api.callback.IRCRTCVideoOutputFrameListener;
|
||||
@@ -83,6 +89,7 @@ public class FaceManager implements SensorEventListener {
|
||||
|
||||
/**
|
||||
* 注册长按对比键事件
|
||||
*
|
||||
* @param 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.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
@@ -66,7 +66,7 @@ public class AnimojiViewHolder extends BaseViewHolder {
|
||||
|
||||
@Override
|
||||
public void reset(List<? extends BaseBean> list) {
|
||||
adapter.del(getName(this));
|
||||
adapter.save(getName(this),"0");
|
||||
adapter.getAnimojiDataFactory().onAnimojiSelected((AnimojiBean) list.get(0));
|
||||
adapter.setSelectPosition(0);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,8 @@ public class BeautyShapeViewHolder extends BaseViewHolder {
|
||||
super.onProgressChanged(seekBar, value, fromUser);
|
||||
FaceBeautyBean bean = (FaceBeautyBean) itemView.getTag();
|
||||
double toValue = SeekBarUtils.Companion.seekToValue(bean.getModelAttributeData().getMaxRange(), value, seekBar.getMin());
|
||||
BeautyShapeViewHolder.this.value.setText(String.format("%.1f", toValue));
|
||||
BeautyShapeViewHolder.this.value.setTag(String.format("%.1f", toValue));
|
||||
BeautyShapeViewHolder.this.value.setText(value+"");
|
||||
adapter.getFaceBeautyDataFactory().updateParamIntensity(bean.getKey(), toValue);
|
||||
saveData();
|
||||
}
|
||||
@@ -80,7 +81,7 @@ public class BeautyShapeViewHolder extends BaseViewHolder {
|
||||
@Override
|
||||
public void saveData() {
|
||||
FaceBeautyBean bean = (FaceBeautyBean) itemView.getTag();
|
||||
adapter.save(getName(this)+bean.getKey(), (String) value.getText());
|
||||
adapter.save(getName(this)+bean.getKey(), (String) value.getTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,7 +36,8 @@ public class BeautySkinViewHolder extends BaseViewHolder{
|
||||
super.onProgressChanged(seekBar, value, fromUser);
|
||||
FaceBeautyBean bean = (FaceBeautyBean) itemView.getTag();
|
||||
double toValue = SeekBarUtils.Companion.seekToValue(bean.getModelAttributeData().getMaxRange(), value, seekBar.getMin());
|
||||
BeautySkinViewHolder.this.value.setText(String.format("%.1f",toValue));
|
||||
BeautySkinViewHolder.this.value.setTag(String.format("%.1f",toValue));
|
||||
BeautySkinViewHolder.this.value.setText(value+"");
|
||||
adapter.getFaceBeautyDataFactory().updateParamIntensity(bean.getKey(),toValue);
|
||||
saveData();
|
||||
}
|
||||
@@ -80,7 +81,7 @@ public class BeautySkinViewHolder extends BaseViewHolder{
|
||||
@Override
|
||||
public void saveData() {
|
||||
String key = ((FaceBeautyBean)itemView.getTag()).getKey();
|
||||
String val= (String) value.getText();
|
||||
String val= (String) value.getTag();
|
||||
adapter.save(getName(this)+key,val);
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ public class BigHeadViewHolder extends BaseViewHolder {
|
||||
|
||||
@Override
|
||||
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().onItemSelected((PropBean) list.get(0));
|
||||
adapter.setSelectPosition(0);
|
||||
|
||||
@@ -9,6 +9,8 @@ import androidx.annotation.NonNull;
|
||||
import com.yunbao.faceunity.R;
|
||||
import com.yunbao.faceunity.entity.BaseBean;
|
||||
import com.yunbao.faceunity.entity.FaceBeautyFilterBean;
|
||||
import com.yunbao.faceunity.seekbar.DiscreteSeekBar;
|
||||
import com.yunbao.faceunity.utils.SeekBarUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -18,6 +20,7 @@ import java.util.List;
|
||||
public class FilterViewHolder extends BaseViewHolder {
|
||||
private ImageView icon;
|
||||
private TextView title;
|
||||
private String KEY_VAL;
|
||||
|
||||
public FilterViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
@@ -28,6 +31,28 @@ public class FilterViewHolder extends BaseViewHolder {
|
||||
adapter.getFaceBeautyDataFactory().onFilterSelected(bean.getKey(), bean.getIntensity(), bean.getDesRes());
|
||||
setSelectPosition(getAdapterPosition());
|
||||
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
|
||||
public boolean loadData() {
|
||||
FaceBeautyFilterBean bean = (FaceBeautyFilterBean) itemView.getTag();
|
||||
KEY_VAL=getName(FilterViewHolder.this)+bean.getKey()+"_val";
|
||||
String val = adapter.getString(getName(this));
|
||||
if (val == null) {
|
||||
return false;
|
||||
@@ -54,8 +80,14 @@ public class FilterViewHolder extends BaseViewHolder {
|
||||
if (!val.equals(bean.getKey())) {
|
||||
return false;
|
||||
}
|
||||
if(!"origin".equals(bean.getKey())){
|
||||
adapter.showSeekBar();
|
||||
}
|
||||
icon.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());
|
||||
return true;
|
||||
}
|
||||
@@ -68,8 +100,14 @@ public class FilterViewHolder extends BaseViewHolder {
|
||||
|
||||
@Override
|
||||
public void reset(List<? extends BaseBean> list) {
|
||||
adapter.del(getName(this));
|
||||
itemView.callOnClick();
|
||||
FaceBeautyFilterBean bean = (FaceBeautyFilterBean) list.get(0);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class FineStickerViewHolder extends BaseViewHolder implements StickerDown
|
||||
|
||||
@Override
|
||||
public void reset(List<? extends BaseBean> list) {
|
||||
adapter.del(getName(this));
|
||||
adapter.save(getName(this),list.get(0).getKey());
|
||||
itemView.callOnClick();
|
||||
adapter.setSelectPosition(0);
|
||||
}
|
||||
|
||||
@@ -115,11 +115,10 @@ public class MakeupCustomItemViewHolder extends BaseViewHolder {
|
||||
|
||||
@Override
|
||||
public void reset(List<? extends BaseBean> list) {
|
||||
adapter.del(getName(this));
|
||||
adapter.save(getName(this),list.get(0).getKey());
|
||||
for (BaseBean bean : list) {
|
||||
adapter.del(getName(this) + bean.getKey() + "_val");
|
||||
}
|
||||
itemView.callOnClick();
|
||||
adapter.setSelectPosition(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ public class MakeupViewHolder extends BaseViewHolder {
|
||||
|
||||
@Override
|
||||
public void reset(List<? extends BaseBean>list) {
|
||||
adapter.del(getName(this));
|
||||
adapter.save(getName(this),list.get(0).getKey());
|
||||
FaceSPUtils.getInstance().delStart("MakeupCustomItemViewHolder");
|
||||
adapter.getMakeupDataFactory().onMakeupCombinationSelected((MakeupCombinationBean) list.get(0));
|
||||
adapter.getMakeupDataFactory().clearAll();
|
||||
|
||||
@@ -70,7 +70,7 @@ public class StickerViewHolder extends BaseViewHolder{
|
||||
|
||||
@Override
|
||||
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().onItemSelected((PropBean) list.get(0));
|
||||
adapter.setSelectPosition(0);
|
||||
|
||||
@@ -46,7 +46,9 @@ public class StyleViewHolder extends BaseViewHolder{
|
||||
BaseBean bean= (BaseBean) itemView.getTag();
|
||||
String val = adapter.getString(getName(this));
|
||||
if(val==null){
|
||||
return false;
|
||||
icon.setSelected(false);
|
||||
title.setSelected(false);
|
||||
return true;
|
||||
}
|
||||
if(!val.equals(bean.getKey())){
|
||||
return false;
|
||||
@@ -66,8 +68,9 @@ public class StyleViewHolder extends BaseViewHolder{
|
||||
|
||||
@Override
|
||||
public void reset(List<? extends BaseBean> list) {
|
||||
adapter.del(getName(this));
|
||||
itemView.callOnClick();
|
||||
// adapter.save(getName(this),list.get(0).getKey());
|
||||
adapter.setSelectPosition(0);
|
||||
adapter.del(getName(this));
|
||||
adapter.getFaceBeautyDataFactory().onStyleSelected(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,6 +85,19 @@ public class FaceBeautyDataFactory extends AbstractFaceBeautyDataFactory {
|
||||
public FaceBeautyDataFactory(FaceBeautyListener 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.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
@@ -15,10 +14,12 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.faceunity.R;
|
||||
import com.yunbao.faceunity.adapters.ContainerRecyclerAdapter;
|
||||
import com.yunbao.faceunity.adapters.MenuGroupRecyclerAdapter;
|
||||
import com.yunbao.faceunity.adapters.vh.StyleViewHolder;
|
||||
import com.yunbao.faceunity.data.FaceParam;
|
||||
import com.yunbao.faceunity.data.FineStickerDataFactory;
|
||||
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.PropSource;
|
||||
import com.yunbao.faceunity.seekbar.DiscreteSeekBar;
|
||||
import com.yunbao.faceunity.utils.FaceSPUtils;
|
||||
import com.yunbao.faceunity.utils.net.StickerDownloadHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -57,6 +59,7 @@ public class FaceUnityView extends LinearLayout implements StickerDownloadHelper
|
||||
private DiscreteSeekBar seekBar;
|
||||
private IFaceUnityInter iFaceUnityInter;
|
||||
private ConstraintLayout titleLayout;
|
||||
private static final String TAG = "美颜";
|
||||
|
||||
public FaceUnityView(Context context) {
|
||||
super(context);
|
||||
@@ -104,6 +107,7 @@ public class FaceUnityView extends LinearLayout implements StickerDownloadHelper
|
||||
initMenuGroup();
|
||||
setContainerRecycler(new ArrayList<>());
|
||||
initViewClick();
|
||||
gotoFaceBeauty();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,6 +172,25 @@ public class FaceUnityView extends LinearLayout implements StickerDownloadHelper
|
||||
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();
|
||||
for (TabLayout.Tab tab : tabs) {
|
||||
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() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
Object tabTag = tab.getTag();
|
||||
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()) {
|
||||
case FaceParam.FACE_BEAUTY_SKIN:
|
||||
changeRecyclerItemCount(2);
|
||||
@@ -407,7 +444,8 @@ public class FaceUnityView extends LinearLayout implements StickerDownloadHelper
|
||||
containerRecycler.setLayoutManager(new GridLayoutManager(mContext, 2));
|
||||
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.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class FURenderer extends IFURenderer {
|
||||
private FURenderKit mFURenderKit;
|
||||
|
||||
/* 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";
|
||||
|
||||
/* GL 线程 ID */
|
||||
@@ -87,8 +87,8 @@ public class FURenderer extends IFURenderer {
|
||||
*/
|
||||
@Override
|
||||
public void setup(Context context) {
|
||||
FURenderManager.setKitDebug(FULogger.LogLevel.OFF);
|
||||
FURenderManager.setCoreDebug(FULogger.LogLevel.OFF);
|
||||
FURenderManager.setKitDebug(FULogger.LogLevel.INFO);
|
||||
FURenderManager.setCoreDebug(FULogger.LogLevel.INFO);
|
||||
FURenderManager.registerFURender(context, Authpack.A(), new OperateCallback() {
|
||||
@Override
|
||||
public void onSuccess(int i, @NotNull String s) {
|
||||
|
||||
@@ -5,6 +5,8 @@ import android.content.SharedPreferences;
|
||||
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class FaceSPUtils {
|
||||
private static FaceSPUtils utils;
|
||||
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 ******************************/
|
||||
// 人脸识别
|
||||
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";
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
android:id="@+id/titleLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="16dp"
|
||||
>
|
||||
|
||||
@@ -178,11 +179,11 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
android:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="25dp"
|
||||
android:layout_height="35dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
@@ -202,7 +203,7 @@
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_weight="1">
|
||||
@@ -214,6 +215,8 @@
|
||||
app:tabMaxWidth="100dp"
|
||||
app:tabMode="scrollable"
|
||||
app:tabSelectedTextColor="#F6F7FB"
|
||||
app:tabIndicatorColor="#F6F7FB"
|
||||
app:tabIndicatorFullWidth="false"
|
||||
app:tabTextColor="#9A9A9A" />
|
||||
</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 |