wrap code in if(DEBUG)

This commit is contained in:
Eric House 2017-05-27 13:26:57 -07:00
parent 9644f40659
commit c53616fd82

View file

@ -43,23 +43,27 @@ public class DisablesItem extends LinearLayout {
void init( CommsConnType typ, boolean[] state ) void init( CommsConnType typ, boolean[] state )
{ {
m_state = state; if ( BuildConfig.DEBUG ) {
m_type = typ; m_state = state;
((TextView)findViewById(R.id.addr_type)).setText( typ.toString() ); m_type = typ;
((TextView)findViewById(R.id.addr_type)).setText( typ.shortName() );
setupCheckbox( R.id.send, true ); setupCheckbox( R.id.send, true );
setupCheckbox( R.id.receive, false ); setupCheckbox( R.id.receive, false );
}
} }
private void setupCheckbox( int id, final boolean forSend ) private void setupCheckbox( int id, final boolean forSend )
{ {
final CheckBox cb = (CheckBox)findViewById( id ); if ( BuildConfig.DEBUG ) {
cb.setChecked( m_state[forSend?1:0] ); final CheckBox cb = (CheckBox)findViewById( id );
cb.setOnClickListener( new View.OnClickListener() { cb.setChecked( m_state[forSend?1:0] );
@Override cb.setOnClickListener( new View.OnClickListener() {
public void onClick( View view ) { @Override
m_state[forSend?1:0] = cb.isChecked(); public void onClick( View view ) {
} m_state[forSend?1:0] = cb.isChecked();
} ); }
} );
}
} }
} }