Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5962529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:07:06+00:00 2026-05-22T19:07:06+00:00

I have a simple Activity and I would like to have the a rounded

  • 0

I have a simple Activity and I would like to have the a rounded rectangle shape. The activity uses a translucent Drawable. I have seen popup windows by other developers that are translucent (not a dialog theme) with rounded corners and I am trying to replicate that. Any help would be appreciated.

Here is the code I currently have that produces a rectangular translucent window in the middle of the screen.

<style name="Theme.TranslucentDialog">
    <item name="android:colorBackgroundCacheHint">@null</item>
    <item name="android:windowIsTranslucent">true</item>
    <!-- Note that we use the base animation style here (that is no
         animations) because we really have no idea how this kind of
         activity will be used. -->
    <item name="android:windowBackground">@drawable/translucent_background</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:colorForeground">#fff</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:backgroundDimEnabled">false</item>
    <item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item> 
</style>

<drawable name="translucent_background">#60000000</drawable>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:07:06+00:00Added an answer on May 22, 2026 at 7:07 pm

    I was not able to do this by generating a custom shape in the code. I had to accomplish this by creating my own 9-Patch png file. Here is the final Theme that I created:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <style name="Theme" parent="android:Theme">
        </style>
    
        <style name="Theme.TranslucentDialog">
            <item name="android:colorBackgroundCacheHint">@null</item>
            <item name="android:windowIsTranslucent">true</item>
            <item name="android:windowNoTitle">true</item>
            <item name="android:colorForeground">#ffffff</item>
            <item name="android:windowIsFloating">true</item>
            <item name="android:backgroundDimEnabled">false</item>
            <item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item> 
            <item name="android:windowBackground">@drawable/notification_panel</item>
        </style>
    
    </resources>
    

    Please note the line:

    <item name="android:windowBackground">@drawable/notification_panel</item>
    

    This is the line that sets the background of the activity to the 9-Patch image that I created. This image could be anything, an image, a 9-patch or a custom shape. I used a 9-Patch so that I could have a nice border and rounded corners while retaining a very translucent activity window (showing everything behind it but leaving a nice hue of grey where the activity window is located).

    The 9-patch notification_panel.9.png is located in my drawable folder. At first I was a little bit intimidated to create my own 9-patch image, but it turns out that by using Inkscape and the android draw9patch.bat utility program, I was able to do this with satisfactory results.

    Let me know if anyone has any questions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to have a window with a simple form (radio buttons and
I would like to implement the following simple pattern in an android app: Activity
i have a listview and i would like to go to a new activity
I have in mind one simple application, but I would like to add some
I would like to Start a new activity from my custom dialog, I have
I have a table that I would like to be able to present ranked
I would like to write a rather simple content application which displays a list
I have a website that's running on a Windows server and I'd like to
I would like to invoke a simple method (no arguments, returns void) from within
I have an activity that has properties that look something like this (they're set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.