I'm developing an application in which I have to show quick action dialog on click of a button. Here is an example how I want it to implement.
Till now I could not figure out how to make a custom quick action dialog. But I have tried using an activity and some what I'm near what I have to achieve. Here is what I have done till now.
On click of the button I'm passing intent to the activity:
if (v.getId() == R.id.points) {
Toast.makeText(MainActivity.this, "Clicked on points",
Toast.LENGTH_SHORT).show();
Intent i = new Intent(MainActivity.this, PointsActionMenu.class);
startActivity(i);
}
And I have used styles.xml
to make the activity transparent.
Styles.xml
<style name="Theme.Transparent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
Implementing these things I have got this UI on my screen.
Now, I have two questions:
Either of the answer can help me.
Any kind of help will be appreciated for this.
I think I solved my problem. Here it is now what it looks like.
Integrated the following code for setting it's position.
WindowManager.LayoutParams wmlp = this.getWindow().getAttributes();
wmlp.gravity = Gravity.TOP | Gravity.LEFT;
wmlp.x = 80; // x position
wmlp.y = 60; // y position
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With