Skip to content

Commit 37416a3

Browse files
author
tatemin
committed
Android 更新SDK 7.7.9457
1 parent e9c7d49 commit 37416a3

File tree

14 files changed

+121
-59
lines changed

14 files changed

+121
-59
lines changed

Android/Demo/beautysettingkit/src/main/assets/default_beauty_data.json

Lines changed: 49 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -273,145 +273,162 @@
273273
"item_level": 4,
274274
"item_icon_normal": "@beauty_biaozhun",
275275
"item_icon_select": "@beauty_biaozhun"
276-
},
277-
{
276+
},{
278277
"item_id": 3,
279278
"item_type": 20203,
279+
"item_name": "@beauty_panel_filter_ziran",
280+
"item_material_url": "",
281+
"item_level": 5,
282+
"item_icon_normal": "@beauty_ziran",
283+
"item_icon_select": "@beauty_ziran"
284+
},
285+
{
286+
"item_id": 4,
287+
"item_type": 20204,
288+
"item_name": "@beauty_panel_filter_baixi",
289+
"item_material_url": "",
290+
"item_level": 5,
291+
"item_icon_normal": "@beauty_baixi",
292+
"item_icon_select": "@beauty_baixi"
293+
},
294+
{
295+
"item_id": 5,
296+
"item_type": 20205,
280297
"item_name": "@beauty_panel_filter_cheery",
281298
"item_material_url": "",
282299
"item_level": 8,
283300
"item_icon_normal": "@beauty_yinghong",
284301
"item_icon_select": "@beauty_yinghong"
285302
},
286303
{
287-
"item_id": 4,
288-
"item_type": 20204,
304+
"item_id": 6,
305+
"item_type": 20206,
289306
"item_name": "@beauty_panel_filter_cloud",
290307
"item_material_url": "",
291308
"item_level": 8,
292309
"item_icon_normal": "@beauty_yunshang",
293310
"item_icon_select": "@beauty_yunshang"
294311
},
295312
{
296-
"item_id": 5,
297-
"item_type": 20205,
313+
"item_id": 7,
314+
"item_type": 20207,
298315
"item_name": "@beauty_panel_filter_pure",
299316
"item_material_url": "",
300317
"item_level": 8,
301318
"item_icon_normal": "@beauty_chunzhen",
302319
"item_icon_select": "@beauty_chunzhen"
303320
},
304321
{
305-
"item_id": 6,
306-
"item_type": 20206,
322+
"item_id": 8,
323+
"item_type": 20208,
307324
"item_name": "@beauty_panel_filter_orchid",
308325
"item_material_url": "",
309326
"item_level": 9,
310327
"item_icon_normal": "@beauty_bailan",
311328
"item_icon_select": "@beauty_bailan"
312329
},
313330
{
314-
"item_id": 7,
315-
"item_type": 20207,
331+
"item_id": 9,
332+
"item_type": 20209,
316333
"item_name": "@beauty_panel_filter_vitality",
317334
"item_material_url": "",
318335
"item_level": 8,
319336
"item_icon_normal": "@beauty_yuanqi",
320337
"item_icon_select": "@beauty_yuanqi"
321338
},
322339
{
323-
"item_id": 8,
324-
"item_type": 20208,
340+
"item_id": 10,
341+
"item_type": 20210,
325342
"item_name": "@beauty_panel_filter_super",
326343
"item_material_url": "",
327344
"item_level": 9,
328345
"item_icon_normal": "@beauty_chaotuo",
329346
"item_icon_select": "@beauty_chaotuo"
330347
},
331348
{
332-
"item_id": 9,
333-
"item_type": 20209,
349+
"item_id": 11,
350+
"item_type": 20211,
334351
"item_name": "@beauty_panel_filter_fragrance",
335352
"item_material_url": "",
336353
"item_level": 5,
337354
"item_icon_normal": "@beauty_xiangfen",
338355
"item_icon_select": "@beauty_xiangfen"
339356
},
340357
{
341-
"item_id": 10,
342-
"item_type": 20210,
358+
"item_id": 12,
359+
"item_type": 20212,
343360
"item_name": "@beauty_panel_filter_white",
344361
"item_material_url": "",
345362
"item_level": 5,
346363
"item_icon_normal": "@beauty_fwhite",
347364
"item_icon_select": "@beauty_fwhite"
348365
},
349366
{
350-
"item_id": 11,
351-
"item_type": 20211,
367+
"item_id": 13,
368+
"item_type": 20213,
352369
"item_name": "@beauty_panel_filter_romantic",
353370
"item_material_url": "",
354371
"item_level": 5,
355372
"item_icon_normal": "@beauty_langman",
356373
"item_icon_select": "@beauty_langman"
357374
},
358375
{
359-
"item_id": 12,
360-
"item_type": 20212,
376+
"item_id": 14,
377+
"item_type": 20214,
361378
"item_name": "@beauty_panel_filter_fresh",
362379
"item_material_url": "",
363380
"item_level": 5,
364381
"item_icon_normal": "@beauty_qingxin",
365382
"item_icon_select": "@beauty_qingxin"
366383
},
367384
{
368-
"item_id": 13,
369-
"item_type": 20213,
385+
"item_id": 15,
386+
"item_type": 20215,
370387
"item_name": "@beauty_panel_filter_beautiful",
371388
"item_material_url": "",
372389
"item_level": 5,
373390
"item_icon_normal": "@beauty_weimei",
374391
"item_icon_select": "@beauty_weimei"
375392
},
376393
{
377-
"item_id": 14,
378-
"item_type": 20214,
394+
"item_id": 16,
395+
"item_type": 20216,
379396
"item_name": "@beauty_panel_filter_pink",
380397
"item_material_url": "",
381398
"item_level": 5,
382399
"item_icon_normal": "@beauty_fennen",
383400
"item_icon_select": "@beauty_fennen"
384401
},
385402
{
386-
"item_id": 15,
387-
"item_type": 20215,
403+
"item_id": 17,
404+
"item_type": 20217,
388405
"item_name": "@beauty_panel_filter_reminiscence",
389406
"item_material_url": "",
390407
"item_level": 5,
391408
"item_icon_normal": "@beauty_huaijiu",
392409
"item_icon_select": "@beauty_huaijiu"
393410
},
394411
{
395-
"item_id": 16,
396-
"item_type": 20216,
412+
"item_id": 18,
413+
"item_type": 20218,
397414
"item_name": "@beauty_panel_filter_blues",
398415
"item_material_url": "",
399416
"item_level": 5,
400417
"item_icon_normal": "@beauty_landiao",
401418
"item_icon_select": "@beauty_landiao"
402419
},
403420
{
404-
"item_id": 17,
405-
"item_type": 20217,
421+
"item_id": 19,
422+
"item_type": 20219,
406423
"item_name": "@beauty_panel_filter_cool",
407424
"item_material_url": "",
408425
"item_level": 5,
409426
"item_icon_normal": "@beauty_qingliang",
410427
"item_icon_select": "@beauty_qingliang"
411428
},
412429
{
413-
"item_id": 18,
414-
"item_type": 20218,
430+
"item_id": 20,
431+
"item_type": 20220,
415432
"item_name": "@beauty_panel_filter_Japanese",
416433
"item_material_url": "",
417434
"item_level": 5,

Android/Demo/beautysettingkit/src/main/java/com/tencent/liteav/demo/beauty/Beauty.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public interface Beauty {
1717
void setMotionTmplEnable(boolean enable);
1818
void fillingMaterialPath(@NonNull BeautyInfo beautyInfo);
1919
void setCurrentFilterIndex(@NonNull BeautyInfo beautyInfo, @IntRange(from = 0) int index);
20+
void setCurrentBeautyIndex(@NonNull BeautyInfo beautyInfo, @IntRange(from = 0) int index);
2021
void setOnFilterChangeListener(OnFilterChangeListener listener);
2122
void clear();
2223
int getFilterProgress(@NonNull BeautyInfo beautyInfo, @IntRange(from = 0) int index);

Android/Demo/beautysettingkit/src/main/java/com/tencent/liteav/demo/beauty/BeautyImpl.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,16 @@ public void setCurrentFilterIndex(BeautyInfo beautyInfo, int index) {
416416
}
417417
}
418418

419+
@Override
420+
public void setCurrentBeautyIndex(@NonNull BeautyInfo beautyInfo, int index) {
421+
for (TabInfo tabInfo : beautyInfo.getBeautyTabList()) {
422+
if (tabInfo.getTabType() == BeautyConstants.TAB_TYPE_BEAUTY) {
423+
ItemInfo itemInfo = tabInfo.getTabItemList().get(index);
424+
dispatchBeautyEffects(itemInfo);
425+
}
426+
}
427+
}
428+
419429
@Override
420430
public void setOnFilterChangeListener(OnFilterChangeListener listener) {
421431
mOnFilterChangeListener = listener;
@@ -715,6 +725,12 @@ private Bitmap decodeFilterResource(@NonNull ItemInfo itemInfo) {
715725
case BeautyConstants.ITEM_TYPE_FILTER_STANDARD:
716726
resId = R.drawable.beauty_filter_biaozhun;
717727
break;
728+
case BeautyConstants.ITEM_TYPE_FILTER_ZIRAN:
729+
resId = R.drawable.beauty_filter_ziran;
730+
break;
731+
case BeautyConstants.ITEM_TYPE_FILTER_BAIXI:
732+
resId = R.drawable.beauty_filter_baixi;
733+
break;
718734
case BeautyConstants.ITEM_TYPE_FILTER_CHEERY:
719735
resId = R.drawable.beauty_filter_yinghong;
720736
break;

Android/Demo/beautysettingkit/src/main/java/com/tencent/liteav/demo/beauty/adapter/ItemAdapter.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ public ItemAdapter(Context context) {
3838
}
3939

4040
public void setData(TabInfo tabInfo) {
41+
setData(tabInfo, 0);
42+
}
43+
44+
public void setData(TabInfo tabInfo, int defaultIndex) {
4145
mTabInfo = tabInfo;
46+
mSelectPos = defaultIndex;
4247
if (mItemInfoList == null) {
4348
mItemInfoList = new ArrayList<>();
4449
}
@@ -106,10 +111,10 @@ public View getView(final int position, View convertView, ViewGroup parent) {
106111
public void onClick(View v) {
107112
if (mItemClickListener != null) {
108113
mItemClickListener.onItemClick(itemInfo, position);
109-
}
110-
if (mSelectPos != position) {
111-
mSelectPos = position;
112-
notifyDataSetChanged();
114+
if (mSelectPos != position) {
115+
mSelectPos = position;
116+
notifyDataSetChanged();
117+
}
113118
}
114119
}
115120
});

Android/Demo/beautysettingkit/src/main/java/com/tencent/liteav/demo/beauty/constant/BeautyConstants.java

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,24 @@ public class BeautyConstants {
3737

3838
public static final int ITEM_TYPE_FILTER_FACE_SHAPE = 20201; // 无特效
3939
public static final int ITEM_TYPE_FILTER_STANDARD = 20202; // 标准
40-
public static final int ITEM_TYPE_FILTER_CHEERY = 20203; // 樱红
41-
public static final int ITEM_TYPE_FILTER_CLOUD = 20204; // 云裳
42-
public static final int ITEM_TYPE_FILTER_PURE = 20205; // 纯真
43-
public static final int ITEM_TYPE_FILTER_ORCHID = 20206; // 白兰
44-
public static final int ITEM_TYPE_FILTER_VITALITY = 20207; // 元气
45-
public static final int ITEM_TYPE_FILTER_SUPER = 20208; // 超脱
46-
public static final int ITEM_TYPE_FILTER_FRAGRANCE = 20209; // 香氛
47-
public static final int ITEM_TYPE_FILTER_WHITE = 20210; // 美白
48-
public static final int ITEM_TYPE_FILTER_ROMANTIC = 20211; // 浪漫
49-
public static final int ITEM_TYPE_FILTER_FRESH = 20212; // 清新
50-
public static final int ITEM_TYPE_FILTER_BEAUTIFUL = 20213; // 唯美
51-
public static final int ITEM_TYPE_FILTER_PINK = 20214; // 粉嫩
52-
public static final int ITEM_TYPE_FILTER_REMINISCENCE = 20215; // 怀旧
53-
public static final int ITEM_TYPE_FILTER_BLUES = 20216; // 蓝调
54-
public static final int ITEM_TYPE_FILTER_COOL = 20217; // 清凉
55-
public static final int ITEM_TYPE_FILTER_JAPANESE = 20218; // 日系
40+
public static final int ITEM_TYPE_FILTER_ZIRAN = 20203; // 自然
41+
public static final int ITEM_TYPE_FILTER_BAIXI = 20204; // 白皙
42+
public static final int ITEM_TYPE_FILTER_CHEERY = 20205; // 樱红
43+
public static final int ITEM_TYPE_FILTER_CLOUD = 20206; // 云裳
44+
public static final int ITEM_TYPE_FILTER_PURE = 20207; // 纯真
45+
public static final int ITEM_TYPE_FILTER_ORCHID = 20208; // 白兰
46+
public static final int ITEM_TYPE_FILTER_VITALITY = 20209; // 元气
47+
public static final int ITEM_TYPE_FILTER_SUPER = 20210; // 超脱
48+
public static final int ITEM_TYPE_FILTER_FRAGRANCE = 20211; // 香氛
49+
public static final int ITEM_TYPE_FILTER_WHITE = 20212; // 美白
50+
public static final int ITEM_TYPE_FILTER_ROMANTIC = 20213; // 浪漫
51+
public static final int ITEM_TYPE_FILTER_FRESH = 20214; // 清新
52+
public static final int ITEM_TYPE_FILTER_BEAUTIFUL = 20215; // 唯美
53+
public static final int ITEM_TYPE_FILTER_PINK = 20216; // 粉嫩
54+
public static final int ITEM_TYPE_FILTER_REMINISCENCE = 20217; // 怀旧
55+
public static final int ITEM_TYPE_FILTER_BLUES = 20218; // 蓝调
56+
public static final int ITEM_TYPE_FILTER_COOL = 20219; // 清凉
57+
public static final int ITEM_TYPE_FILTER_JAPANESE = 20220; // 日系
5658

5759

5860
public static final int ITEM_TYPE_MOTION_NONE = 20301; // 动效,无特效

Android/Demo/beautysettingkit/src/main/java/com/tencent/liteav/demo/beauty/view/BeautyPanel.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.tencent.liteav.demo.beauty.BeautyImpl;
1919
import com.tencent.liteav.demo.beauty.adapter.ItemAdapter;
2020
import com.tencent.liteav.demo.beauty.adapter.TabAdapter;
21+
import com.tencent.liteav.demo.beauty.constant.BeautyConstants;
2122
import com.tencent.liteav.demo.beauty.model.BeautyInfo;
2223
import com.tencent.liteav.demo.beauty.model.ItemInfo;
2324
import com.tencent.liteav.demo.beauty.model.TabInfo;
@@ -154,6 +155,9 @@ public BeautyInfo getDefaultBeautyInfo() {
154155

155156
public void setBeautyManager(TXBeautyManager beautyManager) {
156157
mBeauty.setBeautyManager(beautyManager);
158+
// 滤镜默认选中白皙
159+
setCurrentFilterIndex(3);
160+
setCurrentBeautyIndex(2);
157161
}
158162

159163
public void setMotionTmplEnable(boolean enable) {
@@ -168,6 +172,10 @@ public void setCurrentFilterIndex(int index) {
168172
mBeauty.setCurrentFilterIndex(mBeautyInfo, index);
169173
}
170174

175+
public void setCurrentBeautyIndex(int index) {
176+
mBeauty.setCurrentBeautyIndex(mBeautyInfo, index);
177+
}
178+
171179
public ItemInfo getFilterItemInfo(int index) {
172180
return mBeauty.getFilterItemInfo(mBeautyInfo, index);
173181
}
@@ -237,7 +245,15 @@ public void onTabChange(TabInfo tabInfo, int position) {
237245
private void createItemList(@NonNull final TabInfo tabInfo, @NonNull final int tabPosition) {
238246
setBeautyTitle(tabInfo.getTabName());
239247
ItemAdapter itemAdapter = new ItemAdapter(mContext);
240-
itemAdapter.setData(tabInfo);
248+
if (tabInfo.getTabType() == BeautyConstants.TAB_TYPE_FILTER) {
249+
// 滤镜默认选中白皙
250+
itemAdapter.setData(tabInfo, 3);
251+
} else if(tabInfo.getTabType() == BeautyConstants.TAB_TYPE_BEAUTY) {
252+
// 美颜默认选中P图
253+
itemAdapter.setData(tabInfo, 2);
254+
} else {
255+
itemAdapter.setData(tabInfo);
256+
}
241257
mScrollItemView.setAdapter(itemAdapter);
242258
mScrollItemView.setClicked(mCurrentItemPosition[tabPosition]);
243259
itemAdapter.setOnItemClickListener(new ItemAdapter.OnItemClickListener() {
45.1 KB
Loading
237 KB
Loading
274 KB
Loading
46.4 KB
Loading

0 commit comments

Comments
 (0)