Reputation: 21
hello every one i'm new to android i build this app and i want to make the background blur when i click on the list , not just transparent i made it transparent with adding
<style name="AppTheme.Popuptheme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowCloseOnTouchOutside">true</item>
</style>
in my style.xml file
this is my popup class
package com.example.jihad.smsbalanceparser;
import android.app.Activity;
import android.os.Bundle;
import android.util.DisplayMetrics;
/**
* Created by AMD on 1/6/2018.
*/
public class Pop extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.popup);
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
int width = dm.widthPixels;
int height = dm.heightPixels;
getWindow().setLayout((int)(width*.8),(int)(height*.6));
}
}
and this is my AndroidManifest.xml file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.jihad.smsbalanceparser">
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<application
android:allowBackup="true"
android:icon="@drawable/appicon"
android:label="SMS Balance Manager"
android:roundIcon="@drawable/appicon"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name=".SMSReceiver"
android:enabled="true" >
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<activity android:name=".Pop" android:theme="@style/AppTheme.Popuptheme" >
</activity>
</application>
</manifest>
finally this is my popup.xml file which is my pop-up layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:popup="http://schemas.android.com/apk/res-auto"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="5dp"
>
</LinearLayout>
Upvotes: 2
Views: 1012
Reputation: 1963
Blur effect is obtained in really complex way like taking current screen shot and rendering it.
This Library does all the work. May be this will help you.
Upvotes: 1