Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
import android.app.ListActivity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.graphics.PointF; import android.os.Bundle; import android.util.FloatMath; import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.Window; import android.widget.Button; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.ListView; import android.widget.ScrollView; import android.widget.TextView; public class FloorPlan extends ListActivity { TextView title; TextView content; ImageView iv; FrameLayout sv; Button btnback; Bitmap bm; IconifiedTextListAdapter itla = new IconifiedTextListAdapter(this); private static final String TAG = "Touch"; // These matrices will be used to move and zoom image Matrix matrix = new Matrix(); Matrix savedMatrix = new Matrix(); // We can be in one of these 3 states static final int NONE = 0; static final int DRAG = 1; static final int ZOOM = 2; int mode = NONE; PointF start = new PointF(); PointF mid = new PointF(); float oldDist = 1f; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.floorplan); iv = (ImageView) findViewById(R.id.floorview); sv = (FrameLayout) findViewById(R.id.ScrollView02); btnback = (Button) findViewById(R.id.btn_back); // Add items itla.addItem(new IconifiedText("LG3 Floor", getResources().getDrawable( R.drawable.lg3_small))); itla.addItem(new IconifiedText("LG2A Level", getResources() .getDrawable(R.drawable.lg2a_small))); itla.addItem(new IconifiedText("LG2 Level", getResources().getDrawable( R.drawable.lg2_small))); itla.addItem(new IconifiedText("LG1 Level", getResources().getDrawable( R.drawable.lg1_small))); itla.addItem(new IconifiedText("Ground Level", getResources() .getDrawable(R.drawable.g_small))); itla.addItem(new IconifiedText("First Level", getResources() .getDrawable(R.drawable.first_small))); itla.addItem(new IconifiedText("CP2 Floor", getResources().getDrawable( R.drawable.cp2_small))); // Display it setListAdapter(itla); btnMainMenu();// main menu button btnback.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { } }); btnback.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == 0) { btnback.setBackgroundResource(R.drawable.btnback_onclick); } else if (event.getAction() == 1) { btnback.setBackgroundResource(R.drawable.btnback); } return false; } }); } public void btnMainMenu() { final Button btnmainmenu = (Button) findViewById(R.id.btn_mainmenu); btnmainmenu.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { } }); btnmainmenu.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == 0) { btnmainmenu .setBackgroundResource(R.drawable.mainmenu_onclick); } else if (event.getAction() == 1) { btnmainmenu.setBackgroundResource(R.drawable.mainmenu); } return false; } }); } @Override protected void onListItemClick(final ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); // Get the item that was clicked // System.out.println(position); l.setVisibility(View.GONE); sv.setVisibility(View.VISIBLE); if (position == 0) { bm = BitmapFactory.decodeResource(getResources(), R.drawable.lg3); iv.setImageBitmap(bm); // iv.setBackgroundResource(R.drawable.lg3); } else if (position == 1) { bm = BitmapFactory.decodeResource(getResources(), R.drawable.lg2a); iv.setImageBitmap(bm); // iv.setBackgroundResource(R.drawable.lg2a); } else if (position == 2) { bm = BitmapFactory.decodeResource(getResources(), R.drawable.lg2); iv.setImageBitmap(bm); // iv.setBackgroundResource(R.drawable.lg2); } else if (position == 3) { bm = BitmapFactory.decodeResource(getResources(), R.drawable.lg1); iv.setImageBitmap(bm); // iv.setBackgroundResource(R.drawable.lg1); } else if (position == 4) { bm = BitmapFactory.decodeResource(getResources(), R.drawable.gf); iv.setImageBitmap(bm); // iv.setBackgroundResource(R.drawable.gf); } else if (position == 5) { bm = BitmapFactory.decodeResource(getResources(), R.drawable.ff); iv.setImageBitmap(bm); // iv.setBackgroundResource(R.drawable.ff); } else if (position == 6) { bm = BitmapFactory.decodeResource(getResources(), R.drawable.cp2); iv.setImageBitmap(bm); // iv.setBackgroundResource(R.drawable.cp2); } btnback.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { if (l.getVisibility() == View.GONE) { l.setVisibility(View.VISIBLE); sv.setVisibility(View.GONE); } else if (l.getVisibility() == View.VISIBLE) { } } }); btnback.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == 0) { btnback.setBackgroundResource(R.drawable.btnback_onclick); } else if (event.getAction() == 1) { btnback.setBackgroundResource(R.drawable.btnback); } return false; } }); iv.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { // Dump touch event to log // dumpEvent(event); // Handle touch events here... switch (event.getAction() & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: savedMatrix.set(matrix); start.set(event.getX(), event.getY()); System.out.println("sx = " + (start.x)); System.out.println("sy = " + (start.y)); Log.d(TAG, "mode=DRAG"); mode = DRAG; break; case MotionEvent.ACTION_POINTER_DOWN: oldDist = spacing(event); Log.d(TAG, "oldDist=" + oldDist); if (oldDist > 10f) { savedMatrix.set(matrix); midPoint(mid, event); mode = ZOOM; Log.d(TAG, "mode=ZOOM"); } break; case MotionEvent.ACTION_UP: int xDiff = (int) Math.abs(event.getX() - start.x); int yDiff = (int) Math.abs(event.getY() - start.y); System.out.println("ex = " + (event.getX())); System.out.println("ey = " + (event.getY())); if (xDiff < 8 && yDiff < 8) { iv.performClick(); } case MotionEvent.ACTION_POINTER_UP: mode = NONE; Log.d(TAG, "mode=NONE"); break; case MotionEvent.ACTION_MOVE: if (mode == DRAG) { // ... matrix.set(savedMatrix); if(event.getX() - start.x < 20) { matrix.postTranslate(event.getX() - start.x, event .getY() - start.y); } } else if (mode == ZOOM) { float newDist = spacing(event); Log.d(TAG, "newDist=" + newDist); if (newDist > 10f) { matrix.set(savedMatrix); float scale = newDist / oldDist; matrix.postScale(scale, scale, mid.x, mid.y); } } break; } iv.setImageMatrix(matrix); return true; // indicate event was handled } }); } /** Show an event in the LogCat view, for debugging */ private void dumpEvent(MotionEvent event) { String names[] = { "DOWN", "UP", "MOVE", "CANCEL", "OUTSIDE", "POINTER_DOWN", "POINTER_UP", "7?", "8?", "9?" }; StringBuilder sb = new StringBuilder(); int action = event.getAction(); int actionCode = action & MotionEvent.ACTION_MASK; sb.append("event ACTION_").append(names[actionCode]); if (actionCode == MotionEvent.ACTION_POINTER_DOWN || actionCode == MotionEvent.ACTION_POINTER_UP) { sb.append("(pid ").append( action >> MotionEvent.ACTION_POINTER_ID_SHIFT); sb.append(")"); } sb.append("["); for (int i = 0; i < event.getPointerCount(); i++) { sb.append("#").append(i); sb.append("(pid ").append(event.getPointerId(i)); sb.append(")=").append((int) event.getX(i)); sb.append(",").append((int) event.getY(i)); if (i + 1 < event.getPointerCount()) sb.append(";"); } sb.append("]"); Log.d(TAG, sb.toString()); } private float spacing(MotionEvent event) { // ... float x = event.getX(0) - event.getX(1); float y = event.getY(0) - event.getY(1); return FloatMath.sqrt(x * x + y * y); } private void midPoint(PointF point, MotionEvent event) { // ... float x = event.getX(0) + event.getX(1); float y = event.getY(0) + event.getY(1); point.set(x / 2, y / 2); } }