@Override
  public void onResume() {
    super.onResume();

    setProfileView();

    BaiduAnalyzeUtils.onPageStart("个人微博");

    // 分组发生改变
    if (ActivityHelper.getInstance().getBooleanShareData("ChanneSortHasChanged", false)
        || ActivityHelper.getInstance().getBooleanShareData("offlineChanneChanged", false)) {
      setGroupList();
    }
  }
    @Override
    protected void onSuccess(StatusContents result) {
      super.onSuccess(result);

      if (result == null) return;

      setProfileView();
      getActivity().invalidateOptionsMenu();

      if (result != null
          && result.getStatuses().size() == 1
          && getTaskCount(getTaskId()) == 1
          && !ActivityHelper.getInstance().getBooleanShareData("donotRemindFuckSina", false)) {
        new AlertDialog.Builder(getActivity())
            .setMessage(R.string.profile_fuck_sina)
            .setPositiveButton(R.string.i_know, null)
            .setNegativeButton(
                R.string.donnot_remind,
                new DialogInterface.OnClickListener() {

                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                    ActivityHelper.getInstance().putBooleanShareData("donotRemindFuckSina", true);
                  }
                })
            .show();
      }
    }
Exemple #3
0
  private String getActionType(Intent intent, String action) {
    String type = null;
    // 处理点击Notification时,设置显示菜单
    if (ACTION_LOGIN.equals(action)) {
      type = "1";
    } else if (ACTION_NOTIFICATION.equals(action)) {
      type = intent.getStringExtra("type");
    } else if (ACTION_NOTIFICATION_MS.equals(action)) {
      ActivityHelper.putShareData("showMensitonType", "showMentionStatus");

      type = "2";
    } else if (ACTION_NOTIFICATION_MC.equals(action)) {
      ActivityHelper.putShareData("showMensitonType", "showMentionCmt");

      type = "2";
    }
    return type;
  }
Exemple #4
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.as_ui_main);

    AdTokenUtils.loadIfExpired();

    new GetTokenInfoTask(AppContext.getAccount()).execute();

    BizFragment.getBizFragment(this);

    if (Build.VERSION.SDK_INT >= 19) {
      ViewGroup drawerRoot = (ViewGroup) findViewById(R.id.layDrawerRoot);
      drawerRoot.setPadding(
          drawerRoot.getPaddingLeft(),
          SystemBarUtils.getStatusBarHeight(this),
          drawerRoot.getPaddingRight(),
          drawerRoot.getBottom());
    }
    if (Build.VERSION.SDK_INT == 19) {
      ViewGroup rootMain = (ViewGroup) findViewById(R.id.layMainRoot);
      rootMain.setPadding(
          rootMain.getPaddingLeft(),
          rootMain.getPaddingTop(),
          rootMain.getPaddingRight(),
          rootMain.getBottom() + SystemBarUtils.getNavigationBarHeight(this));
    }

    mToolbar = getToolbar();
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(false);

    mDrawerToggle =
        new ActionBarDrawerToggle(
            this, mDrawerLayout, getToolbar(), R.string.draw_open, R.string.draw_close) {

          public void onDrawerClosed(View view) {
            super.onDrawerClosed(view);

            invalidateOptionsMenu();

            if (isToolbarShown()) btnFab.show(true);
          }

          public void onDrawerOpened(View drawerView) {
            super.onDrawerOpened(drawerView);

            invalidateOptionsMenu();

            btnFab.hide(true);
          }
        };
    mDrawerLayout.setDrawerListener(mDrawerToggle);

    lastSelectedMenu =
        savedInstanceState == null ? null : (MenuBean) savedInstanceState.getSerializable("menu");

    if (ActivityHelper.getBooleanShareData("isFirstLaunch", true)) {
      ActivityHelper.putBooleanShareData("isFirstLaunch", false);

      mDrawerLayout.openDrawer(Gravity.LEFT);
      btnFab.hide();

      getSupportActionBar().setTitle(R.string.draw_timeline);
    } else {
      if (lastSelectedMenu != null) getSupportActionBar().setTitle(lastSelectedMenu.getTitleRes());
      else getSupportActionBar().setTitle(R.string.draw_timeline);
    }

    if (savedInstanceState == null) {
      String action = getIntent() != null ? getIntent().getAction() : null;
      String type = getActionType(getIntent(), action);

      menuFragment = MenuFragment.newInstance(type);
      getFragmentManager()
          .beginTransaction()
          .add(R.id.menu_frame, menuFragment, "MenuFragment")
          .commit();

      // 添加右侧的抽屉
      //            GroupsMenuFragment groupsMenuFragment = GroupsMenuFragment.newInstance();
      //            getFragmentManager().beginTransaction().add(R.id.groups_frame,
      // groupsMenuFragment, "GroupsMenuFragment").commit();
    } else {
      menuFragment = (MenuFragment) getFragmentManager().findFragmentByTag("MenuFragment");

      // 2014-8-30 解决因为状态保存而导致的耗时阻塞
      if (lastSelectedMenu.getType().equals("1")) onMenuSelected(lastSelectedMenu, true, null);
    }

    // 更新FAB的颜色
    btnFab.setColorNormal(AisenUtils.getThemeColor(this));
    btnFab.setColorPressed(AisenUtils.getThemeColor(this));
    btnFab.setColorRipple(AisenUtils.getThemeColor(this));
    btnFab.setOnLongClickListener(this);
  }