Search in sources :

Example 1 with SeekBar

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) {
        }
    });
}
Also used : SeekBar(android.widget.SeekBar)

Example 2 with 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) {
        }
    });
}
Also used : SeekBar(android.widget.SeekBar)

Example 3 with 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) {
        }
    });
}
Also used : SeekBar(android.widget.SeekBar)

Example 4 with 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;
}
Also used : Animator(android.animation.Animator) ValueAnimator(android.animation.ValueAnimator) SeekBar(android.widget.SeekBar) AppCompatSeekBar(android.support.v7.widget.AppCompatSeekBar) AppCompatActivity(android.support.v7.app.AppCompatActivity) ValueAnimator(android.animation.ValueAnimator) LottieAnimationView(com.airbnb.lottie.LottieAnimationView) BindView(butterknife.BindView) View(android.view.View) TextView(android.widget.TextView) Nullable(android.support.annotation.Nullable)

Example 5 with SeekBar

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;
            }
        }
    });
}
Also used : EditText(android.widget.EditText) AlertDialog(android.app.AlertDialog) SeekBar(android.widget.SeekBar) MenuItem(android.view.MenuItem) RadioButton(android.widget.RadioButton) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) File(java.io.File) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

SeekBar (android.widget.SeekBar)338 TextView (android.widget.TextView)159 View (android.view.View)135 Intent (android.content.Intent)45 ImageView (android.widget.ImageView)43 LinearLayout (android.widget.LinearLayout)37 CompoundButton (android.widget.CompoundButton)35 OnSeekBarChangeListener (android.widget.SeekBar.OnSeekBarChangeListener)34 DialogInterface (android.content.DialogInterface)29 SuppressLint (android.annotation.SuppressLint)28 AdapterView (android.widget.AdapterView)28 Paint (android.graphics.Paint)22 OnClickListener (android.view.View.OnClickListener)21 Button (android.widget.Button)20 LayoutInflater (android.view.LayoutInflater)19 FrameLayout (android.widget.FrameLayout)19 SharedPreferences (android.content.SharedPreferences)18 AlertDialog (android.support.v7.app.AlertDialog)18 AlertDialog (android.app.AlertDialog)15 Bundle (android.os.Bundle)15