Monday, 26 September 2011

simple animation

main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/layout" android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TextView android:id="@+id/rotatetext" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:text="Will be rotated." />
    <Button android:id="@+id/Button01" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:text="Rotate"
        android:onClick="startAnimation"></Button>
    <TextView android:id="@+id/scrolltext" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:lines="1"
        android:text="Will be scrolled to the left."
        android:scrollHorizontally="true" />
    <Button android:id="@+id/Button02" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:text="Animate to left + bounce"
        android:onClick="startAnimation"></Button>
    <TextView android:id="@+id/fadeout" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:lines="1"
        android:text="Will be faded out / in" android:scrollHorizontally="true" />
    <Button android:id="@+id/Button03" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:text="Fade"
        android:onClick="startAnimation"></Button>
    <Button android:id="@+id/Button04" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:text="Add / Remove component"
        android:onClick="startAnimation"></Button>
</LinearLayout>

the following file is in res.drawable/anim.xml
anim.xml


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="true">
    <rotate android:fromDegrees="0" android:toDegrees="360"
        android:duration="5000" android:pivotX="50%" android:pivotY="90%"
        android:startOffset="0">
    </rotate>
</set>










SampleAnimationActivity.Java


package com.animation;

import android.app.Activity;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.view.animation.BounceInterpolator;
import android.view.animation.LayoutAnimationController;
import android.view.animation.TranslateAnimation;
import android.widget.TextView;
import android.widget.Toast;

public class SampleAnimation extends Activity implements AnimationListener {
    private TextView animatedView3;

   
/** Called when the activity is first created. */

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

    }

    public void startAnimation(View view) {
        switch (view.getId()) {
        case R.id.Button01:
            // Show how to load an animation from XML
            Animation animation1 = AnimationUtils.loadAnimation(this,
                    R.anim.anim);
            animation1.setAnimationListener(this);
            View animatedView1 = findViewById(R.id.rotatetext);
            animatedView1.startAnimation(animation1);
            break;

        case R.id.Button02:
            // Shows how to define a animation via code
            // Also use an Interpolator (BounceInterpolator)
            Paint paint = new Paint();
            TextView animatedView2 = (TextView) findViewById(R.id.scrolltext);
            float measureTextCenter = paint.measureText(animatedView2.getText()
                    .toString());
            Animation animation2 = new TranslateAnimation(0f,
                    -measureTextCenter, 0.0f, 0.0f);
            animation2.setDuration(5000);
            animation2.setInterpolator(new BounceInterpolator());
            animatedView2.startAnimation(animation2);
            break;

        case R.id.Button03:
            // Demonstrate fading and adding an AnimationListener
            animatedView3 = (TextView) findViewById(R.id.fadeout);
            float from = 1.0f;
            float to = 1.0f;

            if (animatedView3.getVisibility() == View.INVISIBLE) {
                from = to;
                to = 1.0f;
            }

            Animation animation3 = new AlphaAnimation(from, to);
            animation3.setDuration(5000);
            animation3.setAnimationListener(this);
            animatedView3.startAnimation(animation3);

            break;

        case R.id.Button04:
            // Demonstrate LayoutAnimation
            ViewGroup layout = (ViewGroup) findViewById(R.id.layout);
            Animation animation4 = new AlphaAnimation(0.0f, 1.0f);
            animation4.setDuration(5000);
            LayoutAnimationController controller = new LayoutAnimationController(
                    animation4, 0);
            layout.setLayoutAnimation(controller);

            View button = findViewById(R.id.Button03);
            if (button == null) {
                layout.addView(button);
            } else {
                layout.removeView(button);
            }
            break;

        default:
            break;
        }

    }

    public void onAnimationStart(Animation animation) {
        Toast.makeText(this, "Animation started", Toast.LENGTH_SHORT).show();
    }

   
    public void onAnimationEnd(Animation animation) {
        Toast.makeText(this, "Animation ended", Toast.LENGTH_SHORT).show();
        if (animatedView3.getVisibility() == View.VISIBLE) {
            animatedView3.setVisibility(View.INVISIBLE);
        } else {
            animatedView3.setVisibility(View.VISIBLE);
        }
    }

   
    public void onAnimationRepeat(Animation animation) {
        Toast.makeText(this, "Animation rep", Toast.LENGTH_SHORT).show();

    }
}













