Closed buelersandra closed 6 years ago
Same issue here Below is the xml preview:
This is the dialog (with bottom padding)
This is my code. `dialogplus = DialogPlus.newDialog(this)
.setContentHolder(new Holder() { @Override public void addHeader(View view) { } @Override public void addFooter(View view) { } @Override public void setBackgroundResource(int colorResource) { } @Override public View getView(LayoutInflater inflater, ViewGroup parent) { View view=inflater.inflate(R.layout.notification_popup,parent,false); FancyButton btn=(FancyButton)view.findViewById(R.id.updatebtn); nview=(View)view.findViewById(R.id.mainparent); ImageView closebtn=(ImageView)view.findViewById(R.id.closebtn); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String packageName="com.fhoodi"; Intent intent = null; try { intent = new Intent(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setData(Uri.parse("market://details?id=" + packageName)); getApplicationContext().startActivity(intent); } catch (android.content.ActivityNotFoundException anfe) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName))); } } }); closebtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dialogplus.dismiss(); } }); return view; } @Override public void setOnKeyListener(View.OnKeyListener keyListener) { } @Override public View getInflatedView() { return nview; } @Override public View getHeader() { return null; } @Override public View getFooter() { return null; } }) .setOnClickListener(new OnClickListener() { @Override public void onClick(DialogPlus dialog, View view) { if(view.getId()==R.id.closebtn){ dialog.dismiss(); } } }) .setContentWidth(ViewGroup.LayoutParams.WRAP_CONTENT) // or any custom width ie: 300 .setContentHeight(ViewGroup.LayoutParams.WRAP_CONTENT) .setInAnimation(R.anim.abc_fade_in) .setOutAnimation(R.anim.abc_fade_out) .setPadding(20,20,20,0) .setGravity(Gravity.TOP) .setCancelable(false) .setExpanded(true) // This will enable the expand feature, (similar to android L share dialog) .create(); dialogplus.show();`
i realised .setExpanded(true) wasn't necessary and was causing the padding to be created.
Same issue here Below is the xml preview:![screen shot 2018-05-17 at 9 05 40 am](https://user-images.githubusercontent.com/11475652/40168246-89c8ec8e-59b2-11e8-9f50-dd72b410b077.png)
This is the dialog (with bottom padding)![32599578_1846004902371807_2061262381396262912_n](https://user-images.githubusercontent.com/11475652/40169620-ec0413c6-59b5-11e8-978e-f656d6709ac0.jpg)
This is my code. `dialogplus = DialogPlus.newDialog(this)