Custom dialog and progress bar issue

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Custom dialog and progress bar issue

Postby piojo » Sun Nov 04, 2012 10:19 am

Hi,

I have two very strange problems and the only thing they have in common is that they defined in xml ( one of them partially)

ok, problem number 1 - I made a layer-list drawable in xml to define a custom progress bar:

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

<item android:id="@android:id/background">
    <shape
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
       
        <corners android:radius="5dp" />
        <gradient
            android:startColor="#6f7754"
           android:endColor="#858762"
           android:angle="90"/>
    </shape>
</item>

<item android:id="@android:id/secondaryProgress">
    <clip>
        <shape
           xmlns:android="http://schemas.android.com/apk/res/android"
           android:shape="rectangle">
           
            <corners android:radius="5dp" />
            <gradient
                    android:startColor="#ffba00"
                    android:endColor="#af6c03"
                    android:angle="90"/>
        </shape>
    </clip>
</item>

<item android:id="@android:id/progress">
    <clip>
        <shape
             xmlns:android="http://schemas.android.com/apk/res/android"
           android:shape="rectangle">
           
            <corners
                android:radius="5dp" />
              <gradient
                  android:startColor="#ffba00"
                  android:endColor="#af6c03"
                  android:angle="90" />
        </shape>
    </clip>
</item>

</layer-list>


The problem is that sometimes the progress bar is not visible at all. sometimes is only after the second run of my app. sometimes its not happening at all.

The other problem - I wanted to make a custom dialog so I added a style to themes.xml file:

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="Dialog" parent="android:style/Theme.Dialog">
        <item name="android:windowBackground">@color/transparent</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowIsFloating">false</item>
        <item name="android:gravity">center</item>
    </style>

</resources>


The problem happening with dialogs that uses this xml (again not persistently and not all dialogs that uses this style) that a green background is shown on the whole screen behind my background.

I have no idea why and why the *@*# its green


I really need some help with this

10x
piojo
Junior Developer
Junior Developer
 
Posts: 10
Joined: Fri Jun 17, 2011 2:50 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Majestic-12 [Bot] and 9 guests