Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5970495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:22:56+00:00 2026-05-22T20:22:56+00:00

I have a canvas.DrawText. I want to use gestures to dynamically change the text

  • 0

I have a canvas.DrawText. I want to use gestures to dynamically change the text color and font. This is all working nice using a popup view class. But I want to make this more direct maybe using Fling scroll.

There are millions of colors and by sliding finger on the screen I thought I could increase/decrease the colorInteger and send it to paint.setColor(colorInteger ); before I draw. I have tried all day using various methods.

I have public boolean onTouchEvent(MotionEvent event) {

I know I must catch the x/y in MotionEvent.ACTION_DOWN

Wanted to use the screen left edge for color change and screen right for Font change. I have 21 ttf fonts.

The thing is, I see there is the OnGestureListener onscroll implementation but that will disable my onTouchEvent right? I have lots of movement going on in there.

public boolean onTouchEvent(MotionEvent event) {

Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:22:57+00:00Added an answer on May 22, 2026 at 8:22 pm

    You can use GestureDetector. Implement a GestureDetector.OnGestureListener and catch gestures there.

    class MyActivity extends Activity implements GestureDetector.OnGestureListener {
    
        // ....
        gestureDetector = new GestureDetector(getContext(), this);
    

    Provide GestureDetector with touch events like this:

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (gestureDetector.onTouchEvent(event))
            return true;
        else return super.onTouchEvent(event);
    }
    

    In GestureDetector.OnGestureListener‘s onDown you must return true if you want to process this gesture. E.g. then the user puts his finger donw in a specified area return true, and false otherwise. If false is returned here, complicated sequences (like fling or scroll) started with this event will not be detected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen this question/answer: How do you draw text on a <canvas> tag
I have a Canvas that i draw text on. (this is quite advanced i
I want to remove text from Canvas that I have drawn by using following
I have a Canvas with a Rectangle : <Canvas> <Rettangle/> </Canvas> And I want
I have a canvas and I use jCanva (http://calebevans.me/projects/jcanvas/docs.php?p=layers)s to create circles with events.
I have this canvas mousedown event: $('#canvas').mousedown(function(e) { var coords = canvas.getMousePos(e); // user
I have a pretty nice graph going in canvas right now, but I'm hitting
I have a canvas in which I need to draw text on in javascript,
I have a Canvas that contains a button which I want to be able
I'm trying to draw text without antialiasing on a canvas in Android. The font

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.