This commit is contained in:
18142669586 2022-07-20 14:40:44 +08:00
parent 3c189f0735
commit c7e03f576c
91 changed files with 23 additions and 2215 deletions

View File

@ -60,5 +60,4 @@ dependencies {
api(name: 'ti-sdk', ext: 'aar')
//common
implementation project(':common')
implementation project(path: ':lib_beauty360')
}

View File

@ -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;
}

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -3,7 +3,10 @@
<color name="colorPrimary">@color/global</color>
<color name="colorPrimaryDark">@color/global</color>
<color name="colorAccent">@color/global</color>
<color name="color_normalitem">#FF0000</color>
<color name="color_white">#ffffff</color>
<color name="color_selectedlitem">#303F9F</color>
<color name="color_yellow">#fffa37</color>
<color name="global">#FF8D41</color>
<color name="background">@color/gray2</color>
<color name="transparent">#00000000</color>

View File

@ -9,9 +9,9 @@ ext {
]
manifestPlaceholders = [
//
serverHost : "https://napi.yaoulive.com",
// serverHost : "https://napi.yaoulive.com",
//
// serverHost : "https://ceshi.yaoulive.com",
serverHost : "https://ceshi.yaoulive.com",
//
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",

View File

@ -1,77 +0,0 @@
apply plugin: 'com.android.library'
apply plugin: 'img-optimizer'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
packagingOptions {
pickFirst "lib/armeabi/libyuvutils.so"
pickFirst "lib/arm64-v8a/libyuvutils.so"
pickFirst "lib/armeabi-v7a/libyuvutils.so"
pickFirst "lib/armeabi/libyuvtools.so"
pickFirst "lib/arm64-v8a/libyuvtools.so"
pickFirst "lib/armeabi-v7a/libyuvtools.so"
exclude "lib/arm64-v8a/libmmcv_api_handgesture.so"
exclude "lib/arm64-v8a/libmmcv_api_express.so"
exclude "lib/arm64-v8a/libMediaEncoder.so"
exclude "lib/arm64-v8a/libarcore_sdk_c.so"
exclude "lib/arm64-v8a/libmediadecoder.so"
exclude "lib/arm64-v8a/libMediaMuxer.so"
exclude "lib/arm64-v8a/libarcore_sdk_jni.so"
exclude "lib/arm64-v8a/libMediaUtils.so"
exclude "lib/arm64-v8a/libcosmosffmpeg.so"
}
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode rootProject.ext.android.versionCode
versionName rootProject.ext.android.versionName
manifestPlaceholders = rootProject.ext.manifestPlaceholders
testInstrumentationRunner "android.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
flavorDimensions "version"
productFlavors {
original {
dimension "version"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
flatDir {
dirs 'libs'
}
mavenCentral()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.dependencies["appcompat-androidx"]
implementation rootProject.ext.dependencies["recyclerview-androidx"]
implementation project(path: ':common')
}

View File

@ -1,16 +0,0 @@
2019-11-01 13:59:28 info: Task optimizeLib_beauty360Release begin:
----------------------------------------
2019-11-01 13:59:28 info: 4 images need to be optimized.
----------------------------------------
2019-11-01 13:59:28 warn: Skipped! /Users/yaling/Documents/bayue/denglong_release4/lib_beauty360/src/main/res/drawable/icon_none.png
----------------------------------------
2019-11-01 13:59:28 info: Succeed! 3464B-->883B, 74.50924% saved! /Users/yaling/Documents/bayue/denglong_release4/lib_beauty360/src/main/res/drawable/icon_none_32.png
----------------------------------------
2019-11-01 13:59:29 info: Succeed! 2943B-->1353B, 54.026505% saved! /Users/yaling/Documents/bayue/denglong_release4/lib_beauty360/src/main/res/drawable-xxhdpi/seek_thumb.png
----------------------------------------
2019-11-01 13:59:29 info: Succeed! 3673B-->2632B, 28.341955% saved! /Users/yaling/Documents/bayue/denglong_release4/lib_beauty360/src/main/res/drawable-xxhdpi/seek_thumb_press.png
----------------------------------------
2019-11-01 13:59:29 info: Total: 4, Succeed: 3, Skipped: 1, Failed: 0, Saved: 5.08984375KB
----------------------------------------
2019-11-01 13:59:29 info: Task optimizeLib_beauty360Release executed successfully.
----------------------------------------

View File

@ -1,21 +0,0 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@ -1,27 +0,0 @@
package com.by.lib_beauty360;
import android.content.Context;
import android.test.platform.app.InstrumentationRegistry;
import android.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.by.lib_beauty360.test", appContext.getPackageName());
}
}

View File

@ -1,14 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.by.lib_beauty360" >
<application
>
<activity
android:name="com.by.lib_beauty360.Beauty360Activity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateAlwaysHidden"
/>
</application>
</manifest>

View File

