Java Code Examples for android.widget.SeekBar

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project 2Degrees-Toolbox, under directory /Toolbox/src/biz/shadowservices/DegreesToolbox/Preferences/.

Source file: WidgetPreferencesActivity.java

  22 
vote

@Override public void onResume(){
  super.onResume();
  widget=(WidgetInstance)getIntent().getSerializableExtra("widget");
  TextView widgetName=(TextView)findViewById(R.id.WidgetName);
  widgetName.setText(widget.toString());
  Gallery g=(Gallery)findViewById(R.id.gallery);
  Log.d(TAG,"background:" + widget.getSelectedBackgroundId(this));
  int background=widget.getSelectedBackgroundId(this);
  g.setSelection(background);
  ImageView preview=(ImageView)findViewById(R.id.previewImage);
  preview.setImageResource(Values.backgroundIds[background]);
  SeekBar s=(SeekBar)findViewById(R.id.transparencySeekBar);
  s.setProgress(widget.getTransparency(this));
}
 

Example 2

From project agit, under directory /agit/src/main/java/com/madgag/agit/diff/.

Source file: DiffSliderView.java

  22 
vote

public DiffSliderView(Context context,AttributeSet attrs){
  super(context,attrs);
  setOrientation(HORIZONTAL);
  setGravity(CENTER);
  LayoutInflater.from(context).inflate(diff_seekbar_view,this);
  beforeTextView=(TextView)findViewById(beforeText);
  afterTextView=(TextView)findViewById(afterText);
  defaultTypeface=beforeTextView.getTypeface();
  boldTypeFace=create(defaultTypeface,BOLD);
  SeekBar seekBar=(SeekBar)findViewById(DiffPlayerSeekBar);
  seekBar.setProgress(seekBar.getMax() / 2);
  Vibrator vibrator=(Vibrator)context.getSystemService(VIBRATOR_SERVICE);
  seekBar.setOnSeekBarChangeListener(new DiffSeekBarChangeListener(vibrator));
}
 

Example 3

From project android_aosp_packages_apps_Settings, under directory /src/com/android/settings/.

Source file: RingerVolumePreference.java

  22 
vote

@Override protected void onBindDialogView(View view){
  super.onBindDialogView(view);
  for (int i=0; i < SEEKBAR_ID.length; i++) {
    SeekBar seekBar=(SeekBar)view.findViewById(SEEKBAR_ID[i]);
    mSeekBarVolumizer[i]=new SeekBarVolumizer(getContext(),seekBar,SEEKBAR_TYPE[i]);
  }
  mNotificationVolumeTitle=(TextView)view.findViewById(R.id.notification_volume_title);
  mNotificationsUseRingVolumeCheckbox=(CheckBox)view.findViewById(R.id.same_notification_volume);
  mNotificationsUseRingVolumeCheckbox.setOnCheckedChangeListener(this);
  mNotificationsUseRingVolumeCheckbox.setChecked(Settings.System.getInt(getContext().getContentResolver(),Settings.System.NOTIFICATIONS_USE_RING_VOLUME,1) == 1);
  setNotificationVolumeVisibility(!mNotificationsUseRingVolumeCheckbox.isChecked());
}
 

Example 4

From project Catroid-maven-playground, under directory /src/main/java/at/tugraz/ist/catroid/content/bricks/.

Source file: NXTMotorActionBrick.java

  22 
vote

public View getPrototypeView(Context context){
  View view=View.inflate(context,R.layout.brick_nxt_motor_action,null);
  SeekBar noClick=(SeekBar)view.findViewById(R.id.seekBarSpeedMotorAction);
  noClick.setEnabled(false);
  return view;
}
 

Example 5

From project connectbot, under directory /src/sk/vx/connectbot/util/.

Source file: VolumePreference.java

  22 
vote

@Override protected View onCreateDialogView(){
  SeekBar sb=new SeekBar(getContext());
  sb.setMax(100);
  sb.setProgress((int)(getPersistedFloat(PreferenceConstants.DEFAULT_BELL_VOLUME) * 100));
  sb.setPadding(10,10,10,10);
  sb.setOnSeekBarChangeListener(this);
  return sb;
}
 

Example 6

From project Dual-Battery-Widget, under directory /src/org/flexlabs/widgets/dualbattery/ui/.

Source file: SeekBarPreference.java

  22 
vote

@Override protected void onBindDialogView(View view){
  super.onBindDialogView(view);
  mValue=getPersistedInt(mDefault);
  mValueText=(TextView)view.findViewById(R.id.value);
  mValueText.setText(String.valueOf(mValue));
  SeekBar seekBar=(SeekBar)view.findViewById(R.id.seekbar);
  seekBar.setMax(mMax - mMin);
  seekBar.setProgress(mValue - mMin);
  seekBar.setOnSeekBarChangeListener(this);
}
 

Example 7

From project empub, under directory /src/com/commonsware/empub/.

Source file: SeekBarPreference.java

  22 
vote

@Override protected void onBindView(View view){
  super.onBindView(view);
  SeekBar seekBar=(SeekBar)view.findViewById(R.id.seekbar);
  seekBar.setOnSeekBarChangeListener(this);
  seekBar.setMax(mMax);
  seekBar.setProgress(mProgress);
  seekBar.setEnabled(isEnabled());
}
 

Example 8

From project FBReaderJ, under directory /src/org/geometerplus/android/fbreader/.

Source file: NavigationPopup.java

  22 
vote

private void setupNavigation(PopupWindow panel){
  final SeekBar slider=(SeekBar)panel.findViewById(R.id.book_position_slider);
  final TextView text=(TextView)panel.findViewById(R.id.book_position_text);
  final ZLTextView textView=getReader().getTextView();
  final ZLTextView.PagePosition pagePosition=textView.pagePosition();
  if (slider.getMax() != pagePosition.Total - 1 || slider.getProgress() != pagePosition.Current - 1) {
    slider.setMax(pagePosition.Total - 1);
    slider.setProgress(pagePosition.Current - 1);
    text.setText(makeProgressText(pagePosition.Current,pagePosition.Total));
  }
}
 

Example 9

From project opensudoku, under directory /OpenSudoku/src/cz/romario/opensudoku/gui/.

Source file: SeekBarPreference.java

  22 
vote

@Override protected void onBindDialogView(View view){
  super.onBindDialogView(view);
  mValueLabel=(TextView)view.findViewById(R.id.value);
  SeekBar seekBar=mSeekBar;
  seekBar.setProgress(getValue() - mMin);
  updateValueLabel(seekBar.getProgress());
  ViewParent oldParent=seekBar.getParent();
  if (oldParent != view) {
    if (oldParent != null) {
      ((ViewGroup)oldParent).removeView(seekBar);
    }
    onAddSeekBarToDialogView(view,seekBar);
  }
}
 

Example 10

From project opensudoku-blackberry, under directory /opensudoku/src/net/bmagro/blackberry/opensudoku/gui/.

Source file: SeekBarPreference.java

  22 
vote

@Override protected void onBindDialogView(View view){
  super.onBindDialogView(view);
  mValueLabel=(TextView)view.findViewById(R.id.value);
  SeekBar seekBar=mSeekBar;
  seekBar.setProgress(getValue() - mMin);
  updateValueLabel(seekBar.getProgress());
  ViewParent oldParent=seekBar.getParent();
  if (oldParent != view) {
    if (oldParent != null) {
      ((ViewGroup)oldParent).removeView(seekBar);
    }
    onAddSeekBarToDialogView(view,seekBar);
  }
}
 

Example 11

From project platform_packages_apps_VideoEditor, under directory /src/com/android/videoeditor/widgets/.

Source file: AudioTrackLinearLayout.java

  22 
vote

@Override public boolean onCreateActionMode(ActionMode mode,Menu menu){
  mAudioTrackActionMode=mode;
  mode.getMenuInflater().inflate(R.menu.audio_mode_menu,menu);
  final View titleBarView=inflate(getContext(),R.layout.audio_track_action_bar,null);
  mode.setCustomView(titleBarView);
  final TextView titleView=(TextView)titleBarView.findViewById(R.id.action_bar_title);
  titleView.setText(FileUtils.getSimpleName(mAudioTrack.getFilename()));
  final SeekBar seekBar=((SeekBar)titleBarView.findViewById(R.id.action_volume));
  seekBar.setOnSeekBarChangeListener(this);
  seekBar.setProgress(mAudioTrack.getAppVolume());
  return true;
}
 

Example 12

From project RoboBinding, under directory /robobinding/src/test/java/org/robobinding/viewattribute/seekbar/.

Source file: SeekBarListenersTest.java

  22 
vote

@Test public void shouldSupportMultipleOnSeekBarChangeListeners(){
  SeekBar view=new SeekBar(null);
  SeekBarListeners viewListeners=new SeekBarListeners(view);
  MockOnSeekBarChangeListener listener1=new MockOnSeekBarChangeListener();
  MockOnSeekBarChangeListener listener2=new MockOnSeekBarChangeListener();
  viewListeners.addOnSeekBarChangeListener(listener1);
  viewListeners.addOnSeekBarChangeListener(listener2);
  int newProgressValue=RandomValues.anyInteger();
  view.setProgress(newProgressValue);
  assertTrue(listener1.seekBarChangeEventFired);
  assertTrue(listener2.seekBarChangeEventFired);
}
 

Example 13

From project Sage-Mobile-Calc, under directory /src/org/connectbot/util/.

Source file: VolumePreference.java

  22 
vote

@Override protected View onCreateDialogView(){
  SeekBar sb=new SeekBar(getContext());
  sb.setMax(100);
  sb.setProgress((int)(getPersistedFloat(PreferenceConstants.DEFAULT_BELL_VOLUME) * 100));
  sb.setPadding(10,10,10,10);
  sb.setOnSeekBarChangeListener(this);
  return sb;
}
 

Example 14

From project subsonic, under directory /subsonic-android/src/github/daneren2005/dsub/activity/.

Source file: EqualizerActivity.java

  22 
vote

private void updateBars(){
  for (  Map.Entry<Short,SeekBar> entry : bars.entrySet()) {
    short band=entry.getKey();
    SeekBar bar=entry.getValue();
    bar.setEnabled(equalizer.getEnabled());
    short minEQLevel=equalizer.getBandLevelRange()[0];
    bar.setProgress(equalizer.getBandLevel(band) - minEQLevel);
  }
}
 

Example 15

From project Subsonic-Android, under directory /src/net/sourceforge/subsonic/androidapp/activity/.

Source file: EqualizerActivity.java

  22 
vote

private void updateBars(){
  for (  Map.Entry<Short,SeekBar> entry : bars.entrySet()) {
    short band=entry.getKey();
    SeekBar bar=entry.getValue();
    bar.setEnabled(equalizer.getEnabled());
    short minEQLevel=equalizer.getBandLevelRange()[0];
    bar.setProgress(equalizer.getBandLevel(band) - minEQLevel);
  }
}
 

Example 16

From project subsonic_1, under directory /subsonic-android/src/net/sourceforge/subsonic/androidapp/activity/.