how to rotate an image by using bitmap scale

package com.rotate;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.widget.ImageView;

public class Rotateimage extends Activity
{
private ImageView img;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

img=(ImageView)findViewById(R.id.ImageView01);
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.redcar);
// Getting width & height of the given image.
int w = bmp.getWidth();
int h = bmp.getHeight();
// Setting post rotate to 90
Matrix mtx = new Matrix();
mtx.postRotate(180);
// Rotating Bitmap
Bitmap rotatedBMP = Bitmap.createBitmap(bmp, 0, 0, w, h, mtx, true);
BitmapDrawable bmd = new BitmapDrawable(rotatedBMP);

img.setImageDrawable(bmd);

}

}



main.xml


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="#ffffff"
android:gravity="center">
<ImageView android:id="@+id/ImageView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/redcar" />
</LinearLayout>



copy and paste ur image in the drawable folder and run the app how much rotation is reqired for an image.

10 apps that every android developer used in the developement

HI All,

this is the link for apps

http://code.google.com/p/apps-for-android/source/checkout

regards
krishh








simple app image source code

package com.hello;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;
public class HelloWorld extends Activity {
    /** Called when the activity is first created. */
 private ImageView image;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
      
       
    }
}



main.xml

<?
<
xml version="1.0" encoding="utf-8"?>LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:background="@drawable/nnbackground" android:orientation="vertical"
android:weightSum="2">
<LinearLayout android:layout_height="wrap_content"
android:layout_width="wrap_content" android:orientation="horizontal">
<ImageView android:id="@+id/settingicon" android:src="@drawable/settingicon"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="left" android:paddingLeft="10px"
android:paddingRight="100px" />
<ImageView android:id="@+id/nnone" android:src="@drawable/nnone"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="left" android:paddingRight="160px" />
<ImageView android:id="@+id/calendarbackgroundiconone" android:src="@drawable/calendarbackgroundiconone"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="left" android:paddingRight="120px" />
<ImageView android:id="@+id/powerbylogica" android:src="@drawable/powerbylogica"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="left" android:paddingRight="145px"
android:paddingTop="5px" />
<ImageView android:id="@+id/faqicon" android:src="@drawable/faqicon"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="left" android:paddingRight="5px" />
</LinearLayout>
<LinearLayout android:layout_weight="1"
android:layout_height="fill_parent" android:layout_width="fill_parent"
android:paddingLeft="110dip" android:paddingRight="15dip"
android:orientation="horizontal" android:gravity="center_vertical|right">
<TableLayout android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_gravity="center_horizontal">
<TableRow>
<ImageView android:id="@+id/redcar" android:src="@drawable/redcar"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="right" android:paddingLeft="8px" />
<ImageView android:id="@+id/boat" android:src="@drawable/boat"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="right" android:paddingLeft="8px" />
<ImageView android:id="@+id/holiday" android:src="@drawable/holiday"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="right" android:paddingLeft="5px" />
</TableRow>
<TableRow>
<ImageView android:id="@+id/hometwo" android:src="@drawable/hometwo"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="right" android:paddingLeft="8px"
android:paddingTop="20px" />
<ImageView android:id="@+id/coinsicon" android:src="@drawable/coinsicon"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="right" android:paddingTop="20px" />

</TableRow>
<TableRow>
<ImageView android:id="@+id/test_image" android:src="@drawable/buyone"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="right" android:paddingTop="100px" />
<ImageView android:id="@+id/test_image" android:src="@drawable/sellone"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="right" android:paddingTop="10px" />
<ImageView android:id="@+id/test_image" android:src="@drawable/investmentone"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="left" android:paddingTop="10px" />
<ImageView android:id="@+id/test_image" android:src="@drawable/insuranceone"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="right" android:paddingTop="20px" />
</TableRow>
</TableLayout>
</LinearLayout>
<LinearLayout android:layout_height="wrap_content"
android:layout_width="wrap_content" android:orientation="horizontal"
android:gravity="left">
<TableLayout android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_gravity="left"
android:paddingBottom="150dip" android:paddingRight="10dip">
<TableRow>
<ImageView android:id="@+id/coinicon" android:src="@drawable/coinicon"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="left" android:paddingLeft="50px" />
</TableRow>
<TableRow>
<ImageView android:id="@+id/euroicon" android:src="@drawable/euroicon"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="left" android:paddingLeft="50px" android:paddingBottom="50px"/>
<ImageView android:id="@+id/buyone" android:src="@drawable/buyone"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="right" android:paddingLeft="260px" android:paddingBottom="50px" />
<ImageView android:id="@+id/sellone" android:src="@drawable/sellone"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="right" android:paddingLeft="2px" android:paddingBottom="50px" />
<ImageView android:id="@+id/insuranceone" android:src="@drawable/insuranceone"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="left" android:paddingBottom="50px" />
<ImageView android:id="@+id/investmentone" android:src="@drawable/investmentone"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="right" android:paddingBottom="50px" />
</TableRow>
</TableLayout>
</LinearLayout>
</
LinearLayout>


