Skip to content

Commit

Permalink
fbandroid/libraries/fresco/samples/scrollperf/src/main/java/com/faceb…
Browse files Browse the repository at this point in the history
…ook/samples/scrollperf/preferences/SizePreferences.java

Reviewed By: nicholeic

Differential Revision: D67097657

fbshipit-source-id: 37519f3fbce43016dfda97a2dc3a97353661e634
  • Loading branch information
generatedunixname89002005287564 authored and facebook-github-bot committed Dec 12, 2024
1 parent 438caa6 commit 6833fbd
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,23 @@
import android.widget.TextView;
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.samples.scrollperf.R;
import com.facebook.samples.scrollperf.util.SizeUtil;
import javax.annotation.Nullable;

/** A simple Preference containing a SeekBar in order to select a size */
@Nullsafe(Nullsafe.Mode.LOCAL)
public class SizePreferences extends Preference implements SeekBar.OnSeekBarChangeListener {

// We always use half of the width as default
private static final int DEFAULT_SIZE_VALUE = SizeUtil.DISPLAY_WIDTH / 2;

// NULLSAFE_FIXME[Field Not Initialized]
private SeekBar mSeekBar;

@Nullable private TextView mSeekBarValueTextView;
// NULLSAFE_FIXME[Field Not Initialized]
private TextView mTitleView;

private int mProgressValue;
Expand Down Expand Up @@ -54,10 +58,12 @@ public void setSeekBarMaxValue(int maxValue) {
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
// We get the reference to the mSeekBar
// NULLSAFE_FIXME[Not Vetted Third-Party]
mSeekBar = (SeekBar) holder.findViewById(R.id.size_seek_bar);
mSeekBar.setMax(mMaxValue);
mSeekBar.setOnSeekBarChangeListener(this);
mSeekBarValueTextView = (TextView) holder.findViewById(R.id.seek_bar_value);
// NULLSAFE_FIXME[Not Vetted Third-Party]
mTitleView = (TextView) holder.findViewById(R.id.title);
mTitleView.setText(getTitle());
// This is called after the initial value is set
Expand Down

0 comments on commit 6833fbd

Please sign in to comment.