Source file: EqualizerActivity.java

  22 
vote

private void updateBars(){
  for (  Map.Entry<Short,SeekBar> entry : bars.entrySet()) {
    short band=entry.getKey();
    SeekBar bar=entry.getValue();
    bar.setEnabled(equalizer.getEnabled());
    short minEQLevel=equalizer.getBandLevelRange()[0];
    bar.setProgress(equalizer.getBandLevel(band) - minEQLevel);
  }
}
 

Example 17

From project subsonic_2, under directory /subsonic-android/src/net/sourceforge/subsonic/androidapp/activity/.

Source file: EqualizerActivity.java

  22 
vote

private void updateBars(){
  for (  Map.Entry<Short,SeekBar> entry : bars.entrySet()) {
    short band=entry.getKey();
    SeekBar bar=entry.getValue();
    bar.setEnabled(equalizer.getEnabled());
    short minEQLevel=equalizer.getBandLevelRange()[0];
    bar.setProgress(equalizer.getBandLevel(band) - minEQLevel);
  }
}
 

Example 18

From project Supersonic, under directory /subsonic-android/src/net/sourceforge/subsonic/androidapp/activity/.

Source file: EqualizerActivity.java

  22 
vote

private void updateBars(){
  for (  Map.Entry<Short,SeekBar> entry : bars.entrySet()) {
    short band=entry.getKey();
    SeekBar bar=entry.getValue();
    bar.setEnabled(equalizer.getEnabled());
    short minEQLevel=equalizer.getBandLevelRange()[0];
    bar.setProgress(equalizer.getBandLevel(band) - minEQLevel);
  }
}
 

Example 19

From project SWE12-Drone, under directory /catroid/src/at/tugraz/ist/catroid/content/bricks/.

Source file: NXTMotorActionBrick.java

  22 
vote

public View getPrototypeView(Context context){
  View view=View.inflate(context,R.layout.brick_nxt_motor_action,null);
  SeekBar noClick=(SeekBar)view.findViewById(R.id.seekBarSpeedMotorAction);
  noClick.setEnabled(false);
  return view;
}
 

Example 20

From project ThreadPaint, under directory /src/at/droidcode/threadpaint/dialog/.

Source file: BrushPickerDialog.java

  22 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.dialog_brushpicker);
  brushTipView=(BrushTipView)findViewById(R.id.view_brushtip);
  brushTipView.setShapeClickedListener(this);
  int x=((TpApplication)getContext().getApplicationContext()).maxStrokeWidth();
  brushTipView.setShapeDiameter(x / 2f);
  final Button round=(Button)findViewById(R.id.btn_cap_round);
  round.setOnClickListener(this);
  final Button square=(Button)findViewById(R.id.btn_cap_squared);
  square.setOnClickListener(this);
  final SeekBar strokeSeekBar=(SeekBar)findViewById(R.id.seekbar_brush_tip);
  strokeSeekBar.setOnSeekBarChangeListener(this);
}
 

Example 21

From project android-joedayz, under directory /Proyectos/SoundsTest/src/com/androideity/sounds/.

Source file: SoundsTestActivity.java

  21 
vote

/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  snd=new SoundManager(getApplicationContext());
  this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
  laser=snd.load(R.raw.laser);
  explode=snd.load(R.raw.explosion);
  pickup=snd.load(R.raw.pickup);
  meow=snd.load(R.raw.cat);
  bark=snd.load(R.raw.barkloud);
  moo=snd.load(R.raw.cow);
  barChange=new OnSeekBarChangeListener(){
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
switch (seekBar.getId()) {
case R.id.VolBar1:
        snd.setVolume((float)progress / 100.0f);
      break;
case R.id.BalBar:
    snd.setBalance((float)progress / 100.0f);
  break;
case R.id.SpeedBar:
snd.setSpeed((float)progress / 100.0f);
break;
}
}
}
;
SeekBar sb;
sb=(SeekBar)findViewById(R.id.SpeedBar);
sb.setOnSeekBarChangeListener(barChange);
sb=(SeekBar)findViewById(R.id.BalBar);
sb.setOnSeekBarChangeListener(barChange);
sb=(SeekBar)findViewById(R.id.VolBar1);
sb.setOnSeekBarChangeListener(barChange);
}
 

Example 22

From project Backyard-Brains-Android-App, under directory /src/com/backyardbrains/view/.

Source file: UIFactory.java

  21 
vote

public static void setupSampleSlider(final BackyardAndroidActivity context){
  final TextView numberOfSamplesLabel=(TextView)context.findViewById(R.id.numberOfSamplesAveraged);
  OnClickListener toggleSeekbarListener=new OnClickListener(){
    @Override public void onClick(    View v){
      toggleSeekbar(context);
    }
  }
;
  numberOfSamplesLabel.setOnClickListener(toggleSeekbarListener);
  SeekBar samplesSeekBar=(SeekBar)context.findViewById(R.id.samplesSeekBar);
  samplesSeekBar.setMax(49);
  samplesSeekBar.setProgress(9);
  samplesSeekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
      if (!fromUser)       return;
      Intent i=new Intent("setSampleSize").putExtra("newSampleSize",progress + 1);
      context.sendBroadcast(i);
      numberOfSamplesLabel.setText((progress + 1) + " x");
    }
  }
);
}
 

Example 23

From project CoinFlip, under directory /src/com/banasiak/coinflip/.

Source file: SliderPreference.java

  21 
vote

@Override protected void onBindView(View view){
  super.onBindView(view);
  if (mMinText != null) {
    TextView minText=(TextView)view.findViewById(R.id.min);
    minText.setText(mMinText);
  }
  if (mMaxText != null) {
    TextView maxText=(TextView)view.findViewById(R.id.max);
    maxText.setText(mMaxText);
  }
  SeekBar bar=(SeekBar)view.findViewById(R.id.slider);
  bar.setMax(MAX_SLIDER_VALUE);
  bar.setProgress(mValue);
  bar.setOnSeekBarChangeListener(this);
}
 

Example 24

From project eoit, under directory /EOIT/src/fr/eoit/activity/fragment/parameter/.

Source file: SeekBarPreference.java

  21 
vote

@Override protected View onCreateView(ViewGroup parent){
  LinearLayout layout=new LinearLayout(getContext());
  layout.setOrientation(LinearLayout.VERTICAL);
  LinearLayout.LayoutParams params1=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  params1.gravity=Gravity.LEFT;
  params1.weight=1.0f;
  LinearLayout.LayoutParams params2=new LinearLayout.LayoutParams(80,LinearLayout.LayoutParams.WRAP_CONTENT);
  params2.gravity=Gravity.RIGHT;
  LinearLayout.LayoutParams params3=new LinearLayout.LayoutParams(30,LinearLayout.LayoutParams.WRAP_CONTENT);
  params3.gravity=Gravity.CENTER;
  layout.setPadding(15,5,10,5);
  layout.setOrientation(LinearLayout.HORIZONTAL);
  TextView view=new TextView(getContext());
  view.setText(getTitle());
  view.setTextSize(18);
  view.setTypeface(Typeface.SANS_SERIF,Typeface.NORMAL);
  view.setGravity(Gravity.LEFT);
  view.setLayoutParams(params1);
  SeekBar bar=new SeekBar(getContext());
  bar.setMax(maximum);
  bar.setProgress(this.oldValue);
  bar.setLayoutParams(params2);
  bar.setOnSeekBarChangeListener(this);
  this.monitorBox=new TextView(getContext());
  this.monitorBox.setTextSize(12);
  this.monitorBox.setTypeface(Typeface.MONOSPACE,Typeface.ITALIC);
  this.monitorBox.setLayoutParams(params3);
  this.monitorBox.setPadding(2,5,0,0);
  this.monitorBox.setText(bar.getProgress() + "");
  layout.addView(view);
  layout.addView(bar);
  layout.addView(this.monitorBox);
  layout.setId(android.R.id.widget_frame);
  return layout;
}
 

Example 25

From project external-replicaisland, under directory /src/com/replica/replicaisland/.

Source file: SliderPreference.java

  21 
vote

@Override protected void onBindView(View view){
  super.onBindView(view);
  if (mMinText != null) {
    TextView minText=(TextView)view.findViewById(R.id.min);
    minText.setText(mMinText);
  }
  if (mMaxText != null) {
    TextView maxText=(TextView)view.findViewById(R.id.max);
    maxText.setText(mMaxText);
  }
  SeekBar bar=(SeekBar)view.findViewById(R.id.slider);
  bar.setMax(MAX_SLIDER_VALUE);
  bar.setProgress(mValue);
  bar.setOnSeekBarChangeListener(this);
}
 

Example 26

From project HapiPodcastJ, under directory /src/info/xuluan/podcast/.

Source file: PlayerActivity.java

  21 
vote

@Override public void onCreate(Bundle icicle){
  super.onCreate(icicle);
  startService(new Intent(this,PlayerService.class));
  setContentView(R.layout.audio_player);
  setTitle(getResources().getString(R.string.title_episodes));
  getListView().setOnCreateContextMenuListener(this);
  final Intent intent=getIntent();
  mID=intent.getLongExtra("item_id",-1);
  setIntent(new Intent());
  mPauseButton=(ImageButton)findViewById(R.id.pause);
  mPauseButton.requestFocus();
  mPauseButton.setOnClickListener(mPauseListener);
  mRwndButton=(ImageButton)findViewById(R.id.rwnd);
  mRwndButton.requestFocus();
  mRwndButton.setOnClickListener(mRwndListener);
  mFfwdButton=(ImageButton)findViewById(R.id.ffwd);
  mFfwdButton.requestFocus();
  mFfwdButton.setOnClickListener(mFfwdListener);
  mPrevButton=(ImageButton)findViewById(R.id.prev);
  mPrevButton.requestFocus();
  mPrevButton.setOnClickListener(mPrevListener);
  mNextButton=(ImageButton)findViewById(R.id.next);
  mNextButton.requestFocus();
  mNextButton.setOnClickListener(mNextListener);
  mProgress=(ProgressBar)findViewById(android.R.id.progress);
  if (mProgress instanceof SeekBar) {
    SeekBar seeker=(SeekBar)mProgress;
    seeker.setOnSeekBarChangeListener(mSeekListener);
  }
  mProgress.setMax(1000);
  mTotalTime=(TextView)findViewById(R.id.totaltime);
  mCurrentTime=(TextView)findViewById(R.id.currenttime);
  TabsHelper.setEpisodeTabClickListeners(this,R.id.episode_bar_play_button);
  startInit();
}
 

Example 27

From project Jota-Text-Editor, under directory /src/jp/sblo/pandora/jota/.

Source file: SettingsActivity.java

  21 
vote

