mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
enable turning thumbnail featuren on/off via a line in build.xml
This commit is contained in:
parent
8bdde9765d
commit
d72526ff84
5 changed files with 39 additions and 21 deletions
|
@ -63,11 +63,13 @@
|
|||
|
||||
<target name="-pre-build">
|
||||
<property name="CHAT_ENABLED" value="true" />
|
||||
<property name="THUMBNAIL_ENABLED" value="true" />
|
||||
<exec dir="." executable="../scripts/ndkbuild.sh" failonerror="true">
|
||||
<arg value="BUILD_TARGET=${build.target}" />
|
||||
<arg value="-j3"/>
|
||||
<arg value="INITIAL_CLIENT_VERS=${INITIAL_CLIENT_VERS}" />
|
||||
<arg value="CHAT_ENABLED=${CHAT_ENABLED}" />
|
||||
<arg value="THUMBNAIL_ENABLED=${THUMBNAIL_ENABLED}" />
|
||||
</exec>
|
||||
|
||||
<exec dir="." executable="../scripts/mkimages.sh"
|
||||
|
@ -83,6 +85,7 @@
|
|||
<arg value="xw4"/>
|
||||
<arg value="${INITIAL_CLIENT_VERS}" />
|
||||
<arg value="${CHAT_ENABLED}" />
|
||||
<arg value="${THUMBNAIL_ENABLED}" />
|
||||
</exec>
|
||||
</target>
|
||||
<!--
|
||||
|
|
|
@ -44,6 +44,9 @@ local_DEFINES += \
|
|||
ifeq ($(CHAT_ENABLED),true)
|
||||
local_DEFINES += -DXWFEATURE_CHAT
|
||||
endif
|
||||
ifeq ($(THUMBNAIL_ENABLED),true)
|
||||
local_DEFINES += -DXWFEATURE_ACTIVERECT
|
||||
endif
|
||||
|
||||
# -DXWFEATURE_SCOREONEPASS \
|
||||
|
||||
|
|
|
@ -184,12 +184,16 @@ public class DBUtils {
|
|||
summary.lastMoveTime =
|
||||
cursor.getInt(cursor.getColumnIndex(DBHelper.LASTMOVE));
|
||||
|
||||
byte[] data =
|
||||
cursor.getBlob( cursor.getColumnIndex(DBHelper.THUMBNAIL));
|
||||
if ( null != data ) {
|
||||
Bitmap thumb = BitmapFactory.decodeByteArray( data, 0,
|
||||
data.length );
|
||||
summary.setThumbnail( thumb );
|
||||
if ( GitVersion.THUMBNAIL_SUPPORTED ) {
|
||||
byte[] data =
|
||||
cursor.getBlob( cursor.
|
||||
getColumnIndex(DBHelper.THUMBNAIL));
|
||||
if ( null != data ) {
|
||||
Bitmap thumb =
|
||||
BitmapFactory.decodeByteArray( data, 0,
|
||||
data.length );
|
||||
summary.setThumbnail( thumb );
|
||||
}
|
||||
}
|
||||
|
||||
String scoresStr =
|
||||
|
@ -322,14 +326,16 @@ public class DBUtils {
|
|||
}
|
||||
}
|
||||
|
||||
Bitmap thumb = summary.getThumbnail();
|
||||
if ( null == thumb ) {
|
||||
values.putNull( DBHelper.THUMBNAIL );
|
||||
} else {
|
||||
ByteArrayOutputStream bas = new ByteArrayOutputStream();
|
||||
thumb.compress( CompressFormat.PNG, 0 , bas );
|
||||
byte[] data = bas.toByteArray();
|
||||
values.put( DBHelper.THUMBNAIL, data );
|
||||
if ( GitVersion.THUMBNAIL_SUPPORTED ) {
|
||||
Bitmap thumb = summary.getThumbnail();
|
||||
if ( null == thumb ) {
|
||||
values.putNull( DBHelper.THUMBNAIL );
|
||||
} else {
|
||||
ByteArrayOutputStream bas = new ByteArrayOutputStream();
|
||||
thumb.compress( CompressFormat.PNG, 0 , bas );
|
||||
byte[] data = bas.toByteArray();
|
||||
values.put( DBHelper.THUMBNAIL, data );
|
||||
}
|
||||
}
|
||||
|
||||
values.put( DBHelper.SERVERROLE, summary.serverRole.ordinal() );
|
||||
|
|
|
@ -187,7 +187,9 @@ public class GameListItem extends LinearLayout
|
|||
R.drawable.expander_ic_maximized :
|
||||
R.drawable.expander_ic_minimized);
|
||||
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.setPct( m_handler, m_haveTurn && !m_expanded,
|
||||
|
@ -295,12 +297,14 @@ public class GameListItem extends LinearLayout
|
|||
}
|
||||
} );
|
||||
|
||||
m_thumb = (ImageView)findViewById( R.id.thumbnail );
|
||||
Bitmap bmp = summary.getThumbnail();
|
||||
if ( null == bmp ) {
|
||||
m_thumb.setVisibility( View.GONE );
|
||||
} else {
|
||||
m_thumb.setImageBitmap( bmp );
|
||||
if ( GitVersion.THUMBNAIL_SUPPORTED ) {
|
||||
m_thumb = (ImageView)findViewById( R.id.thumbnail );
|
||||
Bitmap bmp = summary.getThumbnail();
|
||||
if ( null == bmp ) {
|
||||
m_thumb.setVisibility( View.GONE );
|
||||
} else {
|
||||
m_thumb.setImageBitmap( bmp );
|
||||
}
|
||||
}
|
||||
|
||||
tview = (TextView)findViewById( R.id.role );
|
||||
|
|
|
@ -6,6 +6,7 @@ DIR=$1
|
|||
VARIANT=$2
|
||||
CLIENT_VERS_RELAY=$3
|
||||
CHAT_SUPPORTED=$4
|
||||
THUMBNAIL_SUPPORTED=$5
|
||||
|
||||
cd $(dirname $0)
|
||||
cd ../../
|
||||
|
@ -35,6 +36,7 @@ class GitVersion {
|
|||
public static final String VERS = "$SHORTVERS";
|
||||
public static final short CLIENT_VERS_RELAY = $CLIENT_VERS_RELAY;
|
||||
public static final boolean CHAT_SUPPORTED = $CHAT_SUPPORTED;
|
||||
public static final boolean THUMBNAIL_SUPPORTED = $THUMBNAIL_SUPPORTED;
|
||||
}
|
||||
EOF
|
||||
|
||||
|
|
Loading…
Reference in a new issue