I am making a custom progress bar using one small image/icon which will basically rotate. But in the background there is white patch or background is showing. I have attached the image here..
I have used the below code for this:
CustomDialog.java
public class CustomDialog extends Dialog{
public Activity c;
public CustomDialog(Activity a) {
super(a);
// TODO Auto-generated constructor stub
this.c = a;
}
public CustomDialog(Activity a, int s) {
super(a, s);
// TODO Auto-generated constructor stub
this.c = a;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.progressbar);
setCancelable(true);
}
}
progressbar.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
android:gravity="center"
android:orientation="vertical" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminate="true"
android:background="@android:color/transparent"
android:indeterminateDrawable="@drawable/my_progress_interminate" >
</ProgressBar>
</RelativeLayout>
my_progress_interminate.xml
<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/sai_icon"
android:pivotX="50%"
android:pivotY="50%" />
How can i remove the white background here.. Please help.