mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +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:paddingLeft="8dp"
|
||||||
android:paddingRight="8dp">
|
android:paddingRight="8dp">
|
||||||
|
|
||||||
<!-- FrameLayout required since Activity will pick between the two
|
<TextView android:id="@+id/empty_games_list"
|
||||||
view using the latter only if the list is empty. -->
|
android:layout_height="wrap_content"
|
||||||
<FrameLayout android:layout_width="fill_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dip"
|
android:text="@string/empty_games_list"
|
||||||
android:layout_weight="1" >
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
/>
|
||||||
|
|
||||||
<ListView android:id="@id/android:list"
|
<ListView android:id="@id/android:list"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:drawSelectorOnTop="false"
|
android:drawSelectorOnTop="false"
|
||||||
/>
|
>
|
||||||
|
</ListView>
|
||||||
<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>
|
|
||||||
|
|
||||||
<Button android:id="@+id/new_game"
|
<Button android:id="@+id/new_game"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
|
|
|
@ -161,7 +161,6 @@ public class GamesList extends XWListActivity
|
||||||
|
|
||||||
setContentView(R.layout.game_list);
|
setContentView(R.layout.game_list);
|
||||||
ListView listView = getListView();
|
ListView listView = getListView();
|
||||||
listView.setEmptyView( findViewById( R.id.empty_games_list ) );
|
|
||||||
registerForContextMenu( listView );
|
registerForContextMenu( listView );
|
||||||
|
|
||||||
boolean isUpgrade = FirstRunDialog.show( this, false );
|
boolean isUpgrade = FirstRunDialog.show( this, false );
|
||||||
|
@ -244,6 +243,17 @@ public class GamesList extends XWListActivity
|
||||||
super.onDestroy();
|
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
|
// DispatchNotify.HandleRelaysIface interface
|
||||||
public void HandleRelaysIDs( final String[] relayIDs )
|
public void HandleRelaysIDs( final String[] relayIDs )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue