0

Im making a library that acts like a guide in android apps. For this I've created an activity that has this theme:

<activity
        android:name=".widgets.TutorialActivity"
        android:screenOrientation="sensorPortrait"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" >
</activity>

and I've set this semi transparent color to activity's relativeLayout background : #DD3F51B5

The problem is that i dont know how to make a circular view in this layout that dosen't take effect of that color and it must be completely transparent without any color.

Saman Sattari
  • 3,322
  • 6
  • 30
  • 46
  • "completely transparent without any color" - So, you mean completely invisible? The nature of transparency implies it will inherit its color from what is behind it – Cruceo Mar 06 '15 at 18:21
  • @Guardanis i want to make a lib like this: https://github.com/amlcurran/ShowcaseView but with Material Design theme – Saman Sattari Mar 06 '15 at 18:48
  • Ohhh, well if that's the case and you want the center to be completely transparent (alpha level of 0.0), then you may want to look into overriding the Canvas and drawing using the xfermode PorterDuffXfermode(Mode.CLEAR) on your Paint Object. (also make sure to call setAlpha(0xFF) on the Paint) and then make sure to set the Background of the View to transparent: setBackgroundColor(Color.TRANSPARENT); which will then cause the canvas to clip what you draw and reveal the content beneath it's View – Cruceo Mar 06 '15 at 18:57

1 Answers1

0

If you want to do it all yourself, you could achieve the circular view with a shape, as referred here:

How to get round shape in Android

But I would recommend you to use this:

https://github.com/amlcurran/ShowcaseView

It works like a charm!

Community
  • 1
  • 1
vinitius
  • 3,212
  • 2
  • 17
  • 22
  • i saw this lib, but i want to make material design guide. my problem isn't "How to make round shape". the problem is that when i make a complete circular transparent view, it hides in the main view. – Saman Sattari Mar 06 '15 at 17:53