4

I am having some difficulties.. I want to mimic Floating Search Widget as seen in Google I/O 2015 app - seen bellow.

enter image description here

So far I managed to put my second(search) activity into a dialog with Theme.AppCompat.Light.Dialog theme. I followed the steps shown here https://stackoverflow.com/a/32199671/2674529 to ger circular reveal effect working.

Second activity style is defined in Theme.Transparent

<style name="Theme.Transparent" parent="Theme.AppCompat.Light.Dialog">
    <item name="android:windowIsTranslucent">false</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
    <item name="android:windowBackground">@android:color/transparent</item>

    <item name="windowNoTitle">true</item>
</style>

Note: Greenish color is green color with alpha and is the background of the root layout of the second activity.

The problem is transparency of the dialog's background. If I comment out the

<item name="android:windowBackground">@android:color/transparent</item>

from the theme, then the dialog's background is whitish - as seen bellow. enter image description here

If I uncomment the line I get a "dialog" without any border nor margin - seen bellow. enter image description here

Does anyone have any ideas? Thanks

PS. xml of the dialog/activity

<?xml version="1.0" encoding="utf-8"?>

<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <FrameLayout
        android:id="@+id/root_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#8800FF00">

    </FrameLayout>

</android.support.v4.widget.DrawerLayout>
Community
  • 1
  • 1
Jaka Dirnbek
  • 155
  • 9

0 Answers0