I am trying to use a custom progress bar however it is stuck in indeterminate mode even when I set it to false, and the progressbar is a square. When I supply the width and height for the layoutparams, the width of the bar does not match the width I set, instead it matches the height, making the progressbar a square.
Here is the code:
ProgressBar pbRightExtruder = new ProgressBar(this);
LinearLayout.LayoutParams lpProgressBar = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
lpProgressBar.weight = 1;
pbRightExtruder.setLayoutParams(lpProgressBar);
pbRightExtruder.setProgress(50);
pbRightExtruder.setIndeterminate(false);
pbRightExtruder.setIndeterminateDrawable(getResources().getDrawable(R.drawable.progressbar));
pbRightExtruder.setProgressDrawable(getResources().getDrawable(R.drawable.progressbar));
layoutRightExtruder.addView(pbRightExtruder);
What am I missing?