Issue
How can I completely customize Android ProgressDialog? I want to use Horizontal Style but with AdMob banner ad or rectangle ad within the dialog. According to me, I have to create custom style and resource file for the dialog. How can I do that?
But I want the horizontal progress bar as it is.
Current code:
progressDialog.setTitle("Downloading...");
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setMax(100);
progressDialog.setProgress(0);
progressDialog.show();
progressDialog.setCancelable(true);
Solution
Use a progress bar and the admob view in a custom xml view shown using a alert dialog
AlertDialog.Builder builderVal=new AlertDialog.Builder(this);
builderVal.setTitle("Loading") ;
View holder=View.inflate(mContext, R.layout.your_view.xml, null);
builderVal.setView(holder);
AdView xs = ( AdView) holder.findViewById(R.id.admobView);
//use your admob view
ProgressBar pb = ( ProgressBar)holder.findViewById(R.id.progressBar);
//use your progressbar
builderVal.show();
see implementation of progressBar http://www.compiletimeerror.com/2013/09/android-progress-bar-example.html#.WEKou-Z9600
Answered By - Mushirih
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.