private void toggleCamera(boolean isNeedEnableCam) {

    // TODO temporary insertion will be removed when GLVideoView will be fixed
    DisplayMetrics displaymetrics = new DisplayMetrics();
    displaymetrics.setToDefaults();

    ViewGroup.LayoutParams layoutParams = imgMyCameraOff.getLayoutParams();

    layoutParams.height = localVideoView.getHeight();
    layoutParams.width = localVideoView.getWidth();

    imgMyCameraOff.setLayoutParams(layoutParams);

    Log.d(
        TAG,
        "Width is: "
            + imgMyCameraOff.getLayoutParams().width
            + " height is:"
            + imgMyCameraOff.getLayoutParams().height);

    if (SessionManager.getCurrentSession() != null) {
      SessionManager.getCurrentSession().setVideoEnabled(isNeedEnableCam);
      cameraToggle.setChecked(isNeedEnableCam);

      if (isNeedEnableCam) {
        Log.d(TAG, "Camera is on");
        switchCameraToggle.setVisibility(View.VISIBLE);
        imgMyCameraOff.setVisibility(View.INVISIBLE);
      } else {
        Log.d(TAG, "Camera is off");
        switchCameraToggle.setVisibility(View.INVISIBLE);
        imgMyCameraOff.setVisibility(View.VISIBLE);
      }
    }
  }
Пример #2
0
  @SuppressWarnings("deprecation")
  public boolean enableShowMyLocation(boolean centerAtFirstFix) {
    Log.d("TileMap", "enableShowMyLocation " + mShowMyLocation);

    gotoLastKnownPosition();

    if (!mShowMyLocation) {
      Criteria criteria = new Criteria();
      criteria.setAccuracy(Criteria.NO_REQUIREMENT);
      String bestProvider = mLocationManager.getBestProvider(criteria, true);

      if (bestProvider == null) {
        // mTileMap.showDialog(DIALOG_LOCATION_PROVIDER_DISABLED);
        return false;
      }
      mShowMyLocation = true;
      enableMyLocation();
      Log.d("TileMap", "enableShowMyLocation " + mShowMyLocation);

      mLocationListener.setFirstCenter(centerAtFirstFix);

      mSnapToLocationView.setVisibility(View.VISIBLE);
      mTileMap.invalidate();
      return true;
    }
    return false;
  }
Пример #3
0
  // Use this method to read sms, when sms text is already know (already found
  // by another method)
  public void readMessages(
      String message,
      Calendar calendar,
      TextView tempr,
      TextView dateV,
      ToggleButton toggleButton) {
    // Making toggle button visible
    toggleButton.setVisibility(View.VISIBLE);

    // Taking required information from message
    String messageTemp = message.substring(message.indexOf("T=") + 2, message.indexOf("T=") + 6);
    tempr.setText(messageTemp);

    // Taking calendar object and getting date and time of incoming
    // message, the feeding information to view
    int smsDay = calendar.get(Calendar.DATE);
    int smsTime = calendar.get(Calendar.HOUR_OF_DAY);
    String smsReceived = smsDay + " - " + smsTime;
    dateV.setText(smsReceived);

    // If yes, check security status and change Toggle button information
    // Accordingly
    if (message.indexOf("Apsauga isjungta") > -1) {
      toggleButton.setChecked(false);
    } else {
      toggleButton.setChecked(true);
    }
  }
Пример #4
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   category = getIntent().getExtras().getString("category");
   setContentView(R.layout.parameters);
   if (category.equalsIgnoreCase("Reviews")) {
     ToggleButton sortButton = (ToggleButton) findViewById(R.id.sortButton);
     sortButton.setClickable(true);
     sortButton.setVisibility(0);
   }
 }
  @Override
  protected void initViews(View view) {
    super.initViews(view);

    localVideoView = (QBGLVideoView) view.findViewById(R.id.localVideoVidew);
    localVideoView.setVisibility(View.VISIBLE);

    remoteVideoView = (QBGLVideoView) view.findViewById(R.id.remoteVideoView);
    remoteVideoView.setVisibility(View.VISIBLE);

    cameraToggle = (ToggleButton) view.findViewById(R.id.cameraToggle);
    cameraToggle.setVisibility(View.VISIBLE);
    cameraToggle.setOnClickListener(this);

    switchCameraToggle = (ToggleButton) view.findViewById(R.id.switchCameraToggle);
    switchCameraToggle.setVisibility(View.VISIBLE);
    switchCameraToggle.setOnClickListener(this);

    imgMyCameraOff = (ImageView) view.findViewById(R.id.imgMyCameraOff);

    actionButtonsEnabled(false);
  }
