| | |
| | | import android.widget.LinearLayout; |
| | | import android.widget.RadioButton; |
| | | import android.widget.RadioGroup; |
| | | import android.widget.TextView; |
| | | import android.widget.Toast; |
| | | |
| | | import com.app.hubert.guide.util.ScreenUtils; |
| | |
| | | import com.huawei.android.hms.agent.HMSAgent; |
| | | import com.huawei.android.hms.agent.push.handler.GetTokenHandler; |
| | | import com.tejia.lijin.app.entity.TrendsCategory; |
| | | import com.tejia.lijin.app.ui.dialog.GoodsDetailJumpLoaingDialog; |
| | | import com.tejia.lijin.app.ui.recommend.GoodsDetailActivity; |
| | | import com.tejia.lijin.app.ui.trends.SendCircleFragmet; |
| | | import com.tejia.lijin.app.util.Constant; |
| | | import com.tejia.lijin.app.util.TopStatusSettings; |
| | | import com.tejia.lijin.app.util.ui.HomeUIUtil; |
| | | import com.umeng.analytics.MobclickAgent; |
| | |
| | | |
| | | |
| | | private SharedPreferences spkefu; |
| | | private ImageView img, tv_msg_num2; |
| | | private ImageView img; |
| | | private TextView tv_msg_count; |
| | | private DragFloatActionButton acbutton; |
| | | |
| | | String tag1 = "systemclient/getsystemclientparams"; |
| | |
| | | window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); |
| | | window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
| | | | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); |
| | | |
| | | // window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); |
| | | |
| | | window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); |
| | | window.setStatusBarColor(Color.TRANSPARENT); |
| | | int result = 0; |
| | |
| | | if (resourceId > 0) { |
| | | result = getResources().getDimensionPixelSize(resourceId); |
| | | } |
| | | //设置状态栏文字颜色及图标为深色 |
| | | // getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); |
| | | |
| | | |
| | | LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, |
| | | result); |
| | | findViewById(R.id.v_status_bar).setLayoutParams(params); |
| | | findViewById(R.id.v_status_bar).setBackground(HomeUIUtil.getHomeTopBg("#FF227B", "#FF2A3E")); |
| | | findViewById(R.id.v_status_bar).setBackground(HomeUIUtil.getHomeTopBg(getApplicationContext())); |
| | | } else { |
| | | findViewById(R.id.v_status_bar).setVisibility(View.GONE); |
| | | } |
| | |
| | | getSystemParams(); |
| | | v_no_login = findViewById(R.id.v_no_login); |
| | | acbutton = findViewById(R.id.actionButton); |
| | | tv_msg_num2 = findViewById(R.id.tv_msg_num2);//我的红点 |
| | | tv_msg_count = findViewById(R.id.tv_msg_count);//消息数量 |
| | | acbutton.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | //登陆 |
| | | if (getSharedPreferences("user", MODE_PRIVATE).getBoolean("isLogin", false)) { |
| | | if (UserUtil.isLogin(getApplicationContext())) { |
| | | LoginTaobao.getLoginTaobao(MainActivity.this, new LonginTaobaoCallback() { |
| | | @Override |
| | | public void onSuccess() { |
| | |
| | | registeredOPPOId();//上传OPPO_RegId |
| | | // onPush_OFF_NO();//检测是否打开推送 |
| | | registeredVIVOId();//上传VIVO_RegId |
| | | |
| | | |
| | | tv_msg_num2.postDelayed(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | //测试 |
| | | Bundle bundle = new Bundle(); |
| | | bundle.putString("goodsId", "19711731038"); |
| | | bundle.putString("goodsType", 1+""); |
| | | startActivity(new Intent(getApplicationContext(), GoodsDetailActivity.class).putExtras(bundle)); |
| | | } |
| | | },5000); |
| | | |
| | | |
| | | } |
| | | |
| | | private void choiceTab(Integer tab, Integer subTab) { |
| | |
| | | JSONArray array = jsonObject.optJSONObject("data").optJSONArray("systemClientParamsList"); |
| | | SystemParamsUtil.saveParams(getApplicationContext(), array); |
| | | boolean input = sp.getBoolean("isFirstInput", true); |
| | | boolean isLogin = sp.getBoolean("isLogin", false); |
| | | boolean isLogin = UserUtil.isLogin(getApplicationContext()); |
| | | //新人好礼1元红包 |
| | | if (input && !isLogin && sp.getString("newuser", "1").equalsIgnoreCase("0")) { |
| | | isFirstInput(); |
| | |
| | | textVideo.isRecord(jsonObject); |
| | | //服务器让显示 购物车&&本地也让显示 |
| | | if (textVideo.getCart_float().equals("1") && textVideo.getLocalCart_float() != 1 |
| | | && getSharedPreferences("user", MODE_PRIVATE).getBoolean("isLogin", false)) { |
| | | && UserUtil.isLogin(getApplicationContext())) { |
| | | acbutton.setVisibility(View.VISIBLE); |
| | | } else {//隐藏购物车 |
| | | acbutton.setVisibility(View.GONE); |
| | |
| | | BuXinConstant.GO_SCAN = false; |
| | | ((RadioButton) findViewById(R.id.rb_nav_recommend)).setChecked(true); |
| | | } |
| | | boolean isLogin = sp.getBoolean("isLogin", false); |
| | | boolean isLogin = UserUtil.isLogin(getApplicationContext()); |
| | | v_no_login.setVisibility(isLogin ? View.INVISIBLE : View.VISIBLE); |
| | | getUnReadMsgCount(UserUtil.getUid(ShoppingApplication.application));//消息 未读数量 |
| | | |
| | |
| | | RecordImageTextVideo textVideo = new RecordImageTextVideo(MainActivity.this); |
| | | //服务器让显示 购物车&&本地也让显示不为1 |
| | | if (textVideo.getCart_float().equals("1") && textVideo.getLocalCart_float() != 1 && |
| | | getSharedPreferences("user", MODE_PRIVATE).getBoolean("isLogin", false)) { |
| | | UserUtil.isLogin(getApplicationContext())) { |
| | | acbutton.setVisibility(View.VISIBLE); |
| | | //点击过 再显示(让按钮复位) |
| | | if (textVideo.getLocalCart_float() == 2) { |
| | |
| | | } else { |
| | | totalCount = 0; |
| | | } |
| | | totalCount = 0; |
| | | } else { |
| | | totalCount = 0; |
| | | tv_msg_num2.setVisibility(View.INVISIBLE);//隐藏我的红点 |
| | | } |
| | | |
| | | tv_msg_count.setVisibility(totalCount > 0 ? View.VISIBLE : View.INVISIBLE); |
| | | if (totalCount > 0) { |
| | | tv_msg_count.setText(totalCount >= 100 ? "99+" : (totalCount + "")); |
| | | } |
| | | |
| | | setUnReadMsgCount(jsonObject); |
| | | getgetHomeMsgList();//获取未读消息条数 |
| | | } |
| | |
| | | } |
| | | } |
| | | //展示我的 红点 |
| | | tv_msg_num2.setVisibility(jsonObject.optJSONObject("data").optInt("mineCount") > 0 ? View.VISIBLE : View.INVISIBLE); |
| | | // int msgCount = jsonObject.optJSONObject("data").optInt("mineCount"); |
| | | } |
| | | |
| | | private void isFirstInput() { |