0

Is there any xml that i can use to perform something like this ?

Sample image for my purpose

I want to have an single ImageView where i show my picture. The picture is "fillparent" that it goes on the whole screen. But i only want to see the pink part normal and all outside the lines i want something like an "alpha = 0.5" or just that it is a little bit less seen than the main.

<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:top="120px" android:right="120px" android:bottom="120px" android:left="120px">
<shape android:shape="rectangle">
    <solid android:color="#9fffffff" />
</shape>
</item>

I want to put an xml as foreground to perform this. With an shape of an rectangle and an alpha of 0.5 it works exactly the opposite side. Now i just need something like an inverse rectangle or something.

Thanks for your time.

ahdgfd
  • 325
  • 3
  • 12
  • You can use two layers instead (just make sure the center has no transparency and you should be ok). – Doron Yakovlev Golani Oct 26 '16 at 21:14
  • Yeah i also thought about that but i want to know if there is a more professional solution. Because if i implement a cameraView or an Video it wount be very good for my performance. – ahdgfd Oct 26 '16 at 21:18

0 Answers0