Пример #6
0
 /**
  * 设置用户相关的信息 </br>
  *
  * @param user
  */
 public void setupUserInfo(CommUser user) {
   if (!user.id.equals(mUser.id)) {
     return;
   }
   mUser = user;
   mUserNameTv.setText(user.name);
   if (user.gender == Gender.MALE) {
     mGenderImageView.setImageDrawable(ResFinder.getDrawable("umeng_comm_gender_male"));
   } else if (user.gender == Gender.FEMALE) {
     mGenderImageView.setImageDrawable(ResFinder.getDrawable("umeng_comm_gender_female"));
   }
   ImgDisplayOption option = ImgDisplayOption.getOptionByGender(mUser.gender);
   // 设置用户头像
   mHeaderImageView.setImageUrl(user.iconUrl, option);
   ImageLoaderManager.getInstance().getCurrentSDK().resume();
   if (isHideFollowStatus()) {
     mFollowToggleButton.setVisibility(View.GONE);
   } else {
     mFollowToggleButton.setVisibility(View.VISIBLE);
     mFollowToggleButton.setChecked(mUser.isFollowed);
   }
 }
Пример #7
0
  public void notifyChange() {
    if (shouldPersist()) oldValue = getPersistedInt(mDefault);

    boolean enabled = getSharedPreferences().getBoolean(getKey() + "_y", false);
    // Log.d("Preference", getTitle()+ "   enabled at start: "+enabled + "   y enabled: "+yEnabled);
    //		  if (yaxis != null)
    //			  enabled = yaxis.isChecked();
    if (yEnabled) {
      yaxis.setChecked(enabled);
      setBarState(!enabled);
      yaxis.setOnCheckedChangeListener(this);
      yaxis.setVisibility(View.VISIBLE);
    } else {
      yaxis.setVisibility(View.INVISIBLE);
    }

    bar.setMax(maximum + minimum);
    bar.setProgress((int) this.oldValue);
    bar.setOnSeekBarChangeListener(this);
    //
    //
    setMonitorBox(bar.getProgress());
  }
Пример #8
0
  /**
   * Disables the "show my location" mode.
   *
   * @return ...
   */
  public boolean disableShowMyLocation() {
    if (mShowMyLocation) {
      mShowMyLocation = false;
      disableSnapToLocation(false);

      // mLocationManager.removeUpdates(mLocationListener);
      removeAll();
      // if (circleOverlay != null) {
      // mapView.getOverlays().remove(circleOverlay);
      // mapView.getOverlays().remove(itemizedOverlay);
      // circleOverlay = null;
      // itemizedOverlay = null;
      // }

      mSnapToLocationView.setVisibility(View.GONE);

      return true;
    }
    return false;
  }