@ -1,78 +0,0 @@
package com.by.lib_beauty360;
import android.os.Environment;
import java.io.File;
/**
* Created by wh on 2017/3/16.
*/
public class AppConfig {
public static final String SDK_KEY_NEW = "NsWl9ZRt+oHFWVmgwmmGFmoGRyzu7xoF2SFj43Xw0gpqYALgUZ+RY8ATXKGIawejr0LMtnYFfVyqfc8uellQXT+PyZzNB+PCtGBO2yj+5I2PsB2eCXr6qb6zccJxMg2s8Ekj5FEn26mrB3k/FXBFCxG9u6caUqYmvcBLbb17K2eghd8zRlsCZ2PJnqcKUkzB5K4wqXHSzYu2f9xXrPibCNqYUYhpC6eZVqY1/JetMKTPNcyfI522A2CKS6fq/gIEWSirosAIAuZAqhyI7augB/3489uaepcD3pQAjo9MhJqavvNh5He7X2ohV3ZCy4Q+3D1FWJySZl4Jth35+XgV6ErtRaWpUfbujyZ78yAjtUmbewnz1yZVwB/AD+JRd/nNd9agrI/2LmJSW6gSlj2k+ehw8k5SREnJR9EX75dftDc89d49eeB1Dh6fmyipCzjil8MCwulCuG4+OjumfP7/U66NfcSbRZyOMn5FTPBgjZnydycKWJUSEXYhJkCkaaa6Fq4oYM64JTaY5WldWmG+aRktCTYW/BtopPbI/qSY5CJpN+K7Q+ORCxta8LNYQXlVWxEy1A22PxGy8RWvWrwI0ncjnKmCT8Szih222P7ad+8lCA6lHZZx8njfPFAD7tvuxTUPAAkY5t8yvlBMK5rcyIaz09BZQdUOzWqgqg7eamPMVaDzmWOIl9JHlCEC2jLp4CcyqQcDuOAUb/OA/e385CTaqrnTXIe7/TRAqocRmTtHnuwbAgVxv53K9hhPOJ2kSH0hshHP+hRIN3J8Pmqetee46Be/pu0dDGnqYA2v4fp9MHmeuhiTH20K8rViYV64KZVDmOu9mcT9jkVPZwFPQnE/BfV5NOsW83r8FmCQ9ignmOmavsNsTAhsc7Vs75Kc/Jhoj/0K5jpiLTU5ZbhPqIbl1ciFTJHlYHirzfhUotlxGDGWsR7jC56bPXSANHY/9nY8ZnmvADlADjLmlZYqpRhM5Ef8nTntjlAa9bvu92oo6Whn2DQAuBn3v839zqc8WMZYaJY1GmZm0+MQxTf51CQ/KNl0hvW5V59JEPChEVbRG0QjYWcECQvXUCXylokGnBYDwtqBbll7az/JHed7GzPej7AcEXZVg3i2MjOGph+Gn0VRVdfNayCKfWCRaOi3i4P9GxQqNWvPvAnAOVrwBlg9dba7HON9pbl426q64vRiAKGaUvMbIMtKGLVK3kgqKkrUb+uw+Q+vmWc1ijYk24ZtlJ4l9Pwnadxwi8sXJTlr9GqIv63fCs2AQeZnCy38tUP2uifZPM05EwngI0Xu1Md7Tj19Sj6h/KnTyqpIMuMYQuSwmammhj+AQesB49j7NlEdu68kfaJ0PDslOY8voY/FwCRBdNTDep3OAS7pLYccp79x0R9z25kQVymPaIuQh/RIu6Wv4FpdFH0JA/ydmQWcf5B/SRmYp4OfQuwFRSYDN934du0W599vgRCRP82N7oUJp4Bi2CNCuR+kttWqQkSDDKxyiuH7m2+97QLIbTfuh12AKBKCq51YBVK/twn4DOWssVosTw+YdjiIzAQX0dw+Nh6vSTymWbu9y17OAvZ2702Tm7cOypZh8N4Ia9X3E7LlSLZSXzg/FfbzR0JGbLi2xKwLGSex5FeaAOZBY5l0JuoQR6ESaIFVpUbZBCIzBoG0TZEeMmLWnyrzyHjqROT9z+ZzJxtaoGKHj4a/M2JGn9dbdpGa0TJ3fXlUdldin876FCRCl/1CJiJAq1e2TKhlH4pyetdHqycxpLA5ykb8S72Fkw1DPiEj4jyCHL79B/67VCqB9u3lSLcFtGTEWxi6MTzs6o6SuHTNh1gs6E7qFlCLrSVSJCPkF+hL5HYxGY51Myx9qswHv/yiuMByTQMerWjKDjXS73xuBEc7n8pZZVGTzpPWb+EIMTEpD5ht10cB2W/l3944F3rZnMclgG1cYRPGKCMQetPJqrN7QVVyH40MAiUEBB7tqh2Q9LDfWzXtiUfM6AoecPM+Kj4v1Tx8y+pc7mkarMziSWRYWRPLqhwjiPEcP0kYlwMXDaVY0cKWGVY2DjfBS4YqQVGQUkRw96gjTVps2TjBK3j8TMW4/0QU0U+iG0JCI68mIZ3d7zYOvTO7MB2Te2qYvKIA4qypL9eYvSJbF+Ner+i9vviD7TdMjTJHkG8W6A/Q+KN4GLCKS8dCnyF4wpeW2P6aUU1NBNrV8tmhNxvYYI0TIymSoWgdicfxi6AUXOV6yQHPdH4fSHSBcNmJyde8Gc9T3rU9Litg3lSF0DFPCmzF/vjRk+UaUWH5j0jDA7sjcOw/LyIKwm81+P6ho5DQv+lxzpsUoxfU68OfZQqDK1ba5BFrJ7vTN7G3g5bmSGSmtSaLiCp/+RtJuHF6E0FKpPnoYo0RkZisoXxSJYNhgP5Ngc7SWDDVjyEpsZRTGNPeR3SdR9DkVa8aJkfkG6kWgKgCBRhXURR8iC4EkDCgluj/5OjrF2szwVqqR/8BRiONOWfZM5HeGqy3ioVbr47JAdqTKwEieAOxjHp5dB35GCsS1cd2kHggSJ88+qQs4rffmtYvtuHRUeXZfzFn7OYli78NfXQIZ4Tfa2cy8EKCeZ6lHq+ieKT34tbeyZZxSm9KUUrc2rDjHO40FIP4u4kEZjpfB9q1sFU0ItUTdkQCwBm5kaRxXMNOdcDAv8ehxckSo09/xepW0tkyrjHg3xhGIMKIc10fWOaAOiGw2BMV1c/jeAxhAm5hPOUptIAbVeSkCbyaEUwAOlANZ9n2lSYzIB7vusjdEHv1uTKYHMUjq0pihDfHR1n1FflYm/ZT5mc6B0uR1K82Ecg8gwjvDWoD8rKWS5ec2AjH/g+l3E6fTm5CLxFwzPrMaVAg8fZIoEEz/iU9uZkbzuxu6rOiBsljGKWFXLi/eYJ3QioY1RQpLJDfOw==";
//滤镜列表 17/05/11
public static String[] mFilterName = {"深度美白", "清新丽人", "暖暖阳光", "香艳红唇", "艺术黑白",
"甜美", "温暖", "果冻", "唯美", "淡雅", "清新",
"Movie", "电影色1", "电影色2", "胶片",
"日系", "淡雅", "怀旧", "黑调", "少女", "初夏", "超现实" };
public static String[] mFilterType = {"Deep", "Skinfresh", "Sunshine", "Sexylips", "Skinbw",
"Sweet", "Lightwarm", "Jelly", "Grace", "Elegant",
"Fresh", "Movie", "FM2", "FM7", "Vista",
"Chihiro", "LZYY", "OldTimeFour", "OldTimeTwo", "PinkyFive", "Zoe", "SketchBW" };
public static String[] mFilterNameAll = {"",
"深度美白", "清新丽人", "暖暖阳光", "香艳红唇", "艺术黑白",
"甜美", "温暖", "果冻", "唯美", "淡雅", "清新",
"Movie", "电影色1", "电影色2", "胶片",
"日系", "淡雅2", "怀旧", "黑调", "少女", "初夏", "超现实"
// ,"漏光","AU","菊次郎","挪威森林","红润"
,"M霏颜","M清凉","M蓝调","M柔光","M初夏",
"B棉花糖","B纯真","B红润","B清晰","B桃花",
"B心境","B霏颜"};
public static String[] mFilterTypeAll = {"none",
"Deep", "Skinfresh", "Sunshine", "Sexylips", "Skinbw",
"Sweet", "Lightwarm", "Jelly", "Grace", "Elegant", "Fresh",
"Movie", "FM2", "FM7", "Vista",
"Chihiro", "LZYY", "OldTimeFour", "OldTimeTwo", "PinkyFive", "Zoe", "SketchBW"
// ,"YKLightLeak","YKButterAU","YKVUEL3","YKVUER1","SkinRosy"
,"MYFeiYan","MYQingLiang","MYLanDiao","MYRouGuang","MYChuXia",
"KJMianHuaTang", "KJChunZhen","KJHongRun","KJQingXi","KJTaoHua",
"KJXinJing","KJFeiYan"
};
public static int[] mFilterPictrueAll = {R.drawable.icon_none_32,
R.drawable.shen_du_mei_bai, R.drawable.qing_xin_li_ren, R.drawable.nuan_nuan_yang_guang, R.drawable.xiang_yan_hong_chun, R.drawable.yi_shu_hei_bai,
R.drawable.tian_mei, R.drawable.wen_nuan, R.drawable.guo_dong, R.drawable.wei_mei, R.drawable.dan_ya, R.drawable.qing_xin,
R.drawable.movie, R.drawable.movie1, R.drawable.movie2, R.drawable.jiao_pian,
R.drawable.ri_xi, R.drawable.dan_ya2, R.drawable.huai_jiu, R.drawable.hei_diao, R.drawable.shao_nv, R.drawable.chu_xia, R.drawable.chao_xian_shi,
// R.drawable.shen_du_mei_bai, R.drawable.qing_xin_li_ren, R.drawable.nuan_nuan_yang_guang, R.drawable.xiang_yan_hong_chun, R.drawable.yi_shu_hei_bai,
R.drawable.m_fei_yan, R.drawable.m_qing_liang, R.drawable.m_lan_diao, R.drawable.m_rou_guang, R.drawable.m_chu_xia,
R.drawable.b_mian_hua_tang, R.drawable.b_chun_zhen, R.drawable.b_hong_run, R.drawable.b_qing_xi, R.drawable.b_tao_hua,
R.drawable.b_xin_jing, R.drawable.b_fei_yan, };
//贴纸列表
// public static String[] mTiezhiName = {"","大哭河", "大眼睛", "大眼睛发夹", "粉色蝴蝶结", "搞怪眼镜",
// "狗耳朵", "红色嘴唇", "皇冠", "婚礼森系小仙女捧花", "蓝色猫耳朵",
// "龙猫", "猫耳朵", "猫咪玩球", "米老鼠耳朵", "米老鼠蝴蝶结",
// "沙球", "闪光黄金耳朵", "桃心兔子耳朵", "天使羽毛", "兔子带草花", "星空眼镜", "长颈鹿","猪鼻子" };
public static final String DEFAULT_PATH = Environment.getExternalStorageDirectory()
+ File.separator + "sdk_demo" + File.separator;
public static final String STICKER_NAME = "TestSticker";
public static final String STICKER_LOCAL_PATH = DEFAULT_PATH + "sticker" + File.separator ;
public static final String STICKER_NOMEDIA_PATH = DEFAULT_PATH + ".nomedia";
public static final boolean IS_USE_INDEPENDENT_THREAD = false;
}

View File

