コード例 #1
0
  @Override
  public void onResume() {
    super.onResume();
    english_popular.setAutoStart(true);
    english_popular.setFlipInterval(2500);
    english_popular.startFlipping();

    english_rated.setAutoStart(true);
    english_rated.setFlipInterval(2800);
    english_rated.startFlipping();

    english_recent.setAutoStart(true);
    english_recent.setFlipInterval(3000);
    english_recent.startFlipping();
  }
コード例 #2
0
  private void initToolbar() {
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    ImageView imageView = new ImageView(this);
    imageView.setBackgroundResource(R.drawable.ic_logo);
    RelativeLayout rl1 = (RelativeLayout) findViewById(R.id.action_logo);
    rl1.addView(imageView);

    Progress progressView = new Progress(this, true);
    RelativeLayout rl2 = (RelativeLayout) findViewById(R.id.action_progress);
    progressView.setProgress(_deposit.get_progress());
    rl2.addView(progressView);

    float values[] = {_deposit.get_principle(), _deposit.get_actInterest()};
    PieChart graphView = new PieChart(this, true);
    graphView.setValues(values);
    RelativeLayout rl3 = (RelativeLayout) findViewById(R.id.action_graph);
    rl3.addView(graphView);

    final GestureDetector detector = new GestureDetector(new SwipeGestureDetector());
    _flipper = (ViewFlipper) this.findViewById(R.id.action_flipper);
    _flipper.startFlipping();
    _flipper.setOnTouchListener(
        new View.OnTouchListener() {
          @Override
          public boolean onTouch(final View view, final MotionEvent event) {
            detector.onTouchEvent(event);
            return true;
          }
        });
  }
コード例 #3
0
ファイル: Flipper.java プロジェクト: reubenjohn/TheNewBoston
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.flipper);
   flippy = (ViewFlipper) findViewById(R.id.viewFlipper1);
   flippy.setOnClickListener(this);
   flippy.setFlipInterval(500);
   flippy.startFlipping();
 }
コード例 #4
0
ファイル: BuyActivity.java プロジェクト: treejames/Android-10
 /** 初始化组件,滚动数据 */
 public void initRollingText() {
   ViewFlipper mFlipper = ((ViewFlipper) this.findViewById(R.id.notice_other_flipper));
   String str[] = splitStr(Constants.NEWS, 23);
   for (int i = 0; i < str.length; i++) {
     mFlipper.addView(addTextByText(str[i]));
   }
   mFlipper.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.push_up_in));
   mFlipper.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.push_up_out));
   mFlipper.startFlipping();
   mFlipper.setOnClickListener(filterclick);
 }
コード例 #5
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.view_animation_activity);
   mFlipper = ((ViewFlipper) this.findViewById(R.id.flipper));
   mFlipper.startFlipping();
   Spinner s = (Spinner) findViewById(R.id.spinner);
   ArrayAdapter<String> adapter =
       new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, mStrings);
   adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
   s.setAdapter(adapter);
   s.setOnItemSelectedListener(this);
 }
コード例 #6
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_full_screen);
    position = getIntent().getExtras().getInt("position");
    filePath = getIntent().getExtras().getStringArrayList("filepath");
    startSlideShow = getIntent().getExtras().getBoolean("slideshow");
    viewFlipper = (ViewFlipper) findViewById(R.id.viewFlip);
    for (int i = 0; i < filePath.size(); i++) AddViewFlipper(i);
    if (startSlideShow) {

      viewFlipper.setFlipInterval(5000);
      viewFlipper.startFlipping();
    } else {
      viewFlipper.setDisplayedChild(position);
      viewFlipper.setOnTouchListener(
          new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
              switch (event.getAction()) {
                case MotionEvent.ACTION_DOWN:
                  lastX = event.getX();
                  break;
                case MotionEvent.ACTION_UP:
                  float currentX = event.getX();
                  if (lastX > currentX) {
                    setSlideToLeftAnimation(viewFlipper, getBaseContext());
                    viewFlipper.showNext();
                  }
                  if (lastX < currentX) {
                    setSlideToRightAnimation(viewFlipper, getBaseContext());
                    viewFlipper.showPrevious();
                  }
                  break;
              }
              return true;
            }
          });
    }
  }