add back vertical version of toolbar so board can be bigger in

landscape mode
This commit is contained in:
Eric House 2014-07-22 08:11:15 -07:00
parent e4c3e9fe13
commit 9c1b4454eb
4 changed files with 417 additions and 322 deletions

View file

@ -78,214 +78,224 @@ public final class R {
}
public static final class id {
public static final int about_xlator=0x7f0a0001;
public static final int add_player=0x7f0a0032;
public static final int advertise_new_room_check=0x7f0a0038;
public static final int blessed_label=0x7f0a0058;
public static final int board_menu_chat=0x7f0a00a8;
public static final int board_menu_dict=0x7f0a00a4;
public static final int board_menu_done=0x7f0a008f;
public static final int board_menu_file_about=0x7f0a009d;
public static final int board_menu_file_prefs=0x7f0a009c;
public static final int board_menu_flip=0x7f0a00a6;
public static final int board_menu_game_counts=0x7f0a0095;
public static final int board_menu_game_history=0x7f0a0097;
public static final int board_menu_game_left=0x7f0a0096;
public static final int board_menu_game_netstats=0x7f0a009e;
public static final int board_menu_game_resend=0x7f0a0099;
public static final int board_menu_game_resign=0x7f0a0098;
public static final int board_menu_hint_next=0x7f0a00a2;
public static final int board_menu_hint_prev=0x7f0a00a1;
public static final int board_menu_invite=0x7f0a008e;
public static final int board_menu_juggle=0x7f0a00a5;
public static final int board_menu_toggle=0x7f0a00a9;
public static final int board_menu_trade=0x7f0a0090;
public static final int board_menu_trade_cancel=0x7f0a0091;
public static final int board_menu_trade_commit=0x7f0a0092;
public static final int board_menu_tray=0x7f0a0094;
public static final int board_menu_undo_current=0x7f0a00a3;
public static final int board_menu_undo_last=0x7f0a0093;
public static final int board_menu_zoom=0x7f0a00a7;
public static final int add_player=0x7f0a003c;
public static final int advertise_new_room_check=0x7f0a0042;
public static final int blessed_label=0x7f0a0062;
public static final int board_menu_chat=0x7f0a00b2;
public static final int board_menu_dict=0x7f0a00ae;
public static final int board_menu_done=0x7f0a0099;
public static final int board_menu_file_about=0x7f0a00a7;
public static final int board_menu_file_prefs=0x7f0a00a6;
public static final int board_menu_flip=0x7f0a00b0;
public static final int board_menu_game_counts=0x7f0a009f;
public static final int board_menu_game_history=0x7f0a00a1;
public static final int board_menu_game_left=0x7f0a00a0;
public static final int board_menu_game_netstats=0x7f0a00a8;
public static final int board_menu_game_resend=0x7f0a00a3;
public static final int board_menu_game_resign=0x7f0a00a2;
public static final int board_menu_hint_next=0x7f0a00ac;
public static final int board_menu_hint_prev=0x7f0a00ab;
public static final int board_menu_invite=0x7f0a0098;
public static final int board_menu_juggle=0x7f0a00af;
public static final int board_menu_toggle=0x7f0a00b3;
public static final int board_menu_trade=0x7f0a009a;
public static final int board_menu_trade_cancel=0x7f0a009b;
public static final int board_menu_trade_commit=0x7f0a009c;
public static final int board_menu_tray=0x7f0a009e;
public static final int board_menu_undo_current=0x7f0a00ad;
public static final int board_menu_undo_last=0x7f0a009d;
public static final int board_menu_zoom=0x7f0a00b1;
public static final int board_root=0x7f0a0002;
public static final int board_view=0x7f0a0003;
public static final int boardsize_spinner=0x7f0a0045;
public static final int bt_disabled=0x7f0a0070;
public static final int bt_separator=0x7f0a006f;
public static final int bt_stuff=0x7f0a0072;
public static final int button_add=0x7f0a0087;
public static final int button_clear=0x7f0a0013;
public static final int button_done=0x7f0a0063;
public static final int button_invite=0x7f0a0014;
public static final int button_rescan=0x7f0a0012;
public static final int button_study=0x7f0a0062;
public static final int boardsize_spinner=0x7f0a004f;
public static final int bt_disabled=0x7f0a007a;
public static final int bt_separator=0x7f0a0079;
public static final int bt_stuff=0x7f0a007c;
public static final int button_add=0x7f0a0091;
public static final int button_clear=0x7f0a001d;
public static final int button_done=0x7f0a006d;
public static final int button_invite=0x7f0a001e;
public static final int button_rescan=0x7f0a001c;
public static final int button_study=0x7f0a006c;
public static final int chat_button_horizontal=0x7f0a000d;
public static final int chat_edit=0x7f0a0016;
public static final int chat_history=0x7f0a0015;
public static final int chat_menu_clear=0x7f0a00aa;
public static final int checkbox=0x7f0a0052;
public static final int color_display_sample=0x7f0a0018;
public static final int color_edit_sample=0x7f0a0019;
public static final int config_button=0x7f0a0083;
public static final int confirm_sms_reasons=0x7f0a0020;
public static final int connect_set_relay=0x7f0a0034;
public static final int connect_set_sms=0x7f0a003c;
public static final int del=0x7f0a0055;
public static final int desc=0x7f0a0023;
public static final int details=0x7f0a0084;
public static final int dict_label=0x7f0a0079;
public static final int dict_spinner=0x7f0a002f;
public static final int chat_button_vertical=0x7f0a0017;
public static final int chat_edit=0x7f0a0020;
public static final int chat_history=0x7f0a001f;
public static final int chat_menu_clear=0x7f0a00b4;
public static final int checkbox=0x7f0a005c;
public static final int color_display_sample=0x7f0a0022;
public static final int color_edit_sample=0x7f0a0023;
public static final int config_button=0x7f0a008d;
public static final int confirm_sms_reasons=0x7f0a002a;
public static final int connect_set_relay=0x7f0a003e;
public static final int connect_set_sms=0x7f0a0046;
public static final int del=0x7f0a005f;
public static final int desc=0x7f0a002d;
public static final int details=0x7f0a008e;
public static final int dict_label=0x7f0a0083;
public static final int dict_spinner=0x7f0a0039;
public static final int dictlist_button_horizontal=0x7f0a000c;
public static final int dicts_delete=0x7f0a00ad;
public static final int dicts_deselect_all=0x7f0a00ac;
public static final int dicts_download=0x7f0a00ab;
public static final int dicts_move=0x7f0a00ae;
public static final int dicts_select=0x7f0a00af;
public static final int divider=0x7f0a0028;
public static final int download_button=0x7f0a0085;
public static final int dwnld_message=0x7f0a0050;
public static final int edit=0x7f0a0075;
public static final int edit_blue=0x7f0a001f;
public static final int edit_green=0x7f0a001d;
public static final int edit_red=0x7f0a001b;
public static final int english_label=0x7f0a0056;
public static final int english_view=0x7f0a0057;
public static final int dictlist_button_vertical=0x7f0a0016;
public static final int dicts_delete=0x7f0a00b7;
public static final int dicts_deselect_all=0x7f0a00b6;
public static final int dicts_download=0x7f0a00b5;
public static final int dicts_move=0x7f0a00b8;
public static final int dicts_select=0x7f0a00b9;
public static final int divider=0x7f0a0032;
public static final int download_button=0x7f0a008f;
public static final int dwnld_message=0x7f0a005a;
public static final int edit=0x7f0a007f;
public static final int edit_blue=0x7f0a0029;
public static final int edit_green=0x7f0a0027;
public static final int edit_red=0x7f0a0025;
public static final int english_label=0x7f0a0060;
public static final int english_view=0x7f0a0061;
public static final int exchange_buttons=0x7f0a0004;
public static final int exchange_cancel=0x7f0a0006;
public static final int exchange_commit=0x7f0a0005;
public static final int expander=0x7f0a0047;
public static final int explain=0x7f0a0081;
public static final int filters=0x7f0a005d;
public static final int expander=0x7f0a0051;
public static final int explain=0x7f0a008b;
public static final int filters=0x7f0a0067;
public static final int flip_button_horizontal=0x7f0a000f;
public static final int game_locked_check=0x7f0a002a;
public static final int game_name=0x7f0a0046;
public static final int gamel_menu_checkmoves=0x7f0a009b;
public static final int games_game_config=0x7f0a00ba;
public static final int games_game_copy=0x7f0a00bf;
public static final int games_game_delete=0x7f0a00b9;
public static final int games_game_move=0x7f0a00bb;
public static final int games_game_new_from=0x7f0a00bd;
public static final int games_game_rename=0x7f0a00be;
public static final int games_game_reset=0x7f0a00bc;
public static final int games_group_default=0x7f0a00c3;
public static final int games_group_delete=0x7f0a00c2;
public static final int games_group_movedown=0x7f0a00c1;
public static final int games_group_moveup=0x7f0a00c0;
public static final int games_group_rename=0x7f0a00c4;
public static final int games_menu_about=0x7f0a00b6;
public static final int games_menu_checkmoves=0x7f0a00b8;
public static final int games_menu_checkupdates=0x7f0a00c5;
public static final int games_menu_dicts=0x7f0a00b4;
public static final int games_menu_email=0x7f0a00b5;
public static final int games_menu_loaddb=0x7f0a00c7;
public static final int games_menu_newgame=0x7f0a00b0;
public static final int games_menu_newgroup=0x7f0a00b1;
public static final int games_menu_prefs=0x7f0a00b2;
public static final int games_menu_rateme=0x7f0a00b3;
public static final int games_menu_resend=0x7f0a00b7;
public static final int games_menu_storedb=0x7f0a00c6;
public static final int games_menu_study=0x7f0a009a;
public static final int group_done=0x7f0a008d;
public static final int group_exchange=0x7f0a009f;
public static final int group_hint=0x7f0a00a0;
public static final int hideable=0x7f0a004c;
public static final int hints_allowed=0x7f0a003e;
public static final int invite_desc=0x7f0a0011;
public static final int item_name=0x7f0a007d;
public static final int item_score=0x7f0a007e;
public static final int join_public_room_check=0x7f0a0035;
public static final int juggle_players=0x7f0a0033;
public static final int lang_separator=0x7f0a002d;
public static final int lang_spinner=0x7f0a002e;
public static final int loc_item_check=0x7f0a00c9;
public static final int loc_item_clear=0x7f0a00c8;
public static final int loc_item_copy_bless=0x7f0a00cb;
public static final int loc_item_copy_eng=0x7f0a00ca;
public static final int loc_search_button=0x7f0a005f;
public static final int loc_search_field=0x7f0a005e;
public static final int local_label=0x7f0a005a;
public static final int local_name_edit=0x7f0a0082;
public static final int local_player_set=0x7f0a0077;
public static final int manual_add_button=0x7f0a0088;
public static final int modtime=0x7f0a004d;
public static final int msg_marker=0x7f0a004a;
public static final int name=0x7f0a0089;
public static final int name_edit=0x7f0a0021;
public static final int name_label=0x7f0a0086;
public static final int newgame_bt_config=0x7f0a0074;
public static final int newgame_enable_bt=0x7f0a0071;
public static final int newgame_enable_sms=0x7f0a006b;
public static final int newgame_invite_bt=0x7f0a0073;
public static final int newgame_invite_net=0x7f0a0067;
public static final int newgame_invite_sms=0x7f0a006d;
public static final int newgame_local=0x7f0a0065;
public static final int newgame_local_config=0x7f0a0066;
public static final int newgame_local_desc=0x7f0a0064;
public static final int newgame_net_config=0x7f0a0068;
public static final int newgame_sms_config=0x7f0a006e;
public static final int flip_button_vertical=0x7f0a0019;
public static final int game_locked_check=0x7f0a0034;
public static final int game_name=0x7f0a0050;
public static final int gamel_menu_checkmoves=0x7f0a00a5;
public static final int games_game_config=0x7f0a00c4;
public static final int games_game_copy=0x7f0a00c9;
public static final int games_game_delete=0x7f0a00c3;
public static final int games_game_move=0x7f0a00c5;
public static final int games_game_new_from=0x7f0a00c7;
public static final int games_game_rename=0x7f0a00c8;
public static final int games_game_reset=0x7f0a00c6;
public static final int games_group_default=0x7f0a00cd;
public static final int games_group_delete=0x7f0a00cc;
public static final int games_group_movedown=0x7f0a00cb;
public static final int games_group_moveup=0x7f0a00ca;
public static final int games_group_rename=0x7f0a00ce;
public static final int games_menu_about=0x7f0a00c0;
public static final int games_menu_checkmoves=0x7f0a00c2;
public static final int games_menu_checkupdates=0x7f0a00cf;
public static final int games_menu_dicts=0x7f0a00be;
public static final int games_menu_email=0x7f0a00bf;
public static final int games_menu_loaddb=0x7f0a00d1;
public static final int games_menu_newgame=0x7f0a00ba;
public static final int games_menu_newgroup=0x7f0a00bb;
public static final int games_menu_prefs=0x7f0a00bc;
public static final int games_menu_rateme=0x7f0a00bd;
public static final int games_menu_resend=0x7f0a00c1;
public static final int games_menu_storedb=0x7f0a00d0;
public static final int games_menu_study=0x7f0a00a4;
public static final int group_done=0x7f0a0097;
public static final int group_exchange=0x7f0a00a9;
public static final int group_hint=0x7f0a00aa;
public static final int hideable=0x7f0a0056;
public static final int hints_allowed=0x7f0a0048;
public static final int invite_desc=0x7f0a001b;
public static final int item_name=0x7f0a0087;
public static final int item_score=0x7f0a0088;
public static final int join_public_room_check=0x7f0a003f;
public static final int juggle_players=0x7f0a003d;
public static final int lang_separator=0x7f0a0037;
public static final int lang_spinner=0x7f0a0038;
public static final int loc_item_check=0x7f0a00d3;
public static final int loc_item_clear=0x7f0a00d2;
public static final int loc_item_copy_bless=0x7f0a00d5;
public static final int loc_item_copy_eng=0x7f0a00d4;
public static final int loc_search_button=0x7f0a0069;
public static final int loc_search_field=0x7f0a0068;
public static final int local_label=0x7f0a0064;
public static final int local_name_edit=0x7f0a008c;
public static final int local_player_set=0x7f0a0081;
public static final int manual_add_button=0x7f0a0092;
public static final int modtime=0x7f0a0057;
public static final int msg_marker=0x7f0a0054;
public static final int name=0x7f0a0093;
public static final int name_edit=0x7f0a002b;
public static final int name_label=0x7f0a0090;
public static final int newgame_bt_config=0x7f0a007e;
public static final int newgame_enable_bt=0x7f0a007b;
public static final int newgame_enable_sms=0x7f0a0075;
public static final int newgame_invite_bt=0x7f0a007d;
public static final int newgame_invite_net=0x7f0a0071;
public static final int newgame_invite_sms=0x7f0a0077;
public static final int newgame_local=0x7f0a006f;
public static final int newgame_local_config=0x7f0a0070;
public static final int newgame_local_desc=0x7f0a006e;
public static final int newgame_net_config=0x7f0a0072;
public static final int newgame_sms_config=0x7f0a0078;
public static final int nexthint_button_horizontal=0x7f0a0009;
public static final int number=0x7f0a008a;
public static final int other_lang=0x7f0a0060;
public static final int password_edit=0x7f0a007c;
public static final int password_set=0x7f0a007b;
public static final int phonies_spinner=0x7f0a0043;
public static final int pick_faceup=0x7f0a0044;
public static final int pick_lang=0x7f0a008b;
public static final int pick_lang_spinner=0x7f0a008c;
public static final int play_button=0x7f0a002b;
public static final int player_list=0x7f0a0031;
public static final int player_name_edit=0x7f0a0078;
public static final int players=0x7f0a0029;
public static final int players_label=0x7f0a0030;
public static final int nexthint_button_vertical=0x7f0a0013;
public static final int number=0x7f0a0094;
public static final int other_lang=0x7f0a006a;
public static final int password_edit=0x7f0a0086;
public static final int password_set=0x7f0a0085;
public static final int phonies_spinner=0x7f0a004d;
public static final int pick_faceup=0x7f0a004e;
public static final int pick_lang=0x7f0a0095;
public static final int pick_lang_spinner=0x7f0a0096;
public static final int play_button=0x7f0a0035;
public static final int player_list=0x7f0a003b;
public static final int player_name_edit=0x7f0a0082;
public static final int players=0x7f0a0033;
public static final int players_label=0x7f0a003a;
public static final int prevhint_button_horizontal=0x7f0a0008;
public static final int private_rooms_set=0x7f0a0036;
public static final int progress_bar=0x7f0a0051;
public static final int public_rooms_set=0x7f0a0039;
public static final int refresh_button=0x7f0a003b;
public static final int remote_check=0x7f0a0076;
public static final int revert_all=0x7f0a0080;
public static final int revert_colors=0x7f0a007f;
public static final int robot_check=0x7f0a007a;
public static final int role=0x7f0a004f;
public static final int room_edit=0x7f0a0037;
public static final int room_spinner=0x7f0a003a;
public static final int screen=0x7f0a002c;
public static final int search_button=0x7f0a0025;
public static final int seek_blue=0x7f0a001e;
public static final int seek_green=0x7f0a001c;
public static final int seek_red=0x7f0a001a;
public static final int send_button=0x7f0a0017;
public static final int show_remote=0x7f0a0022;
public static final int prevhint_button_vertical=0x7f0a0012;
public static final int private_rooms_set=0x7f0a0040;
public static final int progress_bar=0x7f0a005b;
public static final int public_rooms_set=0x7f0a0043;
public static final int refresh_button=0x7f0a0045;
public static final int remote_check=0x7f0a0080;
public static final int revert_all=0x7f0a008a;
public static final int revert_colors=0x7f0a0089;
public static final int robot_check=0x7f0a0084;
public static final int role=0x7f0a0059;
public static final int room_edit=0x7f0a0041;
public static final int room_spinner=0x7f0a0044;
public static final int screen=0x7f0a0036;
public static final int search_button=0x7f0a002f;
public static final int seek_blue=0x7f0a0028;
public static final int seek_green=0x7f0a0026;
public static final int seek_red=0x7f0a0024;
public static final int send_button=0x7f0a0021;
public static final int show_remote=0x7f0a002c;
public static final int shuffle_button_horizontal=0x7f0a000a;
public static final int slmenu_clear_sel=0x7f0a00d0;
public static final int slmenu_copy_sel=0x7f0a00cf;
public static final int slmenu_deselect_all=0x7f0a00ce;
public static final int slmenu_lookup_sel=0x7f0a00cc;
public static final int slmenu_select_all=0x7f0a00cd;
public static final int smart_robot=0x7f0a0042;
public static final int sms_disabled=0x7f0a006a;
public static final int sms_phones=0x7f0a003d;
public static final int sms_separator=0x7f0a0069;
public static final int sms_stuff=0x7f0a006c;
public static final int state=0x7f0a004e;
public static final int summary=0x7f0a0061;
public static final int text_item=0x7f0a0053;
public static final int text_item2=0x7f0a0054;
public static final int thumbnail=0x7f0a004b;
public static final int timer_minutes_edit=0x7f0a0041;
public static final int timer_set=0x7f0a0040;
public static final int shuffle_button_vertical=0x7f0a0014;
public static final int slmenu_clear_sel=0x7f0a00da;
public static final int slmenu_copy_sel=0x7f0a00d9;
public static final int slmenu_deselect_all=0x7f0a00d8;
public static final int slmenu_lookup_sel=0x7f0a00d6;
public static final int slmenu_select_all=0x7f0a00d7;
public static final int smart_robot=0x7f0a004c;
public static final int sms_disabled=0x7f0a0074;
public static final int sms_phones=0x7f0a0047;
public static final int sms_separator=0x7f0a0073;
public static final int sms_stuff=0x7f0a0076;
public static final int state=0x7f0a0058;
public static final int summary=0x7f0a006b;
public static final int text_item=0x7f0a005d;
public static final int text_item2=0x7f0a005e;
public static final int thumbnail=0x7f0a0055;
public static final int timer_minutes_edit=0x7f0a004b;
public static final int timer_set=0x7f0a004a;
public static final int toolbar_horizontal=0x7f0a0007;
public static final int toolbar_vertical=0x7f0a0011;
public static final int undo_button_horizontal=0x7f0a000b;
public static final int use_timer=0x7f0a003f;
public static final int undo_button_vertical=0x7f0a0015;
public static final int use_timer=0x7f0a0049;
public static final int values_button_horizontal=0x7f0a000e;
public static final int values_button_vertical=0x7f0a0018;
public static final int version_string=0x7f0a0000;
public static final int view_loaded=0x7f0a0049;
public static final int view_unloaded=0x7f0a0048;
public static final int word_edit=0x7f0a0024;
public static final int wordlen_max=0x7f0a0027;
public static final int wordlen_min=0x7f0a0026;
public static final int xlated_view=0x7f0a005c;
public static final int xlated_view_blessed=0x7f0a0059;
public static final int xlated_view_local=0x7f0a005b;
public static final int view_loaded=0x7f0a0053;
public static final int view_unloaded=0x7f0a0052;
public static final int word_edit=0x7f0a002e;
public static final int wordlen_max=0x7f0a0031;
public static final int wordlen_min=0x7f0a0030;
public static final int xlated_view=0x7f0a0066;
public static final int xlated_view_blessed=0x7f0a0063;
public static final int xlated_view_local=0x7f0a0065;
public static final int zoom_button_horizontal=0x7f0a0010;
public static final int zoom_button_vertical=0x7f0a001a;
}
public static final class layout {
public static final int about_dlg=0x7f030000;

View file

@ -2,88 +2,142 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/board_root"
android:orientation="vertical"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
>
<org.eehouse.android.xw4.BoardView
android:id="@+id/board_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:focusable="true"
android:clickable="true"
android:longClickable="true"
android:drawSelectorOnTop="false"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
/>
<LinearLayout android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"
>
<org.eehouse.android.xw4.BoardView
android:id="@+id/board_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:focusable="true"
android:clickable="true"
android:longClickable="true"
android:drawSelectorOnTop="false"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
/>
<LinearLayout android:id="@+id/exchange_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="gone"
>
<Button android:id="@+id/exchange_commit"
android:text="@string/button_trade_commit"
style="@style/evenly_spaced_horizontal"
/>
<Button android:id="@+id/exchange_cancel"
android:text="@string/button_trade_cancel"
style="@style/evenly_spaced_horizontal"
/>
</LinearLayout>
<HorizontalScrollView android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
>
<LinearLayout android:id="@+id/toolbar_horizontal"
<LinearLayout android:id="@+id/exchange_buttons"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:visibility="gone"
>
<Button android:id="@+id/exchange_commit"
android:text="@string/button_trade_commit"
style="@style/evenly_spaced_horizontal"
/>
<Button android:id="@+id/exchange_cancel"
android:text="@string/button_trade_cancel"
style="@style/evenly_spaced_horizontal"
/>
</LinearLayout>
<ImageButton android:id="@+id/prevhint_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/prev_hint"
/>
<ImageButton android:id="@+id/nexthint_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/next_hint"
/>
<ImageButton android:id="@+id/shuffle_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/shuffle"
/>
<ImageButton android:id="@+id/undo_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/undo"
/>
<ImageButton android:id="@+id/dictlist_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/dicticon"
/>
<ImageButton android:id="@+id/chat_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/stat_notify_chat"
/>
<ImageButton android:id="@+id/values_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/values"
/>
<ImageButton android:id="@+id/flip_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/flip"
/>
<ImageButton android:id="@+id/zoom_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/zoom"
/>
</LinearLayout>
</HorizontalScrollView>
<HorizontalScrollView android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
>
<LinearLayout android:id="@+id/toolbar_horizontal"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="48dp"
>
<ImageButton android:id="@+id/prevhint_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/prev_hint"
/>
<ImageButton android:id="@+id/nexthint_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/next_hint"
/>
<ImageButton android:id="@+id/shuffle_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/shuffle"
/>
<ImageButton android:id="@+id/undo_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/undo"
/>
<ImageButton android:id="@+id/dictlist_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/dicticon"
/>
<ImageButton android:id="@+id/chat_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/stat_notify_chat"
/>
<ImageButton android:id="@+id/values_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/values"
/>
<ImageButton android:id="@+id/flip_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/flip"
/>
<ImageButton android:id="@+id/zoom_button_horizontal"
style="@style/toolbar_button"
android:src="@drawable/zoom"
/>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
<ScrollView android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
>
<LinearLayout android:id="@+id/toolbar_vertical"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent"
>
<ImageButton android:id="@+id/prevhint_button_vertical"
style="@style/toolbar_button"
android:src="@drawable/prev_hint"
/>
<ImageButton android:id="@+id/nexthint_button_vertical"
style="@style/toolbar_button"
android:src="@drawable/next_hint"
/>
<ImageButton android:id="@+id/shuffle_button_vertical"
style="@style/toolbar_button"
android:src="@drawable/shuffle"
/>
<ImageButton android:id="@+id/undo_button_vertical"
style="@style/toolbar_button"
android:src="@drawable/undo"
/>
<ImageButton android:id="@+id/dictlist_button_vertical"
style="@style/toolbar_button"
android:src="@drawable/dicticon"
/>
<ImageButton android:id="@+id/chat_button_vertical"
style="@style/toolbar_button"
android:src="@drawable/stat_notify_chat"
/>
<ImageButton android:id="@+id/values_button_vertical"
style="@style/toolbar_button"
android:src="@drawable/values"
/>
<ImageButton android:id="@+id/flip_button_vertical"
style="@style/toolbar_button"
android:src="@drawable/flip"
/>
<ImageButton android:id="@+id/zoom_button_vertical"
style="@style/toolbar_button"
android:src="@drawable/zoom"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>

View file

@ -23,16 +23,13 @@ package org.eehouse.android.xw4;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface.OnDismissListener;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.Handler;
@ -46,10 +43,8 @@ import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.HashSet;
@ -1859,7 +1854,11 @@ public class BoardDelegate extends DelegateBase
if ( !CommonPrefs.getHideTitleBar( m_activity ) ) {
setTitle( GameUtils.getName( m_activity, m_rowid ) );
}
m_toolbar = new Toolbar( m_activity, this, R.id.toolbar_horizontal );
int orient = m_activity.getResources().getConfiguration().orientation;
boolean isLandscape = Configuration.ORIENTATION_LANDSCAPE == orient;
m_toolbar = new Toolbar( m_activity, this );
m_toolbar.setIsLandscape( isLandscape );
populateToolbar();
adjustTradeVisibility();
@ -2150,7 +2149,7 @@ public class BoardDelegate extends DelegateBase
private void adjustTradeVisibility()
{
m_toolbar.setVisibility( m_inTrade? View.GONE : View.VISIBLE );
m_toolbar.setVisible( !m_inTrade );
if ( null != m_tradeButtons ) {
m_tradeButtons.setVisibility( m_inTrade? View.VISIBLE : View.GONE );
}

View file

@ -1,7 +1,7 @@
/* -*- compile-command: "find-and-ant.sh debug install"; -*- */
/*
* Copyright 2009-2010 by Eric House (xwords@eehouse.org). All
* rights reserved.
* Copyright 2009-2014 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
@ -28,19 +28,13 @@ import android.view.View;
import android.widget.LinearLayout;
import android.widget.ImageButton;
import junit.framework.Assert;
import org.eehouse.android.xw4.DlgDelegate.Action;
import org.eehouse.android.xw4.DlgDelegate.HasDlgDelegate;
import org.eehouse.android.xw4.jni.*;
public class Toolbar {
private static class TBButtonInfo {
public TBButtonInfo( int id/*, int idVert*/ ) {
m_id = id;
}
public int m_id;
}
public static final int BUTTON_BROWSE_DICT = 0;
public static final int BUTTON_HINT_PREV = 1;
public static final int BUTTON_HINT_NEXT = 2;
@ -51,30 +45,32 @@ public class Toolbar {
public static final int BUTTON_CHAT = 7;
public static final int BUTTON_VALUES = 8;
private static TBButtonInfo[] s_buttonInfo = {
private static int[][] s_buttonInfo = {
// BUTTON_BROWSE_DICT
new TBButtonInfo(R.id.dictlist_button_horizontal ),
{ R.id.dictlist_button_horizontal, R.id.dictlist_button_vertical },
// BUTTON_HINT_PREV
new TBButtonInfo(R.id.prevhint_button_horizontal ),
{ R.id.prevhint_button_horizontal, R.id.prevhint_button_vertical },
// BUTTON_HINT_NEXT
new TBButtonInfo(R.id.nexthint_button_horizontal ),
{ R.id.nexthint_button_horizontal, R.id.nexthint_button_vertical },
// BUTTON_FLIP
new TBButtonInfo(R.id.flip_button_horizontal ),
{ R.id.flip_button_horizontal, R.id.flip_button_vertical },
// BUTTON_JUGGLE
new TBButtonInfo( R.id.shuffle_button_horizontal ),
{ R.id.shuffle_button_horizontal, R.id.shuffle_button_vertical },
// BUTTON_ZOOM
new TBButtonInfo( R.id.zoom_button_horizontal ),
{ R.id.zoom_button_horizontal, R.id.zoom_button_vertical },
// BUTTON_UNDO
new TBButtonInfo( R.id.undo_button_horizontal ),
{ R.id.undo_button_horizontal, R.id.undo_button_vertical },
// BUTTON_CHAT
new TBButtonInfo( R.id.chat_button_horizontal ),
{ R.id.chat_button_horizontal, R.id.chat_button_vertical },
// BUTTON_VALUES
new TBButtonInfo( R.id.values_button_horizontal ),
{ R.id.values_button_horizontal, R.id.values_button_vertical },
};
private Activity m_activity;
private DlgDelegate.HasDlgDelegate m_dlgDlgt;
private View m_me;
private View m_horLayout;
private View m_vertLayout;
private boolean m_visible;
private enum ORIENTATION { ORIENT_UNKNOWN,
ORIENT_PORTRAIT,
@ -82,44 +78,29 @@ public class Toolbar {
};
private ORIENTATION m_curOrient = ORIENTATION.ORIENT_UNKNOWN;
public Toolbar( Activity activity, HasDlgDelegate dlgDlgt, int id )
public Toolbar( Activity activity, HasDlgDelegate dlgDlgt )
{
m_activity = activity;
m_dlgDlgt = dlgDlgt;
m_me = activity.findViewById( id );
m_horLayout = activity.findViewById( R.id.toolbar_horizontal );
m_vertLayout = activity.findViewById( R.id.toolbar_vertical );
}
public void setVisibility( int vis )
public void setVisible( boolean visible )
{
if ( null != m_me ) {
m_me.setVisibility( vis );
if ( m_visible != visible ) {
m_visible = visible;
doShowHide();
}
}
public ImageButton getViewFor( int index )
{
TBButtonInfo info = s_buttonInfo[index];
ImageButton button = (ImageButton)m_activity.findViewById( info.m_id );
int id = idForIndex( index );
ImageButton button = (ImageButton)m_activity.findViewById( id );
return button;
}
private void setListener( int index, View.OnClickListener listener )
{
ImageButton button = getViewFor( index );
if ( null != button ) {
button.setOnClickListener( listener );
}
}
private void setLongClickListener( int index,
View.OnLongClickListener listener )
{
ImageButton button = getViewFor( index );
if ( null != button ) {
button.setOnLongClickListener( listener );
}
}
public void setListener( int index, final int msgID, final int prefsKey,
final Action action )
{
@ -143,15 +124,66 @@ public class Toolbar {
setLongClickListener( index, listener );
}
public void setIsLandscape( boolean landscape )
{
if ( landscape && m_curOrient == ORIENTATION.ORIENT_LANDSCAPE ) {
// do nothing
} else if ( !landscape && m_curOrient == ORIENTATION.ORIENT_PORTRAIT ) {
// do nothing
} else {
if ( landscape ) {
m_curOrient = ORIENTATION.ORIENT_LANDSCAPE;
} else {
m_curOrient = ORIENTATION.ORIENT_PORTRAIT;
}
doShowHide();
}
}
public void update( int index, boolean enable )
{
TBButtonInfo info = s_buttonInfo[index];
int vis = enable ? View.VISIBLE : View.GONE;
ImageButton button = (ImageButton)m_activity.findViewById( info.m_id );
int id = idForIndex( index );
ImageButton button = (ImageButton)m_activity.findViewById( id );
if ( null != button ) {
button.setVisibility( vis );
}
}
private void doShowHide()
{
boolean show;
if ( null != m_horLayout ) {
show = m_visible && ORIENTATION.ORIENT_PORTRAIT == m_curOrient;
m_horLayout.setVisibility( show? View.VISIBLE : View.GONE );
}
if ( null != m_vertLayout ) {
show = m_visible && ORIENTATION.ORIENT_LANDSCAPE == m_curOrient;
m_vertLayout.setVisibility( show? View.VISIBLE : View.GONE );
}
}
private void setListener( int index, View.OnClickListener listener )
{
ImageButton button = getViewFor( index );
if ( null != button ) {
button.setOnClickListener( listener );
}
}
private void setLongClickListener( int index,
View.OnLongClickListener listener )
{
ImageButton button = getViewFor( index );
if ( null != button ) {
button.setOnLongClickListener( listener );
}
}
private int idForIndex( int index )
{
Assert.assertTrue( ORIENTATION.ORIENT_UNKNOWN != m_curOrient );
int indx = ORIENTATION.ORIENT_PORTRAIT == m_curOrient ? 0 : 1;
return s_buttonInfo[index][indx];
}
}