@ -1,320 +0,0 @@
package com.by.lib_beauty360;
import android.app.Activity;
//Camera360美颜
public class Beauty360Activity extends Activity {
// implements SurfaceHolder.Callback,
// SurfaceTexture.OnFrameAvailableListener,
// SeekBar.OnSeekBarChangeListener, Camera.PreviewCallback, MyItemClickListener {
//
// private float mPinkValue = 0.4f;
// private float mWhitenValue = 0.7f;
// private float mReddenValue = 0.5f;
// private int mSoftenValue = 70;
// private int mFilterValue = 100;
// private boolean mClear = false;
//
// private RecyclerView mListView;
// private MyRecycleAdapter4LvJing mAdapter;
// private List<IRecycleCell> mListData;
// private String mCurFilterStrength;
//
// private PreviewUtils mPreviewUtils;
// private SurfaceView mSurfaceView;
// private boolean mFirstFrame = true;
//
// private boolean isSticker = false;
// private boolean zipSuccess = false;
// Context mContext;
// TextView tvSticker;
// private OrientationEventListener mOrientationListener;
//
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_main2);
// mContext = this;
// mPreviewUtils = new PreviewUtils(getApplicationContext(), this);
// initViews();
//
// /**
// * 贴纸zip 解压到本地
// */
// new UnzipAssets().unZipRequest(this, "TestSticker.zip", new UnzipAssets.IUnZipCallBack() {
// @Override
// public void onStart() {
// }
//
// @Override
// public void Response(String outFileDirectory) {
// zipSuccess = true;
// }
//
// @Override
// public void onError() {
// }
// });
//
// }
//
// public void initViews() {
// mSurfaceView = (SurfaceView) findViewById(R.id.surface_view);
//
// SeekBar m_Seekpink = (SeekBar) findViewById(R.id.seek_pink);
// m_Seekpink.setOnSeekBarChangeListener(this);
// m_Seekpink.setProgress((int) (mPinkValue * 100));
// TextView tv_pink = (TextView) findViewById(R.id.pink_value);
// tv_pink.setText(String.valueOf(mPinkValue));
//
// SeekBar m_Seekwhiten = (SeekBar) findViewById(R.id.seek_whiten);
// m_Seekwhiten.setOnSeekBarChangeListener(this);
// m_Seekwhiten.setProgress((int) (mWhitenValue * 100));
// TextView tv_whiten = (TextView) findViewById(R.id.whiten_value);
// tv_whiten.setText(String.valueOf(mWhitenValue));
//
// SeekBar m_Seekredden = (SeekBar) findViewById(R.id.seek_redden);
// m_Seekredden.setOnSeekBarChangeListener(this);
// m_Seekredden.setProgress((int) (mReddenValue * 100));
// TextView tv_redden = (TextView) findViewById(R.id.redden_value);
// tv_redden.setText(String.valueOf(mReddenValue));
//
//
// SeekBar m_Seeksoften = (SeekBar) findViewById(R.id.seek_soften);
// m_Seeksoften.setOnSeekBarChangeListener(this);
// m_Seeksoften.setProgress(mSoftenValue);
// TextView tv_soften = (TextView) findViewById(R.id.soften_value);
// tv_soften.setText(String.valueOf(mSoftenValue));
//
// SeekBar m_SeeksFilter = (SeekBar) findViewById(R.id.filter_redden);
// m_SeeksFilter.setOnSeekBarChangeListener(this);
// m_SeeksFilter.setProgress(mFilterValue);
// TextView tv_filter = (TextView) findViewById(R.id.filter_value);
// tv_filter.setText(String.valueOf(mFilterValue));
//
// tvSticker = (TextView) findViewById(R.id.tv_sticker);
// tvSticker.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// if (!zipSuccess) return;
// if (!isSticker) {
// tvSticker.setText("取消贴纸");
// isSticker = true;
// mPreviewUtils.setSticker(AppConfig.STICKER_LOCAL_PATH + "TestSticker/dog");
// } else {
// tvSticker.setText("贴纸");
// isSticker = false;
// mPreviewUtils.removeSticker();
// }
//
// }
// });
// tvSticker.setVisibility(View.VISIBLE);
//
// View layoutSurface = findViewById(R.id.layout_surface);
// layoutSurface.setOnTouchListener(new View.OnTouchListener() {
// @Override
// public boolean onTouch(View v, MotionEvent event) {
// switch (event.getAction()) {
// case MotionEvent.ACTION_DOWN:
// case MotionEvent.ACTION_MOVE:
// clearAllBuffer();
// break;
// case MotionEvent.ACTION_CANCEL:
// case MotionEvent.ACTION_UP:
// resetBuffer();
// break;
// }
// return true;
// }
// });
//
// mListView = (RecyclerView) findViewById(R.id.listview);
// LinearLayoutManager mLayoutManager = new LinearLayoutManager(mListView.getContext(), LinearLayoutManager.HORIZONTAL, false);
// mListView.setLayoutManager(mLayoutManager);
// ConstructList();
// mAdapter = new MyRecycleAdapter4LvJing(this, mListData);
// mListView.setAdapter(mAdapter);
// mListView.setItemAnimator(new DefaultItemAnimator());
// }
//
// @Override
// public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
// int id = seekBar.getId();
// if (id == R.id.seek_pink) {
// if (fromUser) {
// mPinkValue = progress / 100f;
// mPreviewUtils.SetSkinColor(mPinkValue, mWhitenValue, mReddenValue);
// TextView tv_pink = (TextView) findViewById(R.id.pink_value);
// tv_pink.setText(String.valueOf(mPinkValue));
// }
// } else if (id == R.id.seek_whiten) {
// if (fromUser) {
// mWhitenValue = progress / 100f;
// mPreviewUtils.SetSkinColor(mPinkValue, mWhitenValue, mReddenValue);
// TextView tv_whiten = (TextView) findViewById(R.id.whiten_value);
// tv_whiten.setText(String.valueOf(mWhitenValue));
// }
// } else if (id == R.id.seek_redden) {
// if (fromUser) {
// mReddenValue = progress / 100f;
// mPreviewUtils.SetSkinColor(mPinkValue, mWhitenValue, mReddenValue);
// TextView tv_redden = (TextView) findViewById(R.id.redden_value);
// tv_redden.setText(String.valueOf(mReddenValue));
// }
// } else if (id == R.id.filter_redden) {
// if (fromUser) {
// mFilterValue = progress;
// mPreviewUtils.SetColorFilterStrength(mFilterValue);
// TextView tv_blur = (TextView) findViewById(R.id.filter_value);
// tv_blur.setText(String.valueOf(mFilterValue));
// }
// } else if (id == R.id.seek_soften) {
// if (fromUser) {
// mSoftenValue = progress;
// mPreviewUtils.SetSkinSoftenStrength(mSoftenValue);
// TextView tv_soften = (TextView) findViewById(R.id.soften_value);
// tv_soften.setText(String.valueOf(mSoftenValue));
// }
// }
// }
//
// @Override
// public void onStartTrackingTouch(SeekBar seekBar) {
// }
//
// @Override
// public void onStopTrackingTouch(SeekBar seekBar) {
// }
//
// @Override
// protected void onResume() {
// super.onResume();
// mPreviewUtils.onresume();//启动照相机
// reStartEngine();
//
// // 注册方向回调检测屏幕方向改变
// if (null == mOrientationListener) {
// mOrientationListener = new OrientationEventListener(this) {
// @Override
// public void onOrientationChanged(int orientation) {
// mPreviewUtils.onScreenOriChanged(orientation);
// }
// };
// mOrientationListener.enable();
// }
// }
//
// public void reStartEngine() {
// DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
// float fScreenHeight = displayMetrics.heightPixels;
//
// int iLayoutHeight = (int) fScreenHeight;//- (int)(fScreenHeight * 0.2f);
// int iLayoutWidth = (int) ((iLayoutHeight / (float) mPreviewUtils.getCameraWidth()) * mPreviewUtils.getCameraHeight());
//
// mSurfaceView.getHolder().addCallback(this);
//
// ViewGroup.LayoutParams surfaceLayout;
// surfaceLayout = mSurfaceView.getLayoutParams();
// surfaceLayout.width = iLayoutWidth;
// surfaceLayout.height = iLayoutHeight;
// mSurfaceView.setLayoutParams(surfaceLayout);
// }
//
//
// @Override
// protected void onPause() {
// super.onPause();
// mPreviewUtils.pause();
// mFirstFrame = true;
//
// if (null != mOrientationListener) {
// mOrientationListener.disable();
// mOrientationListener = null;
// }
// }
//
// @Override
// protected void onDestroy() {
// super.onDestroy();
// mPreviewUtils.freeRes();
// }
//
// @Override
// public void surfaceCreated(SurfaceHolder holder) {
// mPreviewUtils.startCameraPreview(holder);//开始预览 绑定surface
// }
//
// @Override
// public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
// mPreviewUtils.setCameraInfo(width, height);
// }
//
// @Override
// public void surfaceDestroyed(SurfaceHolder holder) {
// }
//
// @Override
// public void onFrameAvailable(SurfaceTexture surfaceTexture) {
// }
//
// @Override
// public void onPreviewFrame(byte[] data, Camera camera) {
// mPreviewUtils.frameProcess(data, 0, mFirstFrame, false);//data 可以传空 根据TextureId进行美颜
// mFirstFrame = false;
//// getTxLivePush();
// }
//
// private void getTxLivePush() {
//
// }
//
// private void ConstructList() {
// mListData = new ArrayList<>();
// for (int i = 0; i < AppConfig.mFilterName.length; ++i) {
// ItemData4LvJing itemData = new ItemData4LvJing();
// itemData.filterName = AppConfig.mFilterName[i];
// itemData.filterType = AppConfig.mFilterType[i];
// mListData.add(new HomeItemCell4LvJing(this, itemData, this));
// }
// }
//
// @Override
// public void onItemClick(String filtertype) {
// if (TextUtils.isEmpty(filtertype))
// return;
//
// if (filtertype.equals(mCurFilterStrength)) {
// return;
// }
// mCurFilterStrength = filtertype;
// mPreviewUtils.SetColorFilterByName(filtertype);
// mPreviewUtils.SetColorFilterStrength(mFilterValue);
// mAdapter.notifyDataSetChanged();
//
// }
//
// @Override
// public String getCurFilterType() {
// return mCurFilterStrength;
// }
//
//
// private void clearAllBuffer() {
// if (mClear) return;
// mClear = true;
// mPreviewUtils.SetSkinColor(0, 0, 0);
// mPreviewUtils.SetSkinSoftenStrength(0);
// mPreviewUtils.SetColorFilterStrength(0);
// }
//
// private void resetBuffer() {
// mClear = false;
// mPreviewUtils.SetSkinColor(mPinkValue, mWhitenValue, mReddenValue);
// mPreviewUtils.SetSkinSoftenStrength(mSoftenValue);
// mPreviewUtils.SetColorFilterStrength(mFilterValue);
//
// }
}