private void showLineSpaceDialog(final String key,int title,int message){
  final SharedPreferences sp=PreferenceManager.getDefaultSharedPreferences(SettingsActivity.this);
  View view=getLayoutInflater().inflate(R.layout.linespace,null);
  TextView msgText=(TextView)view.findViewById(R.id.message);
  msgText.setText(message);
  final SeekBar seekBar=(SeekBar)view.findViewById(R.id.seekbar);
  seekBar.setProgress(sp.getInt(key,0));
  new AlertDialog.Builder(SettingsActivity.this).setTitle(title).setView(view).setPositiveButton(R.string.label_ok,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      Editor editor=sp.edit();
      int val=seekBar.getProgress();
      editor.putInt(key,val);
      editor.commit();
    }
  }
).setNegativeButton(R.string.label_cancel,null).show();
}
 

Example 28

From project mixare, under directory /src/org/mixare/.

Source file: MixView.java

  21 
vote

/** 
 * Create zoom bar and returns FrameLayout. FrameLayout is created to be hidden and not added to view, Caller needs to add the frameLayout to view, and enable visibility when needed.
 * @param SharedOreference settings where setting is stored
 * @return FrameLayout Hidden Zoom Bar
 */
private FrameLayout createZoomBar(SharedPreferences settings){
  getMixViewData().setMyZoomBar(new SeekBar(this));
  getMixViewData().getMyZoomBar().setMax(100);
  getMixViewData().getMyZoomBar().setProgress(settings.getInt("zoomLevel",65));
  getMixViewData().getMyZoomBar().setOnSeekBarChangeListener(myZoomBarOnSeekBarChangeListener);
  getMixViewData().getMyZoomBar().setVisibility(View.INVISIBLE);
  FrameLayout frameLayout=new FrameLayout(this);
  frameLayout.setMinimumWidth(3000);
  frameLayout.addView(getMixViewData().getMyZoomBar());
  frameLayout.setPadding(10,0,10,10);
  return frameLayout;
}
 

Example 29

From project mobilis, under directory /MobilisXHunt/MobilisXHunt_Android/src/de/tudresden/inf/rn/mobilis/android/xhunt/ui/.

Source file: SeekBarPreference.java

  21 
vote

/** 
 * Constructor for a new SeekBarPreference instance
 * @param context the Context object
 * @param minValue the minimum value
 * @param maxValue the maximum value
 * @param defaultValue the default value
 * @param unit the unit shown next to the set value
 */
public SeekBarPreference(Context context,int minValue,int maxValue,int defaultValue,String unit){
  super(context);
  mMinValue=minValue;
  mMaxValue=maxValue;
  mDefaultValue=defaultValue;
  mUnits=" " + unit;
  mInterval=1;
  mCurrentValue=getPersistedInt(defaultValue);
  mSeekBar=new SeekBar(context);
  mSeekBar.setMax(mMaxValue - mMinValue);
  mSeekBar.setOnSeekBarChangeListener(this);
}
 

Example 30

From project packages_apps_BlackICEControl, under directory /src/com/blackice/control/fragments/.

Source file: ColorTuningPreference.java

  21 
vote

@Override protected void onBindDialogView(View view){
  super.onBindDialogView(view);
  sInstances++;
  for (int i=0; i < SEEKBAR_ID.length; i++) {
    SeekBar seekBar=(SeekBar)view.findViewById(SEEKBAR_ID[i]);
    TextView valueDisplay=(TextView)view.findViewById(VALUE_DISPLAY_ID[i]);
    mSeekBars[i]=new ColorSeekBar(seekBar,valueDisplay,FILE_PATH[i]);
  }
  mReset_button=(Button)view.findViewById(R.id.reset_button);
  mReset_button.setOnClickListener(new Button.OnClickListener(){
    public void onClick(    View v){
      for (      ColorSeekBar seekbar : mSeekBars) {
        seekbar.mSeekBar.setProgress(DEFAULT_COLOR_MULT);
      }
    }
  }
);
}
 

Example 31

From project ReplicaIsland, under directory /src/com/replica/replicaisland/.

Source file: SliderPreference.java

  21 
vote

@Override protected void onBindView(View view){
  super.onBindView(view);
  if (mMinText != null) {
    TextView minText=(TextView)view.findViewById(R.id.min);
    minText.setText(mMinText);
  }
  if (mMaxText != null) {
    TextView maxText=(TextView)view.findViewById(R.id.max);
    maxText.setText(mMaxText);
  }
  SeekBar bar=(SeekBar)view.findViewById(R.id.slider);
  bar.setMax(MAX_SLIDER_VALUE);
  bar.setProgress(mValue);
  bar.setOnSeekBarChangeListener(this);
}
 

Example 32

From project sls, under directory /src/com/adam/aslfms/.

Source file: SeekBarPreference.java

  21 
vote

@Override protected void onPrepareDialogBuilder(Builder builder){
  LinearLayout layout=new LinearLayout(mContext);
  layout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT));
  layout.setPadding(20,20,20,20);
  mSeekBar=new SeekBar(mContext);
  mSeekBar.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
  mSeekBar.setMax(mStartMax);
  mSeekBar.setProgress(mStartProgress);
  layout.addView(mSeekBar);
  builder.setView(layout);
  super.onPrepareDialogBuilder(builder);
}
 

Example 33

From project Something-Awful-Android, under directory /application/src/com/ferg/awfulapp/.

Source file: SettingsActivity.java

  21 
vote

@Override public boolean onPreferenceClick(Preference preference){
  mFontSizeDialog=new Dialog(mThis);
  mFontSizeDialog.setContentView(R.layout.font_size);
  mFontSizeDialog.setTitle("Set Default Font Size");
  mFontSizeText=(TextView)mFontSizeDialog.findViewById(R.id.fontSizeText);
  SeekBar bar=(SeekBar)mFontSizeDialog.findViewById(R.id.fontSizeBar);
  Button click=(Button)mFontSizeDialog.findViewById(R.id.fontSizeButton);
  click.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      mFontSizeDialog.dismiss();
    }
  }
);
  bar.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
      Editor sizeEdit=mPrefs.edit();
      sizeEdit.putInt("default_post_font_size",seekBar.getProgress() + 10);
      sizeEdit.commit();
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
      mFontSizeText.setText((progress + 10) + "  Get out");
      mFontSizeText.setTextSize(TypedValue.COMPLEX_UNIT_PX,(progress + 10));
    }
  }
);
  bar.setProgress(mPrefs.getInt("default_post_font_size",22) - 10);
  mFontSizeText.setText((bar.getProgress() + 10) + "  Get out");
  mFontSizeText.setTextSize(TypedValue.COMPLEX_UNIT_PX,(bar.getProgress() + 10));
  mFontSizeDialog.show();
  return true;
}
 

Example 34

From project twidere, under directory /src/com/robobunny/.

Source file: SeekBarPreference.java

  21 
vote

private void initPreference(final Context context,final AttributeSet attrs){
  setValuesFromXml(attrs);
  mSeekBar=new SeekBar(context,attrs);
  mSeekBar.setMax(mMaxValue - mMinValue);
  mSeekBar.setOnSeekBarChangeListener(this);
}
 

Example 35

From project android_packages_apps_cmparts, under directory /src/com/cyanogenmod/cmparts/activities/.

Source file: ColorPickerDialog.java

  20 
vote

protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  LinearLayout layout=new LinearLayout(mContext);
  layout.setOrientation(LinearLayout.VERTICAL);
  layout.setGravity(android.view.Gravity.CENTER);
  LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  layoutParams.setMargins(10,0,10,5);
  TextView tv=new TextView(mContext);
  tv.setText(com.cyanogenmod.cmparts.R.string.msg_color_picker);
  layout.addView(tv,layoutParams);
  mColorPickerView=new ColorPickerView(getContext(),onColorChangedListener,mInitialColor);
  layout.addView(mColorPickerView,layoutParams);
  mTransparencyBar=new SeekBar(mContext);
  mTransparencyBar.setMax(255);
  mTransparencyBar.setProgressDrawable(new TextSeekBarDrawable(mContext.getResources(),"alpha",true));
  mTransparencyBar.setProgress(Color.alpha(mInitialColor));
  mTransparencyBar.setOnSeekBarChangeListener(onTransparencyChangedListener);
  layout.addView(mTransparencyBar,layoutParams);
  mEditText=new EditText(mContext);
  mEditText.addTextChangedListener(mEditTextListener);
  mEditText.setText(convertToARGB(mInitialColor));
  layout.addView(mEditText,layoutParams);
  setContentView(layout);
  setTitle(com.cyanogenmod.cmparts.R.string.title_color_picker);
}
 

Example 36

From project android_packages_apps_CMSettings, under directory /src/com/cyanogenmod/settings/activities/.

Source file: ColorPickerDialog.java

  20 
vote

protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  LinearLayout layout=new LinearLayout(mContext);
  layout.setOrientation(LinearLayout.VERTICAL);
  layout.setGravity(android.view.Gravity.CENTER);
  LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  layoutParams.setMargins(10,0,10,5);
  TextView tv=new TextView(mContext);
  tv.setText("Color Picker");
  layout.addView(tv,layoutParams);
  mColorPickerView=new ColorPickerView(getContext(),onColorChangedListener,mInitialColor);
  layout.addView(mColorPickerView,layoutParams);
  mTransparencyBar=new SeekBar(mContext);
  mTransparencyBar.setMax(255);
  mTransparencyBar.setProgressDrawable(new TextSeekBarDrawable(mContext.getResources(),"alpha",true));
  mTransparencyBar.setProgress(Color.alpha(mInitialColor));
  mTransparencyBar.setOnSeekBarChangeListener(onTransparencyChangedListener);
  layout.addView(mTransparencyBar,layoutParams);
  mEditText=new EditText(mContext);
  mEditText.addTextChangedListener(mEditTextListener);
  mEditText.setText(convertToARGB(mInitialColor));
  layout.addView(mEditText,layoutParams);
  setContentView(layout);
  setTitle("Color Picker");
}
 

Example 37

From project android_packages_apps_SalvageParts, under directory /src/com/salvagemod/salvageparts/activities/.

Source file: ColorPickerDialog.java

  20 
vote

protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  LinearLayout layout=new LinearLayout(mContext);
  layout.setOrientation(LinearLayout.VERTICAL);
  layout.setGravity(android.view.Gravity.CENTER);
  LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  layoutParams.setMargins(10,0,10,5);
  TextView tv=new TextView(mContext);
  tv.setText(com.salvagemod.salvageparts.R.string.msg_color_picker);
  layout.addView(tv,layoutParams);
  mColorPickerView=new ColorPickerView(getContext(),onColorChangedListener,mInitialColor);
  layout.addView(mColorPickerView,layoutParams);
  mTransparencyBar=new SeekBar(mContext);
  mTransparencyBar.setMax(255);
  mTransparencyBar.setProgressDrawable(new TextSeekBarDrawable(mContext.getResources(),"alpha",true));
  mTransparencyBar.setProgress(Color.alpha(mInitialColor));
  mTransparencyBar.setOnSeekBarChangeListener(onTransparencyChangedListener);
  layout.addView(mTransparencyBar,layoutParams);
  mEditText=new EditText(mContext);
  mEditText.addTextChangedListener(mEditTextListener);
  mEditText.setText(convertToARGB(mInitialColor));
  layout.addView(mEditText,layoutParams);
  setContentView(layout);
  setTitle(com.salvagemod.salvageparts.R.string.title_color_picker);
}
 

