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 7530009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:47:32+00:00 2026-05-30T04:47:32+00:00

I have a custom view extending from View with lots of text drawn at

  • 0

I have a custom view extending from View with lots of text drawn at different angles and I want a particular string to decrease its alpha value to a certain level once, after first start. Any suggestion or snippet would be appreciated 🙂

postInvalidateDelayed(...) doesn’t seem to work for this task.

  • 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-30T04:47:34+00:00Added an answer on May 30, 2026 at 4:47 am

    There was a mistake in the correct measurement of vertical text bounds to be faded. Here is my onDraw method

    Paint myPaint = new Paint();
    myPaint.setColor(Color.parseColor("#" + colorAlpha + "3AA6D0"));// initially colorAlpha is ff
    Rect r = new Rect();
    char[] a = "Hello World".toCharArray();
    datePaint.getTextBounds(a, 0, a.length, r);// get the bound of the text, I was not calculating this correctly
    canvas.drawText("Hello World", 0, 0, myPaint);// draw the text
    
    int colorValue = Integer.parseInt(colorAlpha, 16);
        colorValue -= 20;// decrease alpha value for next call to onDraw method by postInvalidateDelayed
    if (colorValue > 40) {
            colorAlpha = Integer.toHexString(colorValue);
    
    
     // this will create the effect of fade out animation
     // because each call to onDraw method is at the difference of 50 millisecond delay 
     // and in each call we are decreasing alpha value by 20.
            postInvalidateDelayed(50, r.left, r.top, r.right, r.bottom);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom view which has a piano keyboard drawn inside of it.
I have a custom view (inherited from UIView ) in my app. The custom
I have a custom view with several NSTextField controls for which I want to
I have a custom view subclassed from GridView that I use in order to
I have created my own custom view class by extending SurfaceView. I then override
I have created a custom view by extending Relative Layout and it looks like
I have a grid view which is populated using a custom ImageAdapter class extending
I have created a custom view by extending AutoCompleteTextView (with a specialized function called
I have a custom View extending SurfaceView. The XML layout is <com.myPackage.MyCustomView android:id=@+id/mycview android:layout_width=fill_parent
I have a custom view which is extending View : public class MyView extends

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.