View File

@ -1,207 +0,0 @@
package com.by.lib_beauty360;
import android.graphics.ImageFormat;
import android.graphics.SurfaceTexture;
import android.hardware.Camera;
import android.util.Log;
import java.io.IOException;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/**
* Created by xieyi on 2017/banner_03/12.
*/
public class CameraUtils implements ICameraUtils {
private final String LOG_TAG = "CameraUtils";
private Camera mCamera;
private Object mThreadLock = new Object();
private int mCurrentCameraType = 1;//Camera.CameraInfo.CAMERA_FACING_FRONT
private Camera.Size mCameraPreviewFrameSize;
private int mOritation;
Camera.PreviewCallback mPreviewCallbakck;
SurfaceTexture mSurfaceTexture;
public CameraUtils(Camera.PreviewCallback callback) {
mPreviewCallbakck = callback;
}
public void switchCamera() {
if (mSurfaceTexture == null) return;
stopCamera();
mCurrentCameraType = mCurrentCameraType == 0 ? 1 : 0;
startCamera();
startCameraPreview(mSurfaceTexture);
}
public int getCurrentOrientation() {
return mOritation;
}
@Override
public void stopCamera() {
if (mCamera == null)
return;
synchronized (mThreadLock) {
mCamera.stopPreview();
mCamera.setPreviewCallback(null);
mCamera.release();
mCamera = null;
}
Log.i(LOG_TAG, "stopped camera");
}
@Override
public void switchCameraFlashLigth() {
if (mCamera == null) {return;}
Camera.Parameters camParams = mCamera.getParameters();
if (camParams != null){
if ( Camera.Parameters.FLASH_MODE_TORCH.equals(camParams.getFlashMode() ) ){
camParams.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);//设置成关闭的
}
else {
camParams.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);//设置成开启的
}
mCamera.setParameters(camParams);
}
}
@Override
public void startCamera() {
Log.i(LOG_TAG, "starting camera");
if (mCamera != null) return;
synchronized (mThreadLock) {
Camera.CameraInfo camInfo = new Camera.CameraInfo();
int numCameras = Camera.getNumberOfCameras();
for (int i = 0; i < numCameras; i++) {
Camera.getCameraInfo(i, camInfo);
if (camInfo.facing == mCurrentCameraType) {
mCamera = Camera.open(i);
mOritation = camInfo.orientation;
break;
}
}
if (mCamera == null) {
Log.i(LOG_TAG, "No back-facing camera found; opening default");
mCamera = Camera.open();
}
if (mCamera == null) {
throw new RuntimeException("Unable to open camera");
}
Camera.Parameters camParams = mCamera.getParameters();
mCameraPreviewFrameSize = getProperPreviewSize(camParams);
if (mCameraPreviewFrameSize == null)
mCameraPreviewFrameSize = camParams.getPreviewSize();
if (mCameraPreviewFrameSize != null) {
camParams.setPreviewSize(mCameraPreviewFrameSize.width, mCameraPreviewFrameSize.height);
}
camParams.setPreviewFormat(ImageFormat.NV21);//YV12时才用
camParams.setRecordingHint(true);
mCamera.setParameters(camParams);
mCamera.setPreviewCallback(mPreviewCallbakck);
/* mCamera.addCallbackBuffer(new byte[((mCameraPreviewFrameSize.width * mCameraPreviewFrameSize.height)
* ImageFormat.getBitsPerPixel(ImageFormat.NV21)) / 8]);
mCamera.setPreviewCallbackWithBuffer(mPreviewCallbakck);*/
int[] fps = new int[2];
camParams.getPreviewFpsRange(fps);
Log.i(LOG_TAG, "camera preview frame size is " + mCameraPreviewFrameSize.width + "x" + mCameraPreviewFrameSize.height);
Log.i(LOG_TAG, "camera preview fps range is " + fps[0] / 1000.0f + " - " + fps[1] / 1000.0f);
}
}
/*
public void setPreviewCallback(Camera.PreviewCallback callback){
mCamera.setPreviewCallbackWithBuffer(callback);
}
*/
@Override
public void startCameraPreview(SurfaceTexture surfaceTexture) {
try {
mSurfaceTexture = surfaceTexture;
if (mCamera!=null && mSurfaceTexture!=null){
mCamera.setPreviewTexture(mSurfaceTexture);
}
} catch (IOException e) {
e.printStackTrace();
}
// start the camera preview output
Log.i(LOG_TAG, "starting camera preview");
if (mCamera != null)
mCamera.startPreview();
}
public void addCallbackBuffer(byte[] data) {
mCamera.addCallbackBuffer(data);
}
private Camera.Size getProperPreviewSize(Camera.Parameters parameters) {
int min = 640 * 480;
int max = 720 * 1280;
List<Camera.Size> sizeList = parameters.getSupportedPreviewSizes();
Collections.sort(sizeList, new Comparator<Camera.Size>() {
public int compare(Camera.Size o1, Camera.Size o2) {
if (o1.width > o2.width) {
return -1;
}
if (o1.width == o2.width) {
if (o1.height > o2.height) return -1;
if (o1.height == o2.height) return 0;
return 1;
}
return 1;
}
});
Camera.Size previewSize = null;
for (int i = 0; i < sizeList.size(); i++) {
Camera.Size size = sizeList.get(i);
int value = size.width * size.height;
if (value >= min && value <= max) {
previewSize = size;
break;
}
}
return previewSize;
}
@Override
public int getCameraWidth() {
return mCameraPreviewFrameSize.width;//1280
}
@Override
public int getCameraHeight() {
return mCameraPreviewFrameSize.height;//720
}
@Override
public int getCameraID() {
return mCurrentCameraType;
}
}

View File

