Project

General

Profile

« Previous | Next » 

Revision 77e66c58

Added by Leszek Koltunski 11 months ago

in API 34 R.id. things are no loger constants and cannot be used in switches.

View differences:

src/main/java/org/distorted/examples/glow/GlowActivity.java
122 122

  
123 123
    public void onProgressChanged(SeekBar bar, int progress, boolean fromUser)
124 124
      {
125
      GlowSurfaceView view = findViewById(R.id.glowSurfaceView);
125
      GlowSurfaceView v = findViewById(R.id.glowSurfaceView);
126
      GlowRenderer r = v.getRenderer();
126 127

  
127
      switch (bar.getId())
128
      int id = bar.getId();
129

  
130
      if( id == R.id.glowSeekRadius )
131
        {
132
        int radius = r.setGlowRadius(progress);
133
        textRadius.setText(getString(R.string.glow_radius_placeholder,radius));
134
        }
135
      if( id == R.id.glowSeekAlpha )
128 136
        {
129
        case R.id.glowSeekRadius: int radius = view.getRenderer().setGlowRadius(progress);
130
                                  textRadius.setText(getString(R.string.glow_radius_placeholder,radius));
131
                                  break;
132
        case R.id.glowSeekAlpha : float alpha = view.getRenderer().setGlowAlpha(progress);
133
                                  textAlpha.setText(getString(R.string.glow_alpha_placeholder, alpha));
134
                                  break;
137
        float alpha = r.setGlowAlpha(progress);
138
        textAlpha.setText(getString(R.string.glow_alpha_placeholder, alpha));
135 139
        }
136 140
      }
137 141

  

Also available in: Unified diff