I have a dialog themed activity declared like this:
AndroidManifest:
<activity android:name=".DialogActivity" android:theme="@style/mydialog"></activity>
Style:
<style name="mydialog" parent="@style/Theme.AppCompat.Light.Dialog">
<item name="windowNoTitle">true</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
OnCreate of DialogActivity:
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dialog);
int width = (int)(getResources().getDisplayMetrics().widthPixels*0.95);
int height = (int)(getResources().getDisplayMetrics().heightPixels*0.80);
getWindow().setLayout(width, height);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
...
The problem is the activity does not close when I touch inside the red rectangular area shown in this image:
So my question is how to remove this extra space, so that the activity will finish when touched just outside its actual shape?
The activity finishes fine if I touch outside the red rectangle. Already tried this, couldn't remove the extra space.