@ -1,97 +0,0 @@
package com.by.lib_beauty360;
import android.graphics.SurfaceTexture;
import android.util.Log;
import android.view.SurfaceHolder;
/**
* Created by wh on 2017/03/12.
*/
public class GlContextUtils {
//
// private final String LOG_TAG = "GlContextUtils";
//
// private IContextManagerApi mGlContext;
// private SurfaceTexture mCameraTexture;
// private int mCameraTextureID;
//
// public GlContextUtils() {
// if (AppConfig.IS_USE_INDEPENDENT_THREAD) {
// mGlContext = new PGContextManager();
// } else {
// mGlContext = new PGContextManager2();
// }
// }
//
// public SurfaceTexture init(SurfaceHolder holder) {
//
// mGlContext.initGLContext(0);
//
// Log.i(LOG_TAG, "creating window surface");
//
// //如果不需要渲染仅做数据处理 mGlContext.addSurface(null);
// mGlContext.addSurface(holder);
// mGlContext.activateOurGLContext();
//
// Log.i(LOG_TAG, "creating camera frame texture");
// mCameraTextureID = mGlContext.createGLExtTexture();
// mCameraTexture = new SurfaceTexture(mCameraTextureID);
// // m_pCameraTexture.setOnFrameAvailableListener(this);
//
// Log.i(LOG_TAG, "created camera frame texture with id " + mCameraTextureID);
// return mCameraTexture;
// }
//
// public void pause() {
// if (mGlContext != null) {
// mGlContext.activateOurGLContext();
// }
// // 销毁 PGHelixEngine
// // 销毁 GL Texture
// if (mCameraTexture != null) {
// Log.i(LOG_TAG, "releasing camera frame texture");
// mGlContext.deleteGLExtTexture(mCameraTextureID);
// mCameraTexture.release();
// mCameraTexture = null;
// }
// // 销毁 GL Surface
// if (mGlContext != null) {
// Log.i(LOG_TAG, "releasing window surface");
// mGlContext.releaseSurface();
// }
// // 销毁 GL 上下文
// if (mGlContext != null) {
// mGlContext.releaseContext();
// mGlContext.finalEnd();
// mGlContext = null;
// }
// }
//
// public boolean activateOurGLContext(){
// if (mCameraTexture == null || mGlContext == null) return false;
// mGlContext.activateOurGLContext();
// if (AppConfig.IS_USE_INDEPENDENT_THREAD) {
// mGlContext.postTaskOnRenderThread(new Runnable() {
// @Override
// public void run() {
// mCameraTexture.updateTexImage();
// }
// });
// } else {
// mCameraTexture.updateTexImage();
// }
// return true;
// }
//
// public void presentSurface(){
// mGlContext.presentSurface();
// }
//
// public int getTextureId(){
// return mCameraTextureID;
// }
}

View File

@ -1,21 +0,0 @@
package com.by.lib_beauty360;
import android.graphics.SurfaceTexture;
/**
* Created by PC-Xu on 2017/3/16.
*/
public interface ICameraUtils
{
public int getCameraWidth();
public int getCameraHeight();
public int getCameraID();
public int getCurrentOrientation();
public void switchCamera();
public void startCamera();
public void stopCamera();
//相机闪光
public void switchCameraFlashLigth();
public void startCameraPreview(SurfaceTexture surfaceTexture);
}

View File

@ -1,12 +0,0 @@
package com.by.lib_beauty360;
/**
* Created by PC-Xu on 2017/1/5.
* 滤镜
*/
public class ItemData
{
public String filterName;
public String filterType;
}

View File

@ -1,13 +0,0 @@
package com.by.lib_beauty360;
/**
* Created by PC-Xu on 2017/1/5.
* 滤镜
*/
public class ItemData4LvJing
{
public String filterName;
public String filterType;
public int filterPictrue;
}

View File

@ -1,11 +0,0 @@
package com.by.lib_beauty360;
/**
* Created by PC-Xu on 2017/1/5.
* 贴纸
*/
public class ItemData4TieZhi
{
public String tieZhiName;
}

View File

@ -1,15 +0,0 @@
package com.by.lib_beauty360;
import android.content.Context;
import android.graphics.Bitmap;
import android.util.Log;
import java.nio.ByteBuffer;
/**
* Created by wh on 2017/03/12.
*/
public class PGSkinUtils {
}

View File

@ -1,182 +0,0 @@
package com.by.lib_beauty360;
import android.content.Context;
import android.graphics.Bitmap;
import android.hardware.Camera;
import android.util.Log;
import android.view.SurfaceHolder;
import java.nio.ByteBuffer;
/**
* Created by xieyi on 2017/03/12.
*/
public class PreviewUtils {
//
// PGSkinUtils mPGSkinUtils;
// GlContextUtils mGlContextUtils;
// ICameraUtils mCameraUtils;
//
// private int mSurfaceWidth;
// private int mSurfaceHeight;
//
// public PreviewUtils(Context mContext, Camera.PreviewCallback callback) {
// mCameraUtils = new CameraUtils(callback);
// mGlContextUtils = new GlContextUtils();
// mPGSkinUtils = new PGSkinUtils(mContext);
//
// }
//
// public void switchCamera() {
// mCameraUtils.switchCamera();
// setCameraInfo(mSurfaceWidth, mSurfaceHeight);
// }
//
// public void switchCameraFlashLight(){
// mCameraUtils.switchCameraFlashLigth();
// }
// public void SetColorFilterStrength(int progress) {
// mPGSkinUtils.SetColorFilterStrength(progress);//滤镜强度
// }
//
// public void SetSkinColor(float fPinking, float fWhitening, float fRedden) {
// mPGSkinUtils.SetSkinColor(fPinking, fWhitening, fRedden);
// }
//
//
//
//
// public void SetSkinSoftenStrength(int iSoftenStrength) {
// mPGSkinUtils.SetSkinSoftenStrength(iSoftenStrength);
// }
//
//
// public void setFaceShapingParam(int iBigEyeStrength, int iThinFaceStrength) {
// mPGSkinUtils.setFaceShapingParam(iBigEyeStrength,iThinFaceStrength);
// }
//
//
// public void startCamera() {
// mCameraUtils.startCamera();
// setCameraInfo(mCameraUtils.getCameraWidth(), mCameraUtils.getCameraHeight());
// }
//
// public void setCameraInfo(int screenWidth, int screenHeight) {
// mSurfaceWidth = screenWidth;
// mSurfaceHeight = screenHeight;
//
//
// Log.d("相机宽度",""+mSurfaceWidth+" "+mCameraUtils.getCameraWidth());
// }
//
//
//
// public void startCameraPreview(SurfaceHolder holder) {
// mCameraUtils.startCameraPreview(mGlContextUtils.init(holder));
// }
//
// public void pause() {
// mCameraUtils.stopCamera();
//// mPGSkinUtils.pause();
// }
//
// public void freeRes() {
// mPGSkinUtils.removeSticker();
// mPGSkinUtils.pause();//释放
// mGlContextUtils.pause();
// }
//
// public void onresume() {
// startCamera();//启动照相机
// mPGSkinUtils.onresume();//初始化美肤引擎
// }
//
//
// public void SetColorFilterByName(String filtertype) {
// mPGSkinUtils.SetColorFilterByName(filtertype);
// }
//
// public void frameProcess(byte[] data, int textureId, boolean isFirstFrame, boolean bInitEGL) {
// mGlContextUtils.activateOurGLContext();
// mPGSkinUtils.frameProcess(data, textureId, isFirstFrame, bInitEGL);
//
// mPGSkinUtils.GetOutputToScreen(mSurfaceWidth, mSurfaceHeight);
// /**
// * FAQ
// * 渲染到SurfaceView上部出现白屏
// *
// * mPGSkinUtils.GetOutputToScreen宽高对换
// * */
//
//// mPGSkinUtils.getSkinSoftenByte();
// mGlContextUtils.presentSurface();
//
// }
//
//
//
// public int getCameraWidth() {
// return mCameraUtils.getCameraWidth();
// }
//
// public int getCameraHeight() {
// return mCameraUtils.getCameraHeight();
// }
//
//
// public ByteBuffer SkinSoftenGetResult() {
// return mPGSkinUtils.SkinSoftenGetResult();
// }
//
// public byte[] getSkinSoftenByte() {
// return mPGSkinUtils.getSkinSoftenByte();
// }
//
// public int getSkinSoftenTextureId() {
// return mPGSkinUtils.getSkinSoftenTextureId();
// }
//
// public void setSticker(String path){
// mPGSkinUtils.setSticker(path);
// }
//
// public void removeSticker(){
// mPGSkinUtils.removeSticker();
// }
//
// public void onScreenOriChanged(int ori){
// mPGSkinUtils.onScreenOriChanged(ori);
// }
//
// public boolean setInputImageByJpegPath(String pJpegPath, int iScale) {
// return mPGSkinUtils.setInputImageByJpegPath(pJpegPath, iScale);
// }
//
// public boolean setInputImageByPngPath(String pPngPath) {
// return mPGSkinUtils.setInputImageByPngPath(pPngPath);
// }
//
// public boolean setInputImageByBitmap(Bitmap pBitmap) {
// return mPGSkinUtils.setInputImageByBitmap(pBitmap);
// }
//
// public boolean setInputImageByJpegBuffer(byte[] pJpegBuffer, int iScale) {
// return mPGSkinUtils.setInputImageByJpegBuffer(pJpegBuffer, iScale);
// }
//
// public boolean getOutputToJpegPath(String pJpegPath, int iQuality) {
// return mPGSkinUtils.getOutputToJpegPath(pJpegPath, iQuality);
// }
//
// public boolean getOutputToPngPath(String pPngPath, boolean bSaveAlphaChannel) {
// return mPGSkinUtils.getOutputToPngPath(pPngPath, bSaveAlphaChannel);
// }
//
// public boolean getOutputToBitmap(Bitmap pBitmap) {
// return mPGSkinUtils.getOutputToBitmap(pBitmap);
// }
}