Example 38

From project BBC-News-Reader, under directory /src/com/hlidskialf/android/preference/.

Source file: SeekBarPreference.java

  20 
vote

@Override protected View onCreateDialogView(){
  LinearLayout.LayoutParams params;
  LinearLayout layout=new LinearLayout(mContext);
  layout.setOrientation(LinearLayout.VERTICAL);
  layout.setPadding(6,6,6,6);
  mSplashText=new TextView(mContext);
  if (mDialogMessage != null)   mSplashText.setText(mDialogMessage);
  layout.addView(mSplashText);
  mValueText=new TextView(mContext);
  mValueText.setGravity(Gravity.CENTER_HORIZONTAL);
  mValueText.setTextSize(32);
  params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  layout.addView(mValueText,params);
  mSeekBar=new SeekBar(mContext);
  mSeekBar.setOnSeekBarChangeListener(this);
  layout.addView(mSeekBar,new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT));
  if (shouldPersist())   mValue=getPersistedInt(mDefault);
  mSeekBar.setMax(mMax);
  mSeekBar.setProgress(mValue);
  return layout;
}
 

Example 39

From project CHMI, under directory /src/org/kaldax/app/chmi/.

Source file: StandardLayoutProviderLegacy.java

  20 
vote

public void AllocateLayoutItems(){
  dateTextView=new TextView(chmiActivity);
  iv=new ImageView(chmiActivity){
    @Override public boolean onTouchEvent(    MotionEvent event){
      iZoomOriginWidth=this.getWidth();
      iZoomOriginHeight=this.getHeight();
      iZoomXCenterPos=event.getX();
      iZoomYCenterPos=event.getY();
      bZoomActive=!bZoomActive;
      ShowImage(chmiActivity.getCurrentImgIdx());
      return super.onTouchEvent(event);
    }
  }
;
  seekBar=new SeekBar(chmiActivity);
  btPlay=new ImageButton(chmiActivity);
  lSeekBar=new LinearLayout(chmiActivity);
  imgProgressText=new TextView(chmiActivity);
  statusText=new TextView(chmiActivity);
  layout=new TableLayout(chmiActivity);
  row2lin=new LinearLayout(chmiActivity);
  imgs=new FrameLayout(chmiActivity);
  tableButtons=new TableLayout(chmiActivity);
  row2a=new TableRow(chmiActivity);
  row2b=new TableRow(chmiActivity);
  row2c=new TableRow(chmiActivity);
  row2d=new TableRow(chmiActivity);
  row2e=new TableRow(chmiActivity);
  frLayout=new FrameLayout(chmiActivity);
  row1=new TableRow(chmiActivity);
  row2fr=new FrameLayout(chmiActivity);
  row4=new LinearLayout(chmiActivity);
  row5=new LinearLayout(chmiActivity);
  row3=new LinearLayout(chmiActivity);
  imgScrollView=new ScrollView(chmiActivity);
}
 

Example 40

From project COSsettings, under directory /src/com/cyanogenmod/cmparts/activities/.

Source file: ColorPickerDialog.java

  20 
vote

protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  LinearLayout layout=new LinearLayout(mContext);
  layout.setOrientation(LinearLayout.VERTICAL);
  layout.setGravity(android.view.Gravity.CENTER);
  LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  layoutParams.setMargins(10,0,10,5);
  TextView tv=new TextView(mContext);
  tv.setText(com.cyanogenmod.cmparts.R.string.msg_color_picker);
  layout.addView(tv,layoutParams);
  mColorPickerView=new ColorPickerView(getContext(),onColorChangedListener,mInitialColor);
  layout.addView(mColorPickerView,layoutParams);
  mTransparencyBar=new SeekBar(mContext);
  mTransparencyBar.setMax(255);
  mTransparencyBar.setProgressDrawable(new TextSeekBarDrawable(mContext.getResources(),"alpha",true));
  mTransparencyBar.setProgress(Color.alpha(mInitialColor));
  mTransparencyBar.setOnSeekBarChangeListener(onTransparencyChangedListener);
  layout.addView(mTransparencyBar,layoutParams);
  mEditText=new EditText(mContext);
  mEditText.addTextChangedListener(mEditTextListener);
  mEditText.setText(convertToARGB(mInitialColor));
  layout.addView(mEditText,layoutParams);
  setContentView(layout);
  setTitle(com.cyanogenmod.cmparts.R.string.title_color_picker);
}
 

Example 41

From project LigiAndroidCommons, under directory /src/org/ligi/android/common/preferences/.

Source file: SeekBarPreference.java

  20 
vote

protected void onPrepareDialogBuilder(Builder builder){
  LinearLayout layout=new LinearLayout(context);
  layout.setOrientation(LinearLayout.VERTICAL);
  layout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT));
  layout.setMinimumWidth(400);
  layout.setPadding(20,20,20,20);
  edit_text=new EditText(context);
  edit_text.setInputType(InputType.TYPE_CLASS_NUMBER);
  edit_text.setText("" + getPersistedInt(0));
  layout.addView(edit_text);
  seek_bar=new SeekBar(context);
  seek_bar.setMax(max);
  seek_bar.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
  seek_bar.setOnSeekBarChangeListener(this);
  seek_bar.setProgress(getPersistedInt(0));
  layout.addView(seek_bar);
  builder.setView(layout);
  super.onPrepareDialogBuilder(builder);
}
 

Example 42

From project packages_apps_God_Mode, under directory /src/com/t3hh4xx0r/god_mode/.

Source file: ColorPickerDialog.java

  20 
vote

protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  LinearLayout layout=new LinearLayout(mContext);
  layout.setOrientation(LinearLayout.VERTICAL);
  layout.setGravity(android.view.Gravity.CENTER);
  LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  layoutParams.setMargins(10,0,10,5);
  TextView tv=new TextView(mContext);
  tv.setText("Tap on center color to confirm.\nPress back to cancel.");
  layout.addView(tv,layoutParams);
  mColorPickerView=new ColorPickerView(getContext(),onColorChangedListener,mInitialColor);
  layout.addView(mColorPickerView,layoutParams);
  mTransparencyBar=new SeekBar(mContext);
  mTransparencyBar.setMax(255);
  mTransparencyBar.setProgressDrawable(new TextSeekBarDrawable(mContext.getResources(),"alpha",true));
  mTransparencyBar.setProgress(Color.alpha(mInitialColor));
  mTransparencyBar.setOnSeekBarChangeListener(onTransparencyChangedListener);
  layout.addView(mTransparencyBar,layoutParams);
  mEditText=new EditText(mContext);
  mEditText.addTextChangedListener(mEditTextListener);
  mEditText.setText(convertToARGB(mInitialColor));
  layout.addView(mEditText,layoutParams);
  setContentView(layout);
  setTitle("Pick a color.");
}
 

Example 43

From project PageTurner, under directory /src/main/java/com/hlidskialf/android/preference/.

Source file: SeekBarPreference.java

  20 
vote

@Override protected View onCreateDialogView(){
  LinearLayout.LayoutParams params;
  LinearLayout layout=new LinearLayout(mContext);
  layout.setOrientation(LinearLayout.VERTICAL);
  layout.setPadding(6,6,6,6);
  mSplashText=new TextView(mContext);
  if (mDialogMessage != null)   mSplashText.setText(mDialogMessage);
  layout.addView(mSplashText);
  mValueText=new TextView(mContext);
  mValueText.setGravity(Gravity.CENTER_HORIZONTAL);
  mValueText.setTextSize(32);
  params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  layout.addView(mValueText,params);
  mSeekBar=new SeekBar(mContext);
  mSeekBar.setOnSeekBarChangeListener(this);
  layout.addView(mSeekBar,new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT));
  if (shouldPersist())   mValue=getPersistedInt(mDefault);
  mSeekBar.setMax(mMax);
  mSeekBar.setProgress(mValue);
  return layout;
}
 

Example 44

From project RebeLauncher, under directory /src/com/dirtypepper/rebelauncher/.

Source file: ColorPickerDialog.java

  20 
vote

protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  LinearLayout layout=new LinearLayout(mContext);
  layout.setOrientation(LinearLayout.VERTICAL);
  layout.setGravity(android.view.Gravity.CENTER);
  LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  layoutParams.setMargins(10,0,10,5);
  TextView tv=new TextView(mContext);
  tv.setText(mContext.getString(R.string.pref_dialog_message_color_picker));
  layout.addView(tv,layoutParams);
  mColorPickerView=new ColorPickerView(getContext(),onColorChangedListener,mInitialColor);
  layout.addView(mColorPickerView,layoutParams);
  mTransparencyBar=new SeekBar(mContext);
  mTransparencyBar.setMax(255);
  mTransparencyBar.setProgressDrawable(new TextSeekBarDrawable(mContext.getResources(),mContext.getString(R.string.pref_dialog_color_picker_alpha),true));
  mTransparencyBar.setProgress(Color.alpha(mInitialColor));
  mTransparencyBar.setOnSeekBarChangeListener(onTransparencyChangedListener);
  layout.addView(mTransparencyBar,layoutParams);
  mEditText=new EditText(mContext);
  mEditText.addTextChangedListener(mEditTextListener);
  mEditText.setText(convertToARGB(mInitialColor));
  layout.addView(mEditText,layoutParams);
  setContentView(layout);
  setTitle(mContext.getString(R.string.pref_dialog_title_color_picker));
}
 

Example 45

From project sonet, under directory /core/src/com/piusvelte/sonet/core/.

Source file: ColorPickerDialog.java

  20 
vote

protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  LinearLayout layout=new LinearLayout(mContext);
  layout.setOrientation(LinearLayout.VERTICAL);
  layout.setGravity(android.view.Gravity.CENTER);
  LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  layoutParams.setMargins(10,0,10,5);
  TextView tv=new TextView(mContext);
  tv.setText(R.string.title_color_picker);
  layout.addView(tv,layoutParams);
  mColorPickerView=new ColorPickerView(getContext(),onColorChangedListener,mInitialColor);
  layout.addView(mColorPickerView,layoutParams);
  mTransparencyBar=new SeekBar(mContext);
  mTransparencyBar.setMax(255);
  mTransparencyBar.setProgressDrawable(new TextSeekBarDrawable(mContext.getResources(),"alpha",true));
  mTransparencyBar.setProgress(Color.alpha(mInitialColor));
  mTransparencyBar.setOnSeekBarChangeListener(onTransparencyChangedListener);
  layout.addView(mTransparencyBar,layoutParams);
  mEditText=new EditText(mContext);
  mEditText.addTextChangedListener(mEditTextListener);
  mEditText.setText(convertToARGB(mInitialColor));
  layout.addView(mEditText,layoutParams);
  setContentView(layout);
  setTitle(R.string.title_color_picker);
}
 

Example 46

From project SVQCOM, under directory /Core/src/com/ushahidi/android/app/ui/.

Source file: IncrementalSeekBarPreference.java

  20 
vote

