Android Open Source - custom-touch-examples Two Dimension Scroll Activity






From Project

Back to project page custom-touch-examples.

License

The source code is released under:

Copyright (c) 2012 Wireless Designs, LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in ...

If you think the Android project custom-touch-examples listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (c) 2012 Wireless Designs, LLC
 */* w  w  w .j  ava 2 s.  co m*/
 * See the file license.txt for copying permission.
 */
package com.examples.customtouch;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.examples.customtouch.widget.TwoDimensionScrollView;

public class TwoDimensionScrollActivity extends Activity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    TwoDimensionScrollView scrollView = new TwoDimensionScrollView(this);

        LinearLayout layout = new LinearLayout(this);
        layout.setOrientation(LinearLayout.VERTICAL);
        for(int i=0; i < 5; i++) {
        ImageButton iv = new ImageButton(this);
        iv.setImageResource(R.drawable.ic_launcher);
            iv.setScaleType(ImageView.ScaleType.FIT_CENTER);
            int width = getResources().getDimensionPixelSize(R.dimen.pan_content_width);
            int height = getResources().getDimensionPixelSize(R.dimen.pan_content_height);
            layout.addView(iv, new LinearLayout.LayoutParams(width, height));
        }

    scrollView.addView(layout);
    setContentView(scrollView);
  }
}




Java Source Code List

com.examples.customtouch.MainActivity.java
com.examples.customtouch.MoveLoggerActivity.java
com.examples.customtouch.MultitouchActivity.java
com.examples.customtouch.TouchDelegateActivity.java
com.examples.customtouch.TouchForwardActivity.java
com.examples.customtouch.TouchInterceptActivity.java
com.examples.customtouch.TouchListenerActivity.java
com.examples.customtouch.TwoDimensionGestureScrollActivity.java
com.examples.customtouch.TwoDimensionScrollActivity.java
com.examples.customtouch.widget.RotateZoomImageView.java
com.examples.customtouch.widget.TouchDelegateLayout.java
com.examples.customtouch.widget.TouchForwardLayout.java
com.examples.customtouch.widget.TwoDimensionGestureScrollView.java
com.examples.customtouch.widget.TwoDimensionScrollView.java