예제 #1
0
  @Override
  public void onBackPressed() {
    // if we are in hieratical list, go back one level
    HieraticalHostListView hlv = null;
    if (getTabHost().getCurrentTabTag().equals("tab_status")) {
      hlv = (HieraticalHostListView) findViewById(R.id.hosts_status);
    } else if (getTabHost().getCurrentTabTag().equals("tab_checks")) {
      hlv = (HieraticalHostListView) findViewById(R.id.hosts_checks);
    }

    ViewFlipper vf_screens = (ViewFlipper) findViewById(R.id.view_switcher_screens);

    if (hlv != null && hlv.getDisplayedChild() > 0) {
      hlv.showPrevious();
    } else if (getTabHost().getCurrentTabTag().equals("tab_graphs")) {
      // if we are at graphs, jump to the previsous tab
      getTabHost().setCurrentTabByTag(prevTabTag != null ? prevTabTag : "tab_checks");
    } else if (getTabHost().getCurrentTabTag().equals("tab_screens")
        && vf_screens.getDisplayedChild() == 1) {
      // if we are at screens, jump back to the list
      vf_screens.showPrevious();
      // hide empty view for sure
      findViewById(R.id.listview_screens_empty).setVisibility(View.GONE);
      lastShowScreen_screen__id = -1;
    } else {
      super.onBackPressed();
    }
  }
예제 #2
0
 /** 向右滑动 */
 protected void moveColRight() {
   if (viewFlipper.getDisplayedChild() == 1) {
     viewFlipper.setInAnimation(rightIn);
     viewFlipper.setOutAnimation(rightOut);
     viewFlipper.showPrevious();
     preView.setImageResource(R.drawable.page_arrow_02);
   }
 }
예제 #3
0
 private void showPrevious() {
   if (onNextFlag == 1) {
     Toast.makeText(this, "这就对了嘛", Toast.LENGTH_SHORT).show();
     onNextFlag = 0;
   }
   RadomAnimation.Animation(this, viewFlipper);
   viewFlipper.showPrevious();
 }
예제 #4
0
 /**
  * 移动到上一个月
  *
  * @param gvFlag
  */
 private void enterPrevMonth(int gvFlag, ViewFlipper flipper, View view) {
   jumpMonth--; // 上一个月
   gvFlag++;
   addGridView(flipper, view, gvFlag);
   flipper.setInAnimation(AnimationUtils.loadAnimation(context, R.anim.fragment_slide_left_enter));
   flipper.setOutAnimation(
       AnimationUtils.loadAnimation(context, R.anim.fragment_slide_right_exit));
   flipper.showPrevious();
   flipper.removeViewAt(0);
 }
예제 #5
0
  public void previous(View view) {
    if (index >= 0) {
      mViewFlipper.setInAnimation(customAnimation.inFromLeftAnimation());
      mViewFlipper.setOutAnimation(customAnimation.outToRightAnimation());

      mViewFlipper.showPrevious();
      index--;
      ToggleRadioButton();
    }
  }
예제 #6
0
 // back
 public void backtoFirst() {
   if (mGrid.isFocused()) {
     return;
   }
   setTitle(title);
   setPosition(true);
   flipper.setInAnimation(inFromLeftAnimation());
   flipper.setOutAnimation(outToRightAnimation());
   flipper.showPrevious();
 }
  void showIssues() {
    if (flipper.getCurrentView() != flipper.getChildAt(1)) {
      flipper.setInAnimation(getContext(), R.anim.slide_in_right);
      flipper.setOutAnimation(getContext(), R.anim.slide_out_left);
      flipper.showPrevious();
    }

    disambigHeading.setTypeface(null, Typeface.NORMAL);
    disambigHeading.setEnabled(true);
    issuesHeading.setTypeface(null, Typeface.BOLD);
    issuesHeading.setEnabled(false);
  }
	private void init() {        
		mPath = getIntent().getStringExtra("path");
		mType = getIntent().getStringExtra(TYPE);
		mNewPath = new String(mPath);
		if (CROP.equals(mType)) {
			mIndex = 0;
		} else if (FLITER.equals(mType)) {
			mIndex = 1;
			mVfFlipper.showPrevious();
		}
		initImageFactory();
	}
예제 #9
0
 @Override
 public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
   LogUtil.logAnyTime(TAG, "onFling");
   if (showBox_Type == UISHOWBOX_H) {
     if (e1.getX() > e2.getX()) { // move to left
       flipper.showNext();
       currentIndex += 1;
       if (currentIndex == uris.size()) {
         currentIndex = 0;
       }
     } else if (e1.getX() < e2.getX()) {
       flipper.setInAnimation(mPage.getRawContext(), R.anim.push_right_in);
       flipper.setOutAnimation(mPage.getRawContext(), R.anim.push_right_out);
       flipper.showPrevious();
       flipper.setInAnimation(mPage.getRawContext(), R.anim.push_left_in);
       flipper.setOutAnimation(mPage.getRawContext(), R.anim.push_left_out);
       currentIndex -= 1;
       if (currentIndex == -1) {
         currentIndex = uris.size() - 1;
       }
     } else {
       return false;
     }
   } else {
     if (e1.getY() < e2.getY()) { // move to bottom
       System.out.println("onFling" + "1");
       flipper.showNext();
     } else if (e1.getY() > e2.getY()) {
       flipper.setInAnimation(mPage.getRawContext(), R.anim.push_bottom_in);
       flipper.setOutAnimation(mPage.getRawContext(), R.anim.push_bottom_out);
       flipper.showPrevious();
       flipper.setInAnimation(mPage.getRawContext(), R.anim.push_top_in);
       flipper.setOutAnimation(mPage.getRawContext(), R.anim.push_top_out);
     } else {
       return false;
     }
   }
   return true;
 }
