Can't Click button in Transparent Activty Android - android

i am trying add an transparent activity in front of an another activity. i added the transparent activity. i want both the transparent & behind activity button's clickable. but i can click behind activity's button. but in transparent activity's button i cant click because i added one line in transparent activity that is below
getWindow().addFlags(
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE );
if i remove the above line from transparent activity i can't click the button in behind activity. i need both the behind & transparent activity's button clickable. please post any suggestion. thanks...

Related

how to change activity transparency dynamically

I want to change the transparency of activity dynamically when I move the root element/view. How to do that?. I'm creating a module for which when user slide down the whole UI down to half of the screen vertically to finish the activity. But by default when the user slides down the layout default color white of activity is shown and when I set its theme to transparent previous activity is shown. I want to change the opacity of activity window dynamically when user slides down.
use this where you need:
Window window = this.getWindow();
window.setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));

Android: Dialog cut from Top when activity is resumed

I display a custom dialog which is shown proper on show. But after that when I press home key and bring the application in background. Next, I again launch the application from task menu but in that case the image is cut from the top.
Proper Dialog 1
Dialog Clipped From Top 2
Can any one help us in identifying why it must be cutting from top.
Appreciate the help.
This is an issue with Kitkat/Lollipop versions I think. It can be fixed with the following code.
// Only for Api >=4.0
// On Kitkat & Lollipop, layout top gets clipped if this code is not there.
if (android.os.Build.VERSION.SDK_INT >= 16) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_FULLSCREEN);
}

Creating 2 activities and view programmatically. I want to create the view of second activity transparent

I have requirement of creating two activities and their layout programmatically. And I want to create something like this,
Create a first activity and with a fixed background and second activity which will have a transparent area at all side so there the view of first activity will be shown.
Right now I am creating one activity and it shows OK.
and
setTheme( android.R.style.Theme_Translucent );
when i open second activity the view shows with margin but with the plain background and not the transparent view of first activity.
I have set the back ground of second activity like this, rLayout.setBackgroundColor(Color.parseColor("#80000000"));
It is showing the grey color at background.
I know a one work around by creating dialog, But it would be better to use activity as per our requirement.
You can create a transparent theme in styles and then use that style for your transparent Activity.
Refer to this answer:
How do I create a transparent Activity on Android?

Semi Transparent Activity like Popup window

I want to make Semi Transaparent Activity Like pop window i.e. As my appActivity starts one pop up window on top that should come and user should click proceed button to go on that activity. I have seen dialog as well as Alert Box but they are widget. I want to use the screen as activity so that I can put xml layout .
I have come across PopWindow but I do not know how to use it .I have made one class PopupWindow When I try to achieve findviewbyid I am unable to achieve it becoz PopupWindow class is not extending anything ....
So what should i use if popWindow class then how to use it ? thanks
create an layout as you like to have as a dialogue and create an activity using that layout.
in the manifest declare that activity and add android:theme="#android:style/Theme.Dialog in that activity stub.

How to hide blank/black activity window behind the Dialog

I have one Activity which displayed some Dialog boxes and Progress bars.
This activity does not have call to setContentView as this Activity does not have Screen Layout. It has been just used for displaying Dialogs and progress bar dialogs.
Now what happens is that Activity Displays Dialog box along with the Blank Activity Window on back of the Dialog, So i want to hide make it transparent so it will look like we are just displaying Dialog.
Thank,
PP.
Use this attribute for your activity
<activity android:theme="#android:style/Theme.Translucent">
This will make activity background transparent.
In your activity tag(in manifest) which is displaying progressbar or dialog
put this above attribute android:theme="#android:style/Theme.Translucent
This will work...
Try applying the dialog theme to this activity:
In your manifest file add to the activity element this attribute: android:theme="#android:style/Theme.Dialog"
Copied from background - Android: make everything around dialog darker
All you need to do is play around with the dimAmount field in the
WindowManager.LayoutParams:
WindowManager.LayoutParams lp = myDialog.getWindow().getAttributes();
lp.dimAmount = 0.7f

Categories

Resources