View File

@ -1,110 +0,0 @@
package com.by.lib_beauty360.RecycleView;
import android.app.Activity;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.by.lib_beauty360.ItemData;
import com.by.lib_beauty360.ItemData4LvJing;
import com.by.lib_beauty360.R;
/**
* Created by PC-Xu on 2016/6/24.
* 滤镜
*/
public class HomeItemCell4LvJing extends IRecycleCell<ItemData4LvJing> implements View.OnClickListener{
private Activity mContext;
private MyItemClickListener myItemClickListener;
public HomeItemCell4LvJing(Activity activity, ItemData4LvJing data, MyItemClickListener listener)
{
SetData(data);
mContext =activity;
myItemClickListener= listener;
}
@Override
public int getViewType()
{
return RecycleType.TYPE_NORMAL;
}
@Override
public MyViewHolder onCreateCellView(ViewGroup viewGroup)
{
View view= LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.listview_item_lvjing,null);
return new MyViewHolder(view);
}
@Override
public void onBindViewHolder(MyViewHolder viewHolder)
{
View itemView = viewHolder.itemView;
InitView(itemView);
}
private void InitView(View view)
{
TextView textView = (TextView)view.findViewById(R.id.tv_name);
ImageView iv_lvjing = (ImageView) view.findViewById(R.id.iv_lvjing);
if (textView!=null)
{
ItemData4LvJing itemData = getData();
textView.setText(itemData.filterName);
iv_lvjing.setImageResource(itemData.filterPictrue);
if (myItemClickListener !=null&&itemData.filterType.equals(myItemClickListener.getCurFilterType()))
{//选中后设置为黄色
// textView.setBackgroundColor(mContext.getResources().getColor(R.color.color_selectedlitem));
// textView.setBackgroundColor(Color.parseColor("#ff6131"));
textView.setTextColor(Color.parseColor("#ff6131"));
}
else
{
// textView.setBackgroundColor(mContext.getResources().getColor(R.color.color_normalitem));
// textView.setBackgroundColor(Color.parseColor("#ffffff"));
textView.setTextColor(Color.parseColor("#ffffff"));
}
}
textView.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
if (myItemClickListener ==null)
return;
myItemClickListener.onItemClick(getData().filterType);
}
});
iv_lvjing.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
if (myItemClickListener ==null)
return;
myItemClickListener.onItemClick(getData().filterType);
}
});
}
@Override
public void onClick(View v) {
switch (v.getId()){
}
}
}

View File

@ -1,123 +0,0 @@
package com.by.lib_beauty360.RecycleView;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.by.lib_beauty360.ItemData;
import com.by.lib_beauty360.ItemData4TieZhi;
import com.by.lib_beauty360.R;
import com.yunbao.common.CommonAppConfig;
import java.io.File;
/**
* Created by PC-Xu on 2016/6/24.
* 360美颜贴纸
*/
public class HomeItemCell4Tiezhi extends IRecycleCell<ItemData4TieZhi> implements View.OnClickListener{
private Activity mContext;
private MyItemClickListener4Tiezhi myItemClickListener;
public HomeItemCell4Tiezhi(Activity activity, ItemData4TieZhi data, MyItemClickListener4Tiezhi listener)
{
SetData(data);
mContext =activity;
myItemClickListener= listener;
}
@Override
public int getViewType()
{
return RecycleType.TYPE_NORMAL;
}
@Override
public MyViewHolder onCreateCellView(ViewGroup viewGroup)
{
View view= LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.listview_item_tiezhi,null);
return new MyViewHolder(view);
}
@Override
public void onBindViewHolder(MyViewHolder viewHolder)
{
View itemView = viewHolder.itemView;
InitView(itemView);
}
private void InitView(View view)
{
TextView textView = (TextView)view.findViewById(R.id.tv_name);
ImageView iv_tiezhi = (ImageView) view.findViewById(R.id.iv_tiezhi);
if (textView!=null)
{
ItemData4TieZhi itemData = getData();
textView.setText(itemData.tieZhiName);
if ("".equals(itemData.tieZhiName)){
iv_tiezhi.setImageResource(R.drawable.icon_none_32);
}
else {
String path= CommonAppConfig.VIDEO_TIE_ZHI_PATH+CommonAppConfig.TIEZHI_360_NAME
+ File.separator + "StickerResource_20170502"+File.separator+itemData.tieZhiName
+File.separator+"icon.jpg";
File file=new File(path);
if (file.exists()){
Bitmap bitmap= BitmapFactory.decodeFile(path);
iv_tiezhi.setImageBitmap(bitmap);
}
}
if (myItemClickListener !=null&&itemData.tieZhiName.equals(myItemClickListener.getCurTiezhiName()))
{
textView.setTextColor(Color.parseColor("#ff6131"));
}
else
{
textView.setTextColor(Color.parseColor("#ffffff"));
}
}
textView.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
if (myItemClickListener ==null)
return;
myItemClickListener.onTiezhiItemClick(getData().tieZhiName);
}
});
iv_tiezhi.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
if (myItemClickListener ==null)
return;
myItemClickListener.onTiezhiItemClick(getData().tieZhiName);
}
});
}
@Override
public void onClick(View v) {
switch (v.getId()){
}
}
}

View File

@ -1,23 +0,0 @@
package com.by.lib_beauty360.RecycleView;
import android.view.ViewGroup;
/**
* Created by PC-Xu on 2016/6/24.
*/
public abstract class IRecycleCell<T>
{
private T mData;
public abstract int getViewType();
public abstract MyViewHolder onCreateCellView(ViewGroup viewGroup);
public abstract void onBindViewHolder(MyViewHolder viewHolder);
public T getData()
{
return mData;
}
public void SetData(T data)
{
mData =data;
}
}

View File

@ -1,9 +0,0 @@
package com.by.lib_beauty360.RecycleView;
/**
* Created by zongkaili on 16/6/12.
*/
public interface MyItemClickListener {
void onItemClick(String filtertype);
String getCurFilterType();
}

View File

@ -1,10 +0,0 @@
package com.by.lib_beauty360.RecycleView;
/**
* Created by zongkaili on 16/6/12.
*/
public interface MyItemClickListener4Tiezhi {
void onTiezhiItemClick(String index);
String getCurTiezhiName();
}

View File

