| | |
| | | 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.recommend.GoodsDetailActivity; |
| | | import com.tejia.lijin.app.ui.trends.SendCircleFragmet; |
| | | import com.tejia.lijin.app.util.TopStatusSettings; |
| | | import com.tejia.lijin.app.util.ui.HomeUIUtil; |
| | |
| | | Window window = getWindow(); |
| | | window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); |
| | | window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
| | | | View.SYSTEM_UI_FLAG_LAYOUT_STABLE ); |
| | | | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); |
| | | window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); |
| | | window.setStatusBarColor(Color.TRANSPARENT); |
| | | int result = 0; |
| | |
| | | } else { |
| | | findViewById(R.id.v_status_bar).setVisibility(View.GONE); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | EventBus.getDefault().register(this); |
| | |
| | | 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) { |
| | |
| | | * 系统补充参数请求 |
| | | */ |
| | | private void getSystemParams() { |
| | | String uid = getSharedPreferences("user", |
| | | Context.MODE_PRIVATE).getString("uid", ""); |
| | | ShoppingApi.getSystemParams(MainActivity.this, uid, new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.getSystemParams(MainActivity.this, UserUtil.getUid(ShoppingApplication.application), new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject.optString("code").equalsIgnoreCase("0")) { |
| | |
| | | } |
| | | boolean isLogin = sp.getBoolean("isLogin", false); |
| | | v_no_login.setVisibility(isLogin ? View.INVISIBLE : View.VISIBLE); |
| | | getUnReadMsgCount(sp.getString("uid", "0"));//消息 未读数量 |
| | | getUnReadMsgCount(UserUtil.getUid(ShoppingApplication.application));//消息 未读数量 |
| | | |
| | | if (MiPushMessageReceiver.miPushMessage != null) {//打开小米推送 |
| | | MiPushMessage message = MiPushMessageReceiver.miPushMessage; |
| | |
| | | * |
| | | * @param uid |
| | | */ |
| | | private void getUnReadMsgCount(String uid) { |
| | | private void getUnReadMsgCount(Long uid) { |
| | | ShoppingApi.getUnReadMsgCount(this, uid, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | |
| | | * @param entity |
| | | */ |
| | | public void onEventMainThread(EventMessageEntity entity) { |
| | | getUnReadMsgCount(sp.getString("uid", "0")); |
| | | getUnReadMsgCount(UserUtil.getUid(ShoppingApplication.application)); |
| | | if (messagePush != null) { |
| | | // 这里就会调用我们Fragment中的MessagePush方法 |
| | | messagePush.MessagePush(true);//传入消息推送 |
| | |
| | | * @param homeMsgListListener |
| | | */ |
| | | private void getHomeMsgList(final getHomeMsgListListener homeMsgListListener) { |
| | | String uid = getSharedPreferences("user", |
| | | Context.MODE_PRIVATE).getString("uid", ""); |
| | | ShoppingApi.getHomeMsgList(this, uid, mPage + "", new BasicTextHttpResponseHandler() { |
| | | |
| | | ShoppingApi.getHomeMsgList(this, UserUtil.getUid(ShoppingApplication.application), mPage + "", new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | homeMsgListListener.onSuccessPerfect(statusCode, headers, jsonObject); |
| | |
| | | SharedPreferences sp = getSharedPreferences("user", MODE_PRIVATE); |
| | | if (MobileUtil.getDeviceBrand().equalsIgnoreCase("HUAWEI") |
| | | || MobileUtil.getDeviceBrand().equalsIgnoreCase("HONOR")) { |
| | | String uid = sp.getString("uid", "0"); |
| | | Log.e("eee", "HONOR: "); |
| | | //防止多次请求 |
| | | if (System.currentTimeMillis() - lastBindHWTime > 1000 * 5) {//5s后再请求 |
| | | lastBindHWTime = System.currentTimeMillis(); |
| | | Log.e("eee", "上传token"); |
| | | ShoppingApi.bindHMPush(MainActivity.this, token, uid, null); |
| | | ShoppingApi.bindHMPush(MainActivity.this, token, UserUtil.getUid(ShoppingApplication.application), null); |
| | | } |
| | | } |
| | | } |