Inside one of my fragments I have edit texts, switches, seek bars ect. I would like one of the switch's 'on' position to enable visibility of an additional edit-text - ect. I have tried a couple different variations like shown below. (Does it matter where I make this rule)? Thanks.
Do I need on start and nonstop like I have for my seek bar or use another argument to determine visibility?
I have tried many variations, so I don't know what code to post, but basically I have tried things like this. XML is pretty standard let me know if you need it..
View view = inflater.inflate(R.layout.life_lay1, container, false);
seekBar = (SeekBar) view.findViewById(R.id.seekBar1);
textView1 = (TextView) view.findViewById(R.id.textView1);
EditText01 = (EditText) view.findViewById(R.id.EditText01);
//ib1 = (ImageButton) view.findViewById(R.id.ib1);
// ib1.setOnClickListener(this);
ib2 = (ImageButton) view.findViewById(R.id.ib2);
ib2.setOnClickListener(this);
switch3 = (Switch) view.findViewById(R.id.switch3);
switch3.setVisibility(View.INVISIBLE);
if(switch3.getText() =="Yes" ) // have tried string resource as well.
{
switch3.setVisibility(View.VISIBLE);
}
seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener()
{
int progress = 18;
@Override
public void onProgressChanged(SeekBar seekBar,int progresValue, boolean fromUser)
{
progress = progresValue;
if(progresValue < 18)
{
textView1.setText(": " + 18);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar)
{
textView1.setText(": " + seekBar.getProgress());
}
@Override
public void onStopTrackingTouch(SeekBar seekBar)
{
if(seekBar.getProgress() < 18)
{
textView1.setText(": "+ 18);
}
else
{
textView1.setText(": " + seekBar.getProgress());
}
}
});