use of android.widget.SeekBar in project UltimateAndroid by cymcsg.
the class DetailFragment method createOpacitySeekbar.
private void createOpacitySeekbar(View view, final DriveImageView imageView) {
SeekBar seekBar = (SeekBar) view.findViewById(R.id.detail_seekbar);
seekBar.setMax(OPACITY_SEEKBAR_MAX);
seekBar.setProgress(OPACITY_SEEKBAR_PROGRESS);
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
imageView.setAlphaValue(Float.valueOf(i / 100.0f));
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
}
use of android.widget.SeekBar in project UltimateAndroid by cymcsg.
the class DetailFragment method createWidthSeekBar.
private void createWidthSeekBar(View view, final DriveImageView imageView) {
SeekBar widthSeekBar = (SeekBar) view.findViewById(R.id.detail_drive_width);
widthSeekBar.setMax(WIDTH_SEEKBAR_MAX);
widthSeekBar.setProgress(WIDTH_SEEKBAR_PROGRESS);
widthSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
imageView.setCustomFolderSpacing(Float.valueOf(i));
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
}
use of android.widget.SeekBar in project UltimateAndroid by cymcsg.
the class DetailFragment method createHeightSeekBar.
private void createHeightSeekBar(View view, final DriveImageView imageView) {
SeekBar heightSeekBar = (SeekBar) view.findViewById(R.id.detail_drive_height);
heightSeekBar.setMax(HEIGHT_SEEKBAR_MAX);
heightSeekBar.setProgress(HEIGHT_SEEKBAR_PROGRESS);
heightSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
imageView.setCustomHeight(Float.valueOf(i));
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
}
use of android.widget.SeekBar in project lottie-android by airbnb.
the class AnimationFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_animation, container, false);
ButterKnife.bind(this, view);
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
toolbar.setNavigationIcon(R.drawable.ic_back);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getFragmentManager().popBackStack();
}
});
postUpdatePlayButtonText();
onLoopChanged();
animationView.addAnimatorListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
startRecordingDroppedFrames();
}
@Override
public void onAnimationEnd(Animator animation) {
recordDroppedFrames();
postUpdatePlayButtonText();
}
@Override
public void onAnimationCancel(Animator animation) {
postUpdatePlayButtonText();
}
@Override
public void onAnimationRepeat(Animator animation) {
recordDroppedFrames();
startRecordingDroppedFrames();
}
});
animationView.addAnimatorUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
seekBar.setProgress((int) (animation.getAnimatedFraction() * 100));
}
});
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (!animationView.isAnimating()) {
animationView.setProgress(progress / 100f);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
return view;
}
use of android.widget.SeekBar in project NewPipe by TeamNewPipe.
the class DownloadActivity method showUrlDialog.
private void showUrlDialog() {
// Create the view
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflater.inflate(R.layout.dialog_url, null);
final EditText name = Utility.findViewById(v, R.id.file_name);
final TextView tCount = Utility.findViewById(v, R.id.threads_count);
final SeekBar threads = Utility.findViewById(v, R.id.threads);
final Toolbar toolbar = Utility.findViewById(v, R.id.toolbar);
final RadioButton audioButton = (RadioButton) Utility.findViewById(v, R.id.audio_button);
threads.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekbar, int progress, boolean fromUser) {
tCount.setText(String.valueOf(progress + 1));
}
@Override
public void onStartTrackingTouch(SeekBar p1) {
}
@Override
public void onStopTrackingTouch(SeekBar p1) {
}
});
int def = mPrefs.getInt(THREADS, 4);
threads.setProgress(def - 1);
tCount.setText(String.valueOf(def));
name.setText(getIntent().getStringExtra("fileName"));
toolbar.setTitle(R.string.add);
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_black_24dp);
toolbar.inflateMenu(R.menu.dialog_url);
// Show the dialog
final AlertDialog dialog = new AlertDialog.Builder(this).setCancelable(true).setView(v).create();
dialog.show();
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == R.id.okay) {
String location;
if (audioButton.isChecked()) {
location = NewPipeSettings.getAudioDownloadPath(DownloadActivity.this);
} else {
location = NewPipeSettings.getVideoDownloadPath(DownloadActivity.this);
}
String fName = name.getText().toString().trim();
File f = new File(location, fName);
if (f.exists()) {
Toast.makeText(DownloadActivity.this, R.string.msg_exists, Toast.LENGTH_SHORT).show();
} else {
DownloadManagerService.startMission(DownloadActivity.this, getIntent().getData().toString(), location, fName, audioButton.isChecked(), threads.getProgress() + 1);
mFragment.notifyChange();
mPrefs.edit().putInt(THREADS, threads.getProgress() + 1).commit();
mPendingUrl = null;
dialog.dismiss();
}
return true;
} else {
return false;
}
}
});
}
Aggregations