Sunday, 25 September 2011

Android filpping pages source code

package minh.app.mbook;
import android.app.Activity;
import android.content.Context;
import android.graphics.Typeface;
import android.os.Bundle;
import android.text.TextPaint;
import android.view.Display;
import android.view.Window;
import android.view.WindowManager;
public class MBook extends Activity {
    /** Called when the activity is first created. */

 String text;
 TextPaint myTextPaint;
 int textSize = 20;
 int textColor = 0xffA7573E;
 int pageColor = 0xffFDF8A6;
 int width, height, topPadding = 30, leftPadding =10;
 //Vector<String> listOfPages = new Vector<String>();
 //TextProcess tp;
 boolean done = false;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE); 
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,  
                                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        //
        Display display = ((WindowManager) this.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
  width = display.getWidth();
  height = display.getHeight();
 
        //
        //
        Typeface tf = Typeface.createFromAsset(this.getAssets(),"fonts/UVNDaLat_R.TTF");
     myTextPaint = new TextPaint();
     myTextPaint.setColor(textColor);
     myTextPaint.setTextSize(textSize);
     myTextPaint.bgColor = pageColor;
     myTextPaint.setAntiAlias(true);
     myTextPaint.setTypeface(tf);
    
     //tp = new TextProcess(this, width, height, topPadding, leftPadding, myTextPaint);
    
     //new LoadData(this).execute(tp);
     this.setContentView(new MBookView(this, width, height, topPadding, leftPadding, myTextPaint));
     //setContentView(R.layout.main);
    }
   
    //
    @Override
    public void onDestroy(){
     super.onDestroy();
     System.gc();
     finish();
    }
}

package minh.app.mbook;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.os.Handler;
import android.os.Message;
import android.text.TextPaint;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
public class MBookView extends View {
 // MyHandler myHandler = new MyHandler();
 private static int DEFAULT_FLIP_VALUE = 20;
 private static int FLIP_SPEED = 30;
 private long mMoveDelay = 1000 / 30;

 float xTouchValue = DEFAULT_FLIP_VALUE, yTouchValue = DEFAULT_FLIP_VALUE;;
 //String result = "";
 //
 class FlippingHandler extends Handler {
  @Override
  public void handleMessage(Message msg) {
   Log.i("Thong bao: ", "Clock Handler is still running");
   MBookView.this.flip();
  }
  public void sleep(long delayMillis) {
   this.removeMessages(0);
   sendMessageDelayed(obtainMessage(0), delayMillis);
  }
 }
 //
 //
 FlippingHandler flippingHandler;

 private Bitmap page1;
 private Bitmap page2;
 int width;
 int height;
 float oldTouchX, oldTouchY;
 boolean flipping = false;
 boolean next;
 Point A, B, C, D, E, F;

 Bitmap visiblePage;
 Bitmap invisiblePage;
 Paint flipPagePaint;
 boolean flip = false;
 Context context;
 //
 int loadedPages = 0;
 long timeToLoad = 0;
 //
 //boolean loadingDone = false;

 boolean onloading = true;

 boolean onMoving = false;

