Skip to main content

Posts

Showing posts from February, 2016

Activity Codes

How to make an Activity transparent over another Activity?   <style name="Theme.CustomTranslucent" parent="android:style/Theme.Translucent">         <item name="android:backgroundDimEnabled">true</item>         <item name="android:backgroundDimAmount">0.5</item>         <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>         <item name="android:background">@android:color/transparent</item>  </style>   In my activity 2 layout, I could eihter set android:background="@android:color/transparent" or not set any value at all to make it work. Refer: http://stackoverflow.com/questions/10481277/translucent-activity-filling-the-entire-screen Incase of AppcompatActivity: <style name="Theme.AppCompat.Translucent">     <item name="android:windowNoTitle">true</ite...
To create a Transparent AlertDialog Box: private void createDialogBox() {     AlertDialog.Builder builder = new AlertDialog.Builder(context);     final AlertDialog dialog = builder.create();     dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); //hide Title     getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,             WindowManager.LayoutParams.FLAG_FULLSCREEN);   // For FullScreen     dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);     dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);   //Set Transparent BackGround     View dialogLayout = LayoutInflater.from(getActivity()).inflate(R.layout. demo_dialog , null);     dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));     dialog.setView(dialogLayout, 0, 0, 0, 0); ...