@Override protected View onCreateDialogView(){
  LinearLayout.LayoutParams params;
  LinearLayout layout=new LinearLayout(mContext);
  layout.setOrientation(LinearLayout.VERTICAL);
  layout.setPadding(6,6,6,6);
  mSplashText=new TextView(mContext);
  if (mDialogMessage != null)   mSplashText.setText(mDialogMessage);
  layout.addView(mSplashText);
  mValueText=new TextView(mContext);
  mValueText.setGravity(Gravity.CENTER_HORIZONTAL);
  mValueText.setTextSize(32);
  params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  layout.addView(mValueText,params);
  mSeekBar=new SeekBar(mContext);
  mSeekBar.setOnSeekBarChangeListener(this);
  layout.addView(mSeekBar,new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT));
  if (shouldPersist())   mValue=getPersistedInt(mDefault);
  mSeekBar.setMax(mMax);
  if (mValue < mMin)   mSeekBar.setProgress(mMin);
 else   mSeekBar.setProgress(mValue);
  return layout;
}
 

Example 47

From project Absolute-Android-RSS, under directory /src/com/AA/Activities/.

Source file: AASettings.java

  19 
vote

/** 
 * Called when the activity is created and put into memory. This is where all GUI elements should be set up and any other member variables that is used throughout the class
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.settings_main);
  TextView tv=(TextView)findViewById(R.id.AATitle);
  Typeface face=Typeface.createFromAsset(getAssets(),"fonts/WREXHAM_.TTF");
  tv.setTypeface(face);
  settings=this.getSharedPreferences("settings",0);
  adapter=new ColorAdapter(this);
  this.setListAdapter(adapter);
  ListView lv=getListView();
  lv.setOnItemClickListener(new OnItemClickListener(){
    public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      showDialog(position);
    }
  }
);
  sb_freq=(SeekBar)this.findViewById(R.id.sb_freq);
  tv_freq=(TextView)this.findViewById(R.id.tv_freq);
  sb_freq.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
      tv_freq.setText((progress + 1) + " hour(s)");
    }
  }
);
  sb_freq.setProgress((int)settings.getLong("freq",2) - 1);
}
 

Example 48

From project adg-android, under directory /src/com/analysedesgeeks/android/.

Source file: AbstractPodcastActivity.java

  19 
vote

@Override public void onProgressChanged(final SeekBar bar,final int progress,final boolean fromuser){
  if (!fromuser || (mService == null)) {
    return;
  }
  final long now=SystemClock.elapsedRealtime();
  if ((now - mLastSeekEventTime) > 250) {
    mLastSeekEventTime=now;
    mPosOverride=mDuration * progress / 1000;
    try {
      mService.seek(mPosOverride);
    }
 catch (    final RemoteException ex) {
    }
    if (!mFromTouch) {
      refreshNow();
      mPosOverride=-1;
    }
  }
}
 

Example 49

From project AirCastingAndroidClient, under directory /src/main/java/pl/llp/aircasting/activity/.

Source file: ThresholdsActivity.java

  19 
vote

@Override public void onProgressChanged(SeekBar bar,int i,boolean b){
  int value=unProject(bar.getProgress(),bar.getMax());
  MeasurementLevel measurementLevel=toSoundLevel(bar.getId());
switch (measurementLevel) {
case LOW:
    averageEdit.setText(valueOf(value));
  break;
case MID:
loudEdit.setText(valueOf(value));
break;
case HIGH:
veryLoudEdit.setText(valueOf(value));
break;
}
}
 

Example 50

From project and-bible, under directory /AndBible/src/net/bible/android/view/util/.

Source file: SeekBarPreference.java

  19 
vote

@Override protected void onBindDialogView(View v){
  super.onBindDialogView(v);
  mDialogMessageView=(TextView)v.findViewById(R.id.dialogMessage);
  mDialogMessageView.setText(getDialogMessage());
  mValueText=(TextView)v.findViewById(R.id.actualValue);
  mSeekBar=(SeekBar)v.findViewById(R.id.myBar);
  mSeekBar.setOnSeekBarChangeListener(this);
  mSeekBar.setMax(mMax);
  mSeekBar.setProgress(mValue - mMin);
  String t=String.valueOf(mValue);
  mValueText.setText(mSuffix == null ? t : t.concat(mSuffix));
}
 

Example 51

From project android-context, under directory /src/edu/fsu/cs/contextprovider/.

Source file: ContextAccuracyActivity.java

  19 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final PowerManager pm=(PowerManager)getSystemService(Context.POWER_SERVICE);
  wakelock=pm.newWakeLock(PowerManager.FULL_WAKE_LOCK,"ContextAccuracyActivity");
  wakelock.acquire();
  KeyguardManager km=(KeyguardManager)getSystemService(KEYGUARD_SERVICE);
  KeyguardManager.KeyguardLock keylock=km.newKeyguardLock(TAG);
  keylock.disableKeyguard();
  getPrefs();
  setContentView(R.layout.accuracy);
  vibrate=(Vibrator)getSystemService(Context.VIBRATOR_SERVICE);
  audio=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
  volume=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
  placeBar=(SeekBar)findViewById(R.id.place);
  movementBar=(SeekBar)findViewById(R.id.movement);
  activityBar=(SeekBar)findViewById(R.id.activity);
  shelterGroup=(RadioGroup)findViewById(R.id.shelter);
  shelterCorrect=(RadioButton)findViewById(R.id.shelterCorrect);
  onPersonGroup=(RadioGroup)findViewById(R.id.onPerson);
  onPersonCorrect=(RadioButton)findViewById(R.id.onPersonCorrect);
  placeText=(EditText)findViewById(R.id.editPlace);
  movementText=(EditText)findViewById(R.id.editMovement);
  activityText=(EditText)findViewById(R.id.editActivity);
  shelterText=(EditText)findViewById(R.id.editShelter);
  onPersonText=(EditText)findViewById(R.id.editOnPerson);
  placeText.setText(DerivedMonitor.getPlace());
  movementText.setText(MovementMonitor.getMovementState());
  activityText.setText(DerivedMonitor.getActivity());
  shelterText.setText(DerivedMonitor.getShelterString());
  onPersonText.setText(DerivedMonitor.getOnPersonString());
  submitBtn=(Button)findViewById(R.id.SubmitButton);
  resetBtn=(Button)findViewById(R.id.ResetButton);
  submitBtn.setOnClickListener(this);
  resetBtn.setOnClickListener(this);
  resetBars();
  if (accuracyAudioEnabled)   tone.play();
  if (accuracyVibrateEnabled)   startVibrate();
  timer=new Timer();
  timer.schedule(new ContextDismissTask(),(dismissDelay * 1000));
}
 

Example 52

From project Android-GifStitch, under directory /src/com/phunkosis/gifstitch/dialogs/.

Source file: CreateGifSettingsDialog.java

  19 
vote

public CreateGifSettingsDialog(Context context){
  super(context);
  this.setContentView(R.layout.dialog_build_settings);
  this.mFrameDelayTextView=(TextView)this.findViewById(R.id.text_gif_framedelay);
  this.mFrameDelaySeekBar=(SeekBar)this.findViewById(R.id.sb_framedelay);
  this.mFrameDelaySeekBar.setOnSeekBarChangeListener(this);
  ((Button)this.findViewById(R.id.butt_build_gif)).setOnClickListener(this);
  ((Button)this.findViewById(R.id.butt_cancel_build)).setOnClickListener(this);
  this.setOnCancelListener(new OnCancelListener(){
    @Override public void onCancel(    DialogInterface dialog){
      CreateGifSettingsDialog.this.mCanceled=true;
    }
  }
);
  this.setTitle(context.getResources().getString(R.string.dialog_build_title));
  this.setInitialValues();
}
 

Example 53

From project android-rackspacecloud, under directory /src/com/rackspacecloud/android/.

Source file: AddServerActivity.java

  19 
vote

private void loadServerCount(){
  numberDisplay=(TextView)findViewById(R.id.server_count_text);
  numberBar=(SeekBar)findViewById(R.id.number_of_servers);
  numberBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
      numberDisplay.setText(getCountText(progress));
      if (progress == 0) {
        extension="        ";
      }
 else       if (progress == 9) {
        extension="[1.." + (progress + 1) + "]";
      }
 else {
        extension="[1.." + (progress + 1) + "] ";
      }
      ((TextView)findViewById(R.id.names_number)).setText(extension);
    }
    private String getCountText(    int i){
      if (i == 0) {
        return "1 Server";
      }
 else {
        return i + 1 + " Servers";
      }
    }
  }
);
}
 

Example 54

From project android-xbmcremote, under directory /src/org/xbmc/android/remote/presentation/activity/.

Source file: NowPlayingActivity.java

  19 
vote

public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final Display display=getWindowManager().getDefaultDisplay();
  ThumbSize.setScreenSize(display.getWidth(),display.getHeight());
  setContentView(R.layout.nowplaying);
  mNowPlayingController=new NowPlayingController(this,new Handler());
  mSeekBar=(SeekBar)findViewById(R.id.now_playing_progessbar);
  mTopTitleView=(TextView)findViewById(R.id.now_playing_top_title);
  mBottomTitleView=(TextView)findViewById(R.id.now_playing_bottom_title);
  mBottomSubtitleView=(TextView)findViewById(R.id.now_playing_bottom_subtitle);
  mCounterLeftView=(TextView)findViewById(R.id.now_playing_counter_left);
  mCounterRightView=(TextView)findViewById(R.id.now_playing_counter_right);
  mPlayPauseView=(ImageButton)findViewById(R.id.MediaPlayPauseButton);
  FrameLayout topFrame=(FrameLayout)findViewById(android.R.id.content);
  topFrame.setForeground(null);
  ((TextView)findViewById(R.id.titlebar_text)).setText("Now playing");
  mConfigurationManager=ConfigurationManager.getInstance(this);
  mNowPlayingController.setupButtons(mSeekBar,findViewById(R.id.MediaPreviousButton),findViewById(R.id.MediaStopButton),findViewById(R.id.MediaPlayPauseButton),findViewById(R.id.MediaNextButton),findViewById(R.id.MediaPlaylistButton));
}
 

Example 55

From project androidtracks, under directory /src/org/sfcta/cycletracks/.

Source file: UserInfoActivity.java

  19 
vote

private void savePreferences(){
  SharedPreferences settings=getSharedPreferences("PREFS",0);
  SharedPreferences.Editor editor=settings.edit();
  editor.putString("" + PREF_AGE,((EditText)findViewById(R.id.TextAge)).getText().toString());
  editor.putString("" + PREF_ZIPHOME,((EditText)findViewById(R.id.TextZipHome)).getText().toString());
  editor.putString("" + PREF_ZIPWORK,((EditText)findViewById(R.id.TextZipWork)).getText().toString());
  editor.putString("" + PREF_ZIPSCHOOL,((EditText)findViewById(R.id.TextZipSchool)).getText().toString());
  editor.putString("" + PREF_EMAIL,((EditText)findViewById(R.id.TextEmail)).getText().toString());
  editor.putString("" + PREF_CYCLEFREQ,"" + ((SeekBar)findViewById(R.id.SeekCycleFreq)).getProgress());
  RadioGroup rbg=(RadioGroup)findViewById(R.id.RadioGroup01);
  if (rbg.getCheckedRadioButtonId() == R.id.ButtonMale)   editor.putString("" + PREF_GENDER,"M");
  if (rbg.getCheckedRadioButtonId() == R.id.ButtonFemale)   editor.putString("" + PREF_GENDER,"F");
  editor.commit();
  Toast.makeText(getBaseContext(),"User preferences saved.",Toast.LENGTH_SHORT).show();
}
 

Example 56

From project android_packages_apps_Gallery2, under directory /src/com/android/gallery3d/photoeditor/actions/.

Source file: ColorSeekBar.java

  19 
vote

public void setOnColorChangeListener(final OnColorChangeListener listener){
  setOnSeekBarChangeListener((listener == null) ? null : new OnSeekBarChangeListener(){
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
      listener.onColorChanged(colors[progress],fromUser);
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
    }
  }
);
}
 

Example 57

From project android_wallpaper_flier, under directory /src/fi/harism/wallpaper/flier/prefs/.

Source file: FlierColorPreference.java

  19 
vote

@Override public View onCreateDialogView(){
  View view=LayoutInflater.from(getContext()).inflate(R.layout.preference_color,null);
  mViewColor=view.findViewById(R.id.color_view);
  mSeekBarR=(SeekBar)view.findViewById(R.id.color_red_seekbar);
  mSeekBarR.setMax(255);
  mSeekBarR.setOnSeekBarChangeListener(this);
  mSeekBarG=(SeekBar)view.findViewById(R.id.color_green_seekbar);
  mSeekBarG.setMax(255);
  mSeekBarG.setOnSeekBarChangeListener(this);
  mSeekBarB=(SeekBar)view.findViewById(R.id.color_blue_seekbar);
  mSeekBarB.setMax(255);
  mSeekBarB.setOnSeekBarChangeListener(this);
  return view;
}
 

Example 58

From project android_wallpaper_flowers, under directory /src/fi/harism/wallpaper/flowers/prefs/.

Source file: FlowerRGBAColorPreference.java

  19 
vote

@Override protected View onCreateDialogView(){
  View view=LayoutInflater.from(getContext()).inflate(R.layout.preference_color,null);
  mDlgViewColor=view.findViewById(R.id.color_view);
  mDlgSeekBarR=(SeekBar)view.findViewById(R.id.color_red_seekbar);
  mDlgSeekBarR.setMax(255);
  mDlgSeekBarR.setOnSeekBarChangeListener(this);
  mDlgSeekBarG=(SeekBar)view.findViewById(R.id.color_green_seekbar);
  mDlgSeekBarG.setMax(255);
  mDlgSeekBarG.setOnSeekBarChangeListener(this);
  mDlgSeekBarB=(SeekBar)view.findViewById(R.id.color_blue_seekbar);
  mDlgSeekBarB.setMax(255);
  mDlgSeekBarB.setOnSeekBarChangeListener(this);
  mDlgSeekBarA=(SeekBar)view.findViewById(R.id.color_alpha_seekbar);
  mDlgSeekBarA.setMax(255);
  mDlgSeekBarA.setOnSeekBarChangeListener(this);
  return view;
}
 

Example 59

From project AnySoftKeyboard, under directory /src/com/anysoftkeyboard/ui/.

Source file: MySeekBarPreference.java

  19 
vote

@Override protected View onCreateView(ViewGroup parent){
  LayoutInflater inflator=(LayoutInflater)mContext.getSystemService(Service.LAYOUT_INFLATER_SERVICE);
  ViewGroup mySeekBarLayout=(ViewGroup)inflator.inflate(R.layout.my_seek_bar_pref,null);
  mSeekBar=(SeekBar)mySeekBarLayout.findViewById(R.id.pref_seekbar);
  if (shouldPersist())   mValue=getPersistedInt(mDefault);
  mCurrentValue=(TextView)mySeekBarLayout.findViewById(R.id.pref_current_value);
  mMaxValue=(TextView)mySeekBarLayout.findViewById(R.id.pref_max_value);
  mMinValue=(TextView)mySeekBarLayout.findViewById(R.id.pref_min_value);
  mCurrentValue.setText(Integer.toString(mValue));
  ((TextView)mySeekBarLayout.findViewById(R.id.pref_title)).setText(mTitle);
  writeBoundaries();
  mSeekBar.setMax(mMax - mMin);
  mSeekBar.setProgress(mValue - mMin);
  mSeekBar.setOnSeekBarChangeListener(this);
  return mySeekBarLayout;
}
 

Example 60

From project BibleQuote-for-Android, under directory /src/com/BibleQuote/controls/.

Source file: NumberChoise.java

  19 
vote

@Override protected View onCreateDialogView(){
  mCurrentValue=getPersistedInt(mDefaultValue);
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View view=inflater.inflate(R.layout.dialog_slider,null);
  ((TextView)view.findViewById(R.id.min_value)).setText(Integer.toString(mMinValue));
  ((TextView)view.findViewById(R.id.max_value)).setText(Integer.toString(mMaxValue));
  mSeekBar=(SeekBar)view.findViewById(R.id.seek_bar);
  mSeekBar.setMax(mMaxValue - mMinValue);
  mSeekBar.setProgress(mCurrentValue - mMinValue);
  mSeekBar.setOnSeekBarChangeListener(this);
  mValueText=(TextView)view.findViewById(R.id.current_value);
  mValueText.setText(Integer.toString(mCurrentValue));
  return view;
}
 

Example 61

From project callmeter, under directory /src/de/ub0r/android/callmeter/widget/.

Source file: StatsAppWidgetConfigure.java

  19 
vote

/** 
 * {@inheritDoc}
 */
