本文整理汇总了Java中android.support.v7.widget.AppCompatSeekBar.setOnSeekBarChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java AppCompatSeekBar.setOnSeekBarChangeListener方法的具体用法?Java AppCompatSeekBar.setOnSeekBarChangeListener怎么用?Java AppCompatSeekBar.setOnSeekBarChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.AppCompatSeekBar
的用法示例。
在下文中一共展示了AppCompatSeekBar.setOnSeekBarChangeListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onViewCreated
import android.support.v7.widget.AppCompatSeekBar; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
editGeohash = (AppCompatEditText) view.findViewById(R.id.edit_hash);
editLat = (AppCompatEditText) view.findViewById(R.id.edit_lat);
editLon = (AppCompatEditText) view.findViewById(R.id.edit_lon);
textPrecision = (AppCompatTextView) view.findViewById(R.id.text_precision);
seekPrecision = (AppCompatSeekBar) view.findViewById(R.id.seek_precision);
editGeohash.addTextChangedListener(hashTextWatcher);
editLat.addTextChangedListener(locationTextWatcher);
editLon.addTextChangedListener(locationTextWatcher);
seekPrecision.setOnSeekBarChangeListener(this);
location = new Location("geohash_example");
textPrecision.setText("Precision: " + 1);
}
示例2: onCreateView
import android.support.v7.widget.AppCompatSeekBar; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_discover, container, false);
moviesRadioButton = (RadioButton) view.findViewById(R.id.radio_movies);
moviesRadioButton.setOnCheckedChangeListener(this);
tvRadioButton = (RadioButton) view.findViewById(R.id.radio_tv);
TextView discoverButton = (TextView) view.findViewById(R.id.discover_discover);
discoverButton.setOnClickListener(this);
LinearLayout genres = (LinearLayout) view.findViewById(R.id.genres_root);
genres.setOnClickListener(this);
genresView = (TextView) view.findViewById(R.id.discover_genres);
Spinner sortSpinner = (Spinner) view.findViewById(R.id.discover_sort);
ratingView = (TextView) view.findViewById(R.id.discover_rating);
AppCompatSeekBar ratingSeekBar = (AppCompatSeekBar) view.findViewById(R.id.discover_rating_bar);
mGenresList = new HashSet<>();
mGenresValuesList = new HashSet<>();
checkedGenres = new boolean[] {
false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false
};
ratingSeekBar.setOnSeekBarChangeListener(this);
final List<String> sort = Arrays.asList(getResources().getStringArray(R.array.sort));
ArrayAdapter<String> adapter
= new ArrayAdapter<>(getActivity(), R.layout.spinner_item, sort);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sortSpinner.setAdapter(adapter);
sortSpinner.setOnItemSelectedListener(this);
return view;
}
示例3: onViewCreated
import android.support.v7.widget.AppCompatSeekBar; //导入方法依赖的package包/类
@Override
protected void onViewCreated() {
value = (TextView) findViewById(R.id.mp_value);
if (showValue) {
value.setVisibility(VISIBLE);
}
seekBar = (AppCompatSeekBar) findViewById(R.id.mp_seekbar);
seekBar.setOnSeekBarChangeListener(new ProgressSaver());
seekBar.setMax(maxValue - minValue);
setSeekBarValue(getValue());
}
示例4: onCreate
import android.support.v7.widget.AppCompatSeekBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
viewPager.setAdapter(new DinosaurPagerAdapter(getSupportFragmentManager(), this));
((TabLayout) findViewById(R.id.tabs)).setupWithViewPager(viewPager);
sbRadius = (AppCompatSeekBar) findViewById(R.id.radius);
sbSize = (AppCompatSeekBar) findViewById(R.id.size);
sbRadius.setTag(R.id.label, findViewById(R.id.radius_label));
sbSize.setTag(R.id.label, findViewById(R.id.size_label));
sbRadius.setTag(R.id.label_title, R.string.radius);
sbSize.setTag(R.id.label_title, R.string.size);
sbRadius.setOnSeekBarChangeListener(this);
sbSize.setOnSeekBarChangeListener(this);
sbSize.setMax(GaussianBlur.MAX_RADIUS);
sbSize.setMax(GaussianBlur.MAX_SIZE);
sbRadius.setProgress(GaussianBlur.MAX_RADIUS);
sbSize.setProgress(GaussianBlur.MAX_SIZE);
}
示例5: onCreate
import android.support.v7.widget.AppCompatSeekBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
getTheme().applyStyle(SharedPrefs.getFontSize().getResId(), true);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
UtilFunctions.applyReadingMode();
if (android.os.Build.VERSION.SDK_INT > 9)
{
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white);
toolbar.setContentInsetStartWithNavigation(0);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
mTvDownload = (TextView) findViewById(R.id.download_bible);
mProgressBar = (ProgressBar) findViewById(R.id.progress_bar);
mDayMode = (ImageView) findViewById(R.id.iv_day_mode);
mNightMode = (ImageView) findViewById(R.id.iv_night_mode);
mInflateLayout = (LinearLayout) findViewById(R.id.inflate_layout);
mSeekBarTextSize = (AppCompatSeekBar) findViewById(R.id.seekbar_text_size);
findViewById(R.id.open_hints).setOnClickListener(this);
mTvDownload.setOnClickListener(this);
mDayMode.setOnClickListener(this);
mNightMode.setOnClickListener(this);
findViewById(R.id.tv_about_us).setOnClickListener(this);
findViewById(R.id.backup).setOnClickListener(this);
mFontSize = SharedPrefs.getFontSize();
mReadingMode = SharedPrefs.getReadingMode();
mSeekBarTextSize.setMax(4);
mSeekBarTextSize.setOnSeekBarChangeListener(this);
mSeekBarTextSize.setProgress(getFontSizeInt(SharedPrefs.getFontSize()));
switch (SharedPrefs.getReadingMode()) {
case Day: {
mDayMode.setColorFilter(ContextCompat.getColor(this, R.color.colorAccent));
mNightMode.setColorFilter(ContextCompat.getColor(this, R.color.black_40));
break;
}
case Night: {
mDayMode.setColorFilter(ContextCompat.getColor(this, R.color.black_40));
mNightMode.setColorFilter(ContextCompat.getColor(this, R.color.colorAccent));
break;
}
}
downloadManager = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
if (getIntent().getBooleanExtra(Constants.Keys.IMPORT_BIBLE, false)) {
getIntent().removeExtra(Constants.Keys.IMPORT_BIBLE);
mTvDownload.performClick();
}
}