mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-07 20:46:17 +01:00
move survey-display logic into one place so it's always right
This commit is contained in:
parent
432badf889
commit
38b9420fa0
4 changed files with 7 additions and 8 deletions
|
@ -458,10 +458,7 @@ public class DlgDelegate {
|
|||
public void onClick( DialogInterface dlg,
|
||||
int which )
|
||||
{
|
||||
boolean firstVersion =
|
||||
Utils.onFirstVersion( m_activity );
|
||||
FirstRunDialog.show( m_activity,
|
||||
!firstVersion );
|
||||
FirstRunDialog.show( m_activity );
|
||||
}
|
||||
} )
|
||||
.setPositiveButton( R.string.button_ok, null )
|
||||
|
|
|
@ -36,8 +36,10 @@ import org.eehouse.android.xw4.loc.LocUtils;
|
|||
*/
|
||||
|
||||
public class FirstRunDialog {
|
||||
public static void show( final Context context, final boolean isUpgrade )
|
||||
public static void show( final Context context )
|
||||
{
|
||||
final boolean showSurvey = !Utils.onFirstVersion( context );
|
||||
|
||||
// This won't support e.g mailto refs. Probably want to
|
||||
// launch the browser with an intent eventually.
|
||||
final WebView view = new WebView( context );
|
||||
|
@ -58,7 +60,7 @@ public class FirstRunDialog {
|
|||
{
|
||||
if ( !m_loaded ) {
|
||||
m_loaded = true;
|
||||
if ( isUpgrade ) {
|
||||
if ( showSurvey ) {
|
||||
view.loadUrl( "javascript:showSurvey();" );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -765,7 +765,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
|
||||
boolean isUpgrade = Utils.firstBootThisVersion( m_activity );
|
||||
if ( isUpgrade && !s_firstShown ) {
|
||||
FirstRunDialog.show( m_activity, isUpgrade );
|
||||
FirstRunDialog.show( m_activity );
|
||||
s_firstShown = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -531,7 +531,7 @@ public class Utils {
|
|||
s_isFirstBootEver = new Boolean( -1 == prevVersion );
|
||||
|
||||
int firstVersion = prefs.getInt( FIRST_VERSION_KEY, Integer.MAX_VALUE );
|
||||
s_firstVersion = new Boolean( firstVersion < thisVersion );
|
||||
s_firstVersion = new Boolean( firstVersion >= thisVersion );
|
||||
if ( newVersion || Integer.MAX_VALUE == firstVersion ) {
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
if ( newVersion ) {
|
||||
|
|
Loading…
Add table
Reference in a new issue