@Override public void onCreate(final Bundle savedInstanceState){
  Utils.setLocale(this);
  super.onCreate(savedInstanceState);
  this.setTitle(R.string.widget_config_);
  this.setContentView(R.layout.stats_appwidget_config);
  this.spinner=(Spinner)this.findViewById(R.id.spinner);
  this.cbHideName=(CheckBox)this.findViewById(R.id.hide_name);
  this.cbHideName.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    final CompoundButton buttonView,    final boolean isChecked){
      StatsAppWidgetConfigure.this.cbShowShortname.setEnabled(!isChecked);
    }
  }
);
  this.cbShowShortname=(CheckBox)this.findViewById(R.id.shortname);
  this.cbShowShortname.setOnCheckedChangeListener(this);
  this.cbShowCost=(CheckBox)this.findViewById(R.id.cost);
  this.cbShowBillp=(CheckBox)this.findViewById(R.id.pbillp);
  this.cbShowIcon=(CheckBox)this.findViewById(R.id.show_icon);
  this.cbSmallWidget=(CheckBox)this.findViewById(R.id.small_widget);
  this.etPlanTextSize=(EditText)this.findViewById(R.id.widget_plan_textsize);
  this.etStatsTextSize=(EditText)this.findViewById(R.id.widget_stats_textsize);
  this.btnTextColor=(Button)this.findViewById(R.id.textcolor);
  this.btnBgColor=(Button)this.findViewById(R.id.bgcolor);
  this.vTextColor=this.findViewById(R.id.textcolorfield);
  this.vBgColor=this.findViewById(R.id.bgcolorfield);
  this.sbBgTransparency=(SeekBar)this.findViewById(R.id.bgtransparency);
  this.setAdapter();
  this.findViewById(R.id.ok).setOnClickListener(this);
  this.findViewById(R.id.cancel).setOnClickListener(this);
  this.btnTextColor.setOnClickListener(this);
  this.btnBgColor.setOnClickListener(this);
  this.sbBgTransparency.setOnSeekBarChangeListener(this);
  this.setTextColor(DEFAULT_TEXTCOLOR);
  this.setBgColor(DEFAULT_BGCOLOR,false);
}
 

Example 62

From project cw-advandroid, under directory /Drawable/NinePatch/src/com/commonsware/android/ninepatch/.

Source file: NinePatchDemo.java

  19 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  thingToResize=findViewById(R.id.resize);
  horizontal=(SeekBar)findViewById(R.id.horizontal);
  vertical=(SeekBar)findViewById(R.id.vertical);
  horizontal.setMax(144);
  vertical.setMax(144);
  horizontal.setOnSeekBarChangeListener(h);
  vertical.setOnSeekBarChangeListener(v);
}
 

Example 63

From project cw-omnibus, under directory /Drawable/NinePatch/src/com/commonsware/android/ninepatch/.

Source file: NinePatchDemo.java

  19 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  thingToResize=findViewById(R.id.resize);
  horizontal=(SeekBar)findViewById(R.id.horizontal);
  vertical=(SeekBar)findViewById(R.id.vertical);
  horizontal.setMax(144);
  vertical.setMax(144);
  horizontal.setOnSeekBarChangeListener(h);
  vertical.setOnSeekBarChangeListener(v);
}
 

Example 64

From project Diktofon, under directory /app/src/kaljurand_at_gmail_dot_com/diktofon/activity/.

Source file: TransActivity.java

  19 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Log.i(TransActivity.class.getName(),"onCreate");
  setContentView(R.layout.transcription);
  Bundle extras=getIntent().getExtras();
  if (extras != null) {
    mTitle=extras.getString(EXTRA_TITLE);
    mTransPath=extras.getString(EXTRA_TRANS_PATH);
    mAudioPath=extras.getString(EXTRA_AUDIO_PATH);
    mQuery=extras.getString(EXTRA_QUERY);
  }
  if (mAudioPath == null) {
    Log.i(TransActivity.class.getName(),"Finishing because input is not defined: " + EXTRA_AUDIO_PATH);
    finish();
  }
  mTransScrollView=(ScrollView)findViewById(R.id.scrollViewTrs);
  mTransView=(TextView)findViewById(R.id.transcription);
  mRes=getResources();
  mSettings=getSharedPreferences(getString(R.string.file_preferences),0);
  mPlayer=new Player(mRes,(Button)findViewById(R.id.button_trans_playpause),(TextView)findViewById(R.id.tv_trans_timer),(SeekBar)findViewById(R.id.seekbar_trans_seek));
  startService(new Intent(this,PlayerService.class));
  doBindService();
}
 

Example 65

From project droid-comic-viewer, under directory /src/net/robotmedia/acv/ui/settings/.

Source file: BrightnessPreference.java

  19 
vote

@Override protected View onCreateDialogView(){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  RelativeLayout layout=(RelativeLayout)inflater.inflate(R.layout.brightness_preference,null);
  mSeekBar=(SeekBar)layout.findViewById(R.id.brightness_seekbar);
  mSeekBar.setOnSeekBarChangeListener(this);
  mCheckBox=(CheckBox)layout.findViewById(R.id.brightness_checkbox);
  mCheckBox.setOnCheckedChangeListener(this);
  if (shouldPersist()) {
    mValue=getPersistedInt(mDefault);
  }
  if (mValue < 0) {
    mCheckBox.setChecked(true);
    mSeekBar.setEnabled(false);
  }
 else {
    mCheckBox.setChecked(false);
    mSeekBar.setEnabled(true);
    mSeekBar.setProgress(mValue);
  }
  return layout;
}
 

