title: How to make a layout for the equalizer?
body: <p>This is my code i use to setup a <strong>5 band Equalizer</strong>, but i would like to have a <strong>Layout</strong> which supports the number of equalizer bands supported by the device. </p>
  
  <p>For now i have <strong>hardcoded</strong> the size of <strong>Equalizer bands</strong> because i'm not sure how to create a <strong>Layout</strong> for a non constant value of equalizer bands.</p>
  
  <p><strong>This is the code i would like to use:</strong></p>
  
  <p><code>equalizer.getNumberOfBands(); //it tells you the number of equalizer in device.</code>   </p>
  
  <p>But what if a device supports <strong>+10 equalizer bands</strong>, how can i fit those <strong>bands</strong> on the screen? </p>
  
  <p><strong>Code for creating Equalizer</strong></p>
  
  <pre><code>private void setupEqualizer(){
  
      mEqualizer = new Equalizer(0, mediaPlayer.getAudioSessionId());
  
      final short lowerEqualizerBandLevel = mEqualizer.getBandLevelRange()[0];
      final short upperEqualizerBandLevel = mEqualizer.getBandLevelRange()[1];
  
      for (short i = 0; i &lt; 5; i++){
          final short equalizerBandIndex = i;
  
          int freq_range = mEqualizer.getCenterFreq(equalizerBandIndex);
  
          verticalSeekbar[i].setMax(upperEqualizerBandLevel - lowerEqualizerBandLevel);
          verticalSeekbar[i].setProgress(mEqualizer.getBandLevel(equalizerBandIndex));
  
          verticalSeekbar[i].setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
              @Override
              public void onProgressChanged(SeekBar seekBar, int progress, boolean b) {
                  mEqualizer.setBandLevel(equalizerBandIndex, (short) (progress + lowerEqualizerBandLevel ));
                  slider_value[equalizerBandIndex].setText(String.valueOf((progress + lowerEqualizerBandLevel) / 100 + " dB"));
              }
  
              @Override
              public void onStartTrackingTouch(SeekBar seekBar) {
  
              }
  
              @Override
              public void onStopTrackingTouch(SeekBar seekBar) {
  
              }
          });
          slider_labels[i].setText(formatBandLabel(freq_range));
  
          float scale2 = getResources().getDisplayMetrics().density;
          int dpAsPixels2 = (int) (8*scale2 + 0.5f);
  
      }
      setupEqSpinner();
  }
  </code></pre>