wrap loading and loaded views in FrameLayout

This to prevent the game list item from resizing (and so reflowing the
whole list) when it's reloading game info. Better would be to set a
timer and only show the reloading view if it seems likely to take a
minute.
This commit is contained in:
Eric House 2016-08-06 09:27:11 -07:00
parent c2305dafff
commit 3140df2f37
2 changed files with 9 additions and 7 deletions

View file

@ -13,13 +13,14 @@
android:background="@android:drawable/list_selector_background"
>
<FrameLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView android:id="@+id/view_unloaded"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="@string/game_list_tmp"
/>
@ -118,5 +119,6 @@
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>
</org.eehouse.android.xw4.GameListItem>

View file

@ -204,8 +204,8 @@ public class GameListItem extends LinearLayout
m_loaded = loaded;
// This should be enough to invalidate
m_viewUnloaded.setVisibility( loaded ? View.GONE : View.VISIBLE );
m_viewLoaded.setVisibility( loaded ? View.VISIBLE : View.GONE );
m_viewUnloaded.setVisibility( loaded ? View.INVISIBLE : View.VISIBLE );
m_viewLoaded.setVisibility( loaded ? View.VISIBLE : View.INVISIBLE );
}
}