hide the label and spinner when there's only one language

This commit is contained in:
Eric House 2014-01-30 08:15:43 -08:00
parent 3ea86e630d
commit 647282968a
2 changed files with 7 additions and 4 deletions

View file

@ -8,7 +8,8 @@
android:paddingRight="8dp"
>
<LinearLayout android:orientation="horizontal"
<LinearLayout android:id="@+id/pick_lang"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
@ -17,7 +18,7 @@
android:text="@string/study_langpick"
/>
<Spinner android:id="@+id/pick_language"
<Spinner android:id="@+id/pick_lang_spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"

View file

@ -46,6 +46,7 @@ public class StudyList extends XWListActivity
private static final String START_LANG = "START_LANG";
private Spinner m_spinner;
private View m_pickView; // LinearLayout, actually
private int[] m_langCodes;
private String[] m_words;
private int m_position;
@ -57,7 +58,8 @@ public class StudyList extends XWListActivity
setContentView( R.layout.studylist );
m_spinner = (Spinner)findViewById( R.id.pick_language );
m_spinner = (Spinner)findViewById( R.id.pick_lang_spinner );
m_pickView = findViewById( R.id.pick_lang );
initOrFinish( getIntent() );
}
@ -159,7 +161,7 @@ public class StudyList extends XWListActivity
if ( 0 == m_langCodes.length ) {
finish();
} else if ( 1 == m_langCodes.length ) {
m_spinner.setVisibility( View.GONE );
m_pickView.setVisibility( View.GONE );
m_position = 0;
loadList();
} else {