 // constructor
 public MBookView(Context context) {
  super(context);
  // TODO Auto-generated constructor stub
  // initMyView(context);
  this.context = context;
  init();
  setFocusable(true);
  setFocusableInTouchMode(true);
 }
 public MBookView(Context context, int width, int height, int topPadding,
   int leftPadding, TextPaint myTextPaint) {
  super(context);
  this.context = context;
  this.width = width;
  this.height = height;
  //
  page1 = BitmapFactory.decodeResource(context.getResources(),
    R.drawable.tifa);
  page2 = BitmapFactory.decodeResource(context.getResources(),
    R.drawable.cloud);
  //
 
  init();
 }
 //
 //
 private void init() {
 
  //
  flippingHandler = new FlippingHandler();
  //
  flipPagePaint = new Paint();
  flipPagePaint.setColor(Color.GRAY);
  // flipPagePaint.setAntiAlias(true);
  // flipPagePaint.setStyle(Paint.Style.FILL);
  flipPagePaint.setShadowLayer(5, -5, 5, 0x99000000); 
  A = new Point(10, 0);
  B = new Point(width, height);
  C = new Point(width, 0);
  D = new Point(0, 0);
  E = new Point(0, 0);
  F = new Point(0, 0);
  xTouchValue = yTouchValue = DEFAULT_FLIP_VALUE;
  visiblePage = page1;
  invisiblePage = page2;
  onMoving=false;
  flipping=false;
  //
  //
  loadData();
 }
 //
 private void loadData() {
  // listOfPages.add("this is my text");
  onloading = false;
 
 
 }
 //
 //
 //
 @Override
 public boolean onTouchEvent(MotionEvent event) {
  // TODO Auto-generated method stub
  if (!onloading) {
   //
   switch (event.getAction()) {
   case MotionEvent.ACTION_DOWN:
   
    oldTouchX = event.getX();
    oldTouchY = event.getY();
    flip = true;
    if (oldTouchX > (width >> 1)) {
     xTouchValue = DEFAULT_FLIP_VALUE;
     yTouchValue = DEFAULT_FLIP_VALUE;
     // set invisible page's content
     //
     next = true;
    } else {
     // set invisible page's content
     // invisiblePage.setContent(index-1, null);
     //
     next = false;
     //
     swap2Page();
     xTouchValue = width;
     yTouchValue = DEFAULT_FLIP_VALUE;
    }
    break;
   case MotionEvent.ACTION_UP:   
    if(onMoving){
     xTouchValue = width-A.x;
     onMoving=false;
    }
    flipping = true;   
    flip();
    break;
   case MotionEvent.ACTION_MOVE:
    //Log.i("Thong bao: ","x="+x+" y="+y);
    onMoving=true;
    //
    float xMouse = event.getX();
    float yMouse = event.getY();
    //
    xTouchValue -= (xMouse - oldTouchX) / 1;
    //
    yTouchValue -= yMouse - oldTouchY;
    //
    if (xMouse < oldTouchX) {
     if (!next) {
      flip = false;
     }
     next = true;
    } else {
     if (next) {
      flip = false;
     }
     next = false;
    }
    //
    oldTouchX = event.getX();
    oldTouchY = event.getY();
    this.invalidate();
    break;
   }
  }
  return true;
 }
 //
 //
 public void flip() {
  // neu chua load thi load va lat sang trang
  //
  if (flipping) {
  
   // if (now - mLastMove > mMoveDelay) {
   if (xTouchValue > width || xTouchValue < DEFAULT_FLIP_VALUE) {
    flipping = false;
    if (!flipping) {
     //
     if (next) {
     
      swap2Page();
     }
     flip = false;
     xTouchValue = DEFAULT_FLIP_VALUE;
     yTouchValue = DEFAULT_FLIP_VALUE;
     ;
    }
    return;
   }
   if (next) {
    // new cd sang trai-> trang moi
    xTouchValue += FLIP_SPEED;   
   } else {
    // neu cd sang phai-> trang cu
    xTouchValue -= FLIP_SPEED;
   
   }
   this.invalidate();
   // }
   // call hander
   flippingHandler.sleep(mMoveDelay);
  }
 }
 //