예제 #10
0
 /** 上个月 */
 public synchronized void lastMonth() {
   calendarContent.setInAnimation(push_right_in);
   calendarContent.setOutAnimation(push_right_out);
   calendar_day.add(Calendar.MONTH, -1); // 拨到上个月
   updateCurrent(); // 更新全局变量
   setCalendarDate(nextCalendar()); // 根据下个月填充数据
   calendarContent.showPrevious();
   //		// 回调
   //		if (onCalendarDateChangedListener != null) {
   //			onCalendarDateChangedListener.onCalendarDateChanged(calendarYear,
   //					calendarMonth + 1);
   //		}
 }
  @Override
  public void onFocusChanged(View view, boolean hasFocus) {
    ViewFlipper vf = (ViewFlipper) view.findViewById(R.id.viewflipper1);
    if (hasFocus) {
      if (vf.getCurrentView().getId() != R.id.view2) {
        vf.showNext();
      }
    } else {
      if (vf.getCurrentView().getId() != R.id.view1) {
        vf.showPrevious();
      }

      needScrollCorrection = true;
    }
  }
예제 #12
0
 private void showPreviousView() {
   dian_select(currentPage);
   vf_pic.setInAnimation(AnimationUtils.loadAnimation(ctx, R.anim.push_right_in));
   vf_pic.setOutAnimation(AnimationUtils.loadAnimation(ctx, R.anim.push_right_out));
   vf_pic.showPrevious();
   currentPage--;
   if (currentPage == -1) {
     dian_unselect(currentPage + 1);
     currentPage = vf_pic.getChildCount() - 1;
     dian_select(currentPage);
   } else {
     dian_select(currentPage);
     dian_unselect(currentPage + 1);
   }
 }
 @Override
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   switch (msg.what) {
     case 10:
       favoriteLayout.Refresh(FavoriteLayout.REFRESH_GROUP);
       viewFlipper.showPrevious();
       localLayout.Refresh(LocalLayout.SINGLE_CHOSE);
       break;
     case 20:
       int progress = curms * 100 / totalms;
       // 设置当前进度
       progressBar.setProgress(progress);
       tvdurction.setText(StrTime.gettim(curms) + "/" + StrTime.gettim(totalms));
       break;
   }
 }
 @Override
 public boolean onKeyDown(int keyCode, KeyEvent event) {
   if (keyCode == KeyEvent.KEYCODE_BACK) {
     if (localLayout.localistview.getChoiceMode() == ListView.CHOICE_MODE_MULTIPLE) {
       localLayout.Refresh(LocalLayout.SINGLE_CHOSE);
       localLayout.localistview.setChoiceMode(ListView.CHOICE_MODE_NONE);
       viewFlipper.showPrevious();
       return false;
     } else {
       return super.onKeyDown(keyCode, event);
     }
   }
   if (keyCode == KeyEvent.KEYCODE_MENU) {
     MenuChoice();
   }
   return super.onKeyDown(keyCode, event);
 }
 private void showPrevious() {
   if (mPosition > 0) {
     mPosition--;
     // 记录当前新闻编号
     HashMap<String, Object> hashMap = mNewsData.get(mPosition);
     mNid = (Integer) hashMap.get("nid");
     if (mCursor > mPosition) {
       mCursor = mPosition;
       inflateView(0);
       System.out.println(mNewsBodyFlipper.getChildCount());
       mNewsBodyFlipper.showNext(); // 显示下一页
     }
     mNewsBodyFlipper.setInAnimation(this, R.anim.push_right_in); // 定义下一页进来时的动画
     mNewsBodyFlipper.setOutAnimation(this, R.anim.push_right_out); // 定义当前页出去的动画
     mNewsBodyFlipper.showPrevious(); // 显示上一页
   } else {
     Toast.makeText(this, R.string.no_pre_news, Toast.LENGTH_SHORT).show();
   }
   System.out.println(mCursor + ";" + mPosition);
 }
예제 #16
0
	@Override
	public void onBackPressed() {
		if (mIndex == 0) {
			setResult(RESULT_CANCELED);
			finish();
		} else {
			if (FLITER.equals(mType)) {
				setResult(RESULT_CANCELED);
				finish();
			} else {
				mIndex = 0;
				initImageFactory();
				mVfFlipper.setInAnimation(ImageFactoryActivity.this,
						R.anim.push_right_in);
				mVfFlipper.setOutAnimation(ImageFactoryActivity.this,
						R.anim.push_right_out);
				mVfFlipper.showPrevious();
			}
		}
	}
예제 #17
0
 private void flipLeft() {
   viewFlipper.setInAnimation(rInAnim);
   viewFlipper.setOutAnimation(rOutAnim);
   viewFlipper.showPrevious();
   changeDisplay();
 }