mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
Android: Use findViewById instead of getChildAt
More futureproof if anything else is added to the layout.
This commit is contained in:
parent
4221999c6e
commit
038b968698
@ -10,14 +10,14 @@
|
||||
<SeekBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/seekBar"
|
||||
android:id="@+id/sliderSeekBar"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="Sample Text"
|
||||
android:id="@+id/textView"
|
||||
android:id="@+id/sliderTextView"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
</LinearLayout>
|
@ -40,8 +40,8 @@ public class SliderPreference extends DialogPreference implements SeekBar.OnSeek
|
||||
LayoutInflater inflater = LayoutInflater.from(getContext());
|
||||
LinearLayout layout = (LinearLayout)inflater.inflate(R.layout.slider_layout, null, false);
|
||||
|
||||
m_seekbar = (SeekBar)layout.getChildAt(0);
|
||||
m_textview = (TextView)layout.getChildAt(1);
|
||||
m_seekbar = (SeekBar)layout.findViewById(R.id.sliderSeekBar);
|
||||
m_textview = (TextView)layout.findViewById(R.id.sliderTextView);
|
||||
|
||||
if (shouldPersist())
|
||||
m_value = Integer.valueOf(getPersistedString(Integer.toString(m_value)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user