Пример #9
0
  @SuppressWarnings("deprecation")
  private void initUIComponents() {
    // 设置Fragment
    addFragment(ResFinder.getId("umeng_comm_user_info_fragment_container"), mPostedFragment);

    // 选中的某个tab时的文字颜色
    mSelectedColor = ResFinder.getColor("umeng_comm_text_topic_light_color");

    // 初始化feed、好友、粉丝、back、设置的listener
    findViewById(ResFinder.getId("umeng_comm_posted_layout")).setOnClickListener(this);
    findViewById(ResFinder.getId("umeng_comm_follow_user_layout")).setOnClickListener(this);
    findViewById(ResFinder.getId("umeng_comm_my_fans_layout")).setOnClickListener(this);
    findViewById(ResFinder.getId("umeng_comm_setting_back")).setOnClickListener(this);

    // 举报用户的Dialog
    mReportDialog = new UserReportDialog(this);
    mReportDialog.setTargetUid(mUser.id);

    Button settingButton = (Button) findViewById(ResFinder.getId("umeng_comm_save_bt"));
    settingButton.setBackgroundDrawable(ResFinder.getDrawable("umeng_comm_more"));
    RelativeLayout.LayoutParams params =
        (RelativeLayout.LayoutParams) settingButton.getLayoutParams();
    params.width = DeviceUtils.dp2px(this, 20);
    params.height = DeviceUtils.dp2px(this, 20);
    params.rightMargin = DeviceUtils.dp2px(getApplicationContext(), 10);
    settingButton.setLayoutParams(params);
    settingButton.setOnClickListener(
        new LoginOnViewClickListener() {

          @Override
          protected void doAfterLogin(View v) {
            mReportDialog.show();
          }
        });
    // 如果是用户自己,则不显示设置菜单按钮【目前菜单只有举报功能,即自己不能举报自己】
    if (mUser.id.equals(CommConfig.getConfig().loginedUser.id)
        || mUser.permisson == Permisson.SUPPER_ADMIN) {
      settingButton.setVisibility(View.GONE);
    }

    TextView titleTextView = mViewFinder.findViewById(ResFinder.getId("umeng_comm_setting_title"));
    titleTextView.setText(ResFinder.getString("umeng_comm_user_center"));
    //
    mPostedTv = mViewFinder.findViewById(ResFinder.getId("umeng_comm_posted_msg_tv"));
    mPostedTv.setTextColor(mSelectedColor);

    //
    mPostedCountTv = mViewFinder.findViewById(ResFinder.getId("umeng_comm_posted_count_tv"));
    mPostedCountTv.setTextColor(mSelectedColor);

    mFollowedUserTv = mViewFinder.findViewById(ResFinder.getId("umeng_comm_followed_user_tv"));
    mFollowedUserCountTv =
        mViewFinder.findViewById(ResFinder.getId("umeng_comm_follow_user_count_tv"));

    mFansTextView = mViewFinder.findViewById(ResFinder.getId("umeng_comm_my_fans_tv"));
    mFansCountTextView = mViewFinder.findViewById(ResFinder.getId("umeng_comm_fans_count_tv"));
    // 昵称
    mUserNameTv = mViewFinder.findViewById(ResFinder.getId("umeng_comm_user_name_tv"));
    mUserNameTv.setText(mUser.name);

    mHeaderImageView = mViewFinder.findViewById(ResFinder.getId("umeng_comm_user_header"));

    ImgDisplayOption option = ImgDisplayOption.getOptionByGender(mUser.gender);
    mHeaderImageView.setImageUrl(mUser.iconUrl, option);

    // 用户性别
    mGenderImageView = mViewFinder.findViewById(ResFinder.getId("umeng_comm_user_gender"));

    // 关注按钮
    mFollowToggleButton = mViewFinder.findViewById(ResFinder.getId("umeng_comm_user_follow"));
    mFollowToggleButton.setOnClickListener(
        new Listeners.LoginOnViewClickListener() {

          @Override
          protected void doAfterLogin(View v) {
            mFollowToggleButton.setClickable(false);
            // true为选中状态为已关注,此时显示文本为“取消关注”;false代表未关注,此时显示文本为“关注”
            if (mFollowToggleButton.isChecked()) {
              mPresenter.followUser(mResultListener);
            } else {
              mPresenter.cancelFollowUser(mResultListener);
            }
          }
        });

    mAlbumTextView = mViewFinder.findViewById(ResFinder.getId("umeng_comm_user_albums_tv"));
    mAlbumTextView.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            jumpToActivityWithUid(AlbumActivity.class);
          }
        });
    mTopicTextView = mViewFinder.findViewById(ResFinder.getId("umeng_comm_user_topic_tv"));
    mTopicTextView.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            jumpToActivityWithUid(FollowedTopicActivity.class);
          }
        });

    // 用户自己(在未登录的情况下,点击设置跳转到登录,此时传递进来的uid是空的情况),隐藏关注按钮,显示设置按钮
    // // 如果是超级管理员且已经关注,则隐藏取消关注按钮
    if (isHideFollowStatus()) {
      mFollowToggleButton.setVisibility(View.GONE);
    }
    initCommentView();
  }