@ -1,61 +0,0 @@
package com.by.lib_beauty360.RecycleView;
import android.app.Activity;
import androidx.recyclerview.widget.RecyclerView;
import android.view.ViewGroup;
import java.util.List;
/**
* Created by PC-Xu on 2016/6/24.
*/
public class MyRecycleAdapter4LvJing extends RecyclerView.Adapter
{
private static final String TAG = MyRecycleAdapter4LvJing.class.getSimpleName();
private List<IRecycleCell> mListData;
private Activity mActivity;
public MyRecycleAdapter4LvJing(Activity activity, List<IRecycleCell> mListData)
{
this.mListData = mListData;
mActivity = activity;
}
@Override
public int getItemViewType(int position)
{
return mListData.get(position).getViewType();
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position)
{
mListData.get(position).onBindViewHolder((MyViewHolder)holder);
}
@Override
public int getItemCount()
{
return mListData.size();
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
{
int pos= getFirstPositionByType(viewType);
if (pos ==-1 || pos >=getItemCount())
return null;
IRecycleCell cell = mListData.get(pos);
return cell == null ? null : cell.onCreateCellView(parent);
}
public int getFirstPositionByType(int viewType) {
int size = getItemCount();
for (int i = 0; i < size; i++) {
if (getItemViewType(i) == viewType) {
return i;
}
}
return -1;
}
}

View File

@ -1,62 +0,0 @@
package com.by.lib_beauty360.RecycleView;
import android.app.Activity;
import androidx.recyclerview.widget.RecyclerView;
import android.view.ViewGroup;
import java.util.List;
/**
* Created by PC-Xu on 2016/6/24.
* 360美颜贴纸列表的adapter
*/
public class MyRecycleAdapter4Tiezhi extends RecyclerView.Adapter
{
private static final String TAG = MyRecycleAdapter4Tiezhi.class.getSimpleName();
private List<IRecycleCell> mListData;
private Activity mActivity;
public MyRecycleAdapter4Tiezhi(Activity activity, List<IRecycleCell> mListData)
{
this.mListData = mListData;
mActivity = activity;
}
@Override
public int getItemViewType(int position)
{
return mListData.get(position).getViewType();
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position)
{
mListData.get(position).onBindViewHolder((MyViewHolder)holder);
}
@Override
public int getItemCount()
{
return mListData.size();
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
{
int pos= getFirstPositionByType(viewType);
if (pos ==-1 || pos >=getItemCount())
return null;
IRecycleCell cell = mListData.get(pos);
return cell == null ? null : cell.onCreateCellView(parent);
}
public int getFirstPositionByType(int viewType) {
int size = getItemCount();
for (int i = 0; i < size; i++) {
if (getItemViewType(i) == viewType) {
return i;
}
}
return -1;
}
}

View File

@ -1,15 +0,0 @@
package com.by.lib_beauty360.RecycleView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
/**
* Created by PC-Xu on 2016/6/25.
*/
public class MyViewHolder extends RecyclerView.ViewHolder
{
public MyViewHolder(View itemView)
{
super(itemView);
}
}

View File

@ -1,10 +0,0 @@
package com.by.lib_beauty360.RecycleView;
/**
* Created by PC-Xu on 2016/6/25.
*/
public class RecycleType
{
public static int TYPE_NORMAL = 1001;
}

View File

@ -1,200 +0,0 @@
package com.by.lib_beauty360.utils;
import android.content.Context;
import android.os.AsyncTask;
import com.by.lib_beauty360.AppConfig;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
/**
* Created by wh on 2017/3/22.
*/
public class UnzipAssets {
UnZipTask mUnZipTask;
private static Context mContext;
public UnzipAssets() {
}
public void unZipRequest(Context context, String zipName, IUnZipCallBack callBack) {
mUnZipTask = new UnZipTask(callBack);
mUnZipTask.execute(zipName);
mContext = context;
}
/*
* 异步解压zip
* */
public class UnZipTask extends AsyncTask<String, Void, String> {
IUnZipCallBack mCallBack;
public UnZipTask(IUnZipCallBack callBack) {
mCallBack = callBack;
}
@Override
//在界面上显示进度条
protected void onPreExecute() {
mCallBack.onStart();
}
@Override
protected String doInBackground(String... zipName) {
if (isFileEmpty(AppConfig.STICKER_LOCAL_PATH + AppConfig.STICKER_NAME)) {
try {
unZip(zipName[0], AppConfig.STICKER_LOCAL_PATH);
createNoMediaFile();
} catch (IOException e) {
e.printStackTrace();
}
}
return AppConfig.STICKER_LOCAL_PATH;
}
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
mCallBack.Response(result);
}
}
public static void createNoMediaFile() {
File file = new File(AppConfig.STICKER_NOMEDIA_PATH);
if (!file.exists()) {
try {
file.createNewFile();
} catch (Exception e) {
e.printStackTrace();
}
}
}
// 注入数据对象
public interface IUnZipCallBack {
/**
* 开始解压数据
*/
void onStart();
/**
* @param outFileDirectory
*/
void Response(String outFileDirectory);
/**
* 解压失败
*/
void onError();
}
/**
* 解压Assets中的文件
*
* @param assetName 压缩包文件名
* @param outputDirectory 输出目录
* @throws IOException
*/
public static void unZip(String assetName, String outputDirectory) throws IOException {
//创建解压目标目录
File file = new File(outputDirectory);
//如果目标目录不存在则创建
if (!file.exists()) {
file.mkdirs();
}
InputStream inputStream = null;
//打开压缩文件
inputStream = mContext.getAssets().open(assetName);
ZipInputStream zipInputStream = new ZipInputStream(inputStream);
//读取一个进入点
ZipEntry zipEntry = zipInputStream.getNextEntry();
//使用1Mbuffer
byte[] buffer = new byte[1024 * 1024];
//解压时字节计数
int count = 0;
//如果进入点为空说明已经遍历完所有压缩包中文件和目录
while (zipEntry != null) {
//如果是一个目录
if (zipEntry.isDirectory()) {
//String name = zipEntry.getName();
//name = name.substring(0, name.length() - 1);
file = new File(outputDirectory + File.separator + zipEntry.getName());
file.mkdir();
} else {
//如果是文件
file = new File(outputDirectory + File.separator
+ zipEntry.getName());
//创建该文件
file.createNewFile();
FileOutputStream fileOutputStream = new FileOutputStream(file);
while ((count = zipInputStream.read(buffer)) > 0) {
fileOutputStream.write(buffer, 0, count);
}
fileOutputStream.close();
}
//定位到下一个文件入口
zipEntry = zipInputStream.getNextEntry();
}
zipInputStream.close();
}
public boolean isFileEmpty(String path) {
File file = new File(path);
if (file.exists()) {
File[] files = file.listFiles();
if (files!=null && files.length > 0) return false;
}
return true;
}
public String get(Context context, int id) {
InputStream stream = context.getResources().openRawResource(id);
return read(stream);
}
public String read(InputStream stream) {
return read(stream, "utf-8");
}
public String read(InputStream is, String encode) {
if (is != null) {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(is, encode));
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
is.close();
return sb.toString();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
return "";
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:bottomLeftRadius="17dp"
android:bottomRightRadius="17dp"
android:topLeftRadius="27dp"
android:topRightRadius="27dp"
/>
<solid android:color="#4d000000"/>
</shape>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<solid android:color="#20ffffff" />
</shape>
</item>
<item android:id="@android:id/secondaryProgress">
<clip>
<shape>
<solid android:color="#ff51495e" />
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<solid android:color="#20ffffff" />
</shape>
</clip>
</item>
</layer-list>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/seek_thumb" />
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/seek_thumb_press" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/seek_thumb_press" />
<item android:drawable="@drawable/seek_thumb" />
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/beauty_btn"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_margin="16dp"
android:layout_alignParentBottom="true"
android:gravity="center"
android:onClick="startBeauty"
android:text="点我变美"/>
<ImageView
android:id="@+id/edit_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/beauty_btn"
android:scaleType="centerInside" />
</RelativeLayout>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:gravity="center"
android:layout_height="match_parent">
<Button
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_margin="16dp"
android:onClick="startCamera"
android:text="相机"/>
<Button
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_margin="16dp"
android:onClick="startEdit"
android:text="编辑"/>
</LinearLayout>

View File

@ -1,215 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:id="@+id/layout_surface"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:orientation="vertical">
<SurfaceView
android:id="@+id/surface_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="center_horizontal"
android:orientation="vertical"
>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="粉嫩程度"
android:textColor="#000000"/>
<SeekBar
android:id="@+id/seek_pink"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:maxHeight="3.0dip"
android:minHeight="3.0dip"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:progressDrawable="@drawable/seekbar_bg"
android:thumb="@drawable/seekbar_thumb_selector"
/>
<TextView
android:id="@+id/pink_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="0.30"
android:textColor="#000000"/>
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="白皙程度"
android:textColor="#000000"/>
<SeekBar
android:id="@+id/seek_whiten"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:maxHeight="3.0dip"
android:minHeight="3.0dip"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:progressDrawable="@drawable/seekbar_bg"
android:thumb="@drawable/seekbar_thumb_selector"
/>
<TextView
android:id="@+id/whiten_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="0.30"
android:textColor="#000000"/>
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="红润程度"
android:textColor="#000000"/>
<SeekBar
android:id="@+id/seek_redden"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:maxHeight="3.0dip"
android:minHeight="3.0dip"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:progressDrawable="@drawable/seekbar_bg"
android:thumb="@drawable/seekbar_thumb_selector"
/>
<TextView
android:id="@+id/redden_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="0.30"
android:textColor="#000000"/>
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="美肤强度"
android:textColor="#000000"/>
<SeekBar
android:id="@+id/seek_soften"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:maxHeight="3.0dip"
android:minHeight="3.0dip"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:progressDrawable="@drawable/seekbar_bg"
android:thumb="@drawable/seekbar_thumb_selector"
/>
<TextView
android:id="@+id/soften_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="0.30"
android:textColor="#000000"/>
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="65dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/listview"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="滤镜强度"
android:textColor="#000000"/>
<SeekBar
android:id="@+id/filter_redden"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:maxHeight="3.0dip"
android:minHeight="3.0dip"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:progressDrawable="@drawable/seekbar_bg"
android:thumb="@drawable/seekbar_thumb_selector"
/>
<TextView
android:id="@+id/filter_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="0.30"
android:textColor="#000000"/>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/tv_sticker"
android:background="@color/color_normalitem"
android:gravity="center"
android:layout_margin="10dp"
android:layout_width="80dp"
android:layout_height="40dp"
android:layout_gravity="center_horizontal"
android:text="贴纸"
android:textColor="#ffffff"
android:textSize="15sp"/>
</RelativeLayout>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/layout_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp">
<TextView
android:id="@+id/tv_name"
android:layout_width="60dp"
android:layout_height="60dp"
android:gravity="center"
android:text="dfdsf" />
</LinearLayout>
</RelativeLayout>

View File

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:id="@+id/layout_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:id="@+id/tv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="12sp"
android:singleLine="true"
android:textColor="@color/color_white"
android:text="test" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/iv_lvjing"
android:paddingTop="10dp"
android:src="@drawable/shen_du_mei_bai"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center_horizontal"
app:riv_border_color="@color/gray1"
app:riv_corner_radius="10dip"
/>
</LinearLayout>
</RelativeLayout>

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/layout_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:singleLine="true"
android:id="@+id/tv_name"
android:textSize="8sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="dfdsf" />
<ImageView
android:id="@+id/iv_tiezhi"
android:paddingTop="5dp"
android:src="@drawable/icon_none"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
/>
</LinearLayout>
</RelativeLayout>

View File

@ -1,6 +0,0 @@
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="color_normalitem">#FF0000</color>
<color name="color_white">#ffffff</color>
<color name="color_selectedlitem">#303F9F</color>
<color name="color_yellow">#fffa37</color>
</resources>

View File

@ -1,6 +0,0 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="common_navigator_height">36dp</dimen>
</resources>

View File

@ -1,3 +0,0 @@
<resources>
<string name="app_name">PrettyDemo</string>
</resources>

View File

@ -1,5 +0,0 @@
<resources>
</resources>

View File

@ -1,14 +0,0 @@
package com.by.lib_beauty360;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
// @Test
// public void addition_isCorrect() {
// assertEquals(4, 2 + 2);
// }
}

View File

@ -1 +1 @@
apply plugin: 'com.android.library' apply plugin: 'img-optimizer' apply plugin: 'kotlin-android' android { compileSdkVersion rootProject.ext.android.compileSdkVersion buildToolsVersion rootProject.ext.android.buildToolsVersion aaptOptions.cruncherEnabled = false aaptOptions.useNewCruncher = false packagingOptions { pickFirst "lib/armeabi/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" exclude "lib/arm64-v8a/libmmcv_api_express.so" exclude "lib/arm64-v8a/libMediaEncoder.so" exclude "lib/arm64-v8a/libarcore_sdk_c.so" exclude "lib/arm64-v8a/libmediadecoder.so" exclude "lib/arm64-v8a/libMediaMuxer.so" exclude "lib/arm64-v8a/libarcore_sdk_jni.so" exclude "lib/arm64-v8a/libMediaUtils.so" exclude "lib/arm64-v8a/libcosmosffmpeg.so" } defaultConfig { minSdkVersion rootProject.ext.android.minSdkVersion targetSdkVersion rootProject.ext.android.targetSdkVersion versionCode rootProject.ext.android.versionCode versionName rootProject.ext.android.versionName manifestPlaceholders = rootProject.ext.manifestPlaceholders ndk { abiFilters "armeabi-v7a", "arm64-v8a" } javaCompileOptions { annotationProcessorOptions { arguments = [AROUTER_MODULE_NAME: project.getName()] } } } aaptOptions { cruncherEnabled = false useNewCruncher = false } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } kotlinOptions { allWarningsAsErrors = true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } repositories { flatDir { dirs 'libs', '../libs' } mavenCentral() } dependencies { implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) //socket.io implementation('io.socket:socket.io-client:1.0.0') { exclude group: 'org.json', module: 'json' } //common implementation project(path: ':common') annotationProcessor rootProject.ext.dependencies["arouter-compiler"] //萌颜 implementation project(path: ':beauty') implementation project(path: ':lib_beauty360') //工具 api rootProject.ext.dependencies["blank-utilcode"] implementation 'com.eightbitlab:blurview:1.6.6' implementation files('libs/beautysdk-202202241203.aar') implementation 'com.google.code.gson:gson:2.8.6' implementation "com.getkeepsafe.relinker:relinker:1.4.4" }
apply plugin: 'com.android.library' apply plugin: 'img-optimizer' apply plugin: 'kotlin-android' android { compileSdkVersion rootProject.ext.android.compileSdkVersion buildToolsVersion rootProject.ext.android.buildToolsVersion aaptOptions.cruncherEnabled = false aaptOptions.useNewCruncher = false packagingOptions { pickFirst "lib/armeabi/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" exclude "lib/arm64-v8a/libmmcv_api_express.so" exclude "lib/arm64-v8a/libMediaEncoder.so" exclude "lib/arm64-v8a/libarcore_sdk_c.so" exclude "lib/arm64-v8a/libmediadecoder.so" exclude "lib/arm64-v8a/libMediaMuxer.so" exclude "lib/arm64-v8a/libarcore_sdk_jni.so" exclude "lib/arm64-v8a/libMediaUtils.so" exclude "lib/arm64-v8a/libcosmosffmpeg.so" } defaultConfig { minSdkVersion rootProject.ext.android.minSdkVersion targetSdkVersion rootProject.ext.android.targetSdkVersion versionCode rootProject.ext.android.versionCode versionName rootProject.ext.android.versionName manifestPlaceholders = rootProject.ext.manifestPlaceholders ndk { abiFilters "armeabi-v7a", "arm64-v8a" } javaCompileOptions { annotationProcessorOptions { arguments = [AROUTER_MODULE_NAME: project.getName()] } } } aaptOptions { cruncherEnabled = false useNewCruncher = false } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } kotlinOptions { allWarningsAsErrors = true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } repositories { flatDir { dirs 'libs', '../libs' } mavenCentral() } dependencies { implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) //socket.io implementation('io.socket:socket.io-client:1.0.0') { exclude group: 'org.json', module: 'json' } //common implementation project(path: ':common') annotationProcessor rootProject.ext.dependencies["arouter-compiler"] //萌颜 implementation project(path: ':beauty') //工具 api rootProject.ext.dependencies["blank-utilcode"] implementation 'com.eightbitlab:blurview:1.6.6' implementation files('libs/beautysdk-202202241203.aar') implementation 'com.google.code.gson:gson:2.8.6' implementation "com.getkeepsafe.relinker:relinker:1.4.4" }

View File

@ -21,10 +21,6 @@ import android.widget.FrameLayout;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.bumptech.glide.Glide;
import com.by.lib_beauty360.ItemData4TieZhi;
import com.by.lib_beauty360.PreviewUtils;
import com.by.lib_beauty360.RecycleView.HomeItemCell4Tiezhi;
import com.tencent.rtmp.ITXLivePushListener;
import com.tencent.rtmp.TXLiveConstants;
import com.tencent.rtmp.TXLivePushConfig;
@ -75,7 +71,6 @@ public class LivePushTxViewHolder360Beauty extends AbsLivePushViewHolder impleme
private Bitmap mFilterBmp;
public PreviewUtils mPreviewUtils;
private boolean mFirstFrame = true;
private OrientationEventListener mOrientationListener;
@ -245,7 +240,6 @@ public class LivePushTxViewHolder360Beauty extends AbsLivePushViewHolder impleme
private void initBeauty360() {
// mPreviewUtils = new PreviewUtils(mContext, this);
mSurfaceView360 = (SurfaceView) findViewById(com.by.lib_beauty360.R.id.surface_view);
//
// View layoutSurface = findViewById(com.by.lib_beauty360.R.id.layout_surface);
// layoutSurface.setOnTouchListener(new View.OnTouchListener() {

View File

@ -4,4 +4,5 @@
<dimen name="live_top">120dp</dimen>
<dimen name="live_btn">50dp</dimen>
<dimen name="live_chat1">44dp</dimen>
<dimen name="common_navigator_height">36dp</dimen>
</resources>

View File

@ -53,7 +53,7 @@
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:scaleType="centerCrop"
android:src="@drawable/m_fei_yan"
android:src="@drawable/m_chu_xia"
app:riv_oval="true" />
<ImageView
@ -90,7 +90,7 @@
android:layout_centerHorizontal="true"
android:scaleType="centerCrop"
android:layout_centerInParent="true"
android:src="@drawable/m_fei_yan"
android:src="@drawable/m_chu_xia"
app:riv_oval="true" />
@ -131,7 +131,7 @@
android:layout_centerHorizontal="true"
android:scaleType="centerCrop"
android:layout_centerInParent="true"
android:src="@drawable/m_fei_yan"
android:src="@drawable/m_chu_xia"
app:riv_oval="true" />

View File

@ -1 +1 @@
include ':app', ':beauty', ':video', ':common', ':main', ':baidu', ':live', ':lib_country_code', ':lib_beauty360'
include ':app', ':beauty', ':video', ':common', ':main', ':baidu', ':live', ':lib_country_code'

View File

@ -63,7 +63,6 @@ dependencies {
implementation project(path: ':common')
//
implementation project(path: ':beauty')
implementation project(path: ':lib_beauty360')
//
implementation project(path: ':live')