ProgressDialog and other animations

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

ProgressDialog and other animations

Postby darolla » Tue Aug 31, 2010 12:57 pm

hi :),

as we all should know this shows a ProgressDialog:

Code: Select all
ProgressDialog dialog = ProgressDialog.show(MeineActivity.this, "", "Loading. Please wait...", true);


Another way to do the same:

Code: Select all
ProgressDialog dialog = new ProgressDialog(this);
dialog.setTitle("");
dialog.setMessage("Loading. Please wait...");
dialog.setIndeterminate(true);
dialog.show();


In the folder platforms\android-1.5\data\res\values there is styles.xml:

Code: Select all
<style name="Widget.ProgressBar">
  <item name="android:indeterminateOnly">true</item>
  <item name="android:indeterminateDrawable">@android:drawable/progress_medium</item>
  <item name="android:indeterminateBehavior">repeat</item>
  <item name="android:indeterminateDuration">3500</item>
  <item name="android:minWidth">48dip</item>
  <item name="android:maxWidth">48dip</item>
  <item name="android:minHeight">48dip</item>
  <item name="android:maxHeight">48dip</item>
</style>


So I looked for progress_medium.xml in the folder platforms\android-1.5\data\res\drawable

There are some interesting files:
    progress_circular_background.png
    progress_circular_indeterminate.png
    progress_indeterminate.xml
    progress_large.xml
    progress_medium.xml
    progress_small.xml

So lets use them:

Code: Select all
dialog.setIndeterminateDrawable(getResources().getDrawable(R.drawable.progress_indeterminate));
dialog.setIndeterminateDrawable(getResources().getDrawable(R.drawable.progress_medium));
dialog.setIndeterminateDrawable(getResources().getDrawable(R.drawable.progress_large));
dialog.setIndeterminateDrawable(getResources().getDrawable(R.drawable.progress_small));


But: although the other drawables are shown the animations doesnt start at all.

Who can help me on this?

Best regards,
DaRolla
User avatar
darolla
Master Developer
Master Developer
 
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany

Top

Re: ProgressDialog and other animations

Postby darolla » Tue Aug 31, 2010 1:13 pm

progress_indeterminate.xml
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
   <item android:drawable="@drawable/progress_circular_background" />
   <item>
      <rotate android:pivotX="50%" android:pivotY="50%"
         android:fromDegrees="0" android:toDegrees="360"
         android:drawable="@drawable/progress_circular_indeterminate" />
   </item>
</layer-list>



progress_small.xml
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
   android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0"
   android:toDegrees="360">

   <!-- An extra pixel is added on both ratios for stroke -->
   <shape android:shape="ring" android:innerRadiusRatio="3.2"
      android:thicknessRatio="5.333" android:useLevel="false">

      <size android:width="16dip" android:height="16dip" />

      <gradient android:type="sweep" android:useLevel="false"
         android:startColor="#4c737373" android:centerColor="#4c737373"
         android:centerY="0.50" android:endColor="#ffffd300" />
   </shape>
</rotate>



progress_medium.xml
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
   android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0"
   android:toDegrees="360">

   <shape android:shape="ring" android:innerRadiusRatio="3"
      android:thicknessRatio="8" android:useLevel="false">

      <size android:width="48dip" android:height="48dip" />

      <gradient android:type="sweep" android:useLevel="false"
         android:startColor="#4c737373" android:centerColor="#4c737373"
         android:centerY="0.50" android:endColor="#ffffd300" />
   </shape>
</rotate>



progress_large.xml
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
   android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0"
   android:toDegrees="360">

   <shape android:shape="ring" android:innerRadiusRatio="3"
      android:thicknessRatio="8" android:useLevel="false">

      <size android:width="76dip" android:height="76dip" />

      <gradient android:type="sweep" android:useLevel="false"
         android:startColor="#4c737373" android:centerColor="#4c737373"
         android:centerY="0.50" android:endColor="#ffffd300" />
   </shape>
</rotate>
User avatar
darolla
Master Developer
Master Developer
 
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany

Re: ProgressDialog and other animations

Postby darolla » Tue Aug 31, 2010 1:13 pm

default.png
Attachments
default.png
default.png (8.18 KiB) Viewed 1671 times
User avatar
darolla
Master Developer
Master Developer
 
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany

Re: ProgressDialog and other animations

Postby darolla » Tue Aug 31, 2010 1:14 pm

indeterminate.png
Attachments
indeterminate.png
indeterminate.png (8.24 KiB) Viewed 1671 times
User avatar
darolla
Master Developer
Master Developer
 
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany

Re: ProgressDialog and other animations

Postby darolla » Tue Aug 31, 2010 1:14 pm

medium.png
Attachments
medium.png
medium.png (8.02 KiB) Viewed 1670 times
User avatar
darolla
Master Developer
Master Developer
 
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany

Re: ProgressDialog and other animations

Postby darolla » Tue Aug 31, 2010 1:15 pm

large.png
Attachments
large.png
large.png (8.04 KiB) Viewed 1670 times
User avatar
darolla
Master Developer
Master Developer
 
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany

Top

Re: ProgressDialog and other animations

Postby darolla » Tue Aug 31, 2010 1:15 pm

small.png
Attachments
small.png
small.png (8.15 KiB) Viewed 1670 times
User avatar
darolla
Master Developer
Master Developer
 
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany

Re: ProgressDialog and other animations

Postby darolla » Thu Sep 02, 2010 6:48 pm

is there noone who can help me on this?
User avatar
darolla
Master Developer
Master Developer
 
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: AugustusMallari, bestcanada, BRUNO, DomingoKent, drMartin, Google [Bot], leacanada, LorenVanhowe, lovecanada, mihel, mycanada, neproseds, niset, otrunvetal, SebastianClonts, SindiLoslessok, SindiLoslessom, SindiLoslesson, SindiLoslessop, TysonGullo, WilliamYaroch and 35 guests