Example 66

From project droidkit, under directory /src/org/droidkit/preference/.

Source file: SeekBarPreference.java

  19 
vote

@Override protected void onBindDialogView(View view){
  super.onBindDialogView(view);
  mSeekbar=(SeekBar)view.findViewById(R.id.pref_seekbar);
  mSeekbar.setMax(mMaxValue);
  mSeekbar.setProgress(getValue());
  mSeekbar.setOnSeekBarChangeListener(this);
  mSeekbarLabel=(TextView)view.findViewById(R.id.seekvalue_label);
  mSeekbarLabel.setText(getTitle() + ": ");
  mSeekbarValue=(TextView)view.findViewById(R.id.pref_seekvalue);
  mSeekbarValue.setText(String.valueOf(getValue()));
}
 

Example 67

From project ElectricSleep, under directory /src/com/androsz/electricsleepbeta/app/wizard/.

Source file: CalibrateLightSleepFragment.java

  19 
vote

private void resetViews(final Activity a){
  mSleepChart=(SleepChart)a.findViewById(R.id.calibration_sleep_chart);
  mSleepChart.clear();
  mSeekBar=(VerticalSeekBar)a.findViewById(R.id.calibration_level_seekbar);
  mWarmingUp=a.findViewById(R.id.warming_up_text);
  mSleepChart.setVisibility(View.INVISIBLE);
  mSeekBar.setVisibility(View.INVISIBLE);
  mSleepChart.setCalibrationLevelAndRedraw(mAlarmTrigger);
  mSeekBar.setMax(SettingsActivity.MAX_ALARM_SENSITIVITY);
  mSeekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
    @Override public void onProgressChanged(    final SeekBar seekBar,    final int progress,    final boolean fromUser){
      if (fromUser) {
        mAlarmTrigger=Math.min(SettingsActivity.MAX_ALARM_SENSITIVITY,progress / DecimalSeekBar.PRECISION);
        mSleepChart.setCalibrationLevelAndRedraw(mAlarmTrigger);
      }
    }
    @Override public void onStartTrackingTouch(    final SeekBar seekBar){
    }
    @Override public void onStopTrackingTouch(    final SeekBar seekBar){
      saveCalibrationLevel(a);
    }
  }
);
  mSeekBar.setProgress(mAlarmTrigger);
}
 

Example 68

From project fauxclock, under directory /src/com/teamkang/fauxclock/factories/.

Source file: CpuFactory.java

  19 
vote

public void onStopTrackingTouch(SeekBar seekBar){
switch (seekBar.getId()) {
case R.id.cpu_max_seek:
    cpu.setMaxFreq(seekBar.getProgress() + "");
  break;
case R.id.cpu_min_seek:
cpu.setMinFreq(seekBar.getProgress() + "");
break;
case R.id.cpu_max_seek_screen_off:
cpu.getEditor().putString("cpu_screenoff_max",seekBar.getProgress() + "").apply();
break;
case R.id.cpu_min_seek_screen_off:
cpu.getEditor().putString("cpu_screenoff_min",seekBar.getProgress() + "").apply();
break;
}
touchingScreen=false;
}
 

Example 69

From project Gmote, under directory /gmoteclient/src/org/gmote/client/android/.

Source file: TouchpadSettings.java

  19 
vote

private void attachMediaView(){
  int layoutId=R.layout.touchpad_settings;
  int viewId=R.id.touchpad_settings_view;
  setContentView(layoutId);
  mContentView=findViewById(viewId);
  ((SeekBar)findViewById(R.id.mouse_acceleration_seek)).setOnSeekBarChangeListener(new SeekBarListener());
  ((SeekBar)findViewById(R.id.mouse_sensitivity_seek)).setOnSeekBarChangeListener(new SeekBarListener());
  findViewById(R.id.touchpad_settings_ok).setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      mUtil.startActivityByClass(Touchpad.class);
    }
  }
);
  findViewById(R.id.touchpad_settings_defaults).setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      setSeekBar(R.id.mouse_acceleration_seek,50);
      setSeekBar(R.id.mouse_sensitivity_seek,50);
    }
  }
);
}
 

Example 70

From project gobandroid, under directory /src/org/ligi/gobandroid_hd/ui/gnugo/.

Source file: GnuGoSetupDialog.java

  19 
vote

public GnuGoSetupDialog(Context context){
  super(context);
  shared_prefs=PreferenceManager.getDefaultSharedPreferences(context);
  setTitle(R.string.gnugo);
  setIconResource(R.drawable.preferences);
  setContentFill();
  setContentView(R.layout.setup_gnugo);
  gnugo_plays_white_radio=(RadioButton)this.findViewById(R.id.gnugo_plays_white_radio);
  gnugo_plays_black_radio=(RadioButton)this.findViewById(R.id.gnugo_plays_black_radio);
  gnugo_plays_both_radio=(RadioButton)this.findViewById(R.id.gnugo_plays_both_radio);
  if (shared_prefs.getBoolean(SP_KEY_PLAYS_BOTH,false))   gnugo_plays_both_radio.setChecked(true);
 else   if (shared_prefs.getBoolean(SP_KEY_PLAYS_WHITE,false))   gnugo_plays_white_radio.setChecked(true);
 else   if (shared_prefs.getBoolean(SP_KEY_PLAYS_BLACK,false))   gnugo_plays_black_radio.setChecked(true);
 else   gnugo_plays_black_radio.setChecked(true);
  strange_seek=((SeekBar)this.findViewById(R.id.gnugo_strength_seek));
  strange_seek.setProgress(shared_prefs.getInt(SP_KEY_STRENGTH,0));
}
 

Example 71

From project lullaby, under directory /src/net/sileht/lullaby/.

Source file: PlayingActivity.java

  19 
vote

@Override public void onProgressChanged(SeekBar seekbar,int progress,boolean fromUser){
  if (fromUser && mPlayer != null && mPlayer.isSeekable()) {
    int duration=mPlayer.getDuration();
    int seek=(int)(progress * duration / 1000L);
    int preloaded=mPlayer.getBuffer() * duration;
    Log.d(TAG,"seek: " + Utils.stringForTime(seek) + " buf "+ mPlayer.getBuffer()+ " preload: "+ Utils.stringForTime(preloaded));
    if (seek <= preloaded) {
      Log.d(TAG,"Seeking to " + Utils.stringForTime(seek));
      mPlayer.doSeekTo(seek);
    }
  }
}
 

Example 72

From project maven-android-plugin-samples, under directory /apidemos-android-10/application/src/main/java/com/example/android/apis/view/.

Source file: SeekBar1.java

  19 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.seekbar_1);
  mSeekBar=(SeekBar)findViewById(R.id.seek);
  mSeekBar.setOnSeekBarChangeListener(this);
  mProgressText=(TextView)findViewById(R.id.progress);
  mTrackingText=(TextView)findViewById(R.id.tracking);
}
 

Example 73

From project mediautilities, under directory /src/ac/robinson/view/.

Source file: CustomMediaController.java

  19 
vote

public void onProgressChanged(SeekBar bar,int progress,boolean fromuser){
  if (!fromuser) {
    return;
  }
  long duration=mPlayer.getDuration();
  long newposition=(duration * progress) / 1000L;
  mPlayer.seekTo((int)newposition);
  if (mCurrentTime != null)   mCurrentTime.setText(stringForTime((int)newposition));
}
 

Example 74

From project MicDroid, under directory /src/com/intervigil/micdroid/.

Source file: RecordingPlayer.java

  19 
vote

/** 
 * Called when the activity is starting. This is where most initialization should go: calling setContentView(int) to inflate the activity's UI, etc.
 * @param savedInstanceState Activity's saved state, if any.
 */
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.recording_player);
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  recording=getIntent().getExtras().getParcelable(Constants.INTENT_EXTRA_RECORDING);
  ((Button)findViewById(R.id.recording_player_btn_play)).setOnClickListener(this);
  ((Button)findViewById(R.id.recording_player_btn_stop)).setOnClickListener(this);
  ((Button)findViewById(R.id.recording_player_btn_close)).setOnClickListener(this);
  mediaSeekBar=(SeekBar)findViewById(R.id.recording_player_seekbar);
  ((TextView)findViewById(R.id.recording_player_file_name)).setText(recording.getName());
  mediaSeekBar.setMax(SEEKBAR_RESOLUTION);
  mediaPlayer=new SeekableMediaPlayer(recording.getAbsolutePath(),mediaSeekBar);
}
 

Example 75

From project NineOldAndroids, under directory /sample/src/com/jakewharton/nineoldandroids/sample/apidemos/.

Source file: AnimationSeeking.java

  19 
vote

/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.animation_seeking);
  LinearLayout container=(LinearLayout)findViewById(R.id.container);
  final MyAnimationView animView=new MyAnimationView(this);
  container.addView(animView);
  Button starter=(Button)findViewById(R.id.startButton);
  starter.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View v){
      animView.startAnimation();
    }
  }
);
  mSeekBar=(SeekBar)findViewById(R.id.seekBar);
  mSeekBar.setMax(DURATION);
  mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    public void onStopTrackingTouch(    SeekBar seekBar){
    }
    public void onStartTrackingTouch(    SeekBar seekBar){
    }
    public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
      if (animView.getHeight() != 0) {
        animView.seek(progress);
      }
    }
  }
);
}
 

Example 76

From project NotePad, under directory /src/com/robobunny/.

Source file: SeekBarPreference.java

  19 
vote

@Override public void onBindView(View view){
  super.onBindView(view);
  mSeekBar=(SeekBar)view.findViewById(R.id.prefSeekBar);
  mSeekBar.setMax(mMaxValue - mMinValue);
  mSeekBar.setOnSeekBarChangeListener(this);
  mStatusText=(TextView)view.findViewById(R.id.seekbarPrefValue);
  updateView(view);
}
 

Example 77

From project npr-android-app, under directory /src/org/npr/android/news/.

Source file: ListenView.java

  19 
vote

private void init(){
  ViewGroup.inflate(getContext(),R.layout.listen,this);
  drawer=(SlidingDrawer)findViewById(R.id.drawer);
  drawer.setOnDrawerOpenListener(this);
  drawer.setOnDrawerCloseListener(this);
  playButton=(ImageButton)findViewById(R.id.StreamPlayButton);
  playButton.setEnabled(false);
  playButton.setOnClickListener(this);
  streamButton=(ImageButton)findViewById(R.id.StreamShareButton);
  streamButton.setOnClickListener(this);
  streamButton.setEnabled(false);
  Button playlistButton=(Button)findViewById(R.id.StreamPlaylistButton);
  playlistButton.setOnClickListener(this);
  progressBar=(SeekBar)findViewById(R.id.StreamProgressBar);
  progressBar.setOnSeekBarChangeListener(this);
  progressBar.setEnabled(false);
  infoText=(TextView)findViewById(R.id.StreamTextView);
  lengthText=(TextView)findViewById(R.id.StreamLengthText);
  lengthText.setText("");
  attachToPlaybackService();
}
 

