How to Create a Transparent Demo Screen for an Android App

How do you create a transparent demo screen for an Android app?

Put your demo info in a different activity and give it the following theme.

<style name="Transparent" parent="@android:style/Theme.NoTitleBar">
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>

If you're using ActionBarSherlock change parent to @style/Theme.Sherlock.

This will give you a transparent activity, so you will be able to see the activity below it.

Now I'm guessing you want a translucent background too.

In the xml layout (of your transparent activity) add:

android:background="#aa000000" 

The last 6 digits define the color: 000000 is black.

The first 2 define the opacity: 00 is 100% transparent, ff is 100% opaque. So choose something in between.

how do you create a transparent demo screen for delphi android

Yes, you can do this without any problems. This is an application (a prototype) is made with Delphi XE5.

If you see the captures, you can see this:

ScreenCapture, whith a semi-transparent panel

I have used a semi-transparent panel with alignement alCenter (in you case you can align the panel alClient for all screen). You can modify the level of transparency with the Opacy property. In addition, I have used an effect (blur) with the background form (this is not necesary for you).

Regards.

How do I create a transparent Activity on Android?

Add the following style in your res/values/styles.xml file (if you don’t have one, create it.) Here’s a complete file:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Transparent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources>

(The value @color/transparent is the color value #00000000 which I put in the res/values/color.xml file. You can also use @android:color/transparent in later Android versions.)

Then apply the style to your activity, for example:

<activity android:name=".SampleActivity" android:theme="@style/Theme.Transparent">
...
</activity>

How to add a semi-transparent demo screen using ShowcaseView

You'll want to use the property sv_backgroundColor, rather than android:background. Unfortunately that does mean you can only use a colour, not a drawable.

You can see how to declare custom themes here:
https://github.com/amlcurran/ShowcaseView/blob/master/sample/src/main/res/values/styles.xml

How to run app as a transparent window non-fullscreen

Try using DialogActivity, that should work

How to make a transparent/wallpaper-showing Flutter app

A transparent flutter background is possible now (July 2019).

The Android issue is being discussed here

How to do it:

  • This comment gives a detailed explanation.

Some working Android demo apps that are transparent:

  • A transparent app that shows the device wallpaper GitHub repo
  • A transparent app that displays itself on top of other apps. GitHub repo

The iOS issue is here

A comment suggests that it's possible to have a transparent background on iOS.

It can be achieved by adding the following line to the ViewController.

flutterViewController.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext

And to set flutterViewController.isViewOpaque = false



Related Topics



Leave a reply



Submit