Java Code Examples for android.widget.SeekBar#setMax()
The following examples show how to use
android.widget.SeekBar#setMax() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlaybackFragment.java From android-vlc-remote with GNU General Public License v3.0 | 6 votes |
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.audio_player_common, container, false); mButtonPlaylistPause = setupImageButton(v, R.id.button_pause); mButtonPlaylistStop = setupImageButton(v, R.id.button_stop); mButtonPlaylistSkipForward = setupImageButton(v, R.id.button_skip_forward); mButtonPlaylistSkipBackward = setupImageButton(v, R.id.button_skip_backward); mButtonPlaylistSeekForward = setupImageButton(v, R.id.button_seek_forward); mButtonPlaylistSeekBackward = setupImageButton(v, R.id.button_seek_backward); mButtonPlaylistChapterNext = setupImageButton(v, R.id.button_chapter_next); mButtonPlaylistChapterPrevious = setupImageButton(v, R.id.button_chapter_previous); mSeekPosition = (SeekBar) v.findViewById(R.id.seek_progress); mSeekPosition.setMax(100); mSeekPosition.setOnSeekBarChangeListener(this); mTextTime = (TextView) v.findViewById(R.id.text_time); mTextLength = (TextView) v.findViewById(R.id.text_length); return v; }
Example 2
Source File: CircleActivity.java From TraceByAmap with MIT License | 6 votes |
/** * 初始化AMap对象 */ private void init() { mColorBar = (SeekBar) findViewById(R.id.hueSeekBar); mColorBar.setMax(HUE_MAX); mColorBar.setProgress(50); mAlphaBar = (SeekBar) findViewById(R.id.alphaSeekBar); mAlphaBar.setMax(ALPHA_MAX); mAlphaBar.setProgress(50); mWidthBar = (SeekBar) findViewById(R.id.widthSeekBar); mWidthBar.setMax(WIDTH_MAX); mWidthBar.setProgress(25); if (aMap == null) { aMap = mapView.getMap(); setUpMap(); } }
Example 3
Source File: PolylineActivitybase.java From TraceByAmap with MIT License | 6 votes |
/** * 初始化AMap对象 */ private void init() { mColorBar = (SeekBar) findViewById(R.id.hueSeekBar); mColorBar.setMax(HUE_MAX); mColorBar.setProgress(50); mAlphaBar = (SeekBar) findViewById(R.id.alphaSeekBar); mAlphaBar.setMax(ALPHA_MAX); mAlphaBar.setProgress(255); mWidthBar = (SeekBar) findViewById(R.id.widthSeekBar); mWidthBar.setMax(WIDTH_MAX); mWidthBar.setProgress(10); if (aMap == null) { aMap = mapView.getMap(); setUpMap(); } }
Example 4
Source File: SeekBarPreference.java From Audinaut with GNU General Public License v3.0 | 6 votes |
@Override protected View onCreateDialogView() { View view = super.onCreateDialogView(); mValueText = view.findViewById(R.id.value); mValueText.setText(getSummary(mValue)); SeekBar seekBar = view.findViewById(R.id.seek_bar); seekBar.setMax(mMax - mMin); try { seekBar.setProgress(Integer.parseInt(mValue)); } catch (Exception e) { seekBar.setProgress(0); } seekBar.setOnSeekBarChangeListener(this); return view; }
Example 5
Source File: ColorPreference.java From Noyze with Apache License 2.0 | 6 votes |
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { LayoutInflater layoutInflater = LayoutInflater.from(getActivity()); mRootView = (ViewGroup) layoutInflater.inflate(R.layout.dialog_colors, null); mAlphaSeekBar = (SeekBar) mRootView.findViewById(android.R.id.progress); mAlphaSeekBar.setOnSeekBarChangeListener(alphaSeekListener); mAlphaSeekBar.setMax(255); mAlphaSeekBar.setProgress(getValueAlpha(false)); mColorGrid = (GridLayout) mRootView.findViewById(R.id.color_grid); mColorGrid.setColumnCount(mPreference.mNumColumns); repopulateItems(); return new AlertDialog.Builder(getActivity()) .setView(mRootView) .setNegativeButton(android.R.string.cancel, clickListener) .setPositiveButton(android.R.string.ok, clickListener) .create(); }
Example 6
Source File: SeekBarPreference.java From Popeens-DSub with GNU General Public License v3.0 | 6 votes |
@Override protected View onCreateDialogView() { View view = super.onCreateDialogView(); mValueText = (TextView)view.findViewById(R.id.value); mValueText.setText(getSummary(mValue)); SeekBar seekBar = (SeekBar)view.findViewById(R.id.seek_bar); seekBar.setMax(mMax - mMin); try { seekBar.setProgress(Integer.parseInt(mValue)); } catch(Exception e) { seekBar.setProgress(0); } seekBar.setOnSeekBarChangeListener(this); return view; }
Example 7
Source File: ColorPreference.java From Noyze with Apache License 2.0 | 6 votes |
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { LayoutInflater layoutInflater = LayoutInflater.from(getActivity()); mRootView = (ViewGroup) layoutInflater.inflate(R.layout.dialog_colors, null); mAlphaSeekBar = (SeekBar) mRootView.findViewById(android.R.id.progress); mAlphaSeekBar.setOnSeekBarChangeListener(alphaSeekListener); mAlphaSeekBar.setMax(255); mAlphaSeekBar.setProgress(getValueAlpha(false)); mColorGrid = (GridLayout) mRootView.findViewById(R.id.color_grid); mColorGrid.setColumnCount(mPreference.mNumColumns); repopulateItems(); return new AlertDialog.Builder(getActivity()) .setView(mRootView) .setNegativeButton(android.R.string.cancel, clickListener) .setPositiveButton(android.R.string.ok, clickListener) .create(); }
Example 8
Source File: MediaController.java From BambooPlayer with Apache License 2.0 | 6 votes |
private void initControllerView(View v) { mPauseButton = (ImageButton) v.findViewById(getResources().getIdentifier("mediacontroller_play_pause", "id", mContext.getPackageName())); if (mPauseButton != null) { mPauseButton.requestFocus(); mPauseButton.setOnClickListener(mPauseListener); } mProgress = (SeekBar) v.findViewById(getResources().getIdentifier("mediacontroller_seekbar", "id", mContext.getPackageName())); if (mProgress != null) { if (mProgress instanceof SeekBar) { SeekBar seeker = (SeekBar) mProgress; seeker.setOnSeekBarChangeListener(mSeekListener); } mProgress.setMax(1000); } mEndTime = (TextView) v.findViewById(getResources().getIdentifier("mediacontroller_time_total", "id", mContext.getPackageName())); mCurrentTime = (TextView) v.findViewById(getResources().getIdentifier("mediacontroller_time_current", "id", mContext.getPackageName())); mFileName = (TextView) v.findViewById(getResources().getIdentifier("mediacontroller_file_name", "id", mContext.getPackageName())); if (mFileName != null) mFileName.setText(mTitle); }
Example 9
Source File: ControlLayout.java From DMusic with Apache License 2.0 | 6 votes |
private void initView(View root) { // Top top = (FrameLayout) root.findViewById(R.id.layout_player_top); ivBack = (ImageView) root.findViewById(R.id.iv_player_back); tvTitle = (TextView) root.findViewById(R.id.tv_player_title); // Bottom bottom = (RelativeLayout) root.findViewById(R.id.layout_player_bottom); playPause = (ImageView) root.findViewById(R.id.iv_player_play_pause); current = (TextView) root.findViewById(R.id.tv_player_current); seekBar = (SeekBar) root.findViewById(R.id.seek_player_progress); seekBar.setMax(Util.SEEKBAR_MAX); total = (TextView) root.findViewById(R.id.tv_player_total); fullscreen = (ImageView) root.findViewById(R.id.iv_player_fullscreen); // Center-loading loading = (ProgressBar) root.findViewById(R.id.prb_player_loading); // Center-tips tips = (LinearLayout) root.findViewById(R.id.layout_player_tips); tipsText = (TextView) root.findViewById(R.id.tv_player_tips_text); tipsBtn = (TextView) root.findViewById(R.id.tv_player_tips_btn); }
Example 10
Source File: SeekBarPreference.java From DesignOverlay-Android with Apache License 2.0 | 5 votes |
@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 11
Source File: SeekBarDialogPreference.java From simple-keyboard with Apache License 2.0 | 5 votes |
@Override protected View onCreateDialogView() { final View view = super.onCreateDialogView(); mSeekBar = (SeekBar)view.findViewById(R.id.seek_bar_dialog_bar); mSeekBar.setMax(mMaxValue - mMinValue); mSeekBar.setOnSeekBarChangeListener(this); mValueView = (TextView)view.findViewById(R.id.seek_bar_dialog_value); return view; }
Example 12
Source File: MarkerDemoActivity.java From android-samples with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.marker_demo); mTopText = (TextView) findViewById(R.id.top_text); mRotationBar = (SeekBar) findViewById(R.id.rotationSeekBar); mRotationBar.setMax(360); mRotationBar.setOnSeekBarChangeListener(this); mFlatBox = (CheckBox) findViewById(R.id.flat); mOptions = (RadioGroup) findViewById(R.id.custom_info_window_options); mOptions.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { if (mLastSelectedMarker != null && mLastSelectedMarker.isInfoWindowShown()) { // Refresh the info window when the info window's content has changed. mLastSelectedMarker.showInfoWindow(); } } }); SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); new OnMapAndViewReadyListener(mapFragment, this); }
Example 13
Source File: MySeekBarPreference.java From Float-Bar with Eclipse Public License 1.0 | 5 votes |
@Override protected void onBindView(View view) { super.onBindView(view); SeekBar seekBar = (SeekBar) view.findViewById(R.id.seekbar); seekBar.setMax(mMax); seekBar.setProgress(mProgress); seekBar.setEnabled(isEnabled()); seekBar.setOnSeekBarChangeListener(this); value = (TextView) view.findViewById(R.id.value); value.setText(String.valueOf(mProgress)); }
Example 14
Source File: SeekBarPreference.java From MaterialPreference with Apache License 2.0 | 5 votes |
@Override public void onBindViewHolder(PreferenceViewHolder view) { super.onBindViewHolder(view); view.itemView.setOnKeyListener(mSeekBarKeyListener); mSeekBar = (SeekBar) view.findViewById(R.id.seekbar); mSeekBarValueTextView = (TextView) view.findViewById(R.id.seekbar_value); if (mShowSeekBarValue) { mSeekBarValueTextView.setVisibility(View.VISIBLE); } else { mSeekBarValueTextView.setVisibility(View.GONE); mSeekBarValueTextView = null; } if (mSeekBar == null) { Log.e(TAG, "SeekBar view is null in onBindViewHolder."); return; } mSeekBar.setOnSeekBarChangeListener(mSeekBarChangeListener); mSeekBar.setMax(mMax - mMin); // If the increment is not zero, use that. Otherwise, use the default mKeyProgressIncrement // in AbsSeekBar when it's zero. This default increment value is set by AbsSeekBar // after calling setMax. That's why it's important to call setKeyProgressIncrement after // calling setMax() since setMax() can change the increment value. if (mSeekBarIncrement != 0) { mSeekBar.setKeyProgressIncrement(mSeekBarIncrement); } else { mSeekBarIncrement = mSeekBar.getKeyProgressIncrement(); } mSeekBar.setProgress(mSeekBarValue - mMin); if (mSeekBarValueTextView != null) { mSeekBarValueTextView.setText(String.valueOf(mSeekBarValue)); } mSeekBar.setEnabled(isEnabled()); }
Example 15
Source File: SeekBarDialogPreference.java From Plumble with GNU General Public License v3.0 | 5 votes |
@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(18); params = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); layout.addView(mValueText, params); mSeekBar = new SeekBar(mContext); mSeekBar.setOnSeekBarChangeListener(this); layout.addView(mSeekBar, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); if (shouldPersist()) mValue = getPersistedInt(-1) != -1 ? getPersistedInt(mDefault) / mMultiplier : getPersistedInt(mDefault); mSeekBar.setMax(mMax - mMin); mSeekBar.setProgress(mValue - mMin); return layout; }
Example 16
Source File: Spinner_Fragment.java From ui with Apache License 2.0 | 5 votes |
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View myView = inflater.inflate(R.layout.spinner_fragment, container, false); //first we will work on the spinner1 (which controls the seekbar) SpinnerSB = (Spinner)myView.findViewById(R.id.spinner1); //create the ArrayAdapter of strings from my List. ArrayAdapter<String> adapter = new ArrayAdapter<String>(myContext,android.R.layout.simple_spinner_item, myList); //set the dropdown layout adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //finally set the adapter to the spinner SpinnerSB.setAdapter(adapter); //set the selected listener as well SpinnerSB.setOnItemSelectedListener(this); //get the seekbar, no listener, the spinner will change it. mySeekBar = (SeekBar) myView.findViewById(R.id.seekBar1); mySeekBar.setMax(5); //matches the items in myList. //finally the second spinner, but using the array from values strings. mySpinner = (Spinner)myView.findViewById(R.id.spinner2); //from the resource in values /res/values/strings called spinneritems ArrayAdapter<CharSequence> adapter2 = ArrayAdapter.createFromResource(myContext, R.array.spinneritems, android.R.layout.simple_spinner_item); //now like before adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mySpinner.setAdapter(adapter2); mySpinner.setOnItemSelectedListener(this); return myView; }
Example 17
Source File: SeekBarPreference.java From DistroHopper with GNU General Public License v3.0 | 5 votes |
/** * Create progress bar and other view contents. */ protected View onCreateView (ViewGroup p) { final Context ctx = getContext(); LinearLayout layout = new LinearLayout( ctx ); layout.setId( android.R.id.widget_frame ); layout.setOrientation (LinearLayout.VERTICAL); layout.setPadding (15, 15, 15, 15); TextView title = new TextView( ctx ); title.setId (android.R.id.title); title.setSingleLine (); title.setTextAppearance (ctx, android.R.style.TextAppearance_Medium); layout.addView( title ); seekbar = new SeekBar( ctx ); seekbar.setId( android.R.id.progress ); seekbar.setMax (max); seekbar.setProgress (this.defaultValue); seekbar.setOnSeekBarChangeListener( this ); layout.addView( seekbar ); summary = new TextView( ctx ); summary.setId (android.R.id.summary); summary.setTextAppearance (ctx, android.R.style.TextAppearance_Small); layout.addView( summary ); return layout; }
Example 18
Source File: AdvSettingsActivity.java From Android-Car-duino with GNU General Public License v2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.advanced_settings); shared = PreferenceManager.getDefaultSharedPreferences(this); detector = new GestureDetector(this); //SEEK BARS kp = (SeekBar)findViewById(R.id.kp); kp.setMax(50); ((TextView)findViewById(R.id.progress1)).setText("kp value set to " + shared.getFloat("kp", progressValue)); kp.setProgress((int) (shared.getFloat("kp", progressValue) *10)); kp.setOnSeekBarChangeListener(this); ki = (SeekBar)findViewById(R.id.ki); ki.setMax(50); ((TextView)findViewById(R.id.progress2)).setText("ki value set to " + shared.getFloat("ki", progressValue)); ki.setProgress((int) (shared.getFloat("ki", progressValue) *10)); ki.setOnSeekBarChangeListener(this); kd = (SeekBar)findViewById(R.id.kd); kd.setMax(50); ((TextView)findViewById(R.id.progress3)).setText("kd value set to " + shared.getFloat("kd", progressValue)); kd.setProgress((int) (shared.getFloat("kd", progressValue) *10)); kd.setOnSeekBarChangeListener(this); smoothening = (SeekBar)findViewById(R.id.smoothening); smoothening.setMax(8); // values 0-8 ((TextView)findViewById(R.id.progress4)).setText("Smoothening value set to " + shared.getFloat("smoothening", progressValue)); smoothening.setProgress((int) (shared.getFloat("smoothening", progressValue))); smoothening.setOnSeekBarChangeListener(this); fragment = (SeekBar)findViewById(R.id.fragment); fragment.setMax(60); // values 15-60 ((TextView)findViewById(R.id.progress5)).setText("Fragment distance value set to " + shared.getFloat("fragment", progressValue)); fragment.setProgress((int) (shared.getFloat("fragment", progressValue))); fragment.setOnSeekBarChangeListener(this); leftIteration = (SeekBar)findViewById(R.id.leftIteration); leftIteration.setMax(15); // values 1-15 ((TextView)findViewById(R.id.progress6)).setText("Left Iteration value set to " + shared.getFloat("leftIteration", progressValue)); leftIteration.setProgress((int) (shared.getFloat("leftIteration", progressValue))); leftIteration.setOnSeekBarChangeListener(this); rightIteration = (SeekBar)findViewById(R.id.rightIteration); rightIteration.setMax(15); // values 1-15 ((TextView)findViewById(R.id.progress7)).setText("Right Iteration value set to " + shared.getFloat("rightIteration", progressValue)); rightIteration.setProgress((int) (shared.getFloat("rightIteration", progressValue))); rightIteration.setOnSeekBarChangeListener(this); angle = (SeekBar)findViewById(R.id.angle); angle.setMax(14); // values 0.4-1.4 ((TextView)findViewById(R.id.progress8)).setText("Max angle value set to " + shared.getFloat("angle", progressValue)); angle.setProgress((int) (shared.getFloat("angle", progressValue) *10)); angle.setOnSeekBarChangeListener(this); }
Example 19
Source File: MediaController.java From 365browser with Apache License 2.0 | 4 votes |
private void initControllerView() { mPauseButton = (ImageButton) findViewById(R.id.pause); if (mPauseButton != null) { mPauseButton.requestFocus(); mPauseButton.setOnClickListener(mPauseListener); } mFfwdButton = (ImageButton) findViewById(R.id.ffwd); if (mFfwdButton != null) { mFfwdButton.setOnClickListener(mFfwdListener); mFfwdButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE); } mRewButton = (ImageButton) findViewById(R.id.rew); if (mRewButton != null) { mRewButton.setOnClickListener(mRewListener); mRewButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE); } // By default these are hidden. They will be enabled when setPrevNextListeners() is called mNextButton = (ImageButton) findViewById(R.id.next); if (mNextButton != null && !mListenersSet) { mNextButton.setVisibility(View.GONE); } mPrevButton = (ImageButton) findViewById(R.id.prev); if (mPrevButton != null && !mListenersSet) { mPrevButton.setVisibility(View.GONE); } mProgressGroup = (ViewGroup) findViewById(R.id.mediacontroller_progress_container); if (mProgressGroup != null) { mProgressBar = (SeekBar) mProgressGroup.findViewById(R.id.mediacontroller_progress_bar); if (mProgressBar != null) { mProgressBar.setOnSeekBarChangeListener(mSeekListener); mProgressBar.setMax(1000); } } mEndTime = (TextView) findViewById(R.id.time); mCurrentTime = (TextView) findViewById(R.id.time_current); mFormatBuilder = new StringBuilder(); mFormatter = new Formatter(mFormatBuilder, Locale.getDefault()); installPrevNextListeners(); }
Example 20
Source File: FormExample.java From ui with Apache License 2.0 | 4 votes |
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); et = (EditText) findViewById(R.id.ETname); et.addTextChangedListener(this); label = (TextView) findViewById(R.id.Label01); // label.setText("WTF"); But this one works fine! sounds = (RadioGroup)findViewById(R.id.SndGroup); sounds.setOnCheckedChangeListener(this); pb = (SeekBar) findViewById(R.id.ProgressBar01); pb.setMax(10); pb.setOnClickListener(this); btnalert = (Button) findViewById(R.id.Button01); btnalert.setOnClickListener(this); //dialog information dialog = new Dialog(this); dialog.setContentView(R.layout.dialog); dialog.setTitle("Dialog"); btnok = (Button) dialog.findViewById(R.id.diaglogBTN); btnok.setOnClickListener(new OKListener(dialog)); pbok = (ProgressBar) dialog.findViewById(R.id.dialogPB); pbok.setMax(100); tvok = (TextView) dialog.findViewById(R.id.dialogTV); //back to main layout stuff Spinner s = (Spinner)findViewById(R.id.Spinner01); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, items); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); s.setAdapter(adapter); s.setOnItemSelectedListener(this); TVspinner = (TextView)findViewById(R.id.TVspinner); TVdate = (TextView)findViewById(R.id.TVdate); btnDate = (Button)findViewById(R.id.Button02); btnDate.setOnClickListener(this); //Date picker stuff, instead of implementing a listener, this time just declare one! d = new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { dateAndTime.set(Calendar.YEAR, year); dateAndTime.set(Calendar.MONTH, monthOfYear); dateAndTime.set(Calendar.DAY_OF_MONTH, dayOfMonth); TVdate.setText(fmtDateAndTime.format(dateAndTime.getTime())); } }; }