Page 387 - MDP2022-2
P. 387

mConnectedThread.write("2");
            }  else  if  (status  ==  MotionEvent.ACTION_UP)  {
            mConnectedThread.write("0");
            }
            }
            else{
            Toast.makeText(MainActivity.this,"코인을  충전해  주세요",Toast.LENGTH_SHORT).show();
            yame.loadUrl("http://192.168.102.106:78/downdate.php");
            yame.clearCache(true);
            }
            return  false;
            }
            });

            Down_move.setOnTouchListener(new  View.OnTouchListener()  {
            @Override
            public  boolean  onTouch(View  view,  MotionEvent  event)  {
            int  status  =  event.getAction();
            coinCheck  =  Integer.parseInt(token.getText().toString());
            if(coinCheck  >  0)  {
            if  (status  ==  MotionEvent.ACTION_DOWN)  {
            mConnectedThread.write("1");
            }  else  if  (status  ==  MotionEvent.ACTION_UP)  {
            mConnectedThread.write("0");
            }
            }
            else{
            Toast.makeText(MainActivity.this,"코인을  충전해  주세요",Toast.LENGTH_SHORT).show();
            yame.loadUrl("http://192.168.102.106:78/downdate.php");
            yame.clearCache(true);
            }
            return  false;
            }
            });
            Left_move.setOnTouchListener(new  View.OnTouchListener()  {
            @Override
            public  boolean  onTouch(View  view,  MotionEvent  event)  {
            int  status  =  event.getAction();
            coinCheck  =  Integer.parseInt(token.getText().toString());
            if(coinCheck  >  0)  {
            if  (status  ==  MotionEvent.ACTION_DOWN)  {
            mConnectedThread.write("3");
            }  else  if  (status  ==  MotionEvent.ACTION_UP)  {
            mConnectedThread.write("0");
            }
            }else{
            Toast.makeText(MainActivity.this,"코인을  충전해  주세요",Toast.LENGTH_SHORT).show();
            yame.loadUrl("http://192.168.102.106:78/downdate.php");
            yame.clearCache(true);
            }
            return  false;
            }
            });

            Right_move.setOnTouchListener(new  View.OnTouchListener()  {
            @Override
            public  boolean  onTouch(View  view,  MotionEvent  event)  {
            int  status  =  event.getAction();
            coinCheck  =  Integer.parseInt(token.getText().toString());
            if(coinCheck  >  0)  {
            if  (status  ==  MotionEvent.ACTION_DOWN)  {
            mConnectedThread.write("4");
            }  else  if  (status  ==  MotionEvent.ACTION_UP)  {
            mConnectedThread.write("0");
            }
            }else{
            Toast.makeText(MainActivity.this,"코인을  충전해  주세요",Toast.LENGTH_SHORT).show();
            yame.loadUrl("http://192.168.102.106:78/downdate.php");
            yame.clearCache(true);
            }
            return  false;
            }
            });
            Falling.setOnClickListener(new  View.OnClickListener()  {
            @Override
            public  void  onClick(View  view)  {
            coinCheck  =  Integer.parseInt(token.getText().toString());
            if(coinCheck  >  0)  {
   382   383   384   385   386   387   388   389   390   391   392