enable turning thumbnail featuren on/off via a line in build.xml

This commit is contained in:
Eric House 2013-10-29 06:49:06 -07:00
parent 8bdde9765d
commit d72526ff84
5 changed files with 39 additions and 21 deletions

View file

@ -63,11 +63,13 @@
<target name="-pre-build"> <target name="-pre-build">
<property name="CHAT_ENABLED" value="true" /> <property name="CHAT_ENABLED" value="true" />
<property name="THUMBNAIL_ENABLED" value="true" />
<exec dir="." executable="../scripts/ndkbuild.sh" failonerror="true"> <exec dir="." executable="../scripts/ndkbuild.sh" failonerror="true">
<arg value="BUILD_TARGET=${build.target}" /> <arg value="BUILD_TARGET=${build.target}" />
<arg value="-j3"/> <arg value="-j3"/>
<arg value="INITIAL_CLIENT_VERS=${INITIAL_CLIENT_VERS}" /> <arg value="INITIAL_CLIENT_VERS=${INITIAL_CLIENT_VERS}" />
<arg value="CHAT_ENABLED=${CHAT_ENABLED}" /> <arg value="CHAT_ENABLED=${CHAT_ENABLED}" />
<arg value="THUMBNAIL_ENABLED=${THUMBNAIL_ENABLED}" />
</exec> </exec>
<exec dir="." executable="../scripts/mkimages.sh" <exec dir="." executable="../scripts/mkimages.sh"
@ -83,6 +85,7 @@
<arg value="xw4"/> <arg value="xw4"/>
<arg value="${INITIAL_CLIENT_VERS}" /> <arg value="${INITIAL_CLIENT_VERS}" />
<arg value="${CHAT_ENABLED}" /> <arg value="${CHAT_ENABLED}" />
<arg value="${THUMBNAIL_ENABLED}" />
</exec> </exec>
</target> </target>
<!-- <!--

View file

@ -44,6 +44,9 @@ local_DEFINES += \
ifeq ($(CHAT_ENABLED),true) ifeq ($(CHAT_ENABLED),true)
local_DEFINES += -DXWFEATURE_CHAT local_DEFINES += -DXWFEATURE_CHAT
endif endif
ifeq ($(THUMBNAIL_ENABLED),true)
local_DEFINES += -DXWFEATURE_ACTIVERECT
endif
# -DXWFEATURE_SCOREONEPASS \ # -DXWFEATURE_SCOREONEPASS \

View file

@ -184,13 +184,17 @@ public class DBUtils {
summary.lastMoveTime = summary.lastMoveTime =
cursor.getInt(cursor.getColumnIndex(DBHelper.LASTMOVE)); cursor.getInt(cursor.getColumnIndex(DBHelper.LASTMOVE));
if ( GitVersion.THUMBNAIL_SUPPORTED ) {
byte[] data = byte[] data =
cursor.getBlob( cursor.getColumnIndex(DBHelper.THUMBNAIL)); cursor.getBlob( cursor.
getColumnIndex(DBHelper.THUMBNAIL));
if ( null != data ) { if ( null != data ) {
Bitmap thumb = BitmapFactory.decodeByteArray( data, 0, Bitmap thumb =
BitmapFactory.decodeByteArray( data, 0,
data.length ); data.length );
summary.setThumbnail( thumb ); summary.setThumbnail( thumb );
} }
}
String scoresStr = String scoresStr =
cursor.getString( cursor.getColumnIndex(DBHelper.SCORES)); cursor.getString( cursor.getColumnIndex(DBHelper.SCORES));
@ -322,6 +326,7 @@ public class DBUtils {
} }
} }
if ( GitVersion.THUMBNAIL_SUPPORTED ) {
Bitmap thumb = summary.getThumbnail(); Bitmap thumb = summary.getThumbnail();
if ( null == thumb ) { if ( null == thumb ) {
values.putNull( DBHelper.THUMBNAIL ); values.putNull( DBHelper.THUMBNAIL );
@ -331,6 +336,7 @@ public class DBUtils {
byte[] data = bas.toByteArray(); byte[] data = bas.toByteArray();
values.put( DBHelper.THUMBNAIL, data ); values.put( DBHelper.THUMBNAIL, data );
} }
}
values.put( DBHelper.SERVERROLE, summary.serverRole.ordinal() ); values.put( DBHelper.SERVERROLE, summary.serverRole.ordinal() );

View file

@ -187,7 +187,9 @@ public class GameListItem extends LinearLayout
R.drawable.expander_ic_maximized : R.drawable.expander_ic_maximized :
R.drawable.expander_ic_minimized); R.drawable.expander_ic_minimized);
m_hideable.setVisibility( m_expanded? View.VISIBLE : View.GONE ); m_hideable.setVisibility( m_expanded? View.VISIBLE : View.GONE );
m_thumb.setVisibility( m_expanded? View.VISIBLE : View.GONE ); if ( GitVersion.THUMBNAIL_SUPPORTED ) {
m_thumb.setVisibility( m_expanded ? View.VISIBLE : View.GONE );
}
m_name.setBackgroundColor( android.R.color.transparent ); m_name.setBackgroundColor( android.R.color.transparent );
m_name.setPct( m_handler, m_haveTurn && !m_expanded, m_name.setPct( m_handler, m_haveTurn && !m_expanded,
@ -295,6 +297,7 @@ public class GameListItem extends LinearLayout
} }
} ); } );
if ( GitVersion.THUMBNAIL_SUPPORTED ) {
m_thumb = (ImageView)findViewById( R.id.thumbnail ); m_thumb = (ImageView)findViewById( R.id.thumbnail );
Bitmap bmp = summary.getThumbnail(); Bitmap bmp = summary.getThumbnail();
if ( null == bmp ) { if ( null == bmp ) {
@ -302,6 +305,7 @@ public class GameListItem extends LinearLayout
} else { } else {
m_thumb.setImageBitmap( bmp ); m_thumb.setImageBitmap( bmp );
} }
}
tview = (TextView)findViewById( R.id.role ); tview = (TextView)findViewById( R.id.role );
String roleSummary = summary.summarizeRole(); String roleSummary = summary.summarizeRole();

View file

@ -6,6 +6,7 @@ DIR=$1
VARIANT=$2 VARIANT=$2
CLIENT_VERS_RELAY=$3 CLIENT_VERS_RELAY=$3
CHAT_SUPPORTED=$4 CHAT_SUPPORTED=$4
THUMBNAIL_SUPPORTED=$5
cd $(dirname $0) cd $(dirname $0)
cd ../../ cd ../../
@ -35,6 +36,7 @@ class GitVersion {
public static final String VERS = "$SHORTVERS"; public static final String VERS = "$SHORTVERS";
public static final short CLIENT_VERS_RELAY = $CLIENT_VERS_RELAY; public static final short CLIENT_VERS_RELAY = $CLIENT_VERS_RELAY;
public static final boolean CHAT_SUPPORTED = $CHAT_SUPPORTED; public static final boolean CHAT_SUPPORTED = $CHAT_SUPPORTED;
public static final boolean THUMBNAIL_SUPPORTED = $THUMBNAIL_SUPPORTED;
} }
EOF EOF