diff --git a/xwords4/android/XWords4/archive/R.java b/xwords4/android/XWords4/archive/R.java index de4c79e76..e4a17caa9 100644 --- a/xwords4/android/XWords4/archive/R.java +++ b/xwords4/android/XWords4/archive/R.java @@ -83,34 +83,34 @@ public final class R { public static final int add_player=0x7f09002f; public static final int advertise_new_room_check=0x7f090036; public static final int blessed_label=0x7f090056; - public static final int board_menu_chat=0x7f09009c; - public static final int board_menu_dict=0x7f090098; - public static final int board_menu_done=0x7f090082; - public static final int board_menu_file_about=0x7f090090; - public static final int board_menu_file_prefs=0x7f09008f; - public static final int board_menu_flip=0x7f09009a; - public static final int board_menu_game_counts=0x7f090088; - public static final int board_menu_game_history=0x7f09008a; - public static final int board_menu_game_left=0x7f090089; - public static final int board_menu_game_netstats=0x7f090091; - public static final int board_menu_game_resend=0x7f09008c; - public static final int board_menu_game_resign=0x7f09008b; - public static final int board_menu_hint_next=0x7f090096; - public static final int board_menu_hint_prev=0x7f090095; - public static final int board_menu_invite=0x7f090092; - public static final int board_menu_juggle=0x7f090099; - public static final int board_menu_toggle=0x7f09009d; - public static final int board_menu_trade=0x7f090083; - public static final int board_menu_trade_cancel=0x7f090084; - public static final int board_menu_trade_commit=0x7f090085; - public static final int board_menu_tray=0x7f090087; - public static final int board_menu_undo_current=0x7f090097; - public static final int board_menu_undo_last=0x7f090086; - public static final int board_menu_zoom=0x7f09009b; + public static final int board_menu_chat=0x7f09009e; + public static final int board_menu_dict=0x7f09009a; + public static final int board_menu_done=0x7f090084; + public static final int board_menu_file_about=0x7f090092; + public static final int board_menu_file_prefs=0x7f090091; + public static final int board_menu_flip=0x7f09009c; + public static final int board_menu_game_counts=0x7f09008a; + public static final int board_menu_game_history=0x7f09008c; + public static final int board_menu_game_left=0x7f09008b; + public static final int board_menu_game_netstats=0x7f090093; + public static final int board_menu_game_resend=0x7f09008e; + public static final int board_menu_game_resign=0x7f09008d; + public static final int board_menu_hint_next=0x7f090098; + public static final int board_menu_hint_prev=0x7f090097; + public static final int board_menu_invite=0x7f090094; + public static final int board_menu_juggle=0x7f09009b; + public static final int board_menu_toggle=0x7f09009f; + public static final int board_menu_trade=0x7f090085; + public static final int board_menu_trade_cancel=0x7f090086; + public static final int board_menu_trade_commit=0x7f090087; + public static final int board_menu_tray=0x7f090089; + public static final int board_menu_undo_current=0x7f090099; + public static final int board_menu_undo_last=0x7f090088; + public static final int board_menu_zoom=0x7f09009d; public static final int board_root=0x7f090002; public static final int board_view=0x7f090003; public static final int boardsize_spinner=0x7f090042; - public static final int button_add=0x7f090071; + public static final int button_add=0x7f090073; public static final int button_clear=0x7f09000b; public static final int button_done=0x7f090061; public static final int button_invite=0x7f09000c; @@ -119,10 +119,10 @@ public final class R { public static final int button_rescan=0x7f09000a; public static final int button_study=0x7f090060; public static final int change_connection=0x7f09003a; - public static final int chat_button=0x7f09007d; + public static final int chat_button=0x7f09007f; public static final int chat_edit=0x7f090010; public static final int chat_history=0x7f09000f; - public static final int chat_menu_clear=0x7f09009e; + public static final int chat_menu_clear=0x7f0900a0; public static final int checkbox=0x7f090050; public static final int color_display_sample=0x7f090012; public static final int color_edit_sample=0x7f090013; @@ -132,19 +132,19 @@ public final class R { public static final int conns_label=0x7f090031; public static final int del=0x7f090053; public static final int desc=0x7f09001e; - public static final int details=0x7f09006e; - public static final int dict_label=0x7f090066; + public static final int details=0x7f090070; + public static final int dict_label=0x7f090068; public static final int dict_spinner=0x7f09002c; - public static final int dictlist_button=0x7f09007c; - public static final int dicts_delete=0x7f0900a1; - public static final int dicts_deselect_all=0x7f0900a0; - public static final int dicts_download=0x7f09009f; - public static final int dicts_move=0x7f0900a2; - public static final int dicts_select=0x7f0900a3; + public static final int dictlist_button=0x7f09007e; + public static final int dicts_delete=0x7f0900a3; + public static final int dicts_deselect_all=0x7f0900a2; + public static final int dicts_download=0x7f0900a1; + public static final int dicts_move=0x7f0900a4; + public static final int dicts_select=0x7f0900a5; public static final int divider=0x7f090023; - public static final int download_button=0x7f09006f; + public static final int download_button=0x7f090071; public static final int dwnld_message=0x7f09004e; - public static final int edit=0x7f090062; + public static final int edit=0x7f090064; public static final int edit_blue=0x7f090019; public static final int edit_green=0x7f090017; public static final int edit_red=0x7f090015; @@ -155,88 +155,90 @@ public final class R { public static final int exchange_commit=0x7f090005; public static final int expander=0x7f090025; public static final int filters=0x7f09005b; - public static final int flip_button=0x7f09007f; + public static final int flip_button=0x7f090081; public static final int game_locked_check=0x7f090027; public static final int game_name=0x7f090045; - public static final int gamel_menu_checkmoves=0x7f09008e; - public static final int games_game_config=0x7f0900af; - public static final int games_game_copy=0x7f0900b4; - public static final int games_game_delete=0x7f0900ae; - public static final int games_game_move=0x7f0900b0; - public static final int games_game_new_from=0x7f0900b2; - public static final int games_game_rename=0x7f0900b3; - public static final int games_game_reset=0x7f0900b1; - public static final int games_group_default=0x7f0900b8; - public static final int games_group_delete=0x7f0900b7; - public static final int games_group_movedown=0x7f0900b6; - public static final int games_group_moveup=0x7f0900b5; - public static final int games_group_rename=0x7f0900b9; - public static final int games_menu_about=0x7f0900ab; - public static final int games_menu_checkmoves=0x7f0900ad; - public static final int games_menu_checkupdates=0x7f0900ba; - public static final int games_menu_dicts=0x7f0900a9; - public static final int games_menu_email=0x7f0900aa; - public static final int games_menu_loaddb=0x7f0900bc; - public static final int games_menu_newgame_net=0x7f0900a5; - public static final int games_menu_newgame_solo=0x7f0900a4; - public static final int games_menu_newgroup=0x7f0900a6; - public static final int games_menu_prefs=0x7f0900a7; - public static final int games_menu_rateme=0x7f0900a8; - public static final int games_menu_resend=0x7f0900ac; - public static final int games_menu_storedb=0x7f0900bb; - public static final int games_menu_study=0x7f09008d; - public static final int group_done=0x7f090081; - public static final int group_exchange=0x7f090093; - public static final int group_hint=0x7f090094; + public static final int gamel_menu_checkmoves=0x7f090090; + public static final int games_game_config=0x7f0900b1; + public static final int games_game_copy=0x7f0900b6; + public static final int games_game_delete=0x7f0900b0; + public static final int games_game_move=0x7f0900b2; + public static final int games_game_new_from=0x7f0900b4; + public static final int games_game_rename=0x7f0900b5; + public static final int games_game_reset=0x7f0900b3; + public static final int games_group_default=0x7f0900ba; + public static final int games_group_delete=0x7f0900b9; + public static final int games_group_movedown=0x7f0900b8; + public static final int games_group_moveup=0x7f0900b7; + public static final int games_group_rename=0x7f0900bb; + public static final int games_menu_about=0x7f0900ad; + public static final int games_menu_checkmoves=0x7f0900af; + public static final int games_menu_checkupdates=0x7f0900bc; + public static final int games_menu_dicts=0x7f0900ab; + public static final int games_menu_email=0x7f0900ac; + public static final int games_menu_loaddb=0x7f0900be; + public static final int games_menu_newgame_net=0x7f0900a7; + public static final int games_menu_newgame_solo=0x7f0900a6; + public static final int games_menu_newgroup=0x7f0900a8; + public static final int games_menu_prefs=0x7f0900a9; + public static final int games_menu_rateme=0x7f0900aa; + public static final int games_menu_resend=0x7f0900ae; + public static final int games_menu_storedb=0x7f0900bd; + public static final int games_menu_study=0x7f09008f; + public static final int group_done=0x7f090083; + public static final int group_exchange=0x7f090095; + public static final int group_hint=0x7f090096; public static final int hideable=0x7f09004a; public static final int hints_allowed=0x7f09003b; public static final int invite_desc=0x7f090009; public static final int inviter_check=0x7f09000d; - public static final int item_name=0x7f09006a; - public static final int item_score=0x7f09006b; + public static final int item_name=0x7f09006c; + public static final int item_score=0x7f09006d; public static final int join_public_room_check=0x7f090033; public static final int juggle_players=0x7f090030; public static final int label=0x7f090024; public static final int lang_separator=0x7f09002a; public static final int lang_spinner=0x7f09002b; - public static final int loc_item_check=0x7f0900be; - public static final int loc_item_clear=0x7f0900bd; - public static final int loc_item_copy_bless=0x7f0900c0; - public static final int loc_item_copy_eng=0x7f0900bf; + public static final int loc_item_check=0x7f0900c0; + public static final int loc_item_clear=0x7f0900bf; + public static final int loc_item_copy_bless=0x7f0900c2; + public static final int loc_item_copy_eng=0x7f0900c1; public static final int loc_search_button=0x7f09005d; public static final int loc_search_field=0x7f09005c; public static final int local_label=0x7f090058; - public static final int local_player_set=0x7f090064; - public static final int manual_add_button=0x7f090072; + public static final int local_player_set=0x7f090066; + public static final int manual_add_button=0x7f090074; public static final int modtime=0x7f09004b; + public static final int msg=0x7f090062; public static final int msg_marker=0x7f090048; - public static final int name=0x7f090073; + public static final int name=0x7f090075; public static final int name_edit=0x7f09001c; - public static final int name_label=0x7f090070; - public static final int nexthint_button=0x7f090079; + public static final int name_label=0x7f090072; + public static final int nexthint_button=0x7f09007b; + public static final int not_again_check=0x7f090063; public static final int nperdev_spinner=0x7f09000e; - public static final int number=0x7f090074; + public static final int number=0x7f090076; public static final int other_lang=0x7f09005e; - public static final int password_edit=0x7f090069; - public static final int password_set=0x7f090068; + public static final int password_edit=0x7f09006b; + public static final int password_set=0x7f09006a; public static final int phonies_spinner=0x7f090040; public static final int pick_faceup=0x7f090041; - public static final int pick_lang=0x7f090075; - public static final int pick_lang_spinner=0x7f090076; + public static final int pick_lang=0x7f090077; + public static final int pick_lang_spinner=0x7f090078; public static final int play_button=0x7f090028; public static final int player_list=0x7f09002e; - public static final int player_name_edit=0x7f090065; + public static final int player_name_edit=0x7f090067; public static final int players=0x7f090026; public static final int players_label=0x7f09002d; - public static final int prevhint_button=0x7f090078; + public static final int prevhint_button=0x7f09007a; public static final int private_rooms_set=0x7f090034; public static final int progress_bar=0x7f09004f; public static final int public_rooms_set=0x7f090037; public static final int refresh_button=0x7f090039; - public static final int remote_check=0x7f090063; - public static final int revert_all=0x7f09006d; - public static final int revert_colors=0x7f09006c; - public static final int robot_check=0x7f090067; + public static final int remote_check=0x7f090065; + public static final int revert_all=0x7f09006f; + public static final int revert_colors=0x7f09006e; + public static final int robot_check=0x7f090069; public static final int role=0x7f09004d; public static final int room_edit=0x7f090035; public static final int room_spinner=0x7f090038; @@ -247,12 +249,12 @@ public final class R { public static final int seek_red=0x7f090014; public static final int send_button=0x7f090011; public static final int show_remote=0x7f09001d; - public static final int shuffle_button=0x7f09007a; - public static final int slmenu_clear_sel=0x7f0900c5; - public static final int slmenu_copy_sel=0x7f0900c4; - public static final int slmenu_deselect_all=0x7f0900c3; - public static final int slmenu_lookup_sel=0x7f0900c1; - public static final int slmenu_select_all=0x7f0900c2; + public static final int shuffle_button=0x7f09007c; + public static final int slmenu_clear_sel=0x7f0900c7; + public static final int slmenu_copy_sel=0x7f0900c6; + public static final int slmenu_deselect_all=0x7f0900c5; + public static final int slmenu_lookup_sel=0x7f0900c3; + public static final int slmenu_select_all=0x7f0900c4; public static final int smart_robot=0x7f09003f; public static final int state=0x7f09004c; public static final int summary=0x7f09005f; @@ -263,10 +265,10 @@ public final class R { public static final int thumbnail=0x7f090049; public static final int timer_minutes_edit=0x7f09003e; public static final int timer_set=0x7f09003d; - public static final int toolbar=0x7f090077; - public static final int undo_button=0x7f09007b; + public static final int toolbar=0x7f090079; + public static final int undo_button=0x7f09007d; public static final int use_timer=0x7f09003c; - public static final int values_button=0x7f09007e; + public static final int values_button=0x7f090080; public static final int version_string=0x7f090000; public static final int view_loaded=0x7f090047; public static final int view_unloaded=0x7f090046; @@ -276,7 +278,7 @@ public final class R { public static final int xlated_view=0x7f09005a; public static final int xlated_view_blessed=0x7f090057; public static final int xlated_view_local=0x7f090059; - public static final int zoom_button=0x7f090080; + public static final int zoom_button=0x7f090082; } public static final class layout { public static final int about_dlg=0x7f030000; @@ -308,16 +310,17 @@ public final class R { public static final int loc_list_item=0x7f03001a; public static final int loc_main=0x7f03001b; public static final int lookup=0x7f03001c; - public static final int passwd_view=0x7f03001d; - public static final int player_edit=0x7f03001e; - public static final int player_list_elem=0x7f03001f; - public static final int prefs_w_buttons=0x7f030020; - public static final int remote_dict_details=0x7f030021; - public static final int rename_game=0x7f030022; - public static final int smsinviter=0x7f030023; - public static final int smsinviter_item=0x7f030024; - public static final int studylist=0x7f030025; - public static final int toolbar=0x7f030026; + public static final int not_again_view=0x7f03001d; + public static final int passwd_view=0x7f03001e; + public static final int player_edit=0x7f03001f; + public static final int player_list_elem=0x7f030020; + public static final int prefs_w_buttons=0x7f030021; + public static final int remote_dict_details=0x7f030022; + public static final int rename_game=0x7f030023; + public static final int smsinviter=0x7f030024; + public static final int smsinviter_item=0x7f030025; + public static final int studylist=0x7f030026; + public static final int toolbar=0x7f030027; } public static final class menu { public static final int board_menu=0x7f080000; diff --git a/xwords4/android/XWords4/res/layout/not_again_view.xml b/xwords4/android/XWords4/res/layout/not_again_view.xml new file mode 100644 index 000000000..b69a5d24f --- /dev/null +++ b/xwords4/android/XWords4/res/layout/not_again_view.xml @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java index fa0ceb7f1..2955f7bbd 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java @@ -498,27 +498,15 @@ public class DlgDelegate { private Dialog createNotAgainDialog( final DlgState state, DlgID dlgID ) { - OnClickListener lstnr_p = mkCallbackClickListener( state ); - - OnClickListener lstnr_n = - new OnClickListener() { - public void onClick( DialogInterface dlg, int item ) { - XWPrefs.setPrefsBoolean( m_activity, state.m_prefsKey, - true ); - if ( Action.SKIP_CALLBACK != state.m_action ) { - m_clickCallback. - dlgButtonClicked( state.m_action, - AlertDialog.BUTTON_POSITIVE, - state.m_params ); - } - } - }; + NotAgainView naView = (NotAgainView) + LocUtils.inflate( m_activity, R.layout.not_again_view ); + naView.setMessage( state.m_msg ); + OnClickListener lstnr_p = mkCallbackClickListener( state, naView ); AlertDialog.Builder builder = LocUtils.makeAlertBuilder( m_activity ) .setTitle( R.string.newbie_title ) - .setMessage( state.m_msg ) - .setPositiveButton( R.string.button_ok, lstnr_p ) - .setNegativeButton( R.string.button_notagain, lstnr_n ); + .setView( naView ) + .setPositiveButton( R.string.button_ok, lstnr_p ); // Adding third button doesn't work for some reason. Either this // feature goes away or the "do not show again" becomes a checkbox as @@ -535,6 +523,7 @@ public class DlgDelegate { }; builder.setNeutralButton( more.buttonStr, lstnr ); } + Dialog dialog = builder.create(); return setCallbackDismissListener( dialog, state, dlgID ); @@ -542,7 +531,7 @@ public class DlgDelegate { private Dialog createConfirmThenDialog( DlgState state, DlgID dlgID ) { - OnClickListener lstnr = mkCallbackClickListener( state ); + OnClickListener lstnr = mkCallbackClickListener( state, null ); AlertDialog.Builder builder = LocUtils.makeAlertBuilder( m_activity ); builder.setTitle( R.string.query_title ); @@ -619,11 +608,17 @@ public class DlgDelegate { return dialog; } - private OnClickListener mkCallbackClickListener( final DlgState state ) + private OnClickListener mkCallbackClickListener( final DlgState state, + final NotAgainView naView ) { OnClickListener cbkOnClickLstnr; cbkOnClickLstnr = new OnClickListener() { public void onClick( DialogInterface dlg, int button ) { + if ( null != naView && naView.getChecked() ) { + XWPrefs.setPrefsBoolean( m_activity, state.m_prefsKey, + true ); + } + if ( Action.SKIP_CALLBACK != state.m_action ) { m_clickCallback.dlgButtonClicked( state.m_action, button, diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NotAgainView.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NotAgainView.java new file mode 100644 index 000000000..792355cb7 --- /dev/null +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NotAgainView.java @@ -0,0 +1,45 @@ +/* -*- compile-command: "find-and-ant.sh debug install"; -*- */ +/* + * Copyright 2009 - 2012 by Eric House (xwords@eehouse.org). All + * rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package org.eehouse.android.xw4; + +import android.content.Context; +import android.util.AttributeSet; +import android.widget.CheckBox; +import android.widget.LinearLayout; +import android.widget.TextView; + +public class NotAgainView extends LinearLayout { + + public NotAgainView( Context cx, AttributeSet as ) { + super( cx, as ); + } + + public void setMessage( String msg ) + { + ((TextView)findViewById( R.id.msg )).setText( msg ); + } + + public boolean getChecked() + { + CheckBox cbx = (CheckBox)findViewById( R.id.not_again_check ); + return cbx.isChecked(); + } +}