views:

439

answers:

0

Here the code...

mProgressDialog = new ProgressDialog(this);
mProgressDialog.setIcon(R.drawable.ic_dialog_time);
mProgressDialog.setMessage("Chargement du flux TV...");
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
mProgressDialog.setMax(MAX_PROGRESS);
mProgressDialog.setButton(getText(R.string.alert_dialog_cancel),
 new DialogInterface.OnClickListener() {
  public void onClick(DialogInterface dialog, int whichButton) {
   Log.d(LOG_TAG, "Dialog Click");
   onClickToListInterface();
  }
 }
);


WindowManager.LayoutParams lpWindow = new WindowManager.LayoutParams(); 
lpWindow.flags = WindowManager.LayoutParams.FLAG_DIM_BEHIND; 
lpWindow.dimAmount = 0.1f; // J'ai pas reussi a avoir un arriere plan transparent... :/
//lpWindow.alpha = 0.3f;
//lpWindow.gravity = Gravity.TOP;
lpWindow.windowAnimations = android.R.anim.fade_in | android.R.anim.fade_out; 
mProgressDialog.getWindow().setAttributes(lpWindow);

mProgressDialog.show();
mProgressHandler = new Handler() {
 @Override
 public void handleMessage(Message msg) {
  super.handleMessage(msg);
  if (mProgress >= MAX_PROGRESS) {
   mPicture.setVisibility(View.GONE);
   mVideoView.setVisibility(View.VISIBLE);
   mVideoView.requestFocus();
   mMediaController.hide();
   mProgressDialog.dismiss();
  }
  else {
   mProgress = mVideoView.getBufferPercentage();
   mProgressDialog.incrementProgressBy(1);
   mProgressHandler.sendEmptyMessageDelayed(0, 100);
  }
 }
};

But for the moment "dimAmount" have no effect and i can't have background transparency behind my dialog... (event with style transludent...)