 @Override
 protected void onDraw(Canvas canvas) {
 
  // super.onDraw(canvas);
  width = getWidth();
  height = getHeight();
 
  //
  if(flipping){
   pointGenerate(xTouchValue, width, height);
  }else {
   //pointGenerateII(xTouchValue, yTouchValue, width, height);
   pointGenerate(xTouchValue, width, height);
  }
  // First Page render
  Paint paint = new Paint();
  canvas.drawColor(Color.GRAY);
  canvas.drawBitmap(visiblePage, 0, 0, paint);
  // Second Page Render
  Path pathX = pathOfTheMask();
  canvas.clipPath(pathX);
  canvas.drawBitmap(invisiblePage, 0, 0, paint);
  canvas.restore();
  // Flip Page render
  Path pathX2 = pathOfFlippedPaper();
  canvas.drawPath(pathX2, flipPagePaint);
  //
  pathX = null;
  pathX2 = null;
  paint = null;


 }
 // float degress =0;
 //
 private Path pathOfTheMask() {
  Path path = new Path();
  path.moveTo(A.x, A.y);
  path.lineTo(B.x, B.y);
  path.lineTo(C.x, C.y);
  path.lineTo(D.x, D.y);
  path.lineTo(A.x, A.y);
  //
  return path;
 }
 //
 private Path pathOfFlippedPaper() {
  Path path = new Path();
  path.moveTo(A.x, A.y);
  path.lineTo(D.x, D.y);
  path.lineTo(E.x, E.y);
  path.lineTo(F.x, F.y);
  path.lineTo(A.x, A.y);
  return path;
 }
 //
 //
 private void pointGenerate(float distance, int width, int height) {
  float xA = width - distance;
  float yA = height;
  // float xB= width;
  // float yB= height;
  // float xC = width;
  // float yC = 0;
  float xD = 0;
  float yD = 0;
  //
  if (xA > width / 2) {
   xD = width;
   yD = height - (width - xA) * height / xA;
  } else {
   xD = 2 * xA;
   yD = 0;
  }
  //
  // 
  double a = (height - yD) / (xD + distance - width);
  double alpha = Math.atan(a);
  double _cos = Math.cos(2 * alpha), _sin = Math.sin(2 * alpha);
  // E
  float xE = (float) (xD + _cos * (width - xD));
  float yE = (float) -(_sin * (width - xD));
  // F
  float xF = (float) (width - distance + _cos * distance);
  float yF = (float) (height - _sin * distance);
  //
  if (xA > width / 2) {
   xE = xD;
   yE = yD;
  }
  // 
  A.x = xA;
  A.y = yA;
  D.x = xD;
  D.y = yD;
  E.x = xE;
  E.y = yE;
  F.x = xF;
  F.y = yF;
 }
 //
 float oldxF=0, oldyF=0;
 private void pointGenerateII(float xTouch, float yTouch, int width,
   int height) {
  // 
  float yA = height;
  float xD = width;
  //
  //
  float xF = width - xTouch+0.1f;
  float yF = height - yTouch+0.1f;
  //
  if(A.x==0){
   xF= Math.min(xF, oldxF);
   yF= Math.max(yF, oldyF);
  }
  //
  float deltaX = width-xF;
  float deltaY = height-yF;
  //
  float BH = (float) (Math.sqrt(deltaX * deltaX + deltaY * deltaY) / 2);
  double tangAlpha = deltaY / deltaX;
  double alpha = Math.atan(tangAlpha);
  double _cos = Math.cos(alpha), _sin = Math.sin(alpha);
  //
  float xA = (float) (width - (BH / _cos));
  float yD = (float) (height - (BH / _sin));
  //
  xA = Math.max(0, xA);
  if(xA==0){
   //yF= Math.max(yF, height-(float) Math.sqrt(width*width-xF*xF));
   oldxF = xF;
   oldyF = yF;
  }
  //
  float xE = xD;
  float yE = yD;
  // if (xA > width / 2) {
  if (yD < 0) {
   xD = width + (float) (tangAlpha * yD);
   yE = 0;
   xE = width + (float) (Math.tan(2 * alpha) * yD);
  }
  //
 
  //
  A.x = xA;
  A.y = yA;
  D.x = xD;
  D.y = Math.max(0, yD);
  E.x = xE;
  E.y = yE;
  F.x = xF;
  F.y = yF;
 }
 //
 private void swap2Page() {
  Bitmap temp = visiblePage;
  visiblePage = invisiblePage;
  invisiblePage = temp;
  // stringSplitterInOrder();
  temp = null;
 }

}



package
minh.app.mbook;
public
class Point {float x;float y;//
}
}


public Point(float x, float y){this.x = x;this.y = y;