« first day    last day (15 days later) » 

11:36 AM
Hello Lunar. I tried to set onTouchListener...or onTouchEvent..and I got stuck :(
 
 
3 hours later…
2:19 PM
I'm back @Ramona (pinging so you see the message)
Basically, implement onTouchListener:
implements View.OnTouchListener
Then override the method (you will be prompted, and you can right-click->override as well)
then you pick the view you want to zoom and do: someView.setOnTouchListener(this);
 
2:33 PM
You implement in the class in one of these patterns: public class something /*extends something if applicable*/ implements View.OnTouchListener or public class something /*extends somethign if applicable*/ implements SomeInterface, View.OnTouchListener. Separate implementations with a comma
 
3:07 PM
Because you are in an activity, you cannot use onTouchEvent
 
 
4 hours later…
6:38 PM
I don't know how to do it :( So I write View.OnTouchListener in onCreate? and how to add parameters inside brackets?
@LunarWatcher ..when can I meet you again here in a real time?
 
6:55 PM
Sorry, for my lack of knowledge.
something like this?
  View.OnTouchListener( new View.OnTouchListener(){
            @Override
 
Not exactly @Ramona
You make the class implement OnTouchListener
then on the view you want to zoom on, you setOnClickListener(this)
 
7:12 PM
Ok Lunar. So first I have to learn how to implement this class :(
what to write?
 
before the first bracket in the class, after extend, you write implements View.OnTouchListener
 
but which class do you mean?
 
The activity with the view you want to zoom
or fragment
 
Ok one second I
will read this info you sent
so I will have to add this setOnClik in MainActivity outside of onCreate?
public class MyActivity extends Activity implements OnTouchListener ?
 
After you implement the interface, you override the method onTouch. Rightclick->Generate->Override methods. Find onTouch and press OK
yes like that
 
7:20 PM
public class MainActivity extends AppCompatActivity implements OnTouchListener
in my case.
 
yes
but like that
Now:
 
and write it outside onCreate in MainActivity?
 
yes
1 min ago, by LunarWatcher
After you implement the interface, you override the method onTouch. Rightclick->Generate->Override methods. Find onTouch and press OK
 
Ok, so after I implemented the suggested method I now have
@Override
    public boolean onTouch(View v, MotionEvent event) {
        return false;
 
make it return true
 
7:23 PM
ok, done.
 
Have you created the instances for Scaler and ScaleListener?
 
so far we have this in onCreate
 class Scaler extends ScaleGestureDetector {
            public Scaler(Context context, OnScaleGestureListener listener) {
                super(context, listener);
            }

            @Override
            public float getScaleFactor() {//Leave this method empty.
                return super.getScaleFactor();
            }
        }
and this
private scaleFactor = 1f;
you mean this
private Scaler s;
private ScaleListener listener;
like so
private static final int NUMBER_OF_QUESTIONS = 3;
    static boolean[] answer = new boolean[NUMBER_OF_QUESTIONS];
    static boolean[] checked = new boolean[NUMBER_OF_QUESTIONS];
    static boolean[] isAnswered = new boolean[NUMBER_OF_QUESTIONS];
    private scaleFactor = 1f;
    private Scaler s;
    private ScaleListener listener;
 
7:50 PM
so I have these instances Scaler and ScaleListener created like above.
 

« first day    last day (15 days later) »