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:
- I have used activity and designed a layout to work for my needs. Is there any easy way to implement this using quick action dialog. I have gone through 2-3 examples for that, but I was unable to customize it according to my need.
- As far as I have implemented using an activity, it is showing in the center of the screen, can I change the default place of the activity to right corner as shown in the picture.
Either of the answer can help me.
Any kind of help will be appreciated for this.