Back to project page PocketLantern.
The source code is released under:
GNU General Public License
If you think the Android project PocketLantern listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package cc.co.techzealous.pl; //from w w w .java 2 s .c om import cc.co.techzealous.pl.utils.PLConstants; import android.app.Activity; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.SeekBar; public class PLSizeActivity extends Activity { private Button buttonCancel; private Button buttonOk; private SeekBar seekBarSize; private SharedPreferences prefs; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sizeactivity); prefs = PreferenceManager.getDefaultSharedPreferences(this); buttonCancel = (Button) findViewById(R.id.buttonSizeCancel); buttonOk = (Button) findViewById(R.id.buttonSizeOk); seekBarSize = (SeekBar) findViewById(R.id.seekBar1); seekBarSize.setMax(prefs.getInt(PLConstants.PREF_POSY, 160) * 2); seekBarSize.setProgress(prefs.getInt(PLConstants.PREF_SIZE, PLConstants.DEFAULT_SIZE)); buttonCancel.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { finish(); } }); buttonOk.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { int size = seekBarSize.getProgress(); if(size <= 0) {size = 1;} prefs.edit().putInt(PLConstants.PREF_SIZE, size).commit(); finish(); } }); } }