add send button to right of chat entry field for devices that don't

have action bar.
This commit is contained in:
Eric House 2016-07-02 12:54:04 -07:00
parent 68df61daa8
commit f05375273c
3 changed files with 239 additions and 210 deletions

View file

@ -85,215 +85,216 @@ public final class R {
}
public static final class id {
public static final int about_xlator=0x7f0b0001;
public static final int add_player=0x7f0b0033;
public static final int advertise_new_room_check=0x7f0b003a;
public static final int blessed_label=0x7f0b005a;
public static final int board_menu_chat=0x7f0b00a3;
public static final int board_menu_dict=0x7f0b009f;
public static final int board_menu_done=0x7f0b0089;
public static final int board_menu_file_prefs=0x7f0b0096;
public static final int board_menu_flip=0x7f0b00a1;
public static final int board_menu_game_counts=0x7f0b008f;
public static final int board_menu_game_history=0x7f0b0091;
public static final int board_menu_game_invites=0x7f0b0098;
public static final int board_menu_game_left=0x7f0b0090;
public static final int board_menu_game_netstats=0x7f0b0097;
public static final int board_menu_game_resend=0x7f0b0093;
public static final int board_menu_game_resign=0x7f0b0092;
public static final int board_menu_hint_next=0x7f0b009d;
public static final int board_menu_hint_prev=0x7f0b009c;
public static final int board_menu_invite=0x7f0b0099;
public static final int board_menu_juggle=0x7f0b00a0;
public static final int board_menu_rematch=0x7f0b0088;
public static final int board_menu_toggle=0x7f0b00a4;
public static final int board_menu_trade=0x7f0b008a;
public static final int board_menu_trade_cancel=0x7f0b008b;
public static final int board_menu_trade_commit=0x7f0b008c;
public static final int board_menu_tray=0x7f0b008e;
public static final int board_menu_undo_current=0x7f0b009e;
public static final int board_menu_undo_last=0x7f0b008d;
public static final int board_menu_zoom=0x7f0b00a2;
public static final int add_player=0x7f0b0034;
public static final int advertise_new_room_check=0x7f0b003b;
public static final int blessed_label=0x7f0b005b;
public static final int board_menu_chat=0x7f0b00a4;
public static final int board_menu_dict=0x7f0b00a0;
public static final int board_menu_done=0x7f0b008a;
public static final int board_menu_file_prefs=0x7f0b0097;
public static final int board_menu_flip=0x7f0b00a2;
public static final int board_menu_game_counts=0x7f0b0090;
public static final int board_menu_game_history=0x7f0b0092;
public static final int board_menu_game_invites=0x7f0b0099;
public static final int board_menu_game_left=0x7f0b0091;
public static final int board_menu_game_netstats=0x7f0b0098;
public static final int board_menu_game_resend=0x7f0b0094;
public static final int board_menu_game_resign=0x7f0b0093;
public static final int board_menu_hint_next=0x7f0b009e;
public static final int board_menu_hint_prev=0x7f0b009d;
public static final int board_menu_invite=0x7f0b009a;
public static final int board_menu_juggle=0x7f0b00a1;
public static final int board_menu_rematch=0x7f0b0089;
public static final int board_menu_toggle=0x7f0b00a5;
public static final int board_menu_trade=0x7f0b008b;
public static final int board_menu_trade_cancel=0x7f0b008c;
public static final int board_menu_trade_commit=0x7f0b008d;
public static final int board_menu_tray=0x7f0b008f;
public static final int board_menu_undo_current=0x7f0b009f;
public static final int board_menu_undo_last=0x7f0b008e;
public static final int board_menu_zoom=0x7f0b00a3;
public static final int board_root=0x7f0b0002;
public static final int board_view=0x7f0b0003;
public static final int boardsize_spinner=0x7f0b0046;
public static final int button_add=0x7f0b0074;
public static final int boardsize_spinner=0x7f0b0047;
public static final int button_add=0x7f0b0075;
public static final int button_clear=0x7f0b000b;
public static final int button_done=0x7f0b0065;
public static final int button_done=0x7f0b0066;
public static final int button_invite=0x7f0b000c;
public static final int button_newgame_multi=0x7f0b0048;
public static final int button_newgame_solo=0x7f0b0047;
public static final int button_newgame_multi=0x7f0b0049;
public static final int button_newgame_solo=0x7f0b0048;
public static final int button_rescan=0x7f0b000a;
public static final int button_study=0x7f0b0064;
public static final int change_connection=0x7f0b003e;
public static final int chat_button=0x7f0b0083;
public static final int button_study=0x7f0b0065;
public static final int change_connection=0x7f0b003f;
public static final int chat_button=0x7f0b0084;
public static final int chat_edit=0x7f0b0011;
public static final int chat_history=0x7f0b0010;
public static final int chat_menu_clear=0x7f0b00a6;
public static final int chat_menu_send=0x7f0b00a5;
public static final int chat_row_name=0x7f0b0012;
public static final int chat_row_text=0x7f0b0013;
public static final int checkbox=0x7f0b0054;
public static final int color_display_sample=0x7f0b0014;
public static final int color_edit_sample=0x7f0b0015;
public static final int confirm_sms_reasons=0x7f0b001c;
public static final int conn_types=0x7f0b001d;
public static final int connect_set_relay=0x7f0b0036;
public static final int conns_label=0x7f0b0035;
public static final int default_check=0x7f0b001e;
public static final int del=0x7f0b0057;
public static final int desc=0x7f0b0021;
public static final int details=0x7f0b0075;
public static final int dict_label=0x7f0b006c;
public static final int dict_spinner=0x7f0b0030;
public static final int dictlist_button=0x7f0b0082;
public static final int dicts_delete=0x7f0b00a9;
public static final int dicts_deselect_all=0x7f0b00a8;
public static final int dicts_download=0x7f0b00a7;
public static final int dicts_move=0x7f0b00aa;
public static final int dicts_select=0x7f0b00ab;
public static final int divider=0x7f0b0026;
public static final int download_button=0x7f0b0076;
public static final int dwnld_message=0x7f0b0052;
public static final int edit=0x7f0b0066;
public static final int edit_blue=0x7f0b001b;
public static final int edit_green=0x7f0b0019;
public static final int edit_red=0x7f0b0017;
public static final int english_label=0x7f0b0058;
public static final int english_view=0x7f0b0059;
public static final int chat_menu_clear=0x7f0b00a7;
public static final int chat_menu_send=0x7f0b00a6;
public static final int chat_row_name=0x7f0b0013;
public static final int chat_row_text=0x7f0b0014;
public static final int chat_send=0x7f0b0012;
public static final int checkbox=0x7f0b0055;
public static final int color_display_sample=0x7f0b0015;
public static final int color_edit_sample=0x7f0b0016;
public static final int confirm_sms_reasons=0x7f0b001d;
public static final int conn_types=0x7f0b001e;
public static final int connect_set_relay=0x7f0b0037;
public static final int conns_label=0x7f0b0036;
public static final int default_check=0x7f0b001f;
public static final int del=0x7f0b0058;
public static final int desc=0x7f0b0022;
public static final int details=0x7f0b0076;
public static final int dict_label=0x7f0b006d;
public static final int dict_spinner=0x7f0b0031;
public static final int dictlist_button=0x7f0b0083;
public static final int dicts_delete=0x7f0b00aa;
public static final int dicts_deselect_all=0x7f0b00a9;
public static final int dicts_download=0x7f0b00a8;
public static final int dicts_move=0x7f0b00ab;
public static final int dicts_select=0x7f0b00ac;
public static final int divider=0x7f0b0027;
public static final int download_button=0x7f0b0077;
public static final int dwnld_message=0x7f0b0053;
public static final int edit=0x7f0b0067;
public static final int edit_blue=0x7f0b001c;
public static final int edit_green=0x7f0b001a;
public static final int edit_red=0x7f0b0018;
public static final int english_label=0x7f0b0059;
public static final int english_view=0x7f0b005a;
public static final int exchange_buttons=0x7f0b0004;
public static final int exchange_cancel=0x7f0b0006;
public static final int exchange_commit=0x7f0b0005;
public static final int expander=0x7f0b0028;
public static final int filters=0x7f0b005f;
public static final int flip_button=0x7f0b0085;
public static final int game_locked_check=0x7f0b002b;
public static final int game_name=0x7f0b0049;
public static final int gamel_menu_checkmoves=0x7f0b0095;
public static final int games_game_config=0x7f0b00ae;
public static final int games_game_copy=0x7f0b00b3;
public static final int games_game_delete=0x7f0b00ac;
public static final int games_game_deselect=0x7f0b00b5;
public static final int games_game_invites=0x7f0b00b6;
public static final int games_game_move=0x7f0b00af;
public static final int games_game_new_from=0x7f0b00b1;
public static final int games_game_rematch=0x7f0b00ad;
public static final int games_game_rename=0x7f0b00b2;
public static final int games_game_reset=0x7f0b00b0;
public static final int games_game_select=0x7f0b00b4;
public static final int games_group_default=0x7f0b00ba;
public static final int games_group_delete=0x7f0b00b9;
public static final int games_group_movedown=0x7f0b00b8;
public static final int games_group_moveup=0x7f0b00b7;
public static final int games_group_rename=0x7f0b00bb;
public static final int games_menu_about=0x7f0b00c3;
public static final int games_menu_checkmoves=0x7f0b00c5;
public static final int games_menu_checkupdates=0x7f0b00c6;
public static final int games_menu_dicts=0x7f0b00c1;
public static final int games_menu_email=0x7f0b00c2;
public static final int games_menu_loaddb=0x7f0b00c8;
public static final int games_menu_newgame_net=0x7f0b00bd;
public static final int games_menu_newgame_solo=0x7f0b00bc;
public static final int games_menu_newgroup=0x7f0b00be;
public static final int games_menu_prefs=0x7f0b00bf;
public static final int games_menu_rateme=0x7f0b00c0;
public static final int games_menu_resend=0x7f0b00c4;
public static final int games_menu_storedb=0x7f0b00c7;
public static final int games_menu_study=0x7f0b0094;
public static final int group_done=0x7f0b0087;
public static final int group_exchange=0x7f0b009a;
public static final int group_hint=0x7f0b009b;
public static final int hideable=0x7f0b004e;
public static final int hints_allowed=0x7f0b003f;
public static final int expander=0x7f0b0029;
public static final int filters=0x7f0b0060;
public static final int flip_button=0x7f0b0086;
public static final int game_locked_check=0x7f0b002c;
public static final int game_name=0x7f0b004a;
public static final int gamel_menu_checkmoves=0x7f0b0096;
public static final int games_game_config=0x7f0b00af;
public static final int games_game_copy=0x7f0b00b4;
public static final int games_game_delete=0x7f0b00ad;
public static final int games_game_deselect=0x7f0b00b6;
public static final int games_game_invites=0x7f0b00b7;
public static final int games_game_move=0x7f0b00b0;
public static final int games_game_new_from=0x7f0b00b2;
public static final int games_game_rematch=0x7f0b00ae;
public static final int games_game_rename=0x7f0b00b3;
public static final int games_game_reset=0x7f0b00b1;
public static final int games_game_select=0x7f0b00b5;
public static final int games_group_default=0x7f0b00bb;
public static final int games_group_delete=0x7f0b00ba;
public static final int games_group_movedown=0x7f0b00b9;
public static final int games_group_moveup=0x7f0b00b8;
public static final int games_group_rename=0x7f0b00bc;
public static final int games_menu_about=0x7f0b00c4;
public static final int games_menu_checkmoves=0x7f0b00c6;
public static final int games_menu_checkupdates=0x7f0b00c7;
public static final int games_menu_dicts=0x7f0b00c2;
public static final int games_menu_email=0x7f0b00c3;
public static final int games_menu_loaddb=0x7f0b00c9;
public static final int games_menu_newgame_net=0x7f0b00be;
public static final int games_menu_newgame_solo=0x7f0b00bd;
public static final int games_menu_newgroup=0x7f0b00bf;
public static final int games_menu_prefs=0x7f0b00c0;
public static final int games_menu_rateme=0x7f0b00c1;
public static final int games_menu_resend=0x7f0b00c5;
public static final int games_menu_storedb=0x7f0b00c8;
public static final int games_menu_study=0x7f0b0095;
public static final int group_done=0x7f0b0088;
public static final int group_exchange=0x7f0b009b;
public static final int group_hint=0x7f0b009c;
public static final int hideable=0x7f0b004f;
public static final int hints_allowed=0x7f0b0040;
public static final int invite_desc=0x7f0b0009;
public static final int inviter_check=0x7f0b000d;
public static final int item_name=0x7f0b0070;
public static final int item_score=0x7f0b0071;
public static final int join_public_room_check=0x7f0b0037;
public static final int juggle_players=0x7f0b0034;
public static final int label=0x7f0b0027;
public static final int lang_separator=0x7f0b002e;
public static final int lang_spinner=0x7f0b002f;
public static final int loc_item_check=0x7f0b00ca;
public static final int loc_item_clear=0x7f0b00c9;
public static final int loc_item_copy_bless=0x7f0b00cc;
public static final int loc_item_copy_eng=0x7f0b00cb;
public static final int loc_search_button=0x7f0b0061;
public static final int loc_search_field=0x7f0b0060;
public static final int local_label=0x7f0b005c;
public static final int local_player_set=0x7f0b006a;
public static final int main_container=0x7f0b002a;
public static final int manual_add_button=0x7f0b0078;
public static final int modtime=0x7f0b004f;
public static final int msg=0x7f0b0067;
public static final int msg_marker=0x7f0b004c;
public static final int name=0x7f0b0079;
public static final int name_edit=0x7f0b001f;
public static final int name_label=0x7f0b0077;
public static final int nexthint_button=0x7f0b007f;
public static final int not_again_check=0x7f0b0068;
public static final int item_name=0x7f0b0071;
public static final int item_score=0x7f0b0072;
public static final int join_public_room_check=0x7f0b0038;
public static final int juggle_players=0x7f0b0035;
public static final int label=0x7f0b0028;
public static final int lang_separator=0x7f0b002f;
public static final int lang_spinner=0x7f0b0030;
public static final int loc_item_check=0x7f0b00cb;
public static final int loc_item_clear=0x7f0b00ca;
public static final int loc_item_copy_bless=0x7f0b00cd;
public static final int loc_item_copy_eng=0x7f0b00cc;
public static final int loc_search_button=0x7f0b0062;
public static final int loc_search_field=0x7f0b0061;
public static final int local_label=0x7f0b005d;
public static final int local_player_set=0x7f0b006b;
public static final int main_container=0x7f0b002b;
public static final int manual_add_button=0x7f0b0079;
public static final int modtime=0x7f0b0050;
public static final int msg=0x7f0b0068;
public static final int msg_marker=0x7f0b004d;
public static final int name=0x7f0b007a;
public static final int name_edit=0x7f0b0020;
public static final int name_label=0x7f0b0078;
public static final int nexthint_button=0x7f0b0080;
public static final int not_again_check=0x7f0b0069;
public static final int nperdev_spinner=0x7f0b000e;
public static final int number=0x7f0b007a;
public static final int other_lang=0x7f0b0062;
public static final int password_edit=0x7f0b006f;
public static final int password_set=0x7f0b006e;
public static final int phonies_spinner=0x7f0b0044;
public static final int pick_faceup=0x7f0b0045;
public static final int pick_lang=0x7f0b007b;
public static final int pick_lang_spinner=0x7f0b007c;
public static final int play_button=0x7f0b002c;
public static final int player_list=0x7f0b0032;
public static final int player_name_edit=0x7f0b006b;
public static final int players=0x7f0b0029;
public static final int players_label=0x7f0b0031;
public static final int prevhint_button=0x7f0b007e;
public static final int private_rooms_set=0x7f0b0038;
public static final int progress_bar=0x7f0b0053;
public static final int public_rooms_set=0x7f0b003b;
public static final int refresh_button=0x7f0b003d;
public static final int remote_check=0x7f0b0069;
public static final int revert_all=0x7f0b0073;
public static final int revert_colors=0x7f0b0072;
public static final int robot_check=0x7f0b006d;
public static final int role=0x7f0b0051;
public static final int room_edit=0x7f0b0039;
public static final int room_spinner=0x7f0b003c;
public static final int screen=0x7f0b002d;
public static final int number=0x7f0b007b;
public static final int other_lang=0x7f0b0063;
public static final int password_edit=0x7f0b0070;
public static final int password_set=0x7f0b006f;
public static final int phonies_spinner=0x7f0b0045;
public static final int pick_faceup=0x7f0b0046;
public static final int pick_lang=0x7f0b007c;
public static final int pick_lang_spinner=0x7f0b007d;
public static final int play_button=0x7f0b002d;
public static final int player_list=0x7f0b0033;
public static final int player_name_edit=0x7f0b006c;
public static final int players=0x7f0b002a;
public static final int players_label=0x7f0b0032;
public static final int prevhint_button=0x7f0b007f;
public static final int private_rooms_set=0x7f0b0039;
public static final int progress_bar=0x7f0b0054;
public static final int public_rooms_set=0x7f0b003c;
public static final int refresh_button=0x7f0b003e;
public static final int remote_check=0x7f0b006a;
public static final int revert_all=0x7f0b0074;
public static final int revert_colors=0x7f0b0073;
public static final int robot_check=0x7f0b006e;
public static final int role=0x7f0b0052;
public static final int room_edit=0x7f0b003a;
public static final int room_spinner=0x7f0b003d;
public static final int screen=0x7f0b002e;
public static final int scroll=0x7f0b000f;
public static final int search_button=0x7f0b0023;
public static final int seek_blue=0x7f0b001a;
public static final int seek_green=0x7f0b0018;
public static final int seek_red=0x7f0b0016;
public static final int show_remote=0x7f0b0020;
public static final int shuffle_button=0x7f0b0080;
public static final int slmenu_clear_sel=0x7f0b00d1;
public static final int slmenu_copy_sel=0x7f0b00d0;
public static final int slmenu_deselect_all=0x7f0b00cf;
public static final int slmenu_lookup_sel=0x7f0b00cd;
public static final int slmenu_select_all=0x7f0b00ce;
public static final int smart_robot=0x7f0b0043;
public static final int state=0x7f0b0050;
public static final int summary=0x7f0b0063;
public static final int search_button=0x7f0b0024;
public static final int seek_blue=0x7f0b001b;
public static final int seek_green=0x7f0b0019;
public static final int seek_red=0x7f0b0017;
public static final int show_remote=0x7f0b0021;
public static final int shuffle_button=0x7f0b0081;
public static final int slmenu_clear_sel=0x7f0b00d2;
public static final int slmenu_copy_sel=0x7f0b00d1;
public static final int slmenu_deselect_all=0x7f0b00d0;
public static final int slmenu_lookup_sel=0x7f0b00ce;
public static final int slmenu_select_all=0x7f0b00cf;
public static final int smart_robot=0x7f0b0044;
public static final int state=0x7f0b0051;
public static final int summary=0x7f0b0064;
public static final int tbar_parent_hor=0x7f0b0007;
public static final int tbar_parent_vert=0x7f0b0008;
public static final int text_item=0x7f0b0055;
public static final int text_item2=0x7f0b0056;
public static final int thumbnail=0x7f0b004d;
public static final int timer_minutes_edit=0x7f0b0042;
public static final int timer_set=0x7f0b0041;
public static final int toolbar=0x7f0b007d;
public static final int undo_button=0x7f0b0081;
public static final int use_timer=0x7f0b0040;
public static final int values_button=0x7f0b0084;
public static final int text_item=0x7f0b0056;
public static final int text_item2=0x7f0b0057;
public static final int thumbnail=0x7f0b004e;
public static final int timer_minutes_edit=0x7f0b0043;
public static final int timer_set=0x7f0b0042;
public static final int toolbar=0x7f0b007e;
public static final int undo_button=0x7f0b0082;
public static final int use_timer=0x7f0b0041;
public static final int values_button=0x7f0b0085;
public static final int version_string=0x7f0b0000;
public static final int view_loaded=0x7f0b004b;
public static final int view_unloaded=0x7f0b004a;
public static final int word_edit=0x7f0b0022;
public static final int wordlen_max=0x7f0b0025;
public static final int wordlen_min=0x7f0b0024;
public static final int xlated_view=0x7f0b005e;
public static final int xlated_view_blessed=0x7f0b005b;
public static final int xlated_view_local=0x7f0b005d;
public static final int zoom_button=0x7f0b0086;
public static final int view_loaded=0x7f0b004c;
public static final int view_unloaded=0x7f0b004b;
public static final int word_edit=0x7f0b0023;
public static final int wordlen_max=0x7f0b0026;
public static final int wordlen_min=0x7f0b0025;
public static final int xlated_view=0x7f0b005f;
public static final int xlated_view_blessed=0x7f0b005c;
public static final int xlated_view_local=0x7f0b005e;
public static final int zoom_button=0x7f0b0087;
}
public static final class layout {
public static final int about_dlg=0x7f030000;

View file

@ -21,14 +21,26 @@
</ScrollView>
<EditText android:id="@+id/chat_edit"
android:layout_width="fill_parent"
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<EditText android:id="@+id/chat_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="false"
android:inputType="textCapSentences|textMultiLine"
android:layout_weight="1"
android:scrollHorizontally="false"
android:hint="@string/chat_hint"
/>
<Button android:id="@+id/chat_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="false"
android:inputType="textCapSentences|textMultiLine"
android:layout_weight="0"
android:scrollHorizontally="false"
android:hint="@string/chat_hint"
android:text="@string/chat_send"
android:layout_gravity="center_vertical"
/>
</LinearLayout>
</LinearLayout>

View file

@ -30,6 +30,7 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View.OnLayoutChangeListener;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ScrollView;
import android.widget.TableLayout;
@ -98,6 +99,17 @@ public class ChatDelegate extends DelegateBase {
}
});
}
Button sendButton = (Button)findViewById( R.id.chat_send );
if ( ABUtils.haveActionBar() ) {
sendButton.setVisibility( View.GONE );
} else {
sendButton.setOnClickListener( new View.OnClickListener() {
public void onClick( View view ) {
handleSend();
}
} );
}
DBUtils.HistoryPair[] pairs
= DBUtils.getChatHistory( m_activity, m_rowid, locals );
@ -165,6 +177,20 @@ public class ChatDelegate extends DelegateBase {
});
}
private void handleSend() {
String text = m_edit.getText().toString();
if ( null == text || text.length() == 0 ) {
setResult( Activity.RESULT_CANCELED );
finish();
} else {
DBUtils.appendChatHistory( m_activity, m_rowid, text, m_curPlayer );
addRow( text, m_curPlayer );
m_edit.setText( null );
m_jniThreadRef.sendChat( text );
}
}
@Override
public boolean onPrepareOptionsMenu( Menu menu )
{
@ -185,17 +211,7 @@ public class ChatDelegate extends DelegateBase {
}
break;
case R.id.chat_menu_send:
String text = m_edit.getText().toString();
if ( null == text || text.length() == 0 ) {
setResult( Activity.RESULT_CANCELED );
finish();
} else {
DBUtils.appendChatHistory( m_activity, m_rowid, text, m_curPlayer );
addRow( text, m_curPlayer );
m_edit.setText( null );
m_jniThreadRef.sendChat( text );
}
handleSend();
break;
default:
handled = false;