mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
make the empty-list message a header instead since its instructions
matter after there are games in the list. But hide it whenever there are four or more games.
This commit is contained in:
parent
bfc5bb62dc
commit
26a274ab0f
2 changed files with 24 additions and 21 deletions
|
@ -7,27 +7,20 @@
|
|||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp">
|
||||
|
||||
<!-- FrameLayout required since Activity will pick between the two
|
||||
view using the latter only if the list is empty. -->
|
||||
<FrameLayout android:layout_width="fill_parent"
|
||||
android:layout_height="0dip"
|
||||
android:layout_weight="1" >
|
||||
<TextView android:id="@+id/empty_games_list"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/empty_games_list"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
/>
|
||||
|
||||
<ListView android:id="@id/android:list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:drawSelectorOnTop="false"
|
||||
/>
|
||||
|
||||
<TextView android:id="@+id/empty_games_list"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/empty_games_list"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
/>
|
||||
|
||||
</FrameLayout>
|
||||
<ListView android:id="@id/android:list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:drawSelectorOnTop="false"
|
||||
>
|
||||
</ListView>
|
||||
|
||||
<Button android:id="@+id/new_game"
|
||||
android:layout_width="fill_parent"
|
||||
|
|
|
@ -161,7 +161,6 @@ public class GamesList extends XWListActivity
|
|||
|
||||
setContentView(R.layout.game_list);
|
||||
ListView listView = getListView();
|
||||
listView.setEmptyView( findViewById( R.id.empty_games_list ) );
|
||||
registerForContextMenu( listView );
|
||||
|
||||
boolean isUpgrade = FirstRunDialog.show( this, false );
|
||||
|
@ -244,6 +243,17 @@ public class GamesList extends XWListActivity
|
|||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContentChanged()
|
||||
{
|
||||
int count = DBUtils.gamesList( this ).length;
|
||||
int hereOrGone = count > 3 ? View.GONE : View.VISIBLE;
|
||||
View hint = findViewById( R.id.empty_games_list );
|
||||
hint.setVisibility( hereOrGone );
|
||||
|
||||
super.onContentChanged();
|
||||
}
|
||||
|
||||
// DispatchNotify.HandleRelaysIface interface
|
||||
public void HandleRelaysIDs( final String[] relayIDs )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue