How to create special activity?

susu

Well-Known Member
Licensed User
Longtime User
I just wonder how to create special activity like this?

2-this-is-the-level-of-information-presented-by-battery-indicator-pro.jpg
 

rfresh

Well-Known Member
Licensed User
Longtime User
I guess that's what I don't understand. My manifest is exactly like the one in Margret's test app. Maybe I don't understand the Manifest. I am under the impression each project carries its own Manifest?
 
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
@barx

Thanks...that was it. I had that line in my Manifest but I noticed Margret didn't so I removed it from my app. Well, I guess it is needed. Thanks again.
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
Yes, each project has it's own manifest. If you open Margret's manifest.xml in wordpad (or similar) you will see a different picture. This is probably due to margret running b4a v1.7 which I don't believe had the manifest editor.
 
Upvote 0

salmander

Active Member
Licensed User
Longtime User
Hello,
the transparent activity works fine. However, is there a way a user can interact with the activity/views beneath the transparent activity. Here is the example app: link I think there is an overlaying activity with an image but a user can still interact with the underlying activities/views. Is this possible in basic4android please?

Thanks
 
Upvote 0

mjtaryan

Active Member
Licensed User
Longtime User
Note that you can make a transparent activity by adding the following line to the new manifest editor (will be included in B4A v1.8):
B4X:
SetActivityAttribute(main, android:theme, "@android:style/Theme.Translucent.NoTitleBar")
You will also need to set Activity.Color=Colors.Transparent

Hi Erel,

I was trying this out. I copied and pasted your code tothe manifest file and added the Activity.Color = Colors.Transparent to Sub Activity_Create, but when I ran the test app on my device, the activity background (beneath a smaller panel used as the parent for a label) was not transparent but gray. I tied using the Activity. Color line in Activity_Resume as well, but that didn't work. I have the latest version of B4a. What do I do? Thanks.
 
Upvote 0

mjtaryan

Active Member
Licensed User
Longtime User
After reading some other posts and trying Margrets test app, I got it to work.


A correction in the instructions appear necessary, to whit:


Not only do you need "Activity.Color = Colors.Transparent" (without the quotes), but you also need a panel (let's call it Panel1) and the line

Panel1.Color = Colors.Transparent

I haven't tested whether or not Panel1 needs to be the size of the activity or if it can merely be the size of the app. However, if you don't want what is underneath your app to show through, it seems wise to make Panel1 the size of the activity and make it the parent for a second panel (Panel2) that will serve as the background and parent for the other views of your app.

I have some apps in development that would be greatly oversized and, therefore, groteque on, for example, a 10 inch tablet. To avoid such an unpleasing visual design, I intend to use the approach discussed in this thread.
 
Upvote 0
Top