mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-31 19:57:06 +01:00
only show the survey invitation when this isn't the first version
you've installed, i.e. after at least one upgrade.
This commit is contained in:
parent
ad7a32504a
commit
f374d67aab
5 changed files with 91 additions and 60 deletions
|
@ -1,26 +1,31 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<script>
|
||||||
|
showSurvey = function() {
|
||||||
|
var div = document.getElementById('survey');
|
||||||
|
div.style.display = 'inline';
|
||||||
|
};
|
||||||
|
</script>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body {font-size: smaller;}
|
body {font-size: smaller;}
|
||||||
|
#survey { display: none;
|
||||||
|
}
|
||||||
|
h2,h3 { text-align: center; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<b>Crosswords 4.4 beta 87 release</b>
|
<h2>Crosswords 4.4 beta 88 release</h2>
|
||||||
|
|
||||||
<p>Please
|
<div id="survey">
|
||||||
consider <a href="https://www.surveymonkey.com/s/GX3XLHR">taking this
|
<p>Please <a href="https://www.surveymonkey.com/s/GX3XLHR">take
|
||||||
survey</a> to help me improve Crosswords.</p>
|
this survey</a> to help determine what gets done next in
|
||||||
|
Crosswords.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h3>New with this (and prev.) releases</h3>
|
<h3>New with this release</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Don't prevent board displaying in the landscape orientation on
|
<li>Post reminder notifications when it's been your turn for
|
||||||
large and x-large devices (tablets)</li>
|
one, two or three days.</li>
|
||||||
<li>Fix changes for above to not crash on small-screened phones
|
|
||||||
(thanks Anonymous)</li>
|
|
||||||
<li>Fix changes for above so Nexus 10 and other x-large devices
|
|
||||||
still use the full screen in the portrait orientation (thanks DS)</li>
|
|
||||||
<li>Fix reported crash in new toolbar code (thanks Anonymous)</li>
|
|
||||||
<li>Fix reported crash receiving malformed SMS (thanks Anonymous)</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>(The full changelog
|
<p>(The full changelog
|
||||||
|
@ -28,17 +33,15 @@ is <a href="http://xwords.sf.net/and_changes.php">here</a>.)</p>
|
||||||
|
|
||||||
<h3>Next up</h3>
|
<h3>Next up</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Side-by-side display (e.g. games list and a game open at the
|
<li>Look, again, at play via Bluetooth now that HTC phones aren't quite so common</li>
|
||||||
same time) for tablets in landscape mode</li>
|
|
||||||
<li>Look, again, at play via Bluetooth now that HTC phones aren't quite so common</li>
|
|
||||||
<li>Fix SMS play for KitKat</li>
|
<li>Fix SMS play for KitKat</li>
|
||||||
<li>Offer "Rematch" when game's over</li>
|
<li>Offer "Rematch" when game's over</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>This is beta software. Please let me know (at eehouse@eehouse.org)
|
<p>This is beta software. Please let me know (email
|
||||||
what's broken and what features you'd most like to see. And if you
|
eehouse@eehouse.org) what's broken and what features you'd
|
||||||
do get a crash, please let your phone report it to Google so I can
|
most like to see. And if you do get a crash, please let your phone
|
||||||
see it!</p>
|
report it to Google so I can see it!</p>
|
||||||
|
|
||||||
<p>Thanks!<br>--Eric</p>
|
<p>Thanks!<br>--Eric</p>
|
||||||
|
|
||||||
|
|
|
@ -458,7 +458,10 @@ public class DlgDelegate {
|
||||||
public void onClick( DialogInterface dlg,
|
public void onClick( DialogInterface dlg,
|
||||||
int which )
|
int which )
|
||||||
{
|
{
|
||||||
FirstRunDialog.show( m_activity );
|
boolean firstVersion =
|
||||||
|
Utils.onFirstVersion( m_activity );
|
||||||
|
FirstRunDialog.show( m_activity,
|
||||||
|
!firstVersion );
|
||||||
}
|
}
|
||||||
} )
|
} )
|
||||||
.setPositiveButton( R.string.button_ok, null )
|
.setPositiveButton( R.string.button_ok, null )
|
||||||
|
|
|
@ -36,12 +36,13 @@ import org.eehouse.android.xw4.loc.LocUtils;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class FirstRunDialog {
|
public class FirstRunDialog {
|
||||||
public static void show( final Context context )
|
public static void show( final Context context, final boolean isUpgrade )
|
||||||
{
|
{
|
||||||
// This won't support e.g mailto refs. Probably want to
|
// This won't support e.g mailto refs. Probably want to
|
||||||
// launch the browser with an intent eventually.
|
// launch the browser with an intent eventually.
|
||||||
WebView view = new WebView( context );
|
final WebView view = new WebView( context );
|
||||||
view.setWebViewClient( new WebViewClient() {
|
view.setWebViewClient( new WebViewClient() {
|
||||||
|
private boolean m_loaded = false;
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldOverrideUrlLoading( WebView view,
|
public boolean shouldOverrideUrlLoading( WebView view,
|
||||||
String url ) {
|
String url ) {
|
||||||
|
@ -52,6 +53,16 @@ public class FirstRunDialog {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public void onPageFinished(WebView view, String url)
|
||||||
|
{
|
||||||
|
if ( !m_loaded ) {
|
||||||
|
m_loaded = true;
|
||||||
|
if ( isUpgrade ) {
|
||||||
|
view.loadUrl( "javascript:showSurvey();" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
view.getSettings().setJavaScriptEnabled( true ); // for surveymonkey
|
view.getSettings().setJavaScriptEnabled( true ); // for surveymonkey
|
||||||
view.loadUrl("file:///android_asset/changes.html");
|
view.loadUrl("file:///android_asset/changes.html");
|
||||||
|
|
|
@ -765,7 +765,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
|
|
||||||
boolean isUpgrade = Utils.firstBootThisVersion( m_activity );
|
boolean isUpgrade = Utils.firstBootThisVersion( m_activity );
|
||||||
if ( isUpgrade && !s_firstShown ) {
|
if ( isUpgrade && !s_firstShown ) {
|
||||||
FirstRunDialog.show( m_activity );
|
FirstRunDialog.show( m_activity, isUpgrade );
|
||||||
s_firstShown = true;
|
s_firstShown = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,9 +63,11 @@ public class Utils {
|
||||||
|
|
||||||
private static final String DB_PATH = "XW_GAMES";
|
private static final String DB_PATH = "XW_GAMES";
|
||||||
private static final String HIDDEN_PREFS = "xwprefs_hidden";
|
private static final String HIDDEN_PREFS = "xwprefs_hidden";
|
||||||
|
private static final String FIRST_VERSION_KEY = "FIRST_VERSION_KEY";
|
||||||
private static final String SHOWN_VERSION_KEY = "SHOWN_VERSION_KEY";
|
private static final String SHOWN_VERSION_KEY = "SHOWN_VERSION_KEY";
|
||||||
|
|
||||||
private static Boolean s_isFirstBootThisVersion = null;
|
private static Boolean s_isFirstBootThisVersion = null;
|
||||||
|
private static Boolean s_firstVersion = null;
|
||||||
private static Boolean s_deviceSupportSMS = null;
|
private static Boolean s_deviceSupportSMS = null;
|
||||||
private static Boolean s_isFirstBootEver = null;
|
private static Boolean s_isFirstBootEver = null;
|
||||||
private static Integer s_appVersion = null;
|
private static Integer s_appVersion = null;
|
||||||
|
@ -81,19 +83,21 @@ public class Utils {
|
||||||
return s_random.nextInt();
|
return s_random.nextInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean onFirstVersion( Context context )
|
||||||
|
{
|
||||||
|
setFirstBootStatics( context );
|
||||||
|
return s_firstVersion;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean firstBootEver( Context context )
|
public static boolean firstBootEver( Context context )
|
||||||
{
|
{
|
||||||
if ( null == s_isFirstBootEver ) {
|
|
||||||
setFirstBootStatics( context );
|
setFirstBootStatics( context );
|
||||||
}
|
|
||||||
return s_isFirstBootEver;
|
return s_isFirstBootEver;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean firstBootThisVersion( Context context )
|
public static boolean firstBootThisVersion( Context context )
|
||||||
{
|
{
|
||||||
if ( null == s_isFirstBootThisVersion ) {
|
|
||||||
setFirstBootStatics( context );
|
setFirstBootStatics( context );
|
||||||
}
|
|
||||||
return s_isFirstBootThisVersion;
|
return s_isFirstBootThisVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -508,10 +512,14 @@ public class Utils {
|
||||||
|
|
||||||
private static void setFirstBootStatics( Context context )
|
private static void setFirstBootStatics( Context context )
|
||||||
{
|
{
|
||||||
|
if ( null == s_isFirstBootThisVersion ) {
|
||||||
int thisVersion = getAppVersion( context );
|
int thisVersion = getAppVersion( context );
|
||||||
int prevVersion = 0;
|
int prevVersion = 0;
|
||||||
|
SharedPreferences prefs =
|
||||||
|
context.getSharedPreferences( HIDDEN_PREFS,
|
||||||
|
Context.MODE_PRIVATE );
|
||||||
|
|
||||||
|
|
||||||
SharedPreferences prefs = null;
|
|
||||||
if ( 0 < thisVersion ) {
|
if ( 0 < thisVersion ) {
|
||||||
prefs = context.getSharedPreferences( HIDDEN_PREFS,
|
prefs = context.getSharedPreferences( HIDDEN_PREFS,
|
||||||
Context.MODE_PRIVATE );
|
Context.MODE_PRIVATE );
|
||||||
|
@ -522,10 +530,16 @@ public class Utils {
|
||||||
s_isFirstBootThisVersion = new Boolean( newVersion );
|
s_isFirstBootThisVersion = new Boolean( newVersion );
|
||||||
s_isFirstBootEver = new Boolean( -1 == prevVersion );
|
s_isFirstBootEver = new Boolean( -1 == prevVersion );
|
||||||
|
|
||||||
if ( newVersion ) {
|
int firstVersion = prefs.getInt( FIRST_VERSION_KEY, thisVersion );
|
||||||
prefs.edit()
|
s_firstVersion = new Boolean( firstVersion == thisVersion );
|
||||||
.putInt( SHOWN_VERSION_KEY, thisVersion )
|
if ( newVersion || s_firstVersion ) {
|
||||||
.commit();
|
SharedPreferences.Editor editor = prefs.edit()
|
||||||
|
.putInt( SHOWN_VERSION_KEY, thisVersion );
|
||||||
|
if ( 0 == firstVersion ) {
|
||||||
|
editor.putInt( FIRST_VERSION_KEY, thisVersion );
|
||||||
|
}
|
||||||
|
editor.commit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue