Commit a6be91c5 a6be91c55b61208cb412fb1678e60af2cc7b2337 by 金学艇

1.解决透明度问题

1 parent b994d0fb
......@@ -207,7 +207,7 @@
"array": [
0,
0,
271.0659484863281,
265.0037841796875,
0,
0,
0,
......@@ -2653,8 +2653,8 @@
}
],
"_useOriginalSize": false,
"_string": "应用信息",
"_N$string": "应用信息",
"_string": "精彩图片",
"_N$string": "精彩图片",
"_fontSize": 32,
"_lineHeight": 45,
"_enableWrapText": true,
......@@ -3800,12 +3800,6 @@
"PFB_RECOMMEN_CATEGORY": {
"__uuid__": "3555d4d3-0ee6-47bb-9039-3bb44aab89a2"
},
"test_detail_type_json": {
"__uuid__": "11cd5783-c449-45e7-8f89-78d931485c00"
},
"test_detail_json": {
"__uuid__": "769f72d2-5dbf-4a57-852a-b416a22d17f8"
},
"_id": "e7L+WJBsFHUK29Fs5R70+b"
}
]
\ No newline at end of file
......
......@@ -192,7 +192,7 @@
"array": [
0,
0,
271.0659484863281,
265.0037841796875,
0,
0,
0,
......@@ -5631,7 +5631,7 @@
},
{
"__type__": "cc.Node",
"_name": "New Label",
"_name": "Version",
"_objFlags": 0,
"_parent": {
"__id__": 2
......@@ -5657,7 +5657,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 201.96,
"width": 205.52,
"height": 30.24
},
"_anchorPoint": {
......@@ -5708,8 +5708,8 @@
}
],
"_useOriginalSize": false,
"_string": "v0.9.0.2020031117",
"_N$string": "v0.9.0.2020031117",
"_string": "v0.9.0.2020031217",
"_N$string": "v0.9.0.2020031217",
"_fontSize": 24,
"_lineHeight": 24,
"_enableWrapText": true,
......@@ -5736,7 +5736,7 @@
"_target": null,
"_alignFlags": 36,
"_left": 0,
"_right": 10,
"_right": 8.219999999999999,
"_top": 0,
"_bottom": 10,
"_verticalCenter": 0,
......
......@@ -231,11 +231,11 @@ cc.Class({
// }
cc.log("向下滑动:" + fiFocusTarget.node.name);
this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_DOWN, 1.0, oScrollParameter);
}
if (this._fiCurrentFocus.node.name == "Play" && this._bShowProgress) {
this.showSelectGatherArea();
return;
}
}
// if (this._fiCurrentFocus.node.name == "Play" && this._bShowProgress) { //暂时隐藏选集框,否则点击单曲循环会出现问题
// this.showSelectGatherArea();
// return;
// }
}
if (event.keyCode == cc.macro.KEY.left || event.keyCode == Common.ANDROID_KEY.left) {
if (this._fiCurrentFocus.node.name == "Nothing") {
......
......@@ -71,6 +71,7 @@ cc.Class({
this._bAbleHotUpdate = false;
this._bIsDataListMoving = false;
this._bIsScrollViewMoving = false;
this._bInitCategoryListSuccess = true;
this._scrollview = this.node.getComponent(cc.ScrollView);
this._oSceneContext.focusPath = "scrollContent/TopNavi/topNavi1";
this._oSceneContext._iPageIndex = 1;
......@@ -590,8 +591,6 @@ cc.Class({
// cc.log("子节点:"+nodeLayout.childrenCount);
}
if (this._oSceneContext._iPageIndex != 1)
this.recoverFocusPath(); //有必要的话去恢复焦点记忆
// this.node.getChildByName("scrollContent").height = 2300; //这里暂且写死,scrollView有bug
// this._scrollview.scrollToTop();
} catch (error) {
......@@ -605,6 +604,13 @@ cc.Class({
recoverFocusPath: function () {
if (this._oSceneContext._iCurrentLeftIndex == 1) {
if (this._oSceneContext._iPageIndex == 1) {
this.scheduleOnce(()=>{
let fiFocusTarget = cc.find(this._oSceneContext.focusPath, this.node).getComponent(FocusInfo);
this._cFocus.flyFocus(this._fiCurrentFocus, fiFocusTarget, Common.MOVE_DIRECTION_DOWN, null, null);
return;
},0)
}
let height = this._aBgHeight[this._oSceneContext._iPageIndex - 1] || 0; //-1,打补丁:解决回退回来页面对不上的bug
this.onScrollViewScrollStart();
this._scrollview.scrollToOffset(cc.v2(0, height), 0.5);
......@@ -761,8 +767,11 @@ cc.Class({
);
// lvCategoryList.loadData(
// function (strResponse) {
// cc.log("列表:" + JSON.stringify(this._aJsonList[this._oSceneContext._iCurrentLeftIndex]));
// cc.log("列表:" + this._oInit[this._oSceneContext._iCurrentLeftIndex]);
let strResponse = this._oInit[this._oSceneContext._iCurrentLeftIndex]; //这里采用列表
if (strResponse && strResponse != "undefined") { //防止焦点未初始化完成就去跳转,导致报错
this._bInitCategoryListSuccess = false;
}
lvCategoryList.renderInitData(strResponse, function () {
cc.log("InitCategoryList-------------------->");
var oJSONResult = JSON.parse(strResponse);
......@@ -816,10 +825,10 @@ cc.Class({
var nodeInitFocus;
if (this._oSceneContext._iCurrentLeftIndex == 1) { //只对导航1瀑布流做光标记忆,其他暂不做,以后考虑会做
nodeInitFocus = cc.find(this._oSceneContext.focusPath, this.node);
}else{
} else {
nodeInitFocus = cc.find("scrollContent/TopNavi/topNavi" + this._oSceneContext._iCurrentLeftIndex, this.node);
}
// cc.log("初始化 "+nodeInitFocus.name);
var nodeFocus = new cc.Node('nodeFocus');
this.node.addChild(nodeFocus, 10);
......@@ -829,11 +838,15 @@ cc.Class({
Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, 10, 6, 1.1, true);
this._cFocus.hide();
if (this._oSceneContext.focusPath != "scrollContent/TopNavi/topNavi1")
this.recoverFocusPath(); //有必要的话去恢复焦点记忆
if (this._oSceneContext._iCurrentLeftIndex > 1) { //不是第一个焦点框就跳过去,恢复记忆
this.scheduleOnce(function () {
this._cFocus.flyFocus(this._fiCurrentFocus, nodeInitFocus.getComponent(FocusInfo), Common.MOVE_DIRECTION_RIGHT, null, null);
}, 0);
}
if (!Common._bIsHotUpdate) {
Common._bIsHotUpdate = true;
this.checkUpdate(); //热更新
......@@ -874,6 +887,10 @@ cc.Class({
// cc.log("目标节点名称:" + fiFocusTarget.node.name);
var leftNavLayout = this.targetAry[0].target;
if (!this._bInitCategoryListSuccess) {
return [null, oScrollParameter];
}
if (fiFocusTarget && 0 == fiFocusTarget.node.name.indexOf("topNavi") || 0 == fiFocusTarget.node.name.indexOf("topCell")) {
if (0 != this._fiCurrentFocus.node.name.indexOf("topNavi") && 0 != this._fiCurrentFocus.node.name.indexOf("topCell")) {//如果不是TypeList之间跳转,则哪里来回哪里去
fiFocusTarget = cc.find("topNavi" + this._oSceneContext._iCurrentLeftIndex, leftNavLayout).getComponent(FocusInfo);
......@@ -1256,32 +1273,35 @@ cc.Class({
);
}
this._oSceneContext._iCurrentLeftIndex = iIndex;
this.scheduleOnce(function () {
// this.requestMediaList(1); //重新渲染CategoryList
this.getSimulateRequest();
}, 0);
// this.renderCategoryList(1);
if (0 == fiFrom.node.getName().indexOf('topNavi')) {//如果不是导航之间切换,不必要重新刷新数据
var rightNodeLayout = this.targetAry[1].target;
this._oSceneContext._iCurrentLeftIndex = iIndex;
this.scheduleOnce(function () {
// this.requestMediaList(1); //重新渲染CategoryList
this.getSimulateRequest();
}, 0);
// this.renderCategoryList(1);
if (iIndex == 1) {
cc.find("scrollContent/ViewPagerArea", this.node).active = true;
cc.find("scrollContent/BlockShadow", this.node).active = true;
// cc.find("scrollContent/CategoryList", this.node).active = false;
cc.find("scrollContent/CategoryListRecommendLayout", this.node).active = false;
} else {
cc.find("scrollContent/ViewPagerArea", this.node).active = false;
cc.find("scrollContent/BlockShadow", this.node).active = false;
// cc.find("scrollContent/CategoryList", this.node).active = true;
cc.find("scrollContent/CategoryListRecommendLayout", this.node).active = true;
}
var rightNodeLayout = this.targetAry[1].target;
for (let i = 0; i < rightNodeLayout.childrenCount; i++) {
if (iIndex == 1) { //“休闲益智”采用单独的框架渲染 || iIndex == 3
rightNodeLayout.children[i].active = true;
if (iIndex == 1) {
cc.find("scrollContent/ViewPagerArea", this.node).active = true;
cc.find("scrollContent/BlockShadow", this.node).active = true;
// cc.find("scrollContent/CategoryList", this.node).active = false;
cc.find("scrollContent/CategoryListRecommendLayout", this.node).active = false;
} else {
rightNodeLayout.children[i].active = false;
cc.find("scrollContent/ViewPagerArea", this.node).active = false;
cc.find("scrollContent/BlockShadow", this.node).active = false;
// cc.find("scrollContent/CategoryList", this.node).active = true;
cc.find("scrollContent/CategoryListRecommendLayout", this.node).active = true;
}
for (let i = 0; i < rightNodeLayout.childrenCount; i++) {
if (iIndex == 1) { //“休闲益智”采用单独的框架渲染 || iIndex == 3
rightNodeLayout.children[i].active = true;
} else {
rightNodeLayout.children[i].active = false;
}
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_single"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<ImageView
android:id="@+id/iv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@mipmap/icon_white"/>
</RelativeLayout>
\ No newline at end of file
......@@ -40,8 +40,10 @@ import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.webkit.WebView;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.topdraw.component.CocosMediaPlayer;
......@@ -54,13 +56,21 @@ public class AppActivity extends Cocos2dxActivity {
protected static Handler mUIHandler;
private BroadcastReceiver receiver = null;
private View view;
private View singleView;
private RelativeLayout relativeLayout;
private RelativeLayout mRLSingleColor;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//----解决游戏页按返回退出时,背景图透明度过高,onPause和onResume中控制显示还是隐藏
singleView = LayoutInflater.from(this).inflate(R.layout.activity_main_single_color, null);
mRLSingleColor = singleView.findViewById(R.id.ll_single);
mFrameLayout.addView(singleView);
//---- end
//添加加载小游戏进度条(暂时将Cocos2dxActivity中的this.mGLSurfaceView.setZOrderOnTop(true);注释,否则显示不出来)
view = LayoutInflater.from(this).inflate(R.layout.activity_main, null);
final RelativeLayout relativeLayout = view.findViewById(R.id.rl_img);
relativeLayout = view.findViewById(R.id.rl_img);
mFrameLayout.addView(view);
receiver = new BroadcastReceiver() {
@Override
......@@ -103,9 +113,6 @@ public class AppActivity extends Cocos2dxActivity {
// DO OTHER INITIALIZATION BELOW
SDKWrapper.getInstance().init(this);
//测试下载奥比中光
// TopdrawSDKWrapper.startOBiGame("com.topdraw.xhx.bird","");
}
//修改回默认主题,防止部分挖洞窗口有阴影
......@@ -129,15 +136,20 @@ public class AppActivity extends Cocos2dxActivity {
@Override
protected void onResume() {
Log.d("AppActivity", "onResume()....");
super.onResume();
SDKWrapper.getInstance().onResume();
mRLSingleColor.setVisibility(View.GONE);
}
@Override
protected void onPause() {
Log.d("AppActivity", "onPause()....");
mRLSingleColor.setVisibility(View.VISIBLE);
// setTheme(android.R.style.Theme_NoDisplay);
super.onPause();
SDKWrapper.getInstance().onPause();
}
@Override
......@@ -198,6 +210,7 @@ public class AppActivity extends Cocos2dxActivity {
@Override
protected void onStart() {
Log.d("AppActivity", "onStart()....");
SDKWrapper.getInstance().onStart();
super.onStart();
}
......