Example 78

From project OpenBike, under directory /src/fr/openbike/android/ui/widget/.

Source file: SeekBarPreference.java

  19 
vote

@Override protected View onCreateDialogView(){
  View view=super.onCreateDialogView();
  mDistanceTextView=(TextView)view.findViewById(R.id.distance_preference_meters);
  int distance=getValue();
  mDistanceTextView.setText(" " + distance + "m.");
  mBar=(SeekBar)view.findViewById(R.id.distance_seekBar);
  mBar.setMax(2000);
  mBar.setOnSeekBarChangeListener(this);
  mBar.setProgress(distance);
  return view;
}
 

Example 79

From project packages_apps_ROMControl, under directory /src/com/aokp/romcontrol/performance/.

Source file: CPUSettings.java

  19 
vote

@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  if (fromUser) {
switch (seekBar.getId()) {
case R.id.max_slider:
      setMaxSpeed(seekBar,progress);
    break;
case R.id.min_slider:
  setMinSpeed(seekBar,progress);
break;
}
}
}
 

Example 80

From project Pixelesque, under directory /src/de/devmil/common/ui/color/.

Source file: RgbSelectorView.java

  19 
vote

private void init(){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View rgbView=inflater.inflate(R.layout.color_rgbview,null);
  addView(rgbView,new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
  SeekBar.OnSeekBarChangeListener listener=new SeekBar.OnSeekBarChangeListener(){
    @Override public void onStopTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onStartTrackingTouch(    SeekBar seekBar){
    }
    @Override public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
      setPreviewImage();
      onColorChanged();
    }
  }
;
  seekRed=(SeekBar)rgbView.findViewById(R.id.color_rgb_seekRed);
  seekRed.setOnSeekBarChangeListener(listener);
  seekGreen=(SeekBar)rgbView.findViewById(R.id.color_rgb_seekGreen);
  seekGreen.setOnSeekBarChangeListener(listener);
  seekBlue=(SeekBar)rgbView.findViewById(R.id.color_rgb_seekBlue);
  seekBlue.setOnSeekBarChangeListener(listener);
  seekAlpha=(SeekBar)rgbView.findViewById(R.id.color_rgb_seekAlpha);
  seekAlpha.setOnSeekBarChangeListener(listener);
  imgPreview=(ImageView)rgbView.findViewById(R.id.color_rgb_imgpreview);
  setColor(Color.BLACK);
}
 

Example 81

From project platform_packages_apps_contacts, under directory /src/com/android/contacts/voicemail/.

Source file: VoicemailPlaybackFragment.java

  19 
vote

public PlaybackViewImpl(ActivityReference activityReference,Context applicationContext,View playbackLayout){
  Preconditions.checkNotNull(activityReference);
  Preconditions.checkNotNull(applicationContext);
  Preconditions.checkNotNull(playbackLayout);
  mActivityReference=activityReference;
  mApplicationContext=applicationContext;
  mPlaybackSeek=(SeekBar)playbackLayout.findViewById(R.id.playback_seek);
  mStartStopButton=(ImageButton)playbackLayout.findViewById(R.id.playback_start_stop);
  mPlaybackSpeakerphone=(ImageButton)playbackLayout.findViewById(R.id.playback_speakerphone);
  mRateDecreaseButton=(ImageButton)playbackLayout.findViewById(R.id.rate_decrease_button);
  mRateIncreaseButton=(ImageButton)playbackLayout.findViewById(R.id.rate_increase_button);
  mTextController=new TextViewWithMessagesController((TextView)playbackLayout.findViewById(R.id.playback_position_text),(TextView)playbackLayout.findViewById(R.id.playback_speed_text));
}
 

Example 82

From project platform_packages_apps_Gallery2_1, under directory /src/com/android/gallery3d/app/.

Source file: MediaController.java

  19 
vote

public void onProgressChanged(SeekBar bar,int progress,boolean fromuser){
  if (!fromuser) {
    return;
  }
  long duration=mPlayer.getDuration();
  long newposition=(duration * progress) / 1000L;
  mPlayer.seekTo((int)newposition);
  if (mCurrentTime != null)   mCurrentTime.setText(stringForTime((int)newposition));
}
 

Example 83

From project platform_packages_apps_music, under directory /src/com/android/music/.

Source file: AudioPreview.java

  19 
vote

public void onProgressChanged(SeekBar bar,int progress,boolean fromuser){
  if (!fromuser) {
    return;
  }
  if (mPlayer == null) {
    return;
  }
  mPlayer.seekTo(progress);
}
 

Example 84

From project RHQpocket, under directory /src/org/rhq/pocket/metric/.

Source file: MetricDisplayRangeDialogFragment.java

  19 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.metric_display_range_dialog_fragment,container);
  seekBar=(SeekBar)v.findViewById(R.id.seekBar);
  valueView=(TextView)v.findViewById(R.id.valueView);
  seekBar.setOnSeekBarChangeListener(this);
  seekBar.setMax(60);
  pickButton=(Button)v.findViewById(R.id.pick_resource);
  cancelButton=(Button)v.findViewById(R.id.back);
  pickButton.setOnClickListener(this);
  cancelButton.setOnClickListener(this);
  radioGroup=(RadioGroup)v.findViewById(R.id.unit_selector);
  radioGroup.setOnCheckedChangeListener(this);
  return v;
}
 

Example 85

From project SamyGo-Android-Remote, under directory /src/de/quist/app/samyGoRemote/.

Source file: SeekBarPreference.java

  19 
vote

@Override protected View onCreateDialogView(){
  LayoutInflater layoutInflator=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View layout=layoutInflator.inflate(R.layout.seek_bar_preference_layout,null);
  TextView messageTextView=(TextView)layout.findViewById(android.R.id.text1);
  if (mDialogText != null) {
    messageTextView.setText(mDialogText);
  }
 else {
    messageTextView.setVisibility(View.GONE);
  }
  mValueTextView=(TextView)layout.findViewById(android.R.id.text2);
  mSeekBar=(SeekBar)layout.findViewById(android.R.id.progress);
  mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
    public void onProgressChanged(    SeekBar seekBar,    int progress,    boolean fromUser){
      String valueString=Integer.toString(progress);
      if (mValueText == null) {
        mValueTextView.setText(valueString);
      }
 else {
        mValueTextView.setText(TextUtils.expandTemplate(mValueText,valueString));
      }
      mValue=progress;
      if (shouldPersist())       persistInt(progress);
      callChangeListener(progress);
    }
    public void onStartTrackingTouch(    SeekBar seekBar){
    }
    public void onStopTrackingTouch(    SeekBar seekBar){
    }
  }
);
  mSeekBar.setMax(mMax);
  mSeekBar.setProgress(mValue);
  if (shouldPersist()) {
    mValue=getPersistedInt(mDefault);
  }
  return layout;
}
 

Example 86

From project TeclaAccess, under directory /source/src/ca/idi/tekla/util/.

Source file: FullResetTimeoutDialog.java

  19 
vote

@Override protected void onStart(){
  setTitle(R.string.fullreset_timeout);
  int timeout=TeclaApp.persistence.getFullResetTimeout();
  mTimeoutStrings=TeclaApp.getInstance().getResources().getStringArray(R.array.fullreset_strings);
  mTimeoutValues=TeclaApp.getInstance().getResources().getIntArray(R.array.full_reset_values);
  mSeekBarPos=-1;
  int value=Persistence.FULLRESET_NULL;
  while (value != timeout && mSeekBarPos < (mTimeoutValues.length - 1)) {
    mSeekBarPos++;
    value=mTimeoutValues[mSeekBarPos];
  }
  mMinLabel=(TextView)findViewById(R.id.dlg_min_label);
  mMaxLabel=(TextView)findViewById(R.id.dlg_max_label);
  mTimeoutLabel=(TextView)findViewById(R.id.dlg_timeout_label);
  mMinLabel.setText(mTimeoutStrings[0]);
  mMaxLabel.setText(mTimeoutStrings[mTimeoutStrings.length - 1]);
  mTimeoutLabel.setText(mTimeoutStrings[mSeekBarPos]);
  mButton=(Button)findViewById(R.id.dlg_btn_done);
  mButton.setOnClickListener(this);
  mSeekBar=(SeekBar)findViewById(R.id.dlg_seekbar);
  mSeekBar.setMax(mTimeoutValues.length - 1);
  mSeekBar.setProgress(mSeekBarPos);
  mSeekBar.setOnSeekBarChangeListener(this);
  mSeekBar.requestFocus();
  super.onStart();
}
 

Example 87

From project TextSecure, under directory /src/org/thoughtcrime/securesms/preferences/.

Source file: LedBlinkPatternListPreference.java

  19 
vote

private void showDialog(){
  LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View view=inflater.inflate(R.layout.led_pattern_dialog,null);
  this.seekBarOn=(SeekBar)view.findViewById(R.id.SeekBarOn);
  this.seekBarOff=(SeekBar)view.findViewById(R.id.SeekBarOff);
  this.seekBarOnLabel=(TextView)view.findViewById(R.id.SeekBarOnMsLabel);
  this.seekBarOffLabel=(TextView)view.findViewById(R.id.SeekBarOffMsLabel);
  this.seekBarOn.setOnSeekBarChangeListener(this);
  this.seekBarOff.setOnSeekBarChangeListener(this);
  initializeSeekBarValues();
  initializeDialog(view);
  dialogInProgress=true;
  dialogInProgress=true;
}
 

Example 88

From project TweakGS2, under directory /src/net/sakuramilk/TweakGS2/Parts/.

Source file: SeekBarPreference.java

  19 
vote

public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  mValue=progress + mMin;
  String value=String.valueOf(mValue);
  mTextView.setText(value + mUnit);
  callChangeListener(value);
}
 

Example 89

From project UDJ-Android-Client, under directory /src/org/klnusbaum/udj/.

Source file: PlayerActivity.java

  19 
vote

@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  AlertDialog toReturn=new AlertDialog.Builder(getActivity()).setTitle(R.string.volume_set).setPositiveButton(android.R.string.ok,this).create();
  LayoutInflater inflater=getActivity().getLayoutInflater();
  View volumeEditor=inflater.inflate(R.layout.set_volume,null,false);
  toReturn.setView(volumeEditor);
  AccountManager am=AccountManager.get(getActivity());
  volumeBar=(SeekBar)volumeEditor.findViewById(R.id.volume_selector);
  volumeDisplay=(TextView)volumeEditor.findViewById(R.id.volume_display);
  volumeBar.setMax(10);
  volumeBar.setProgress(Utils.getPlayerVolume(am,getAccount()));
  volumeBar.setPadding(volumeBar.getThumbOffset() + 2,2,volumeBar.getThumbOffset() + 2,2);
  volumeDisplay.setText(String.valueOf(Utils.getPlayerVolume(am,getAccount())));
  volumeBar.setOnSeekBarChangeListener(this);
  return toReturn;
}