Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/mumla.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore12
-rw-r--r--.gitmodules6
-rw-r--r--LICENSE674
-rw-r--r--Plumble/build.gradle71
m---------Plumble/libraries/Jumble0
m---------Plumble/libraries/libonionkit0
-rw-r--r--Plumble/src/jenkins/ic_launcher-web.pngbin0 -> 48473 bytes
-rw-r--r--Plumble/src/jenkins/res/drawable-hdpi/ic_launcher.pngbin0 -> 4352 bytes
-rw-r--r--Plumble/src/jenkins/res/drawable-mdpi/ic_launcher.pngbin0 -> 2545 bytes
-rw-r--r--Plumble/src/jenkins/res/drawable-xhdpi/ic_launcher.pngbin0 -> 6163 bytes
-rw-r--r--Plumble/src/jenkins/res/drawable-xxhdpi/ic_launcher.pngbin0 -> 10032 bytes
-rw-r--r--Plumble/src/jenkins/res/values/strings.xml21
-rw-r--r--Plumble/src/main/AndroidManifest.xml86
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/Constants.java22
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/Settings.java256
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/app/DrawerAdapter.java202
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/app/PlumbleActivity.java644
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/channel/AccessTokenFragment.java178
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelAdapter.java109
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelChatFragment.java365
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelEditFragment.java109
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelFragment.java224
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelListAdapter.java293
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelListFragment.java847
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelSearchProvider.java152
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChatTargetProvider.java61
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/channel/CommentFragment.java132
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/channel/ServerInfoFragment.java134
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/db/DatabaseProvider.java25
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/db/PlumbleDatabase.java45
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/db/PlumbleSQLiteDatabase.java277
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/db/PublicServer.java65
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/preference/KeySelectDialogPreference.java144
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/preference/PlumbleCertificateGenerateTask.java79
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/preference/PlumbleCertificateManager.java88
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/preference/Preferences.java221
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/preference/SeekBarDialogPreference.java145
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/servers/PublicServerListFragment.java663
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerEditFragment.java190
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerInfoResponse.java103
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerInfoTask.java81
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerListFragment.java295
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/service/PlumbleOverlay.java230
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/service/PlumbleService.java467
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/util/JumbleServiceFragment.java107
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/util/JumbleServiceProvider.java29
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/view/PlumbleNestedAdapter.java272
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/view/PlumbleNestedListView.java112
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardActivity.java172
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardAudioFragment.java98
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardCertificateFragment.java78
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardNavigation.java26
-rw-r--r--Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardWelcomeFragment.java37
-rw-r--r--Plumble/src/main/res/anim/fade_in.xml28
-rw-r--r--Plumble/src/main/res/anim/fade_out.xml28
-rw-r--r--Plumble/src/main/res/anim/slide_down.xml22
-rw-r--r--Plumble/src/main/res/anim/slide_up.xml22
-rw-r--r--Plumble/src/main/res/drawable-hdpi/drawer_shadow.9.pngbin0 -> 171 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_add_dark.pngbin0 -> 529 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_add_light.pngbin0 -> 555 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_audio_muted.pngbin0 -> 1360 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_audio_muted_active.pngbin0 -> 1779 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_audio_on.pngbin0 -> 1363 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_audio_on_active.pngbin0 -> 1712 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_audio_on_dark.pngbin0 -> 1333 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_channels.pngbin0 -> 945 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_chat_active.pngbin0 -> 838 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_chat_dark.pngbin0 -> 700 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_chat_light.pngbin0 -> 673 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_comment.pngbin0 -> 819 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_comment_active.pngbin0 -> 1040 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_delete_dark.pngbin0 -> 741 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_delete_light.pngbin0 -> 745 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_drag_handle.pngbin0 -> 192 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_edit_dark.pngbin0 -> 1287 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_edit_light.pngbin0 -> 1220 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_favorite_dark.pngbin0 -> 924 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_favourite_off.pngbin0 -> 1298 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_favourite_on.pngbin0 -> 1146 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_fullscreen.pngbin0 -> 1810 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_headphones.pngbin0 -> 1225 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_headphones_deafened.pngbin0 -> 1047 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_info_dark.pngbin0 -> 1088 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_info_light.pngbin0 -> 1160 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_microphone.pngbin0 -> 1321 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_microphone_dark.pngbin0 -> 633 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_microphone_muted.pngbin0 -> 767 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_minus_light.pngbin0 -> 370 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_more.pngbin0 -> 489 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_save.pngbin0 -> 887 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_search.pngbin0 -> 1090 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_send.pngbin0 -> 905 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_settings.pngbin0 -> 977 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_sort.pngbin0 -> 585 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_unfullscreen.pngbin0 -> 1239 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_action_user_dark.pngbin0 -> 1603 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_carriage_return.pngbin0 -> 766 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_comment.pngbin0 -> 3071 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_comment_seen.pngbin0 -> 1873 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_deafened.pngbin0 -> 4206 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_drawer.pngbin0 -> 2842 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_launcher.pngbin0 -> 4681 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_menu_moreoverflow_card_dark_normal.pngbin0 -> 141 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_menu_moreoverflow_card_dark_pressed.pngbin0 -> 141 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_microphone_muted_strike.pngbin0 -> 1072 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_muted.pngbin0 -> 4156 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_muted_local.pngbin0 -> 4243 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_registered.pngbin0 -> 1532 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_server_deafened.pngbin0 -> 4809 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_server_light.pngbin0 -> 494 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_server_location.pngbin0 -> 705 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_server_muted.pngbin0 -> 4649 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_stat_notify.pngbin0 -> 1056 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_stat_notify_active.pngbin0 -> 2139 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_suppressed.pngbin0 -> 4778 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_talking_off.pngbin0 -> 3133 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_talking_on.pngbin0 -> 3341 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_up_arrow.pngbin0 -> 1425 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/ic_user_light.pngbin0 -> 580 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/list_longpressed.9.pngbin0 -> 154 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/list_pressed.9.pngbin0 -> 159 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/list_selector_disabled.9.pngbin0 -> 189 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/list_selector_focused.9.pngbin0 -> 190 bytes
-rw-r--r--Plumble/src/main/res/drawable-hdpi/server_card.9.pngbin0 -> 141 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/drawer_shadow.9.pngbin0 -> 158 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_add_dark.pngbin0 -> 488 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_add_light.pngbin0 -> 490 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_audio_muted.pngbin0 -> 914 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_audio_muted_active.pngbin0 -> 1255 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_audio_on.pngbin0 -> 910 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_audio_on_active.pngbin0 -> 1226 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_audio_on_dark.pngbin0 -> 893 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_channels.pngbin0 -> 770 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_chat_active.pngbin0 -> 711 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_chat_dark.pngbin0 -> 565 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_chat_light.pngbin0 -> 549 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_comment.pngbin0 -> 610 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_comment_active.pngbin0 -> 813 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_delete_dark.pngbin0 -> 519 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_delete_light.pngbin0 -> 577 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_drag_handle.pngbin0 -> 170 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_edit_dark.pngbin0 -> 850 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_edit_light.pngbin0 -> 832 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_favorite_dark.pngbin0 -> 693 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_favourite_off.pngbin0 -> 880 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_favourite_on.pngbin0 -> 821 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_fullscreen.pngbin0 -> 1479 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_headphones.pngbin0 -> 883 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_headphones_deafened.pngbin0 -> 742 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_info_dark.pngbin0 -> 712 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_info_light.pngbin0 -> 795 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_microphone.pngbin0 -> 1024 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_microphone_dark.pngbin0 -> 413 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_microphone_muted.pngbin0 -> 574 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_minus_light.pngbin0 -> 337 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_more.pngbin0 -> 416 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_save.pngbin0 -> 704 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_search.pngbin0 -> 744 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_send.pngbin0 -> 627 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_settings.pngbin0 -> 781 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_sort.pngbin0 -> 502 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_unfullscreen.pngbin0 -> 877 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_action_user_dark.pngbin0 -> 1359 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_carriage_return.pngbin0 -> 590 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_comment.pngbin0 -> 1921 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_comment_seen.pngbin0 -> 1330 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_deafened.pngbin0 -> 2612 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_drawer.pngbin0 -> 2837 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_launcher.pngbin0 -> 2942 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_menu_moreoverflow_card_dark_normal.pngbin0 -> 151 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_menu_moreoverflow_card_dark_pressed.pngbin0 -> 151 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_microphone_muted_strike.pngbin0 -> 770 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_muted.pngbin0 -> 2464 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_muted_local.pngbin0 -> 2427 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_registered.pngbin0 -> 1188 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_server_deafened.pngbin0 -> 2967 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_server_light.pngbin0 -> 425 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_server_location.pngbin0 -> 526 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_server_muted.pngbin0 -> 2799 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_stat_notify.pngbin0 -> 750 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_stat_notify_active.pngbin0 -> 1339 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_suppressed.pngbin0 -> 2876 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_talking_off.pngbin0 -> 1918 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_talking_on.pngbin0 -> 1899 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_up_arrow.pngbin0 -> 1238 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/ic_user_light.pngbin0 -> 466 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/list_longpressed.9.pngbin0 -> 151 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/list_pressed.9.pngbin0 -> 158 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/list_selector_disabled.9.pngbin0 -> 171 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/list_selector_focused.9.pngbin0 -> 176 bytes
-rw-r--r--Plumble/src/main/res/drawable-mdpi/server_card.9.pngbin0 -> 102 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/drawer_shadow.9.pngbin0 -> 182 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_add_dark.pngbin0 -> 1221 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_add_light.pngbin0 -> 1225 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_audio_muted.pngbin0 -> 2576 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_audio_muted_active.pngbin0 -> 1953 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_audio_on.pngbin0 -> 2489 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_audio_on_active.pngbin0 -> 1802 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_audio_on_dark.pngbin0 -> 2437 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_bad.pngbin0 -> 1724 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_channels.pngbin0 -> 1446 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_chat_active.pngbin0 -> 626 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_chat_dark.pngbin0 -> 1401 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_chat_light.pngbin0 -> 1374 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_comment.pngbin0 -> 1529 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_comment_active.pngbin0 -> 758 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_delete_dark.pngbin0 -> 1348 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_delete_light.pngbin0 -> 1488 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_drag_handle.pngbin0 -> 214 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_edit_dark.pngbin0 -> 2382 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_edit_light.pngbin0 -> 2343 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_error.pngbin0 -> 1580 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_favorite_dark.pngbin0 -> 1773 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_favourite_off.pngbin0 -> 2279 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_favourite_on.pngbin0 -> 2045 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_fullscreen.pngbin0 -> 2065 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_info_dark.pngbin0 -> 2040 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_info_light.pngbin0 -> 2257 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_match.pngbin0 -> 2204 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_microphone.pngbin0 -> 1073 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_microphone_dark.pngbin0 -> 771 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_microphone_muted.pngbin0 -> 900 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_minus_light.pngbin0 -> 246 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_more.pngbin0 -> 184 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_save.pngbin0 -> 1610 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_search.pngbin0 -> 3199 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_send.pngbin0 -> 1691 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_settings.pngbin0 -> 1641 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_sort.pngbin0 -> 1247 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_unfullscreen.pngbin0 -> 2250 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_action_user_dark.pngbin0 -> 1901 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_carriage_return.pngbin0 -> 541 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_comment.pngbin0 -> 3910 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_comment_seen.pngbin0 -> 2952 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_deafened.pngbin0 -> 4988 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_drawer.pngbin0 -> 1056 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_launcher.pngbin0 -> 6538 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_menu_moreoverflow_card_dark_normal.pngbin0 -> 150 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_menu_moreoverflow_card_dark_pressed.pngbin0 -> 150 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_microphone_muted_strike.pngbin0 -> 2055 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_muted.pngbin0 -> 4877 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_muted_local.pngbin0 -> 5892 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_registered.pngbin0 -> 1157 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_server_deafened.pngbin0 -> 4716 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_server_light.pngbin0 -> 363 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_server_location.pngbin0 -> 858 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_server_muted.pngbin0 -> 4751 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_stat_notify.pngbin0 -> 1392 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_stat_notify_active.pngbin0 -> 2199 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_suppressed.pngbin0 -> 4837 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_talking_off.pngbin0 -> 3751 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_talking_on.pngbin0 -> 4118 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_up_arrow.pngbin0 -> 1658 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/ic_user_light.pngbin0 -> 563 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/list_longpressed.9.pngbin0 -> 158 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/list_pressed.9.pngbin0 -> 163 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/list_selector_disabled.9.pngbin0 -> 188 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/list_selector_focused.9.pngbin0 -> 190 bytes
-rw-r--r--Plumble/src/main/res/drawable-xhdpi/server_card.9.pngbin0 -> 192 bytes
-rw-r--r--Plumble/src/main/res/drawable-xxhdpi/ic_action_drag_handle.pngbin0 -> 263 bytes
-rw-r--r--Plumble/src/main/res/drawable-xxhdpi/ic_action_microphone_dark.pngbin0 -> 1153 bytes
-rw-r--r--Plumble/src/main/res/drawable-xxhdpi/ic_launcher.pngbin0 -> 10544 bytes
-rw-r--r--Plumble/src/main/res/drawable/card_background.xml28
-rw-r--r--Plumble/src/main/res/drawable/ic_card_overflow.xml23
-rw-r--r--Plumble/src/main/res/drawable/ic_stat_notify.pngbin0 -> 4945 bytes
-rw-r--r--Plumble/src/main/res/drawable/list_selector_transition.xml22
-rw-r--r--Plumble/src/main/res/drawable/overlay_background.xml24
-rw-r--r--Plumble/src/main/res/drawable/popup_menu_item_background.xml23
-rw-r--r--Plumble/src/main/res/drawable/ptt_indicator_background.xml27
-rw-r--r--Plumble/src/main/res/drawable/selectable_background.xml31
-rw-r--r--Plumble/src/main/res/layout-sw600dp-v11/fragment_channel.xml79
-rw-r--r--Plumble/src/main/res/layout-sw720dp-v11/fragment_channel.xml79
-rw-r--r--Plumble/src/main/res/layout/activity_main.xml35
-rw-r--r--Plumble/src/main/res/layout/activity_wizard.xml63
-rw-r--r--Plumble/src/main/res/layout/channel_row.xml61
-rw-r--r--Plumble/src/main/res/layout/channel_user_row.xml42
-rw-r--r--Plumble/src/main/res/layout/dialog_comment.xml72
-rw-r--r--Plumble/src/main/res/layout/dialog_server_edit.xml84
-rw-r--r--Plumble/src/main/res/layout/dialog_server_search.xml44
-rw-r--r--Plumble/src/main/res/layout/fragment_channel.xml62
-rw-r--r--Plumble/src/main/res/layout/fragment_channel_edit.xml71
-rw-r--r--Plumble/src/main/res/layout/fragment_channel_list.xml36
-rw-r--r--Plumble/src/main/res/layout/fragment_chat.xml69
-rw-r--r--Plumble/src/main/res/layout/fragment_public_server_list.xml46
-rw-r--r--Plumble/src/main/res/layout/fragment_server_info.xml139
-rw-r--r--Plumble/src/main/res/layout/fragment_server_list.xml48
-rw-r--r--Plumble/src/main/res/layout/fragment_tokens.xml58
-rw-r--r--Plumble/src/main/res/layout/fragment_wizard_audio.xml34
-rw-r--r--Plumble/src/main/res/layout/fragment_wizard_certificate.xml51
-rw-r--r--Plumble/src/main/res/layout/fragment_wizard_welcome.xml46
-rw-r--r--Plumble/src/main/res/layout/list_chat_item.xml60
-rw-r--r--Plumble/src/main/res/layout/list_drawer_header.xml41
-rw-r--r--Plumble/src/main/res/layout/list_drawer_item.xml44
-rw-r--r--Plumble/src/main/res/layout/nested_dropdown_item.xml52
-rw-r--r--Plumble/src/main/res/layout/overlay.xml110
-rw-r--r--Plumble/src/main/res/layout/overlay_user_row.xml47
-rw-r--r--Plumble/src/main/res/layout/popup_menu.xml44
-rw-r--r--Plumble/src/main/res/layout/popup_user_menu_item.xml51
-rw-r--r--Plumble/src/main/res/layout/ptt_corner.xml26
-rw-r--r--Plumble/src/main/res/layout/ptt_overlay.xml40
-rw-r--r--Plumble/src/main/res/layout/public_server_list_row.xml141
-rw-r--r--Plumble/src/main/res/layout/server_list_row.xml161
-rw-r--r--Plumble/src/main/res/layout/token_row.xml41
-rw-r--r--Plumble/src/main/res/menu/activity_server_info.xml24
-rw-r--r--Plumble/src/main/res/menu/activity_server_list.xml21
-rw-r--r--Plumble/src/main/res/menu/channel_list_context.xml23
-rw-r--r--Plumble/src/main/res/menu/channel_list_menu.xml25
-rw-r--r--Plumble/src/main/res/menu/channel_modify_menu.xml26
-rw-r--r--Plumble/src/main/res/menu/fragment_channel_list.xml24
-rw-r--r--Plumble/src/main/res/menu/fragment_chat.xml27
-rw-r--r--Plumble/src/main/res/menu/fragment_public_server_list.xml26
-rw-r--r--Plumble/src/main/res/menu/fragment_server_list.xml22
-rw-r--r--Plumble/src/main/res/menu/plumble.xml26
-rw-r--r--Plumble/src/main/res/menu/popup_server_row.xml25
-rw-r--r--Plumble/src/main/res/values-de/preference.xml134
-rw-r--r--Plumble/src/main/res/values-de/strings.xml142
-rw-r--r--Plumble/src/main/res/values-large/dimens.xml24
-rw-r--r--Plumble/src/main/res/values-pl/preference.xml134
-rw-r--r--Plumble/src/main/res/values-pl/strings.xml142
-rw-r--r--Plumble/src/main/res/values-sw600dp/dimens.xml21
-rw-r--r--Plumble/src/main/res/values-sw720dp-land/dimens.xml22
-rw-r--r--Plumble/src/main/res/values-v11/styles.xml23
-rw-r--r--Plumble/src/main/res/values/attrs.xml31
-rw-r--r--Plumble/src/main/res/values/colors.xml56
-rw-r--r--Plumble/src/main/res/values/dimens.xml27
-rw-r--r--Plumble/src/main/res/values/preference.xml182
-rw-r--r--Plumble/src/main/res/values/strings.xml228
-rw-r--r--Plumble/src/main/res/values/styles.xml110
-rw-r--r--Plumble/src/main/res/values/wizard.xml37
-rw-r--r--Plumble/src/main/res/xml/preference_headers.xml51
-rw-r--r--Plumble/src/main/res/xml/preference_headers_legacy.xml61
-rw-r--r--Plumble/src/main/res/xml/searchable.xml28
-rw-r--r--Plumble/src/main/res/xml/settings_about.xml44
-rw-r--r--Plumble/src/main/res/xml/settings_appearance.xml49
-rw-r--r--Plumble/src/main/res/xml/settings_audio.xml102
-rw-r--r--Plumble/src/main/res/xml/settings_authentication.xml42
-rw-r--r--Plumble/src/main/res/xml/settings_general.xml48
-rw-r--r--README.md2
-rw-r--r--build.gradle20
-rw-r--r--gradle/wrapper/gradle-wrapper.jarbin0 -> 49896 bytes
-rw-r--r--gradle/wrapper/gradle-wrapper.properties23
-rwxr-xr-xgradlew164
-rw-r--r--gradlew.bat90
-rw-r--r--settings.gradle20
344 files changed, 13327 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b26bae8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,12 @@
+# Gradle / Android Studio
+build/
+.idea/
+.gradle/
+*.iml
+signing.gradle
+
+# Android
+local.properties
+
+# Java
+*.class
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..b2dffe1
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,6 @@
+[submodule "Plumble/libraries/Jumble"]
+ path = Plumble/libraries/Jumble
+ url = https://www.github.com/Morlunk/Jumble.git
+[submodule "Plumble/libraries/libonionkit"]
+ path = Plumble/libraries/libonionkit
+ url = https://www.github.com/Morlunk/OnionKit.git
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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 3 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, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/Plumble/build.gradle b/Plumble/build.gradle
new file mode 100644
index 0000000..10fbb0b
--- /dev/null
+++ b/Plumble/build.gradle
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+
+
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:0.7.+'
+ }
+}
+apply plugin: 'android'
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ compile project("libraries:Jumble")
+ compile project("libraries:libonionkit")
+ compile 'com.android.support:support-v4:19.0.+'
+ compile 'com.android.support:appcompat-v7:19.0.+'
+ compile 'com.google.guava:guava:15.+'
+}
+
+
+// Keep my credentials private :^)
+signingFile = file 'signing.gradle';
+if(signingFile.exists()) apply from: 'signing.gradle'
+
+android {
+ compileSdkVersion 19
+ buildToolsVersion "19.0.1"
+
+ defaultConfig {
+ minSdkVersion 9
+ targetSdkVersion 19
+ }
+
+ productFlavors {
+ official {
+ packageName "com.morlunk.mumbleclient"
+ }
+
+ jenkins {
+ packageName "com.morlunk.mumbleclient.jenkins"
+ }
+ }
+}
+
+// Add Jumble's built native libs - hack
+tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
+ pkgTask.jniFolders = new HashSet<File>()
+ pkgTask.jniFolders.add(new File(project("libraries:Jumble").buildDir, 'native-libs'))
+} \ No newline at end of file
diff --git a/Plumble/libraries/Jumble b/Plumble/libraries/Jumble
new file mode 160000
+Subproject 0833aa5a494216b652d2e7db911246df91e9ab9
diff --git a/Plumble/libraries/libonionkit b/Plumble/libraries/libonionkit
new file mode 160000
+Subproject 86f8022da2d544b19d163c43cf658b6ffe62149
diff --git a/Plumble/src/jenkins/ic_launcher-web.png b/Plumble/src/jenkins/ic_launcher-web.png
new file mode 100644
index 0000000..d7de51d
--- /dev/null
+++ b/Plumble/src/jenkins/ic_launcher-web.png
Binary files differ
diff --git a/Plumble/src/jenkins/res/drawable-hdpi/ic_launcher.png b/Plumble/src/jenkins/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..544858c
--- /dev/null
+++ b/Plumble/src/jenkins/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/Plumble/src/jenkins/res/drawable-mdpi/ic_launcher.png b/Plumble/src/jenkins/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..b94d2db
--- /dev/null
+++ b/Plumble/src/jenkins/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/Plumble/src/jenkins/res/drawable-xhdpi/ic_launcher.png b/Plumble/src/jenkins/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..5788753
--- /dev/null
+++ b/Plumble/src/jenkins/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/Plumble/src/jenkins/res/drawable-xxhdpi/ic_launcher.png b/Plumble/src/jenkins/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..acde6b9
--- /dev/null
+++ b/Plumble/src/jenkins/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/Plumble/src/jenkins/res/values/strings.xml b/Plumble/src/jenkins/res/values/strings.xml
new file mode 100644
index 0000000..1573387
--- /dev/null
+++ b/Plumble/src/jenkins/res/values/strings.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources>
+ <string name="app_name">Plumble Nightly</string>
+</resources> \ No newline at end of file
diff --git a/Plumble/src/main/AndroidManifest.xml b/Plumble/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b9a92a5
--- /dev/null
+++ b/Plumble/src/main/AndroidManifest.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.morlunk.mumbleclient"
+ android:versionCode="53"
+ android:versionName="3.0.0-beta1" >
+
+ <uses-sdk
+ android:minSdkVersion="9"
+ android:targetSdkVersion="18" />
+
+ <uses-feature
+ android:name="android.hardware.microphone"
+ android:required="false" />
+
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
+ <uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
+ <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
+ <uses-permission android:name="android.permission.VIBRATE" />
+ <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
+ <uses-permission android:name="android.permission.BLUETOOTH" />
+
+ <application
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/Theme.Plumble" >
+
+ <!--<provider-->
+ <!--android:name=".channel.ChannelSearchProvider"-->
+ <!--android:authorities="com.morlunk.mumbleclient.channel.ChannelSearchProvider"-->
+ <!--android:exported="false" />-->
+
+ <activity android:name=".wizard.WizardActivity"/>
+
+ <activity android:name=".preference.Preferences"
+ android:parentActivityName=".app.PlumbleActivity"/>
+
+ <service
+ android:name=".service.PlumbleService"
+ android:enabled="true"/>
+
+ <activity
+ android:name=".app.PlumbleActivity"
+ android:label="@string/app_name"
+ android:launchMode="singleTop"
+ android:configChanges="keyboardHidden|orientation|screenSize"> <!-- TODO get fragment state preservation into a state where this is unnecessary -->
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.intent.action.SEARCH" />
+ </intent-filter>
+ <meta-data android:name="android.app.searchable"
+ android:resource="@xml/searchable"/>
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+
+ <data android:scheme="mumble" />
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest> \ No newline at end of file
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/Constants.java b/Plumble/src/main/java/com/morlunk/mumbleclient/Constants.java
new file mode 100644
index 0000000..bf3e4ff
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/Constants.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient;
+
+public class Constants {
+ public static final String TAG = "Plumble";
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/Settings.java b/Plumble/src/main/java/com/morlunk/mumbleclient/Settings.java
new file mode 100644
index 0000000..4eb7519
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/Settings.java
@@ -0,0 +1,256 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.content.SharedPreferences.Editor;
+import android.preference.PreferenceManager;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+/**
+ * Singleton settings class for universal access to the app's preferences.
+ * @author morlunk
+ */
+public class Settings {
+ public static final String PREF_CALL_MODE = "callMode";
+ public static final String ARRAY_CALL_MODE_SPEAKER = "speakerphone";
+ public static final String ARRAY_CALL_MODE_VOICE = "voice";
+
+ public static final String PREF_INPUT_METHOD = "audioInputMethod";
+ public static final String ARRAY_INPUT_METHOD_VOICE = "voiceActivity";
+ public static final String ARRAY_INPUT_METHOD_PTT = "ptt";
+ public static final String ARRAY_INPUT_METHOD_CONTINUOUS = "continuous";
+
+ public static final String PREF_THRESHOLD = "vadThreshold";
+ public static final int DEFAULT_THRESHOLD = 50;
+
+ public static final String PREF_PUSH_KEY = "talkKey";
+ public static final Integer DEFAULT_PUSH_KEY = -1;
+
+ public static final String PREF_HOT_CORNER_KEY = "hotCorner";
+ public static final String ARRAY_HOT_CORNER_NONE = "none";
+ public static final String ARRAY_HOT_CORNER_TOP_LEFT = "topLeft";
+ public static final String ARRAY_HOT_CORNER_BOTTOM_LEFT = "bottomLeft";
+ public static final String ARRAY_HOT_CORNER_TOP_RIGHT = "topRight";
+ public static final String ARRAY_HOT_CORNER_BOTTOM_RIGHT = "bottomRight";
+ public static final String DEFAULT_HOT_CORNER = ARRAY_HOT_CORNER_NONE;
+
+ public static final String PREF_PUSH_BUTTON_HIDE_KEY = "hidePtt";
+ public static final Boolean DEFAULT_PUSH_BUTTON_HIDE = false;
+
+ public static final String PREF_PTT_TOGGLE = "togglePtt";
+ public static final Boolean DEFAULT_PTT_TOGGLE = false;
+
+ public static final String PREF_INPUT_QUALITY = "input_quality";
+ public static final String DEFAULT_QUALITY = "48000";
+
+ public static final String PREF_AMPLITUDE_BOOST = "inputVolume";
+ public static final Integer DEFAULT_AMPLITUDE_BOOST = 100;
+
+ public static final String PREF_CHAT_NOTIFY = "chatNotify";
+ public static final Boolean DEFAULT_CHAT_NOTIFY = true;
+
+ public static final String PREF_USE_TTS = "useTts";
+ public static final Boolean DEFAULT_USE_TTS = true;
+
+ public static final String PREF_AUTO_RECONNECT = "autoReconnect";
+ public static final Boolean DEFAULT_AUTO_RECONNECT = true;
+
+ public static final String PREF_THEME = "theme";
+ public static final String ARRAY_THEME_LIGHT = "lightDark";
+ public static final String ARRAY_THEME_DARK = "dark";
+ public static final String ARRAY_THEME_SOLARIZED_LIGHT = "solarizedLight";
+ public static final String ARRAY_THEME_SOLARIZED_DARK = "solarizedDark";
+
+ public static final String PREF_CERT = "certificatePath";
+ public static final String PREF_CERT_PASSWORD = "certificatePassword";
+
+ public static final String PREF_DEFAULT_USERNAME = "defaultUsername";
+ public static final String DEFAULT_DEFAULT_USERNAME = "Plumble_User"; // funny var name
+
+ public static final String PREF_FORCE_TCP = "forceTcp";
+ public static final Boolean DEFAULT_FORCE_TCP = false;
+
+ public static final String PREF_USE_TOR = "useTor";
+ public static final Boolean DEFAULT_USE_TOR = false;
+
+ public static final String PREF_DISABLE_OPUS = "disableOpus";
+ public static final Boolean DEFAULT_DISABLE_OPUS = false;
+
+ public static final String PREF_MUTED = "muted";
+ public static final Boolean DEFAULT_MUTED = false;
+
+ public static final String PREF_DEAFENED = "deafened";
+ public static final Boolean DEFAULT_DEAFENED = false;
+
+ public static final String PREF_FIRST_RUN = "firstRun";
+ public static final Boolean DEFAULT_FIRST_RUN = true;
+
+ private final SharedPreferences preferences;
+
+ private static Settings settings;
+
+ public static Settings getInstance(Context context) {
+ if(settings == null)
+ settings = new Settings(context);
+ return settings;
+ }
+
+ private Settings(Context ctx) {
+ preferences = PreferenceManager.getDefaultSharedPreferences(ctx);
+ }
+
+ public String getInputMethod() {
+ return preferences.getString(PREF_INPUT_METHOD, ARRAY_INPUT_METHOD_VOICE);
+ }
+
+ public String getCallMode() {
+ return preferences.getString(PREF_CALL_MODE, ARRAY_CALL_MODE_SPEAKER);
+ }
+
+ public int getAudioQuality() {
+ return Integer.parseInt(preferences.getString(Settings.PREF_INPUT_QUALITY, DEFAULT_QUALITY));
+ }
+
+ public float getAmplitudeBoostMultiplier() {
+ return (float)preferences.getInt(Settings.PREF_AMPLITUDE_BOOST, DEFAULT_AMPLITUDE_BOOST)/100;
+ }
+
+ public float getDetectionThreshold() {
+ return (float)preferences.getInt(PREF_THRESHOLD, DEFAULT_THRESHOLD)/100;
+ }
+
+ public int getPushToTalkKey() {
+ return preferences.getInt(PREF_PUSH_KEY, DEFAULT_PUSH_KEY);
+ }
+
+ public String getHotCorner() {
+ return preferences.getString(PREF_HOT_CORNER_KEY, DEFAULT_HOT_CORNER);
+ }
+
+ /**
+ * @return the resource ID of the user-defined theme.
+ */
+ public int getTheme() {
+ String theme = preferences.getString(PREF_THEME, ARRAY_THEME_LIGHT);
+ if(ARRAY_THEME_LIGHT.equals(theme))
+ return R.style.Theme_Plumble;
+ else if(ARRAY_THEME_DARK.equals(theme))
+ return R.style.Theme_Plumble_Dark;
+ else if(ARRAY_THEME_SOLARIZED_LIGHT.equals(theme))
+ return R.style.Theme_Plumble_Solarized_Light;
+ else if(ARRAY_THEME_SOLARIZED_DARK.equals(theme))
+ return R.style.Theme_Plumble_Solarized_Dark;
+ return -1;
+ }
+
+ /**
+ * Attempts to read the certificate from the path specified in settings.
+ * @return The parsed bytes of the certificate, or null otherwise.
+ */
+ public byte[] getCertificate() {
+ try {
+ FileInputStream inputStream = new FileInputStream(preferences.getString(PREF_CERT, ""));
+ byte[] buffer = new byte[inputStream.available()];
+ inputStream.read(buffer);
+ return buffer;
+ } catch (FileNotFoundException e) {
+ return null;
+ } catch (IOException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ public boolean isUsingCertificate() {
+ return preferences.contains(PREF_CERT);
+ }
+
+ public String getCertificatePassword() {
+ return preferences.getString(PREF_CERT_PASSWORD, "");
+ }
+
+ public String getDefaultUsername() {
+ return preferences.getString(PREF_DEFAULT_USERNAME, DEFAULT_DEFAULT_USERNAME);
+ }
+
+ public boolean isPushToTalkToggle() {
+ return preferences.getBoolean(PREF_PTT_TOGGLE, DEFAULT_PTT_TOGGLE);
+ }
+
+ public boolean isPushToTalkButtonShown() {
+ return !preferences.getBoolean(PREF_PUSH_BUTTON_HIDE_KEY, DEFAULT_PUSH_BUTTON_HIDE);
+ }
+
+ public boolean isChatNotifyEnabled() {
+ return preferences.getBoolean(PREF_CHAT_NOTIFY, DEFAULT_CHAT_NOTIFY);
+ }
+
+ public boolean isTextToSpeechEnabled() {
+ return preferences.getBoolean(PREF_USE_TTS, DEFAULT_USE_TTS);
+ }
+
+ public boolean isAutoReconnectEnabled() {
+ return preferences.getBoolean(PREF_AUTO_RECONNECT, DEFAULT_AUTO_RECONNECT);
+ }
+
+ public boolean isTcpForced() {
+ return preferences.getBoolean(PREF_FORCE_TCP, DEFAULT_FORCE_TCP);
+ }
+
+ public boolean isOpusDisabled() {
+ return preferences.getBoolean(PREF_DISABLE_OPUS, DEFAULT_DISABLE_OPUS);
+ }
+
+ public boolean isTorEnabled() {
+ return preferences.getBoolean(PREF_USE_TOR, DEFAULT_USE_TOR);
+ }
+
+ public boolean isMuted() {
+ return preferences.getBoolean(PREF_MUTED, DEFAULT_MUTED);
+ }
+
+ public boolean isDeafened() {
+ return preferences.getBoolean(PREF_DEAFENED, DEFAULT_DEAFENED);
+ }
+
+ public boolean isFirstRun() {
+ return preferences.getBoolean(PREF_FIRST_RUN, DEFAULT_FIRST_RUN);
+ }
+
+ public void setMutedAndDeafened(boolean muted, boolean deafened) {
+ Editor editor = preferences.edit();
+ editor.putBoolean(PREF_MUTED, muted || deafened);
+ editor.putBoolean(PREF_DEAFENED, deafened);
+ editor.commit();
+ }
+
+ public void setCertificatePath(String path) {
+ Editor editor = preferences.edit();
+ editor.putString(PREF_CERT, path);
+ editor.commit();
+ }
+
+ public void setFirstRun(boolean run) {
+ preferences.edit().putBoolean(PREF_FIRST_RUN, run).commit();
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/app/DrawerAdapter.java b/Plumble/src/main/java/com/morlunk/mumbleclient/app/DrawerAdapter.java
new file mode 100644
index 0000000..159eced
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/app/DrawerAdapter.java
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.app;
+
+import android.content.Context;
+import android.graphics.PorterDuff;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.morlunk.mumbleclient.R;
+
+/**
+ * Created by andrew on 01/08/13.
+ */
+public class DrawerAdapter extends ArrayAdapter<DrawerAdapter.DrawerRow> {
+
+ /**
+ * Provides context for the drawer module.
+ */
+ public interface DrawerDataProvider {
+
+ /**
+ * @return true if connected, false otherwise.
+ */
+ public boolean isConnected();
+ /**
+ * @return The name of the connected server. If not connected, then null.
+ */
+ public String getConnectedServerName();
+ }
+
+ // Drawer rows, integer value is id
+ public static final int HEADER_CONNECTED_SERVER = 0;
+ public static final int ITEM_SERVER = 1;
+ public static final int ITEM_INFO = 2;
+ public static final int ITEM_ACCESS_TOKENS = 3;
+ public static final int ITEM_PINNED_CHANNELS = 4;
+ public static final int HEADER_SERVERS = 5;
+ public static final int ITEM_FAVOURITES = 6;
+ public static final int ITEM_LAN = 7;
+ public static final int ITEM_PUBLIC = 8;
+
+ private static final int HEADER_TYPE = 0;
+ private static final int ITEM_TYPE = 1;
+
+ // TODO clean this up.
+
+ public static class DrawerRow {
+ int id;
+ String title;
+
+ private DrawerRow(int id, String title) {
+ this.id = id;
+ this.title = title;
+ }
+ }
+
+ public static class DrawerHeader extends DrawerRow {
+
+ public DrawerHeader(int id, String title) {
+ super(id, title);
+ }
+ }
+
+ public static class DrawerItem extends DrawerRow {
+ int icon;
+
+ public DrawerItem(int id, String title, int icon) {
+ super(id, title);
+ this.icon = icon;
+ }
+ }
+
+ private DrawerDataProvider mProvider;
+
+ public DrawerAdapter(Context context, DrawerDataProvider provider) {
+ super(context, 0);
+ mProvider = provider;
+ add(new DrawerAdapter.DrawerHeader(HEADER_CONNECTED_SERVER, context.getString(R.string.drawer_not_connected)));
+ add(new DrawerAdapter.DrawerItem(ITEM_SERVER, context.getString(R.string.drawer_server), R.drawable.ic_action_channels));
+ add(new DrawerAdapter.DrawerItem(ITEM_INFO, context.getString(R.string.information), R.drawable.ic_action_info_dark));
+ add(new DrawerAdapter.DrawerItem(ITEM_ACCESS_TOKENS, context.getString(R.string.drawer_tokens), R.drawable.ic_action_save));
+ add(new DrawerAdapter.DrawerItem(ITEM_PINNED_CHANNELS, context.getString(R.string.drawer_pinned), R.drawable.ic_action_comment));
+ add(new DrawerAdapter.DrawerHeader(HEADER_SERVERS, context.getString(R.string.drawer_header_servers)));
+ add(new DrawerAdapter.DrawerItem(ITEM_FAVOURITES, context.getString(R.string.drawer_favorites), R.drawable.ic_action_favourite_on));
+ add(new DrawerAdapter.DrawerItem(ITEM_LAN, context.getString(R.string.drawer_lan), R.drawable.ic_action_fullscreen)); // Coming soon, TODO
+ add(new DrawerAdapter.DrawerItem(ITEM_PUBLIC, context.getString(R.string.drawer_public), R.drawable.ic_action_search));
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View v = convertView;
+ int viewType = getItemViewType(position);
+ if(v == null) {
+ if(viewType == HEADER_TYPE)
+ v = LayoutInflater.from(getContext()).inflate(R.layout.list_drawer_header, null, false);
+ else if(viewType == ITEM_TYPE)
+ v = LayoutInflater.from(getContext()).inflate(R.layout.list_drawer_item, null, false);
+
+ }
+
+ if(viewType == HEADER_TYPE) {
+ DrawerHeader header = (DrawerHeader) getItem(position);
+ TextView title = (TextView) v.findViewById(R.id.drawer_header_title);
+
+ switch((int) getItemId(position)) {
+ case HEADER_CONNECTED_SERVER:
+ if(mProvider.isConnected()) {
+ title.setText(mProvider.getConnectedServerName());
+ break;
+ }
+ default:
+ title.setText(header.title);
+ break;
+ }
+ } else if(viewType == ITEM_TYPE) {
+ DrawerItem item = (DrawerItem) getItem(position);
+ TextView title = (TextView) v.findViewById(R.id.drawer_item_title);
+ ImageView icon = (ImageView) v.findViewById(R.id.drawer_item_icon);
+ title.setText(item.title);
+ icon.setImageResource(item.icon);
+
+ boolean enabled = isEnabled(position);
+
+ // Set text and icon color+alpha based on enabled/disabled state
+ int textColor = title.getCurrentTextColor();
+ textColor &= ~(0xFF << 60); // Clear alpha bits
+ textColor |= enabled ? 0xFF << 60 : 0x55 << 60; // Set alpha bits depending on whether the state is enabled or disabled
+ title.setTextColor(textColor);
+ icon.setColorFilter(textColor, PorterDuff.Mode.MULTIPLY);
+
+ }
+
+ return v;
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return getItem(position).id;
+ }
+
+ public DrawerRow getItemWithId(int id) {
+ for(int x=0;x<getCount();x++) {
+ DrawerRow row = getItem(x);
+ if(row.id == id) return row;
+ }
+ return null;
+ }
+
+ @Override
+ public boolean isEnabled(int position) {
+ int viewType = getItemViewType(position);
+ if(viewType == ITEM_TYPE) {
+ switch ((int) getItemId(position)) {
+ case ITEM_SERVER:
+ case ITEM_INFO:
+ case ITEM_ACCESS_TOKENS:
+ case ITEM_PINNED_CHANNELS:
+ return mProvider.isConnected();
+ case ITEM_LAN:
+ return false;
+ default:
+ return true;
+ }
+ }
+ return false; // Default false for headers
+ }
+
+ @Override
+ public int getItemViewType(int position) {
+ Object item = getItem(position);
+ if(item instanceof DrawerHeader)
+ return HEADER_TYPE;
+ else if(item instanceof DrawerItem)
+ return ITEM_TYPE;
+ return ITEM_TYPE;
+ }
+
+ @Override
+ public int getViewTypeCount() {
+ return 2;
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/app/PlumbleActivity.java b/Plumble/src/main/java/com/morlunk/mumbleclient/app/PlumbleActivity.java
new file mode 100644
index 0000000..9136d34
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/app/PlumbleActivity.java
@@ -0,0 +1,644 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.app;
+
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
+import android.content.ComponentName;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
+import android.content.res.Configuration;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.preference.PreferenceManager;
+import android.support.v4.app.ActionBarDrawerToggle;
+import android.support.v4.app.Fragment;
+import android.support.v4.widget.DrawerLayout;
+import android.support.v7.app.ActionBarActivity;
+import android.view.KeyEvent;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.EditText;
+import android.widget.ListView;
+import android.widget.Toast;
+
+import com.morlunk.jumble.Constants;
+import com.morlunk.jumble.IJumbleService;
+import com.morlunk.jumble.JumbleService;
+import com.morlunk.jumble.model.Server;
+import com.morlunk.jumble.net.JumbleObserver;
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.Settings;
+import com.morlunk.mumbleclient.channel.AccessTokenFragment;
+import com.morlunk.mumbleclient.channel.ChannelFragment;
+import com.morlunk.mumbleclient.channel.ServerInfoFragment;
+import com.morlunk.mumbleclient.db.DatabaseProvider;
+import com.morlunk.mumbleclient.db.PlumbleDatabase;
+import com.morlunk.mumbleclient.db.PlumbleSQLiteDatabase;
+import com.morlunk.mumbleclient.db.PublicServer;
+import com.morlunk.mumbleclient.preference.PlumbleCertificateGenerateTask;
+import com.morlunk.mumbleclient.preference.Preferences;
+import com.morlunk.mumbleclient.servers.PublicServerListFragment;
+import com.morlunk.mumbleclient.servers.ServerEditFragment;
+import com.morlunk.mumbleclient.servers.ServerListFragment;
+import com.morlunk.mumbleclient.service.PlumbleService;
+import com.morlunk.mumbleclient.util.JumbleServiceFragment;
+import com.morlunk.mumbleclient.util.JumbleServiceProvider;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class PlumbleActivity extends ActionBarActivity implements ListView.OnItemClickListener, ServerListFragment.ServerConnectHandler, JumbleServiceProvider, DatabaseProvider, SharedPreferences.OnSharedPreferenceChangeListener, DrawerAdapter.DrawerDataProvider, ServerEditFragment.ServerEditListener {
+
+ /** Broadcasted when the activity gains focus. Used to dismiss chat notifications, bit of a hack. */
+ public static final String ACTION_PLUMBLE_SHOWN = "com.morlunk.mumbleclient.ACTION_PLUMBLE_SHOWN";
+ public static final Pattern MUMBLE_URL_REGEX = Pattern.compile("mumble://((.+)(:.+)?@)?(.+?)(:([0-9]+))?/");
+ public static final int RECONNECT_DELAY = 10000;
+
+ private static final String SAVED_FRAGMENT_TAG = "fragment";
+
+ private IJumbleService mService;
+ private PlumbleDatabase mDatabase;
+ private Settings mSettings;
+
+ private ActionBarDrawerToggle mDrawerToggle;
+ private DrawerLayout mDrawerLayout;
+ private ListView mDrawerList;
+ private DrawerAdapter mDrawerAdapter;
+ private int mActiveFragment;
+
+ private ProgressDialog mConnectingDialog;
+ private AlertDialog mErrorDialog;
+
+ /** List of fragments to be notified about service state changes. */
+ private List<JumbleServiceFragment> mServiceFragments = new ArrayList<JumbleServiceFragment>();
+
+ private ServiceConnection mConnection = new ServiceConnection() {
+ @Override
+ public void onServiceConnected(ComponentName name, IBinder service) {
+ mService = (IJumbleService) service;
+ try {
+ mService.registerObserver(mObserver);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ mDrawerAdapter.notifyDataSetChanged();
+
+ for(JumbleServiceFragment fragment : mServiceFragments)
+ fragment.setServiceBound(true);
+ }
+
+ @Override
+ public void onServiceDisconnected(ComponentName name) {
+ for(JumbleServiceFragment fragment : mServiceFragments)
+ fragment.setServiceBound(false);
+ }
+ };
+
+ private JumbleObserver mObserver = new JumbleObserver() {
+ @Override
+ public void onConnected() throws RemoteException {
+ loadDrawerFragment(DrawerAdapter.ITEM_SERVER);
+ mDrawerAdapter.notifyDataSetChanged();
+ supportInvalidateOptionsMenu();
+
+ mConnectingDialog.dismiss();
+ if(mErrorDialog != null) mErrorDialog.dismiss();
+ }
+
+ @Override
+ public void onDisconnected() throws RemoteException {
+ // Re-show server list if we're showing a fragment that depends on the service.
+ if(getSupportFragmentManager().findFragmentById(R.id.content_frame) instanceof JumbleServiceFragment) {
+ loadDrawerFragment(DrawerAdapter.ITEM_FAVOURITES);
+ }
+ mDrawerAdapter.notifyDataSetChanged();
+ supportInvalidateOptionsMenu();
+
+ mConnectingDialog.dismiss();
+ }
+
+ @Override
+ public void onConnectionError(String message, boolean reconnecting) throws RemoteException {
+ if(mErrorDialog != null) mErrorDialog.dismiss();
+ mConnectingDialog.dismiss();
+
+ AlertDialog.Builder ab = new AlertDialog.Builder(PlumbleActivity.this);
+ if(!reconnecting) {
+ ab.setTitle(R.string.connectionRefused);
+ ab.setMessage(message);
+ ab.setPositiveButton(android.R.string.ok, null);
+ } else {
+ ab.setTitle(R.string.connectionRefused);
+ ab.setMessage(message+"\n"+getString(R.string.reconnecting, RECONNECT_DELAY/1000));
+ ab.setPositiveButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ if(getService() != null) {
+ try {
+ getService().cancelReconnect();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ });
+ }
+ mErrorDialog = ab.show();
+ }
+
+ @Override
+ public void onPermissionDenied(String reason) throws RemoteException {
+ AlertDialog.Builder adb = new AlertDialog.Builder(PlumbleActivity.this);
+ adb.setTitle(R.string.perm_denied);
+ adb.setMessage(reason);
+ adb.show();
+ }
+ };
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ mSettings = Settings.getInstance(this);
+ setTheme(mSettings.getTheme()); // Set custom theme
+
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
+ preferences.registerOnSharedPreferenceChangeListener(this);
+
+ mDatabase = new PlumbleSQLiteDatabase(this); // TODO add support for cloud storage
+
+ mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
+ mDrawerList = (ListView) findViewById(R.id.left_drawer);
+ mDrawerList.setOnItemClickListener(this);
+ mDrawerAdapter = new DrawerAdapter(this, this);
+ mDrawerList.setAdapter(mDrawerAdapter);
+ mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close) {
+ @Override
+ public void onDrawerClosed(View drawerView) {
+ supportInvalidateOptionsMenu();
+ }
+
+ @Override
+ public void onDrawerOpened(View drawerView) {
+ supportInvalidateOptionsMenu();
+ }
+ };
+ mDrawerLayout.setDrawerListener(mDrawerToggle);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setHomeButtonEnabled(true);
+
+ mConnectingDialog = new ProgressDialog(this);
+ mConnectingDialog.setIndeterminate(true);
+ mConnectingDialog.setCancelable(true);
+ mConnectingDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
+ @Override
+ public void onCancel(DialogInterface dialog) {
+ try {
+ mService.disconnect();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
+ // Restore old fragment or load server list (default)
+ int fragmentId = DrawerAdapter.ITEM_FAVOURITES;
+ if(savedInstanceState != null)
+ fragmentId = savedInstanceState.getInt(SAVED_FRAGMENT_TAG, DrawerAdapter.ITEM_FAVOURITES);
+ loadDrawerFragment(fragmentId);
+
+ // If we're given a Mumble URL to show, open up a server edit fragment.
+ if(getIntent() != null &&
+ Intent.ACTION_VIEW.equals(getIntent().getAction())) {
+ String url = getIntent().getDataString();
+ Matcher matcher = MUMBLE_URL_REGEX.matcher(url);
+ if(!matcher.find()) {
+ Toast.makeText(this, getString(R.string.mumble_url_parse_failed), Toast.LENGTH_LONG).show();
+ return;
+ }
+
+ // Any optional fields that failed to match will return null.
+ final String username = matcher.group(2);
+ final String password = matcher.group(3);
+ final String host = matcher.group(4);
+ final String port = matcher.group(6);
+
+ Server server = new Server(-1, "", host, Integer.valueOf(port), username, password);
+
+ // Open a dialog prompting the user to add the Mumble server.
+ Bundle args = new Bundle();
+ args.putBoolean("save", false);
+ args.putParcelable("server", server);
+ ServerEditFragment fragment = (ServerEditFragment) ServerEditFragment.instantiate(this, ServerEditFragment.class.getName(), args);
+ fragment.show(getSupportFragmentManager(), "url_edit");
+ }
+ if(mSettings.isFirstRun()) showSetupWizard();
+ }
+
+ @Override
+ protected void onPostCreate(Bundle savedInstanceState) {
+ super.onPostCreate(savedInstanceState);
+ mDrawerToggle.syncState();
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ Intent connectIntent = new Intent(this, PlumbleService.class);
+ bindService(connectIntent, mConnection, BIND_AUTO_CREATE);
+
+ Intent resumeIntent = new Intent(ACTION_PLUMBLE_SHOWN);
+ sendBroadcast(resumeIntent);
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ if(mService != null)
+ try {
+ mService.unregisterObserver(mObserver);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ unbindService(mConnection);
+ }
+
+ @Override
+ protected void onDestroy() {
+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
+ preferences.unregisterOnSharedPreferenceChangeListener(this);
+ super.onDestroy();
+ }
+
+ @Override
+ public boolean onPrepareOptionsMenu(Menu menu) {
+ MenuItem disconnectButton = menu.findItem(R.id.action_disconnect);
+ try {
+ disconnectButton.setVisible(mService != null && mService.isConnected());
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+
+ // Color the action bar icons to the primary text color of the theme, TODO optimize
+ int foregroundColor = getTheme().obtainStyledAttributes(new int[] { android.R.attr.textColorPrimaryInverse }).getColor(0, -1);
+ for(int x=0;x<menu.size();x++) {
+ MenuItem item = menu.getItem(x);
+ if(item.getIcon() != null) {
+ Drawable icon = item.getIcon().mutate(); // Mutate the icon so that the color filter is exclusive to the action bar
+ icon.setColorFilter(foregroundColor, PorterDuff.Mode.MULTIPLY);
+ }
+ }
+
+ return super.onPrepareOptionsMenu(menu);
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ // Inflate the menu; this adds items to the action bar if it is present.
+ getMenuInflater().inflate(R.menu.plumble, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if(mDrawerToggle.onOptionsItemSelected(item))
+ return true;
+
+ switch (item.getItemId()) {
+ case R.id.action_disconnect:
+ try {
+ getService().disconnect();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return true;
+ case R.id.action_settings:
+ Intent prefIntent = new Intent(this, Preferences.class);
+ startActivity(prefIntent);
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ mDrawerToggle.onConfigurationChanged(newConfig);
+ }
+
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+
+ // Persist active fragment across rotations
+ outState.putInt(SAVED_FRAGMENT_TAG, mActiveFragment);
+
+ }
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ try {
+ if(Settings.ARRAY_INPUT_METHOD_PTT.equals(mSettings.getInputMethod()) &&
+ keyCode == mSettings.getPushToTalkKey() &&
+ mService != null &&
+ mService.isConnected()) {
+ mService.setTalkingState(true);
+ return true;
+ }
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+
+ @Override
+ public boolean onKeyUp(int keyCode, KeyEvent event) {
+ try {
+ if(Settings.ARRAY_INPUT_METHOD_PTT.equals(mSettings.getInputMethod()) &&
+ keyCode == mSettings.getPushToTalkKey() &&
+ mService != null &&
+ mService.isConnected()) {
+ mService.setTalkingState(false);
+ return true;
+ }
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return super.onKeyUp(keyCode, event);
+ }
+
+ @Override
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+ mDrawerLayout.closeDrawers();
+ loadDrawerFragment((int) id);
+ }
+
+ /**
+ * Shows a nice looking setup wizard to guide the user through the app's settings.
+ * Will do nothing if it isn't the first launch.
+ */
+ private void showSetupWizard() {
+ // Prompt the user to generate a certificate, FIXME
+ if(mSettings.isUsingCertificate()) return;
+ AlertDialog.Builder adb = new AlertDialog.Builder(this);
+ adb.setTitle(R.string.first_run_generate_certificate_title);
+ adb.setMessage(R.string.first_run_generate_certificate);
+ adb.setPositiveButton(R.string.generate, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ PlumbleCertificateGenerateTask generateTask = new PlumbleCertificateGenerateTask(PlumbleActivity.this) {
+ @Override
+ protected void onPostExecute(File result) {
+ super.onPostExecute(result);
+ mSettings.setCertificatePath(result.getAbsolutePath());
+ }
+ };
+ generateTask.execute();
+ }
+ });
+ adb.show();
+ mSettings.setFirstRun(false);
+
+ // TODO: finish wizard
+// Intent intent = new Intent(this, WizardActivity.class);
+// startActivity(intent);
+ }
+
+ /**
+ * Loads a fragment from the drawer.
+ */
+ private void loadDrawerFragment(int fragmentId) {
+ Class<? extends Fragment> fragmentClass = null;
+ Bundle args = new Bundle();
+ switch (fragmentId) {
+ case DrawerAdapter.ITEM_SERVER:
+ fragmentClass = ChannelFragment.class;
+ break;
+ case DrawerAdapter.ITEM_INFO:
+ fragmentClass = ServerInfoFragment.class;
+ break;
+ case DrawerAdapter.ITEM_ACCESS_TOKENS:
+ fragmentClass = AccessTokenFragment.class;
+ try {
+ args.putLong("server", mService.getConnectedServer().getId());
+ args.putStringArrayList("access_tokens", (ArrayList<String>) mDatabase.getAccessTokens(mService.getConnectedServer().getId()));
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ break;
+ case DrawerAdapter.ITEM_PINNED_CHANNELS:
+ fragmentClass = ChannelFragment.class;
+ args.putBoolean("pinned", true);
+ break;
+ case DrawerAdapter.ITEM_FAVOURITES:
+ fragmentClass = ServerListFragment.class;
+ break;
+ case DrawerAdapter.ITEM_LAN:
+ break;
+ case DrawerAdapter.ITEM_PUBLIC:
+ fragmentClass = PublicServerListFragment.class;
+ break;
+ default:
+ return;
+ }
+ Fragment fragment = Fragment.instantiate(this, fragmentClass.getName(), args);
+ getSupportFragmentManager().beginTransaction()
+ .replace(R.id.content_frame, fragment, fragmentClass.getName())
+ .commit();
+ setTitle(mDrawerAdapter.getItemWithId(fragmentId).title);
+ mActiveFragment = fragmentId;
+ }
+
+ public void connectToServer(final Server server) {
+ // Check if we're already connected to a server; if so, inform user.
+ try {
+ if(mService != null && mService.isConnected()) {
+ AlertDialog.Builder adb = new AlertDialog.Builder(this);
+ adb.setMessage(R.string.reconnect_dialog_message);
+ adb.setPositiveButton(R.string.connect, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ try {
+ // Register an observer to reconnect to the new server once disconnected.
+ mService.registerObserver(new JumbleObserver() {
+ @Override
+ public void onDisconnected() throws RemoteException {
+ connectToServer(server);
+ mService.unregisterObserver(this);
+ }
+ });
+ mService.disconnect();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ adb.setNegativeButton(android.R.string.cancel, null);
+ adb.show();
+ return;
+ }
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+
+ mConnectingDialog.setMessage(getString(R.string.connecting_to_server, server.getHost(), server.getPort()));
+ mConnectingDialog.show();
+
+ /* Convert input method defined in settings to an integer format used by Jumble. */
+ int inputMethod = 0;
+ String prefInputMethod = mSettings.getInputMethod();
+ if(Settings.ARRAY_INPUT_METHOD_VOICE.equals(prefInputMethod))
+ inputMethod = Constants.TRANSMIT_VOICE_ACTIVITY;
+ if(Settings.ARRAY_INPUT_METHOD_PTT.equals(prefInputMethod))
+ inputMethod = Constants.TRANSMIT_PUSH_TO_TALK;
+ if(Settings.ARRAY_INPUT_METHOD_CONTINUOUS.equals(prefInputMethod))
+ inputMethod = Constants.TRANSMIT_CONTINUOUS;
+
+ String applicationVersion = "";
+ try {
+ applicationVersion = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
+ } catch (PackageManager.NameNotFoundException e) {
+ e.printStackTrace();
+ }
+
+ Intent connectIntent = new Intent(this, PlumbleService.class);
+ connectIntent.putExtra(JumbleService.EXTRAS_SERVER, server);
+ connectIntent.putExtra(JumbleService.EXTRAS_CLIENT_NAME, getString(R.string.app_name)+" "+applicationVersion);
+ connectIntent.putExtra(JumbleService.EXTRAS_TRANSMIT_MODE, inputMethod);
+ connectIntent.putExtra(JumbleService.EXTRAS_DETECTION_THRESHOLD, mSettings.getDetectionThreshold());
+ connectIntent.putExtra(JumbleService.EXTRAS_CERTIFICATE, mSettings.getCertificate());
+ connectIntent.putExtra(JumbleService.EXTRAS_CERTIFICATE_PASSWORD, mSettings.getCertificatePassword());
+ connectIntent.putExtra(JumbleService.EXTRAS_AUTO_RECONNECT, mSettings.isAutoReconnectEnabled());
+ connectIntent.putExtra(JumbleService.EXTRAS_AUTO_RECONNECT_DELAY, RECONNECT_DELAY);
+ connectIntent.putExtra(JumbleService.EXTRAS_USE_OPUS, !mSettings.isOpusDisabled());
+ connectIntent.putExtra(JumbleService.EXTRAS_INPUT_QUALITY, mSettings.getAudioQuality());
+ connectIntent.putExtra(JumbleService.EXTRAS_FORCE_TCP, mSettings.isTcpForced());
+ connectIntent.putExtra(JumbleService.EXTRAS_USE_TOR, mSettings.isTorEnabled());
+ connectIntent.putStringArrayListExtra(JumbleService.EXTRAS_ACCESS_TOKENS, (ArrayList<String>) mDatabase.getAccessTokens(server.getId()));
+ connectIntent.setAction(JumbleService.ACTION_CONNECT);
+ startService(connectIntent);
+ }
+
+ public void connectToPublicServer(final PublicServer server) {
+ AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
+
+ final Settings settings = Settings.getInstance(this);
+
+ // Allow username entry
+ final EditText usernameField = new EditText(this);
+ usernameField.setHint(settings.getDefaultUsername());
+ alertBuilder.setView(usernameField);
+
+ alertBuilder.setTitle(R.string.connectToServer);
+
+ alertBuilder.setPositiveButton(R.string.connect, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ PublicServer newServer = server;
+ if(!usernameField.getText().toString().equals(""))
+ newServer.setUsername(usernameField.getText().toString());
+ else
+ newServer.setUsername(settings.getDefaultUsername());
+ connectToServer(newServer);
+ }
+ });
+
+ alertBuilder.show();
+ }
+
+ @Override
+ public void serverInfoUpdated() {
+ loadDrawerFragment(DrawerAdapter.ITEM_FAVOURITES);
+ }
+
+ /*
+ * HERE BE IMPLEMENTATIONS
+ */
+
+ @Override
+ public IJumbleService getService() {
+ return mService;
+ }
+
+ @Override
+ public PlumbleDatabase getDatabase() {
+ return mDatabase;
+ }
+
+ @Override
+ public void addServiceFragment(JumbleServiceFragment fragment) {
+ mServiceFragments.add(fragment);
+ }
+
+ @Override
+ public void removeServiceFragment(JumbleServiceFragment fragment) {
+ mServiceFragments.remove(fragment);
+ }
+
+ @Override
+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
+ if(Settings.PREF_THEME.equals(key)) {
+ // Recreate activity when theme is changed
+ if(Build.VERSION.SDK_INT >= 11)
+ recreate();
+ else {
+ Intent intent = new Intent(this, PlumbleActivity.class);
+ finish();
+ startActivity(intent);
+ }
+ }
+ }
+
+ @Override
+ public boolean isConnected() {
+ try {
+ return mService != null && mService.isConnected();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ @Override
+ public String getConnectedServerName() {
+ try {
+ if(mService != null && mService.isConnected()) {
+ Server server = mService.getConnectedServer();
+ return server.getName().equals("") ? server.getHost() : server.getName();
+ }
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/channel/AccessTokenFragment.java b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/AccessTokenFragment.java
new file mode 100644
index 0000000..a778c73
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/AccessTokenFragment.java
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.channel;
+
+import android.app.Activity;
+import android.content.Context;
+import android.os.Bundle;
+import android.os.RemoteException;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
+import android.widget.ArrayAdapter;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.TextView.OnEditorActionListener;
+
+import com.morlunk.mumbleclient.Constants;
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.db.DatabaseProvider;
+import com.morlunk.mumbleclient.util.JumbleServiceFragment;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AccessTokenFragment extends JumbleServiceFragment {
+
+ public interface AccessTokenListener {
+ public void onAccessTokenAdded(long serverId, String token);
+ public void onAccessTokenRemoved(long serverId, String token);
+ }
+
+ private List<String> mTokens;
+
+ private ListView mTokenList;
+ private TokenAdapter mTokenAdapter;
+ private EditText mTokenField;
+
+ private DatabaseProvider mProvider;
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+
+ mTokens = new ArrayList<String>(getAccessTokens());
+ mTokenAdapter = new TokenAdapter(activity, mTokens);
+
+ try {
+ mProvider = (DatabaseProvider) activity;
+ } catch (ClassCastException e) {
+ throw new ClassCastException(activity.toString() + " must implement DatabaseProvider");
+ }
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_tokens, container, false);
+
+ mTokenList = (ListView) view.findViewById(R.id.tokenList);
+ mTokenList.setAdapter(mTokenAdapter);
+
+ mTokenField = (EditText) view.findViewById(R.id.tokenField);
+ mTokenField.setOnEditorActionListener(new OnEditorActionListener() {
+
+ @Override
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+ if(actionId == EditorInfo.IME_ACTION_SEND) {
+ addToken();
+ return true;
+ }
+ return false;
+ }
+ });
+
+ ImageButton addButton = (ImageButton) view.findViewById(R.id.tokenAddButton);
+ addButton.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ addToken();
+ }
+ });
+
+ return view;
+ }
+
+ private void addToken() {
+ String tokenText = mTokenField.getText().toString().trim();
+
+ if(tokenText.equals(""))
+ return;
+
+ mTokenField.setText("");
+
+ Log.i(Constants.TAG, "Adding token: "+tokenText);
+
+ mTokens.add(tokenText);
+ mTokenAdapter.notifyDataSetChanged();
+
+ mTokenList.smoothScrollToPosition(mTokens.size() - 1);
+ mProvider.getDatabase().addAccessToken(getServerId(), tokenText);
+ try {
+ getService().sendAccessTokens(mTokens);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private long getServerId() {
+ return getArguments().getLong("server");
+ }
+
+ private List<String> getAccessTokens() {
+ return getArguments().getStringArrayList("access_tokens");
+ }
+
+ private class TokenAdapter extends ArrayAdapter<String> {
+
+ public TokenAdapter(Context context,
+ List<String> objects) {
+ super(context, android.R.layout.simple_list_item_1, objects);
+ }
+
+ @Override
+ public View getView(final int position, View convertView, ViewGroup parent) {
+ View view = convertView;
+ if(convertView == null) {
+ view = getActivity().getLayoutInflater().inflate(R.layout.token_row, null, false);
+ }
+
+ final String token = getItem(position);
+
+ TextView title = (TextView) view.findViewById(R.id.tokenItemTitle);
+ title.setText(token);
+
+ ImageButton deleteButton = (ImageButton) view.findViewById(R.id.tokenItemDelete);
+ deleteButton.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ mTokens.remove(position);
+ notifyDataSetChanged();
+ mProvider.getDatabase().removeAccessToken(getServerId(), token);
+ try {
+ getService().sendAccessTokens(mTokens);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
+ return view;
+ }
+
+ }
+
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelAdapter.java b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelAdapter.java
new file mode 100644
index 0000000..a166955
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelAdapter.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.channel;
+
+import android.content.Context;
+import android.os.RemoteException;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.morlunk.jumble.IJumbleService;
+import com.morlunk.jumble.model.Channel;
+import com.morlunk.jumble.model.User;
+import com.morlunk.mumbleclient.R;
+
+/**
+ * Simple adapter to display the users in a single channel.
+ * Created by andrew on 24/11/13.
+ */
+public class ChannelAdapter extends BaseAdapter {
+
+ private Context mContext;
+ private IJumbleService mService;
+ private Channel mChannel;
+
+ public ChannelAdapter(Context context, IJumbleService service, Channel channel) {
+ mContext = context;
+ mService = service;
+ mChannel = channel;
+ }
+
+ @Override
+ public int getCount() {
+ return mChannel.getUsers().size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ try {
+ return mService.getUser(mChannel.getUsers().get(position));
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return mChannel.getUsers().get(position);
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View v = convertView;
+ if(v == null) {
+ LayoutInflater layoutInflater = LayoutInflater.from(mContext);
+ v = layoutInflater.inflate(R.layout.overlay_user_row, parent, false);
+ }
+ User user = (User) getItem(position);
+ TextView titleView = (TextView) v.findViewById(R.id.userRowName);
+ titleView.setText(user.getName());
+
+ ImageView state = (ImageView) v.findViewById(R.id.userRowState);
+ if (user.isSelfDeafened())
+ state.setImageResource(R.drawable.ic_deafened);
+ else if (user.isSelfMuted())
+ state.setImageResource(R.drawable.ic_muted);
+ else if (user.isDeafened())
+ state.setImageResource(R.drawable.ic_server_deafened);
+ else if (user.isMuted())
+ state.setImageResource(R.drawable.ic_server_muted);
+ else if (user.isSuppressed())
+ state.setImageResource(R.drawable.ic_suppressed);
+ else
+ if (user.getTalkState() == User.TalkState.TALKING)
+ state.setImageResource(R.drawable.ic_talking_on);
+ else
+ state.setImageResource(R.drawable.ic_talking_off);
+
+ return v;
+ }
+
+ public void setChannel(Channel channel) {
+ mChannel = channel;
+ notifyDataSetChanged();
+ }
+
+ public Channel getChannel() {
+ return mChannel;
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelChatFragment.java b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelChatFragment.java
new file mode 100644
index 0000000..dc942c8
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelChatFragment.java
@@ -0,0 +1,365 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.channel;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.RemoteException;
+import android.text.Editable;
+import android.text.Html;
+import android.text.TextWatcher;
+import android.text.method.LinkMovementMethod;
+import android.util.Base64;
+import android.util.DisplayMetrics;
+import android.view.Gravity;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.TextView.OnEditorActionListener;
+
+import com.morlunk.jumble.IJumbleObserver;
+import com.morlunk.jumble.IJumbleService;
+import com.morlunk.jumble.model.Channel;
+import com.morlunk.jumble.model.Message;
+import com.morlunk.jumble.model.User;
+import com.morlunk.jumble.net.JumbleObserver;
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.util.JumbleServiceFragment;
+
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class ChannelChatFragment extends JumbleServiceFragment implements ChatTargetProvider.OnChatTargetSelectedListener {
+ private static final Pattern LINK_PATTERN = Pattern.compile("(https?://\\S+)");
+ private static final String CHAT_DATE_FORMAT = "%I:%M %p";
+
+ private IJumbleObserver mServiceObserver = new JumbleObserver() {
+
+ @Override
+ public void onMessageLogged(Message message) throws RemoteException {
+ addChatMessage(message, true);
+ }
+ };
+
+ private ListView mChatList;
+ private ChannelChatAdapter mChatAdapter;
+ private EditText mChatTextEdit;
+ private ImageButton mSendButton;
+ private ChatTargetProvider mTargetProvider;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setHasOptionsMenu(true);
+ }
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+ try {
+ mTargetProvider = (ChatTargetProvider) getParentFragment();
+ } catch (ClassCastException e) {
+ throw new ClassCastException(getParentFragment().toString()+" must implement ChatTargetProvider");
+ }
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ mTargetProvider.registerChatTargetListener(this);
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ mTargetProvider.unregisterChatTargetListener(this);
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_chat, container, false);
+ mChatList = (ListView) view.findViewById(R.id.chat_list);
+ mChatTextEdit = (EditText) view.findViewById(R.id.chatTextEdit);
+
+ mSendButton = (ImageButton) view.findViewById(R.id.chatTextSend);
+ mSendButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ try {
+ sendMessage(mChatTextEdit.getText().toString());
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ mChatTextEdit.setText("");
+ }
+ });
+
+ mChatTextEdit.setOnEditorActionListener(new OnEditorActionListener() {
+ @Override
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+ try {
+ sendMessage(v.getText().toString());
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ v.setText("");
+ return true;
+ }
+ });
+
+ mChatTextEdit.addTextChangedListener(new TextWatcher() {
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ mSendButton.setEnabled(mChatTextEdit.getText().length() > 0);
+ }
+
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+
+ }
+ });
+
+ try {
+ updateChatTargetText(mTargetProvider.getChatTarget());
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return view;
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ inflater.inflate(R.menu.fragment_chat, menu);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.menu_clear_chat:
+ clear();
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ /**
+ * Adds the passed text to the fragment chat body.
+ * @param message The message to add.
+ * @param scroll Whether to scroll to the bottom after adding the message.
+ */
+ public void addChatMessage(Message message, boolean scroll) {
+ if(mChatAdapter == null) return;
+
+ mChatAdapter.add(message);
+
+ if(scroll) {
+ mChatList.post(new Runnable() {
+
+ @Override
+ public void run() {
+ mChatList.smoothScrollToPosition(mChatAdapter.getCount() - 1);
+ }
+ });
+ }
+ }
+
+ private void sendMessage(String message) throws RemoteException {
+ String formattedMessage = linkifyOutgoingMessage(message);
+ ChatTargetProvider.ChatTarget target = mTargetProvider.getChatTarget();
+ Message responseMessage = null;
+ if(target == null)
+ responseMessage = getService().sendChannelTextMessage(getService().getSessionChannel().getId(), formattedMessage, false);
+ else if(target.getUser() != null)
+ responseMessage = getService().sendUserTextMessage(target.getUser().getSession(), formattedMessage);
+ else if(target.getChannel() != null)
+ responseMessage = getService().sendChannelTextMessage(target.getChannel().getId(), formattedMessage, false);
+ addChatMessage(responseMessage, true);
+ }
+
+ private String linkifyOutgoingMessage(String message) {
+ String formattedBody = message;
+ Matcher matcher = LINK_PATTERN.matcher(formattedBody);
+ formattedBody = matcher.replaceAll("<a href=\"$1\">$1</a>");
+ return formattedBody;
+ }
+
+ public void clear() {
+ mChatAdapter.clear();
+ try {
+ getService().clearMessageLog();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Updates hint displaying chat target.
+ */
+ public void updateChatTargetText(ChatTargetProvider.ChatTarget target) throws RemoteException {
+ if(getService() == null) return;
+
+ if(target == null) mChatTextEdit.setHint(getString(R.string.messageToChannel, getService().getSessionChannel().getName()));
+ else if(target.getUser() != null) mChatTextEdit.setHint(getString(R.string.messageToUser, target.getUser().getName()));
+ else if(target.getChannel() != null) mChatTextEdit.setHint(getString(R.string.messageToChannel, target.getChannel().getName()));
+ }
+
+
+ @Override
+ public void onServiceBound(IJumbleService service) {
+ try {
+ mChatAdapter = new ChannelChatAdapter(getActivity(), service, service.getMessageLog());
+ mChatList.setAdapter(mChatAdapter);
+ mChatList.post(new Runnable() {
+ @Override
+ public void run() {
+ mChatList.setSelection(mChatAdapter.getCount() - 1);
+ }
+ });
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public IJumbleObserver getServiceObserver() {
+ return mServiceObserver;
+ }
+
+ @Override
+ public void onChatTargetSelected(ChatTargetProvider.ChatTarget target) {
+ try {
+ updateChatTargetText(target);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private static class ChannelChatAdapter extends ArrayAdapter<Message> {
+
+ /**
+ * Image getter to read base64 image data from messages.
+ */
+ private Html.ImageGetter mImageGetter = new Html.ImageGetter() {
+
+ @Override
+ public Drawable getDrawable(String source) {
+ try {
+ String decodedSource = URLDecoder.decode(source, "UTF-8"); // Decode from URL encoding
+ String base64 = decodedSource.split(",")[1]; // Take the binary data only, not the img src header
+ byte[] src = Base64.decode(base64, Base64.DEFAULT);
+ Bitmap bmp = BitmapFactory.decodeByteArray(src, 0, src.length);
+ BitmapDrawable drawable = new BitmapDrawable(getContext().getResources(), bmp);
+ DisplayMetrics metrics = getContext().getResources().getDisplayMetrics(); // Use display metrics to scale image to mdpi
+ drawable.setBounds(0, 0, (int)((float)drawable.getIntrinsicWidth()*metrics.density), (int)((float)drawable.getIntrinsicHeight()*metrics.density));
+ return drawable;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+ };
+ private IJumbleService mService;
+
+ public ChannelChatAdapter(Context context, IJumbleService service, List<Message> messages) {
+ super(context, 0, new ArrayList<Message>(messages));
+ mService = service;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View v = convertView;
+ if(v == null) {
+ v = LayoutInflater.from(getContext()).inflate(R.layout.list_chat_item, parent, false);
+ }
+
+ LinearLayout chatBox = (LinearLayout) v.findViewById(R.id.list_chat_item_box);
+ TextView targetText = (TextView) v.findViewById(R.id.list_chat_item_target);
+ TextView messageText = (TextView) v.findViewById(R.id.list_chat_item_text);
+ TextView timeText = (TextView) v.findViewById(R.id.list_chat_item_time);
+
+ Message message = getItem(position);
+ String targetMessage = null;
+ boolean selfAuthored = false;
+ try {
+ User actor = mService.getUser(message.getActor());
+ selfAuthored = actor != null && actor.getSession() == mService.getSession();
+
+ if(actor != null && (!message.getChannels().isEmpty() || !message.getTrees().isEmpty())) {
+ Channel currentChannel = message.getChannels().get(0);
+ targetMessage = getContext().getString(R.string.chat_message_to, actor.getName(), currentChannel.getName());
+ } else if(actor != null && !message.getUsers().isEmpty()) {
+ User user = message.getUsers().get(0);
+ targetMessage = getContext().getString(R.string.chat_message_to, actor.getName(), user.getName());
+ } else if(actor != null) {
+ targetMessage = actor.getName();
+ } else {
+ targetMessage = getContext().getString(R.string.server);
+ }
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+
+ int gravity = selfAuthored ? Gravity.RIGHT : Gravity.LEFT;
+
+ chatBox.setGravity(gravity);
+ targetText.setVisibility(message.getType() == Message.Type.TEXT_MESSAGE ? View.VISIBLE : View.GONE);
+ targetText.setText(targetMessage);
+ messageText.setText(Html.fromHtml(message.getMessage(), mImageGetter, null));
+ messageText.setMovementMethod(LinkMovementMethod.getInstance());
+ messageText.setGravity(gravity);
+ timeText.setText(message.getReceivedTime().format(CHAT_DATE_FORMAT));
+
+ return v;
+ }
+
+ @Override
+ public boolean areAllItemsEnabled() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnabled(int position) {
+ return false; // Makes links clickable.
+ }
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelEditFragment.java b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelEditFragment.java
new file mode 100644
index 0000000..6e0b7d7
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelEditFragment.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.channel;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.os.Bundle;
+import android.os.RemoteException;
+import android.support.v4.app.DialogFragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.CheckBox;
+import android.widget.TextView;
+
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.util.JumbleServiceProvider;
+
+/**
+ * Created by andrew on 23/11/13.
+ */
+public class ChannelEditFragment extends DialogFragment {
+
+ private JumbleServiceProvider mServiceProvider;
+ private TextView mNameField;
+ private TextView mDescriptionField;
+ private TextView mPositionField;
+ private CheckBox mTemporaryBox;
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+
+ try {
+ mServiceProvider = (JumbleServiceProvider) activity;
+ } catch (ClassCastException e) {
+ throw new ClassCastException(activity.toString() + " must implement JumbleServiceProvider");
+ }
+ }
+
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ LayoutInflater inflater = LayoutInflater.from(getActivity());
+ View view = inflater.inflate(R.layout.fragment_channel_edit, null, false);
+ mNameField = (TextView) view.findViewById(R.id.channel_edit_name);
+ mDescriptionField = (TextView) view.findViewById(R.id.channel_edit_description);
+ mPositionField = (TextView) view.findViewById(R.id.channel_edit_position);
+ mTemporaryBox = (CheckBox) view.findViewById(R.id.channel_edit_temporary);
+ return new AlertDialog.Builder(getActivity())
+ .setTitle(isAdding() ? R.string.channel_add : R.string.channel_edit)
+ .setView(view)
+ .setPositiveButton(isAdding() ? R.string.add : R.string.save, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ try {
+ if(isAdding()) {
+ mServiceProvider.getService().createChannel(getParent(),
+ mNameField.getText().toString(),
+ mDescriptionField.getText().toString(),
+ Integer.parseInt(mPositionField.getText().toString()), // We can guarantee this to be an int. InputType is numberSigned.
+ mTemporaryBox.isChecked());
+ } else {
+ // TODO
+ }
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ })
+ .setNegativeButton(android.R.string.cancel, null)
+ .create();
+ }
+
+ /**
+ * @return true if the user is adding a new channel.
+ */
+ public boolean isAdding() {
+ return getArguments().getBoolean("adding");
+ }
+
+ /**
+ * @return the parent channel that the new channel will be a child of.
+ */
+ public int getParent() {
+ return getArguments().getInt("parent");
+ }
+ /**
+ * @return the channel being updated.
+ */
+ public int getChannel() {
+ return getArguments().getInt("channel");
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelFragment.java b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelFragment.java
new file mode 100644
index 0000000..d377b21
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelFragment.java
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.channel;
+
+import android.content.SharedPreferences;
+import android.content.res.TypedArray;
+import android.os.Bundle;
+import android.os.RemoteException;
+import android.preference.PreferenceManager;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentPagerAdapter;
+import android.support.v4.view.PagerTabStrip;
+import android.support.v4.view.ViewPager;
+import android.util.TypedValue;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.Settings;
+import com.morlunk.mumbleclient.util.JumbleServiceFragment;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Class to encapsulate both a ChannelListFragment and ChannelChatFragment.
+ * Created by andrew on 02/08/13.
+ */
+public class ChannelFragment extends JumbleServiceFragment implements SharedPreferences.OnSharedPreferenceChangeListener, ChatTargetProvider {
+
+ private ViewPager mViewPager;
+ private PagerTabStrip mTabStrip;
+ private Button mTalkButton;
+ private View mTalkView;
+
+ private ChatTarget mChatTarget;
+ /** Chat target listeners, notified when the chat target is changed. */
+ private List<OnChatTargetSelectedListener> mChatTargetListeners = new ArrayList<OnChatTargetSelectedListener>();
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_channel, container, false);
+ mViewPager = (ViewPager) view.findViewById(R.id.channel_view_pager);
+ mTabStrip = (PagerTabStrip) view.findViewById(R.id.channel_tab_strip);
+ if(mTabStrip != null) {
+ int[] attrs = new int[] { R.attr.secondaryBackground, android.R.attr.textColorPrimaryInverse };
+ TypedArray a = getActivity().obtainStyledAttributes(attrs);
+ int titleStripBackground = a.getColor(0, -1);
+ int titleStripColor = a.getColor(1, -1);
+ a.recycle();
+
+ mTabStrip.setTextColor(titleStripColor);
+ mTabStrip.setTabIndicatorColor(titleStripColor);
+ mTabStrip.setBackgroundColor(titleStripBackground);
+ mTabStrip.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
+ }
+
+ final Settings settings = Settings.getInstance(getActivity());
+ mTalkView = view.findViewById(R.id.pushtotalk_view);
+ mTalkButton = (Button) view.findViewById(R.id.pushtotalk);
+ mTalkButton.setOnTouchListener(new View.OnTouchListener() {
+
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ try {
+ if (event.getAction() == MotionEvent.ACTION_DOWN) {
+ if (!settings.isPushToTalkToggle())
+ getService().setTalkingState(true);
+ else
+ getService().setTalkingState(!getService().isTalking());
+ } else if (event.getAction() == MotionEvent.ACTION_UP) {
+ if (!settings.isPushToTalkToggle())
+ getService().setTalkingState(false);
+ }
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
+ });
+ configureInput();
+ return view;
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+
+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
+ preferences.registerOnSharedPreferenceChangeListener(this);
+
+ if(mViewPager != null) { // Phone
+ ChannelFragmentPagerAdapter pagerAdapter = new ChannelFragmentPagerAdapter(getChildFragmentManager());
+ mViewPager.setAdapter(pagerAdapter);
+ } else { // Tablet
+ ChannelListFragment listFragment = new ChannelListFragment();
+ Bundle listArgs = new Bundle();
+ listArgs.putBoolean("pinned", isShowingPinnedChannels());
+ listFragment.setArguments(listArgs);
+ ChannelChatFragment chatFragment = new ChannelChatFragment();
+
+ getChildFragmentManager().beginTransaction()
+ .replace(R.id.list_fragment, listFragment)
+ .replace(R.id.chat_fragment, chatFragment)
+ .commit();
+ }
+ }
+
+ @Override
+ public void onDestroy() {
+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
+ preferences.unregisterOnSharedPreferenceChangeListener(this);
+ super.onDestroy();
+ }
+
+ /**
+ * @return true if the channel fragment is set to display only the user's pinned channels.
+ */
+ private boolean isShowingPinnedChannels() {
+ return getArguments() != null &&
+ getArguments().getBoolean("pinned");
+ }
+
+ /**
+ * Configures the fragment in accordance with the user's interface preferences.
+ */
+ private void configureInput() {
+ Settings settings = Settings.getInstance(getActivity());
+ boolean showPttButton = settings.isPushToTalkButtonShown() && settings.getInputMethod().equals(Settings.ARRAY_INPUT_METHOD_PTT);
+ mTalkView.setVisibility(showPttButton ? View.VISIBLE : View.GONE);
+ }
+
+ @Override
+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
+ if(Settings.PREF_INPUT_METHOD.equals(key) || Settings.PREF_PUSH_BUTTON_HIDE_KEY.equals(key))
+ configureInput();
+ }
+
+ @Override
+ public ChatTarget getChatTarget() {
+ return mChatTarget;
+ }
+
+ @Override
+ public void setChatTarget(ChatTarget target) {
+ if(target != null && mViewPager != null) {
+ // Scroll to chat pane when a user is selected.
+ mViewPager.setCurrentItem(1, true);
+ }
+ mChatTarget = target;
+ for(OnChatTargetSelectedListener listener : mChatTargetListeners)
+ listener.onChatTargetSelected(target);
+ }
+
+ @Override
+ public void registerChatTargetListener(OnChatTargetSelectedListener listener) {
+ mChatTargetListeners.add(listener);
+ }
+
+ @Override
+ public void unregisterChatTargetListener(OnChatTargetSelectedListener listener) {
+ mChatTargetListeners.remove(listener);
+ }
+
+ private class ChannelFragmentPagerAdapter extends FragmentPagerAdapter {
+
+ public ChannelFragmentPagerAdapter(FragmentManager fm) {
+ super(fm);
+ }
+
+ @Override
+ public Fragment getItem(int i) {
+ Fragment fragment = null;
+ Bundle args = new Bundle();
+ switch (i) {
+ case 0:
+ fragment = new ChannelListFragment();
+ args.putBoolean("pinned", isShowingPinnedChannels());
+ break;
+ case 1:
+ fragment = new ChannelChatFragment();
+ break;
+ }
+ fragment.setArguments(args);
+ return fragment;
+ }
+
+ @Override
+ public CharSequence getPageTitle(int position) {
+ switch (position) {
+ case 0:
+ return getString(R.string.channel).toUpperCase();
+ case 1:
+ return getString(R.string.chat).toUpperCase();
+ default:
+ return null;
+ }
+ }
+
+ @Override
+ public int getCount() {
+ return 2;
+ }
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelListAdapter.java b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelListAdapter.java
new file mode 100644
index 0000000..a4ea2a1
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelListAdapter.java
@@ -0,0 +1,293 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.channel;
+
+import android.content.Context;
+import android.graphics.Typeface;
+import android.os.RemoteException;
+import android.util.DisplayMetrics;
+import android.util.SparseArray;
+import android.util.TypedValue;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.morlunk.jumble.IJumbleService;
+import com.morlunk.jumble.model.Channel;
+import com.morlunk.jumble.model.User;
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.db.PlumbleDatabase;
+import com.morlunk.mumbleclient.view.PlumbleNestedAdapter;
+import com.morlunk.mumbleclient.view.PlumbleNestedListView;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by andrew on 31/07/13.
+ */
+public class ChannelListAdapter extends PlumbleNestedAdapter<Channel, User> {
+
+ /**
+ * Gets called when the channel menu needs to be shown.
+ */
+ public interface ChannelMenuListener {
+ public void showChannelMenu(Channel channel, View anchor);
+ }
+
+ private IJumbleService mService;
+ private PlumbleNestedListView mListView;
+ private ChannelMenuListener mMenuListener;
+ private PlumbleDatabase mDatabase;
+
+ private SparseArray<Channel> mChannels = new SparseArray<Channel>();
+ private SparseArray<User> mUsers = new SparseArray<User>();
+ private List<Integer> mRootChannels = new ArrayList<Integer>();
+
+ private boolean mShowPinnedOnly;
+
+ public ChannelListAdapter(Context context, PlumbleNestedListView listView, IJumbleService service, PlumbleDatabase database, boolean showPinnedOnly) {
+ super(context);
+ mService = service;
+ mDatabase = database;
+ mListView = listView;
+ mShowPinnedOnly = showPinnedOnly;
+ }
+
+ /**
+ * Fetches a new list of channels from the service.
+ */
+ public void updateChannelList() throws RemoteException {
+ mChannels.clear();
+ mUsers.clear();
+
+ List<Channel> channels = mService.getChannelList();
+ List<User> users = mService.getUserList();
+ mRootChannels = new ArrayList<Integer>();
+
+ if(mShowPinnedOnly) {
+ mRootChannels = mDatabase.getPinnedChannels(mService.getConnectedServer().getId());
+ } else {
+ mRootChannels.add(0);
+ }
+
+ for(Channel channel : channels)
+ mChannels.put(channel.getId(), channel);
+ for(User user : users)
+ mUsers.put(user.getSession(), user);
+ }
+
+ public void refreshUser(User user) throws RemoteException {
+ int position = getVisibleFlatChildPosition(user.getSession());
+ if(position < 0)
+ return;
+
+ View userView = mListView.getChildAt(position - mListView.getFirstVisiblePosition());
+
+ // Update comment state TODO reimplement
+// if (user.getComment() != null
+// || user.getCommentHash() != null
+// && !service.isConnectedServerPublic()) {
+// commentsSeen.put(user, database.isCommentSeen(
+// user.name,
+// user.commentHash != null ? user.commentHash
+// .toStringUtf8() : user.comment));
+// }
+
+ if (userView != null && userView.isShown() && userView.getTag() != null && userView.getTag().equals(user))
+ refreshElements(userView, user);
+ }
+
+ public void refreshTalkingState(User user) {
+ int position = getVisibleFlatChildPosition(user.getSession());
+ if(position < 0)
+ return;
+
+ View userView = mListView.getChildAt(position - mListView.getFirstVisiblePosition());
+
+ if (userView != null && userView.isShown() && userView.getTag() != null && userView.getTag().equals(user))
+ refreshTalkingState(userView, user);
+
+ }
+
+ private void refreshElements(final View view, final User user) {
+ TextView name = (TextView) view.findViewById(R.id.userRowName);
+
+ name.setText(user.getName());
+ try {
+ name.setTypeface(null, user.getSession() == mService.getSession() ? Typeface.BOLD : Typeface.NORMAL);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+
+ refreshTalkingState(view, user);
+ }
+
+ private void refreshTalkingState(final View view, final User user) {
+ final ImageView state = (ImageView) view.findViewById(R.id.userRowState);
+
+ if (user.isSelfDeafened())
+ state.setImageResource(R.drawable.ic_deafened);
+ else if (user.isSelfMuted())
+ state.setImageResource(R.drawable.ic_muted);
+ else if (user.isDeafened())
+ state.setImageResource(R.drawable.ic_server_deafened);
+ else if (user.isMuted())
+ state.setImageResource(R.drawable.ic_server_muted);
+ else if (user.isSuppressed())
+ state.setImageResource(R.drawable.ic_suppressed);
+ else
+ if (user.getTalkState() == User.TalkState.TALKING)
+ state.setImageResource(R.drawable.ic_talking_on);
+ else
+ state.setImageResource(R.drawable.ic_talking_off);
+ }
+
+ public void setChannelMenuListener(ChannelMenuListener listener) {
+ mMenuListener = listener;
+ }
+
+ @Override
+ public User getChild(int groupId, int childPosition) {
+ Channel channel = mChannels.get(groupId);
+ int session = channel.getUsers().get(childPosition);
+ return mUsers.get(session);
+ }
+
+ @Override
+ public View getChildView(int groupId, int childPosition, int depth, View v, ViewGroup arg4) {
+ if (v == null) {
+ final LayoutInflater inflater = (LayoutInflater) getContext()
+ .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ v = inflater.inflate(R.layout.channel_user_row, arg4, false);
+ }
+
+ final User user = getChild(groupId, childPosition);
+
+ if(user != null)
+ refreshElements(v, user);
+ v.setTag(user);
+
+ // Pad the view depending on channel's nested level.
+ final View titleView = v.findViewById(R.id.channel_user_row_title);
+ DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();
+ float margin = (depth + 1) * TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 25, metrics);
+ titleView.setPadding((int) margin, titleView.getPaddingTop(), titleView.getPaddingRight(), titleView.getPaddingBottom());
+
+ return v;
+ }
+
+ @Override
+ public List<Integer> getRootIds() {
+ return mRootChannels;
+ }
+
+ @Override
+ public int getGroupCount(int parentId) {
+ if(mShowPinnedOnly) return 0; // No subchannels when using pinned
+ Channel parent = mChannels.get(parentId);
+ return parent.getSubchannels().size();
+ }
+
+ @Override
+ public int getChildCount(int arg0) {
+ Channel channel = mChannels.get(arg0);
+ return channel.getUsers().size();
+ }
+
+ @Override
+ public Channel getGroup(int arg0) {
+ return mChannels.get(arg0);
+ }
+
+ @Override
+ public View getGroupView(final int groupId, int depth, View convertView, ViewGroup parent) {
+ View v = convertView;
+ if (v == null) {
+ final LayoutInflater inflater = (LayoutInflater) getContext()
+ .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ v = inflater.inflate(R.layout.channel_row, parent, false);
+ }
+
+ final Channel channel = mChannels.get(groupId);
+
+ ImageView expandView = (ImageView) v.findViewById(R.id.channel_row_expand);
+ expandView.setImageResource(isGroupExpanded(groupId) ? R.drawable.ic_action_minus_light : R.drawable.ic_action_add_light);
+ expandView.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ if(isGroupExpanded(groupId))
+ collapseGroup(groupId);
+ else
+ expandGroup(groupId);
+ notifyVisibleSetChanged();
+ }
+ });
+
+ TextView nameView = (TextView) v
+ .findViewById(R.id.channel_row_name);
+ TextView countView = (TextView) v.findViewById(R.id.channel_row_count);
+
+ nameView.setText(channel.getName());
+
+ int userCount = channel.getSubchannelUserCount();
+ countView.setText(String.format("%d", userCount));
+ countView.setTextColor(getContext().getResources().getColor(userCount > 0 ? R.color.holo_blue_light : android.R.color.darker_gray));
+
+ ImageView moreView = (ImageView) v.findViewById(R.id.channel_row_more);
+ moreView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if(mMenuListener != null)
+ mMenuListener.showChannelMenu(channel, v);
+ }
+ });
+
+ View channelTitle = v.findViewById(R.id.channel_row_title);
+
+ // Pad the view depending on channel's nested level.
+ DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();
+ float margin = depth * TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 25, metrics);
+ channelTitle.setPadding((int) margin, channelTitle.getPaddingTop(), channelTitle.getPaddingRight(),
+ channelTitle.getPaddingBottom());
+
+ return v;
+ }
+
+ @Override
+ public int getGroupId(int parentId, int groupPosition) {
+ Channel parent = mChannels.get(parentId);
+ Channel channel = mChannels.get(parent.getSubchannels().get(groupPosition));
+ return channel.getId();
+ }
+
+ @Override
+ public int getChildId(int groupId, int childPosition) {
+ Channel channel = mChannels.get(groupId);
+ return channel.getUsers().get(childPosition);
+ }
+
+ @Override
+ public boolean isGroupExpandedByDefault(int groupId) {
+ // Return true if there are channels in the chain with more than 0 users.
+ return mChannels.get(groupId).getSubchannelUserCount() > 0;
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelListFragment.java b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelListFragment.java
new file mode 100644
index 0000000..f8d4e5a
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelListFragment.java
@@ -0,0 +1,847 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.channel;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
+import android.app.SearchManager;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.graphics.PorterDuff;
+import android.graphics.Rect;
+import android.graphics.drawable.ColorDrawable;
+import android.media.AudioManager;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.RemoteException;
+import android.support.v4.view.MenuItemCompat;
+import android.support.v7.widget.PopupMenu;
+import android.support.v7.widget.SearchView;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.EditText;
+import android.widget.GridView;
+import android.widget.ImageView;
+import android.widget.PopupWindow;
+import android.widget.TextView;
+
+import com.morlunk.jumble.IJumbleObserver;
+import com.morlunk.jumble.IJumbleService;
+import com.morlunk.jumble.model.Channel;
+import com.morlunk.jumble.model.User;
+import com.morlunk.jumble.net.JumbleObserver;
+import com.morlunk.jumble.net.Permissions;
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.db.DatabaseProvider;
+import com.morlunk.mumbleclient.util.JumbleServiceFragment;
+import com.morlunk.mumbleclient.view.PlumbleNestedListView;
+import com.morlunk.mumbleclient.view.PlumbleNestedListView.OnNestedChildClickListener;
+import com.morlunk.mumbleclient.view.PlumbleNestedListView.OnNestedGroupClickListener;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ChannelListFragment extends JumbleServiceFragment implements OnNestedChildClickListener, OnNestedGroupClickListener, ChannelListAdapter.ChannelMenuListener, CommentFragment.CommentFragmentListener {
+
+ public static final int KICK_ID = 0,
+ BAN_ID = 1,
+ MUTE_ID = 2,
+ DEAFEN_ID = 3,
+ PRIORITY_ID = 4,
+ LOCAL_MUTE_ID = 5,
+ IGNORE_MESSAGES_ID = 6,
+ CHANGE_COMMENT_ID = 7,
+ VIEW_COMMENT_ID = 8,
+ RESET_COMMENT_ID = 9,
+ SEND_MESSAGE_ID = 10,
+ USER_INFORMATION_ID = 11,
+ REGISTER_ID = 12;
+
+ private IJumbleObserver mServiceObserver = new JumbleObserver() {
+ @Override
+ public void onDisconnected() throws RemoteException {
+ mChannelView.setAdapter(null);
+ }
+
+ @Override
+ public void onUserJoinedChannel(User user, Channel newChannel, Channel oldChannel) throws RemoteException {
+ updateChannelList();
+ if(getService().getSession() == user.getSession()) {
+ scrollToChannel(newChannel.getId());
+ }
+ }
+
+ @Override
+ public void onChannelAdded(Channel channel) throws RemoteException {
+ updateChannelList();
+ }
+
+ @Override
+ public void onChannelRemoved(Channel channel) throws RemoteException {
+ updateChannelList();
+ }
+
+ @Override
+ public void onChannelStateUpdated(Channel channel) throws RemoteException {
+ updateChannel(channel);
+ }
+
+ @Override
+ public void onUserConnected(User user) throws RemoteException {
+ updateChannelList();
+ }
+
+ @Override
+ public void onUserRemoved(User user, String reason) throws RemoteException {
+ removeUser(user);
+ }
+
+ @Override
+ public void onUserStateUpdated(User user) throws RemoteException {
+ updateUser(user);
+ }
+
+ @Override
+ public void onUserTalkStateUpdated(User user) throws RemoteException {
+ updateUserTalking(user);
+ }
+ };
+
+ private BroadcastReceiver mBluetoothReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if(getActivity() != null)
+ getActivity().supportInvalidateOptionsMenu(); // Update bluetooth menu item
+ }
+ };
+
+ private PlumbleNestedListView mChannelView;
+ private ChannelListAdapter mChannelListAdapter;
+ private ChatTargetProvider mTargetProvider;
+ private DatabaseProvider mDatabaseProvider;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setHasOptionsMenu(true);
+ }
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+ try {
+ mTargetProvider = (ChatTargetProvider) getParentFragment();
+ } catch (ClassCastException e) {
+ throw new ClassCastException(getParentFragment().toString()+" must implement ChatTargetProvider");
+ }
+ try {
+ mDatabaseProvider = (DatabaseProvider) getActivity();
+ } catch (ClassCastException e) {
+ throw new ClassCastException(getActivity().toString()+" must implement DatabaseProvider");
+ }
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_channel_list, container, false);
+
+ // Get the UI views
+ mChannelView = (PlumbleNestedListView) view.findViewById(R.id.channelUsers);
+ mChannelView.setOnChildClickListener(this);
+ mChannelView.setOnGroupClickListener(this);
+
+ return view;
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+ registerForContextMenu(mChannelView);
+ getActivity().registerReceiver(mBluetoothReceiver, new IntentFilter(AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED));
+ }
+
+ @Override
+ public void onDetach() {
+ getActivity().unregisterReceiver(mBluetoothReceiver);
+ super.onDetach();
+ }
+
+ @Override
+ public IJumbleObserver getServiceObserver() {
+ return mServiceObserver;
+ }
+
+ @Override
+ public void onServiceBound(IJumbleService service) {
+ try {
+ if(mChannelListAdapter == null)
+ setupChannelList();
+ else
+ updateChannelList();
+ scrollToUser(service.getSession());
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void onPrepareOptionsMenu(Menu menu) {
+ super.onPrepareOptionsMenu(menu);
+//
+// Mute/deaf opacity conflicts with color drawable mutation
+// MenuItem muteItem = menu.findItem(R.id.menu_mute_button);
+// MenuItem deafenItem = menu.findItem(R.id.menu_deafen_button);
+//
+// try {
+// if(getService() != null && getService().getSessionUser() != null && getService().isConnected()) {
+// User self = getService().getSessionUser();
+// muteItem.getIcon().mutate().setAlpha(self.isSelfMuted() ? 100 : 255);
+// deafenItem.getIcon().mutate().setAlpha(self.isSelfDeafened() ? 100 : 255);
+// }
+// } catch (RemoteException e) {
+// e.printStackTrace();
+// }
+
+ try {
+ if(getService() != null) {
+ MenuItem bluetoothItem = menu.findItem(R.id.menu_bluetooth);
+ bluetoothItem.setChecked(getService().isBluetoothAvailable());
+ }
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ inflater.inflate(R.menu.fragment_channel_list, menu);
+
+ MenuItem searchItem = menu.findItem(R.id.menu_search);
+ SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE);
+ SearchView searchView = (SearchView)MenuItemCompat.getActionView(searchItem);
+ searchView.setSearchableInfo(searchManager.getSearchableInfo(getActivity().getComponentName()));
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+
+ switch (item.getItemId()) {
+ case R.id.menu_mute_button:
+ try {
+ User self = getService().getSessionUser();
+
+ boolean muted = !self.isSelfMuted();
+ boolean deafened = self.isSelfDeafened();
+ deafened &= muted; // Undeafen if mute is off
+ self.setSelfMuted(muted);
+ self.setSelfDeafened(deafened);
+ getService().setSelfMuteDeafState(self.isSelfMuted(), self.isSelfDeafened());
+
+ getActivity().supportInvalidateOptionsMenu();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return true;
+ case R.id.menu_deafen_button:
+ try {
+ User self = getService().getSessionUser();
+
+ boolean deafened = self.isSelfDeafened();
+ self.setSelfDeafened(!deafened);
+ self.setSelfMuted(!deafened);
+ getService().setSelfMuteDeafState(self.isSelfDeafened(), self.isSelfDeafened());
+
+ getActivity().supportInvalidateOptionsMenu();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return true;
+ case R.id.menu_search:
+ return false;
+ case R.id.menu_bluetooth:
+ item.setChecked(!item.isChecked());
+ try {
+ getService().setBluetoothEnabled(item.isChecked());
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return true;
+ }
+
+ return super.onOptionsItemSelected(item);
+ }
+
+ private void setupChannelList() throws RemoteException {
+ mChannelListAdapter = new ChannelListAdapter(getActivity(), mChannelView, getService(), mDatabaseProvider.getDatabase(), isShowingPinnedChannels());
+ mChannelListAdapter.setChannelMenuListener(this);
+ mChannelView.setAdapter(mChannelListAdapter);
+ updateChannelList();
+ }
+
+ public void updateChannelList() throws RemoteException {
+ mChannelListAdapter.updateChannelList();
+ mChannelListAdapter.notifyDataSetChanged();
+ }
+
+ public void updateUser(User user) throws RemoteException {
+ mChannelListAdapter.refreshUser(user);
+ }
+
+ public void updateChannel(Channel channel) throws RemoteException {
+ if(channel.getDescription() != null || channel.getDescriptionHash() != null) {
+// TODO reimplement comment caching
+// mChannelListAdapter.commentsSeen.put(channel, mChannelListAdapter.database.isCommentSeen(
+// channel.getName(),
+// channel.getDescriptionHash() != null ? new String(channel.getDescriptionHash()) : channel.getDescription()));
+ }
+ updateChannelList();
+ }
+
+ public void updateUserTalking(User user) {
+ mChannelListAdapter.refreshTalkingState(user);
+ }
+
+ /**
+ * Removes the user from the channel list.
+ *
+ * @param user
+ */
+ public void removeUser(User user) {
+ mChannelListAdapter.notifyDataSetChanged();
+ }
+
+ /**
+ * Scrolls to the passed channel.
+ */
+ public void scrollToChannel(int channelId) {
+ int channelPosition = mChannelListAdapter.getFlatGroupPosition(channelId);
+ mChannelView.smoothScrollToPosition(channelPosition);
+ }
+ /**
+ * Scrolls to the passed user.
+ */
+ public void scrollToUser(int userId) {
+ int userPosition = mChannelListAdapter.getFlatChildPosition(userId);
+ mChannelView.smoothScrollToPosition(userPosition);
+ }
+
+ public void setChatTarget(User chatTarget) {
+ User oldTarget = chatTarget;
+ if (mChannelListAdapter != null) {
+ try {
+ if (oldTarget != null)
+ mChannelListAdapter.refreshUser(oldTarget);
+ mChannelListAdapter.refreshUser(chatTarget);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ @Override
+ public void onNestedChildClick(AdapterView<?> parent, View view, int groupId, int childPosition) {
+ User user = mChannelListAdapter.getChild(groupId, childPosition);
+ showUserMenu(view, user);
+ }
+
+ @Override
+ public void onNestedGroupClick(AdapterView<?> parent, View view, int groupId) {
+ try {
+ getService().joinChannel(groupId);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void showChannelMenu(Channel channel, View anchor) {
+ PopupMenu menu = new PopupMenu(getActivity(), anchor);
+ menu.inflate(R.menu.channel_modify_menu);
+ // TODO detect permissions
+ ChannelPopupMenuListener menuListener = new ChannelPopupMenuListener(channel);
+ menu.setOnMenuItemClickListener(menuListener);
+ boolean targeted = mTargetProvider.getChatTarget() != null &&
+ mTargetProvider.getChatTarget().getChannel() != null &&
+ mTargetProvider.getChatTarget().getChannel().getId() == channel.getId();
+ menu.getMenu().findItem(R.id.menu_channel_send_message).setChecked(targeted);
+
+ try {
+ long serverId = getService().getConnectedServer().getId();
+ boolean pinned = mDatabaseProvider.getDatabase().isChannelPinned(serverId, channel.getId());
+ menu.getMenu().findItem(R.id.menu_channel_pin).setChecked(pinned);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+
+ int permissions = channel.getPermissions();
+ menu.getMenu().findItem(R.id.menu_channel_add).setVisible((permissions & (Permissions.MakeChannel | Permissions.MakeTempChannel)) > 0);
+ menu.getMenu().findItem(R.id.menu_channel_edit).setVisible((permissions & Permissions.Write) > 0);
+ menu.getMenu().findItem(R.id.menu_channel_remove).setVisible((permissions & Permissions.Write) > 0);
+
+ menu.show();
+ }
+
+ /**
+ * Slides a PopupWindow containing a user menu underneath the passed view.
+ */
+ public void showUserMenu(final View view, final User user) {
+ LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ final View menuView = inflater.inflate(R.layout.popup_menu, null, false);
+ final GridView menuGrid = (GridView) menuView.findViewById(R.id.user_menu_grid);
+ final PopupWindow popupWindow = new PopupWindow(menuView, view.getMeasuredWidth(), WindowManager.LayoutParams.WRAP_CONTENT, true);
+
+ // Update menu grid when we receive updated permissions.
+ final JumbleObserver observer = new JumbleObserver() {
+ @Override
+ public void onChannelPermissionsUpdated(Channel channel) throws RemoteException {
+ List<ChannelMenuItem> items = getUserMenu(user);
+ menuGrid.setAdapter(new PopupGridMenuAdapter(getActivity(), items));
+ }
+ };
+
+ try {
+ getService().registerObserver(observer);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+
+ final List<ChannelMenuItem> menuItems;
+ try {
+ menuItems = getUserMenu(user);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ return;
+ }
+ menuGrid.setAdapter(new PopupGridMenuAdapter(getActivity(), menuItems));
+ menuGrid.setOnItemClickListener(new UserMenuListener(user, popupWindow));
+
+ final Animation slideDown = AnimationUtils.loadAnimation(getActivity(), R.anim.slide_down);
+ final Animation slideUp = AnimationUtils.loadAnimation(getActivity(), R.anim.slide_up);
+ slideUp.setAnimationListener(new Animation.AnimationListener() {
+ @Override public void onAnimationStart(Animation animation) { }
+
+ @Override
+ public void onAnimationEnd(Animation animation) {
+ Handler handler = new Handler();
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ popupWindow.dismiss(); // Automatically dismiss when hidden. Do this in main thread to avoid errors.
+ }
+ });
+ }
+ @Override public void onAnimationRepeat(Animation animation) { }
+ });
+
+ popupWindow.setBackgroundDrawable(new ColorDrawable()); // Hack to fix touch events.
+ popupWindow.setAnimationStyle(0); // No animations. We do our own.
+
+ // We do some not-so-nice hacks here. Because we're animating the view inside the PopupWindow and not the window itself, we have to make our own method to dismiss the window when there is an outside touch.
+ popupWindow.setTouchInterceptor(new View.OnTouchListener() {
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ Rect rect = new Rect();
+ v.getHitRect(rect);
+ if(event.getAction() == MotionEvent.ACTION_DOWN && !rect.contains((int)event.getX(), (int)event.getY())) {
+ menuView.startAnimation(slideUp); // Dismiss is done after animation, see above.
+ return true;
+ }
+ return false;
+ }
+ });
+
+ // Unregister listener on dismiss
+ popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+ @Override
+ public void onDismiss() {
+ if(getService() != null)
+ try {
+ getService().unregisterObserver(observer);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
+ // We only slide down the view inside of the PopupWindow so it clips to the PopupWindow.
+ menuView.startAnimation(slideDown);
+ popupWindow.showAsDropDown(view);
+ }
+
+ /**
+ * Configures the menu for the provided user, enabling allowed features and disabling/hiding others.
+ */
+ private List<ChannelMenuItem> getUserMenu(User user) throws RemoteException {
+ // TODO: maybe make these all class members, there's no point in re-instantiating every time we want to make a menu.
+ List<ChannelMenuItem> menuItems = new ArrayList<ChannelMenuItem>();
+ ChannelMenuItem kickItem = new ChannelMenuItem(KICK_ID, getActivity().getString(R.string.user_menu_kick), R.drawable.ic_action_delete_dark);
+ ChannelMenuItem banItem = new ChannelMenuItem(BAN_ID, getActivity().getString(R.string.user_menu_ban), R.drawable.ic_action_error);
+ ChannelMenuItem muteItem = new ChannelMenuItem(MUTE_ID, getActivity().getString(R.string.user_menu_mute), R.drawable.ic_action_microphone);
+ ChannelMenuItem deafItem = new ChannelMenuItem(DEAFEN_ID, getActivity().getString(R.string.user_menu_deafen), R.drawable.ic_action_headphones);
+ ChannelMenuItem priorityItem = new ChannelMenuItem(PRIORITY_ID, getActivity().getString(R.string.user_menu_priority_speaker), R.drawable.ic_action_audio_on);
+ ChannelMenuItem localMuteItem = new ChannelMenuItem(LOCAL_MUTE_ID, getActivity().getString(R.string.user_menu_local_mute), R.drawable.ic_action_audio_muted);
+ ChannelMenuItem ignoreMessagesItem = new ChannelMenuItem(IGNORE_MESSAGES_ID, getActivity().getString(R.string.user_menu_ignore_messages), R.drawable.ic_action_bad);
+ ChannelMenuItem changeCommentItem = new ChannelMenuItem(CHANGE_COMMENT_ID, getActivity().getString(R.string.user_menu_change_comment), R.drawable.ic_action_edit_dark);
+ ChannelMenuItem viewCommentItem = new ChannelMenuItem(VIEW_COMMENT_ID, getActivity().getString(R.string.user_menu_view_comment), R.drawable.ic_action_comment);
+ ChannelMenuItem resetCommentItem = new ChannelMenuItem(RESET_COMMENT_ID, getActivity().getString(R.string.user_menu_reset_comment), R.drawable.ic_action_comment);
+ ChannelMenuItem informationItem = new ChannelMenuItem(USER_INFORMATION_ID, getActivity().getString(R.string.user_menu_information), R.drawable.ic_action_info_dark);
+ ChannelMenuItem sendMessageItem = new ChannelMenuItem(SEND_MESSAGE_ID, getActivity().getString(R.string.user_menu_send_message), R.drawable.ic_action_chat_dark);
+ ChannelMenuItem registerItem = new ChannelMenuItem(REGISTER_ID, getActivity().getString(R.string.user_menu_register), R.drawable.ic_registered);
+
+ boolean self = user.getSession() == getService().getSession();
+
+ if((getService().getPermissions() & (Permissions.Kick | Permissions.Ban | Permissions.Write)) > 0)
+ menuItems.add(kickItem);
+
+ if((getService().getPermissions() & (Permissions.Ban | Permissions.Write)) > 0)
+ menuItems.add(banItem);
+
+ menuItems.add(muteItem);
+ menuItems.add(deafItem);
+ menuItems.add(priorityItem);
+ menuItems.add(localMuteItem);
+ menuItems.add(ignoreMessagesItem);
+
+ if(self) {
+ menuItems.add(changeCommentItem);
+ } else {
+ menuItems.add(viewCommentItem);
+ menuItems.add(resetCommentItem);
+ }
+
+// menuItems.add(informationItem); TODO
+ menuItems.add(sendMessageItem);
+
+ menuItems.add(registerItem);
+
+ registerItem.enabled = user.getUserId() < 0 && (user.getHash() != null && !user.getHash().isEmpty()) && (getService().getPermissions() & ((self ? Permissions.SelfRegister : Permissions.Register) | Permissions.Write)) > 0; // Enable if we can register, and the user isn't registered.
+ registerItem.title = user.getUserId() < 0 ? getActivity().getString(R.string.user_menu_register) : getActivity().getString(R.string.user_menu_registered); // Say 'registered' if registered.
+
+ Channel channel = getService().getChannel(user.getChannelId());
+ int channelPermissions = channel.getPermissions();
+
+ if(channelPermissions == 0) {
+ getService().requestPermissions(channel.getId());
+ if(channel.getId() == 0)
+ channelPermissions = getService().getPermissions();
+ else
+ channelPermissions = Permissions.All;
+ channel.setPermissions(channelPermissions);
+ }
+
+ muteItem.enabled = ((channelPermissions & (Permissions.Write | Permissions.MuteDeafen)) > 0 && ((user.getSession() != getService().getSession()) || user.isMuted() || user.isSuppressed()));
+ deafItem.enabled = ((channelPermissions & (Permissions.Write | Permissions.MuteDeafen)) > 0 && ((user.getSession() != getService().getSession()) || user.isDeafened()));
+ priorityItem.enabled = ((channelPermissions & (Permissions.Write | Permissions.MuteDeafen)) > 0);
+ sendMessageItem.enabled = ((channelPermissions & (Permissions.Write | Permissions.TextMessage)) > 0);
+ informationItem.enabled = (((getService().getPermissions() & (Permissions.Write | Permissions.Register))) > 0 || (channelPermissions & (Permissions.Write | Permissions.Enter)) > 0 || (user.getSession() == getService().getSession()));
+
+ kickItem.enabled = !self;
+ banItem.enabled = !self;
+ localMuteItem.enabled = !self;
+ ignoreMessagesItem.enabled = !self;
+ resetCommentItem.enabled = user.getCommentHash() != null && !user.getCommentHash().isEmpty() && (getService().getPermissions() & (Permissions.Move | Permissions.Write)) > 0;
+ viewCommentItem.enabled = (user.getComment() != null && !user.getComment().isEmpty()) || (user.getCommentHash() != null && !user.getCommentHash().isEmpty());
+
+ // Highlight toggles
+ muteItem.toggled = user.isMuted();
+ deafItem.toggled = user.isDeafened();
+ priorityItem.toggled = user.isPrioritySpeaker();
+ localMuteItem.toggled = user.isLocalMuted();
+ ignoreMessagesItem.toggled = user.isLocalIgnored();
+ sendMessageItem.toggled = mTargetProvider.getChatTarget() != null && mTargetProvider.getChatTarget().getUser() != null ? mTargetProvider.getChatTarget().getUser().getSession() == user.getSession() : false;
+
+ return menuItems;
+ }
+
+ private boolean isShowingPinnedChannels() {
+ return getArguments().getBoolean("pinned");
+ }
+
+ @Override
+ public void onCommentChanged(int session, String comment) {
+ try {
+ getService().setUserComment(session, comment);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private class ChannelMenuItem {
+ public int id;
+ public String title;
+ public int icon;
+ public boolean enabled = true;
+ public boolean toggled;
+
+ public ChannelMenuItem(int id, String title, int icon) {
+ this.id = id;
+ this.title = title;
+ this.icon = icon;
+ }
+ }
+
+ private class PopupGridMenuAdapter extends ArrayAdapter<ChannelMenuItem> {
+
+ public PopupGridMenuAdapter(Context context, List<ChannelMenuItem> items) {
+ super(context, 0, items);
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View v = convertView;
+ if(v == null) {
+ LayoutInflater inflater = LayoutInflater.from(getContext());
+ v = inflater.inflate(R.layout.popup_user_menu_item, parent, false);
+ }
+
+ ImageView icon = (ImageView) v.findViewById(R.id.user_menu_item_icon);
+ TextView title = (TextView) v.findViewById(R.id.user_menu_item_title);
+
+ ChannelMenuItem item = getItem(position);
+
+ icon.setImageResource(item.icon);
+ title.setText(item.title);
+
+ // Retrieve the title color and manipulate it
+ int filterColor = item.toggled ? getResources().getColor(R.color.holo_blue_light) : title.getCurrentTextColor();
+
+ // If the item isn't enabled, dim.
+ if(!item.enabled) {
+ filterColor &= 0x00FFFFFF; // First, remove opacity data.
+ filterColor |= 0x80000000; // Then use an OR operation to apply 50% alpha.
+ }
+
+ // Apply #33b5e5 (R.I.P. #holoyolo) color filter when toggled. Use the title's color (likely ?textColorSecondary) for the icon otherwise. TODO use defined ?highlightColor.
+ icon.setColorFilter(filterColor, PorterDuff.Mode.MULTIPLY);
+ title.setTextColor(filterColor);
+
+ return v;
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return getItem(position).id;
+ }
+
+ @Override
+ public boolean isEnabled(int position) {
+ return getItem(position).enabled;
+ }
+ }
+
+ private class ChannelPopupMenuListener implements PopupMenu.OnMenuItemClickListener {
+
+ private Channel mChannel;
+
+ public ChannelPopupMenuListener(Channel channel) {
+ mChannel = channel;
+ }
+
+ @Override
+ public boolean onMenuItemClick(MenuItem menuItem) {
+ boolean adding = false;
+ switch(menuItem.getItemId()) {
+ case R.id.menu_channel_add:
+ adding = true;
+ case R.id.menu_channel_edit:
+ ChannelEditFragment addFragment = new ChannelEditFragment();
+ Bundle args = new Bundle();
+ if(adding) args.putInt("parent", mChannel.getId());
+ else args.putInt("channel", mChannel.getId());
+ args.putBoolean("adding", adding);
+ addFragment.setArguments(args);
+ addFragment.show(getChildFragmentManager(), "ChannelAdd");
+ return true;
+ case R.id.menu_channel_remove:
+ AlertDialog.Builder adb = new AlertDialog.Builder(getActivity());
+ adb.setTitle(R.string.confirm);
+ adb.setMessage(R.string.confirm_delete_channel);
+ adb.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ try {
+ getService().removeChannel(mChannel.getId());
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ adb.setNegativeButton(android.R.string.cancel, null);
+ adb.show();
+ return true;
+ case R.id.menu_channel_send_message:
+ if(mTargetProvider.getChatTarget() != null &&
+ mTargetProvider.getChatTarget().getChannel() != null &&
+ mTargetProvider.getChatTarget().getChannel().getId() == mChannel.getId())
+ mTargetProvider.setChatTarget(null);
+ else
+ mTargetProvider.setChatTarget(new ChatTargetProvider.ChatTarget(mChannel));
+ return true;
+ case R.id.menu_channel_pin:
+ try {
+ long serverId = getService().getConnectedServer().getId();
+ boolean pinned = mDatabaseProvider.getDatabase().isChannelPinned(serverId, mChannel.getId());
+ if(!pinned) mDatabaseProvider.getDatabase().addPinnedChannel(serverId, mChannel.getId());
+ else mDatabaseProvider.getDatabase().removePinnedChannel(serverId, mChannel.getId());
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return true;
+ }
+ return false;
+ }
+ }
+
+ private class UserMenuListener implements GridView.OnItemClickListener {
+
+ private User mUser;
+ private PopupWindow mWindow;
+
+ public UserMenuListener(User user, PopupWindow window) {
+ mUser = user;
+ mWindow = window;
+ }
+
+ @Override
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+ try {
+ boolean ban = false;
+ switch ((int)id) {
+ case BAN_ID:
+ ban = true;
+ case KICK_ID:
+ AlertDialog.Builder alertBuilder = new AlertDialog.Builder(getActivity());
+ alertBuilder.setTitle(R.string.user_menu_kick);
+ final EditText reasonField = new EditText(getActivity());
+ reasonField.setHint(R.string.hint_reason);
+ alertBuilder.setView(reasonField);
+ final boolean finalBan = ban;
+ alertBuilder.setPositiveButton(R.string.user_menu_kick, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ try {
+ getService().kickBanUser(mUser.getSession(), reasonField.getText().toString(), finalBan);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ alertBuilder.setNegativeButton(android.R.string.cancel, null);
+ alertBuilder.show();
+ break;
+ case MUTE_ID:
+ getService().setMuteDeafState(mUser.getSession(), !mUser.isMuted(), mUser.isDeafened());
+ break;
+ case DEAFEN_ID:
+ getService().setMuteDeafState(mUser.getSession(), mUser.isMuted(), !mUser.isDeafened());
+ break;
+ case PRIORITY_ID:
+ getService().setPrioritySpeaker(mUser.getSession(), !mUser.isPrioritySpeaker());
+ break;
+ case LOCAL_MUTE_ID:
+ mUser.setLocalMuted(!mUser.isLocalMuted());
+ break;
+ case IGNORE_MESSAGES_ID:
+ mUser.setLocalIgnored(!mUser.isLocalIgnored());
+ break;
+ case CHANGE_COMMENT_ID:
+ showUserComment(true);
+ break;
+ case VIEW_COMMENT_ID:
+ showUserComment(false);
+ break;
+ case RESET_COMMENT_ID:
+ new AlertDialog.Builder(getActivity())
+ .setMessage(getString(R.string.confirm_reset_comment, mUser.getName()))
+ .setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ try {
+ getService().setUserComment(mUser.getSession(), "");
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ })
+ .setNegativeButton(android.R.string.cancel, null)
+ .show();
+ break;
+ case USER_INFORMATION_ID:
+ break;
+ case SEND_MESSAGE_ID:
+ if(mTargetProvider.getChatTarget() != null &&
+ mTargetProvider.getChatTarget().getUser() != null &&
+ mTargetProvider.getChatTarget().getUser().getSession() == mUser.getSession()) {
+ mTargetProvider.setChatTarget(null); // If selecting the same user, deselect target.
+ } else {
+ ChatTargetProvider.ChatTarget target = new ChatTargetProvider.ChatTarget(mUser);
+ mTargetProvider.setChatTarget(target);
+ }
+ break;
+ case REGISTER_ID:
+ getService().registerUser(mUser.getSession());
+ break;
+ }
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+
+ mWindow.dismiss();
+ }
+
+ private void showUserComment(final boolean edit) {
+ if(mUser.getCommentHash() != null && mUser.getComment() == null) {
+ try {
+ final ProgressDialog dialog = ProgressDialog.show(getActivity(), null, getString(R.string.loading), true, true);
+ // Send a RequestBlob to the server to ask for the comment. Register a listener to show the edit dialog when we get the response.
+ getService().registerObserver(new JumbleObserver() {
+ @Override
+ public void onUserStateUpdated(User user) throws RemoteException {
+ if(user.getSession() == mUser.getSession() && user.getComment() != null) {
+ getService().unregisterObserver(this); // TODO if we don't get a response find a way to unregister this anyway
+ dialog.dismiss();
+ showUserComment(edit);
+ }
+ }
+ });
+ getService().requestComment(mUser.getSession());
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+
+ } else {
+ CommentFragment editCommentFragment = CommentFragment.newInstance(mUser.getSession(), mUser.getComment(), edit);
+ editCommentFragment.show(getChildFragmentManager(), CommentFragment.class.getName());
+ }
+ }
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelSearchProvider.java b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelSearchProvider.java
new file mode 100644
index 0000000..5d1ee16
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChannelSearchProvider.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.channel;
+
+import android.app.SearchManager;
+import android.content.ComponentName;
+import android.content.ContentProvider;
+import android.content.ContentValues;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.database.Cursor;
+import android.database.MatrixCursor;
+import android.net.Uri;
+import android.os.IBinder;
+import android.os.RemoteException;
+
+import com.morlunk.jumble.IJumbleService;
+import com.morlunk.jumble.model.Channel;
+import com.morlunk.jumble.model.User;
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.service.PlumbleService;
+
+import java.util.List;
+import java.util.Locale;
+
+public class ChannelSearchProvider extends ContentProvider {
+
+ public static final String INTENT_DATA_CHANNEL = "channel";
+ public static final String INTENT_DATA_USER = "user";
+
+ private ServiceConnection conn = new ServiceConnection() {
+ @Override
+ public void onServiceConnected(ComponentName name, IBinder service) {
+ mService = (IJumbleService) service;
+ synchronized (mServiceLock) {
+ mServiceLock.notify();
+ }
+ }
+
+ @Override
+ public void onServiceDisconnected(ComponentName name) {
+ mService = null;
+ }
+ };
+
+ private IJumbleService mService;
+
+ @Override
+ public int delete(Uri uri, String selection, String[] selectionArgs) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public String getType(Uri uri) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Uri insert(Uri uri, ContentValues values) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean onCreate() {
+ return true;
+ }
+
+ private Object mServiceLock = new Object();
+
+
+ @Override
+ public Cursor query(Uri uri, String[] projection, String selection,
+ String[] selectionArgs, String sortOrder) {
+
+ // Try to connect to the service. Wait for conn to establish.
+ if(mService == null) {
+ Intent serviceIntent = new Intent(getContext(), PlumbleService.class);
+ getContext().bindService(serviceIntent, conn, 0);
+
+ synchronized (mServiceLock) {
+ try {
+ mServiceLock.wait();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ String query = "";
+ for(int x=0;x<selectionArgs.length;x++) {
+ query += selectionArgs[x];
+ if(x != selectionArgs.length-1)
+ query += " ";
+ }
+
+ query = query.toLowerCase(Locale.getDefault());
+
+ MatrixCursor cursor = new MatrixCursor(new String[] { "_ID", SearchManager.SUGGEST_COLUMN_INTENT_EXTRA_DATA, SearchManager.SUGGEST_COLUMN_TEXT_1, SearchManager.SUGGEST_COLUMN_ICON_1, SearchManager.SUGGEST_COLUMN_TEXT_2, SearchManager.SUGGEST_COLUMN_INTENT_DATA });
+
+ List<Channel> channels;
+ List<User> users;
+ try {
+ channels = mService.getChannelList();
+ users = mService.getUserList();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ return null;
+ }
+
+ for(int x=0;x<channels.size();x++) {
+ Channel channel = channels.get(x);
+ String channelNameLower = channel.getName().toLowerCase(Locale.getDefault());
+ if(channelNameLower.contains(query))
+ cursor.addRow(new Object[] { x, INTENT_DATA_CHANNEL, channel.getName(), R.drawable.ic_action_channels, getContext().getString(R.string.search_channel_users, channel.getSubchannelUserCount()), channel.getId() });
+ }
+
+ for(int x=0;x<users.size();x++) {
+ User user = users.get(x);
+ String userNameLower = user.getName().toLowerCase(Locale.getDefault());
+ if(userNameLower.contains(query))
+ cursor.addRow(new Object[] { x, INTENT_DATA_USER, user.getName(), R.drawable.ic_action_user_dark, getContext().getString(R.string.user), user.getSession() });
+ }
+
+ return cursor;
+ }
+
+ @Override
+ public int update(Uri uri, ContentValues values, String selection,
+ String[] selectionArgs) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChatTargetProvider.java b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChatTargetProvider.java
new file mode 100644
index 0000000..8c8b532
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ChatTargetProvider.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.channel;
+
+import com.morlunk.jumble.model.Channel;
+import com.morlunk.jumble.model.User;
+
+public interface ChatTargetProvider {
+
+ /**
+ * Abstraction for user and channel chat targets.
+ */
+ public class ChatTarget {
+ private Channel mChannel;
+ private User mUser;
+
+ public ChatTarget(Channel channel) {
+ mChannel = channel;
+ }
+
+ public ChatTarget(User user) {
+ mUser = user;
+ }
+
+ public Channel getChannel() {
+ return mChannel;
+ }
+
+ public User getUser() {
+ return mUser;
+ }
+ }
+
+ /**
+ * Interface for classes which wish to receive chat target change calls.
+ * Created by andrew on 06/08/13.
+ */
+ public interface OnChatTargetSelectedListener {
+ public void onChatTargetSelected(ChatTarget target);
+ }
+
+ public ChatTarget getChatTarget();
+ public void setChatTarget(ChatTarget target);
+ public void registerChatTargetListener(OnChatTargetSelectedListener listener);
+ public void unregisterChatTargetListener(OnChatTargetSelectedListener listener);
+} \ No newline at end of file
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/channel/CommentFragment.java b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/CommentFragment.java
new file mode 100644
index 0000000..5351a6e
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/CommentFragment.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.channel;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.os.Bundle;
+import android.support.v4.app.DialogFragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.webkit.WebView;
+import android.widget.EditText;
+import android.widget.TabHost;
+
+import com.morlunk.mumbleclient.R;
+
+/**
+ * Fragment to change your comment using basic WYSIWYG tools.
+ * Created by andrew on 10/08/13.
+ */
+public class CommentFragment extends DialogFragment {
+
+ public interface CommentFragmentListener {
+ public void onCommentChanged(int session, String comment);
+ }
+
+ private CommentFragmentListener mListener;
+ private TabHost mTabHost;
+ private WebView mCommentView;
+ private EditText mCommentEdit;
+
+ public static CommentFragment newInstance(int session, String comment, boolean editing) {
+ CommentFragment fragment = new CommentFragment();
+ Bundle args = new Bundle();
+ args.putInt("session", session);
+ args.putString("comment", comment);
+ args.putBoolean("editing", editing);
+ fragment.setArguments(args);
+ return fragment;
+ }
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+ try {
+ mListener = (CommentFragmentListener) getParentFragment();
+ } catch (ClassCastException e) {
+ throw new ClassCastException(getParentFragment().toString() + " must implement CommentFragmentListener");
+ }
+ }
+
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ LayoutInflater inflater = LayoutInflater.from(getActivity());
+ View view = inflater.inflate(R.layout.dialog_comment, null, false);
+
+ mCommentView = (WebView) view.findViewById(R.id.comment_view);
+ mCommentView.loadData(getComment(), "text/html", "UTF-8");
+ mCommentEdit = (EditText) view.findViewById(R.id.comment_edit);
+
+ mTabHost = (TabHost) view.findViewById(R.id.comment_tabhost);
+ mTabHost.setup();
+
+ TabHost.TabSpec viewTab = mTabHost.newTabSpec("View");
+ viewTab.setIndicator(getString(R.string.comment_view));
+ viewTab.setContent(R.id.comment_tab_view);
+
+ TabHost.TabSpec editTab = mTabHost.newTabSpec("Edit");
+ editTab.setIndicator(getString(isEditing() ? R.string.comment_edit_source : R.string.comment_view_source));
+ editTab.setContent(R.id.comment_tab_edit);
+
+ mTabHost.addTab(viewTab);
+ mTabHost.addTab(editTab);
+
+ mTabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
+ @Override
+ public void onTabChanged(String tabId) {
+ if("View".equals(tabId)) {
+ // When switching back to view tab, update with user's HTML changes.
+ mCommentView.loadData(mCommentEdit.getText().toString(), "text/html", "UTF-8");
+ } else if("Edit".equals(tabId) && "".equals(mCommentEdit.getText().toString())) {
+ // Load edittext content for the first time when the tab is selected, to improve performance with long messages.
+ mCommentEdit.setText(getComment());
+ }
+ }
+ });
+
+ mTabHost.setCurrentTab(isEditing() ? 1 : 0);
+
+ AlertDialog.Builder adb = new AlertDialog.Builder(getActivity());
+ adb.setView(view);
+ if (isEditing()) {
+ adb.setPositiveButton(R.string.save, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ mListener.onCommentChanged(getSession(), mCommentEdit.getText().toString());
+ }
+ });
+ }
+ adb.setNegativeButton(R.string.close, null);
+ return adb.create();
+ }
+
+ public int getSession() {
+ return getArguments().getInt("session");
+ }
+
+ public String getComment() {
+ return getArguments().getString("comment");
+ }
+
+ public boolean isEditing() {
+ return getArguments().getBoolean("editing");
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ServerInfoFragment.java b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ServerInfoFragment.java
new file mode 100644
index 0000000..fddc1b0
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/channel/ServerInfoFragment.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.channel;
+
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.RemoteException;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import com.morlunk.jumble.IJumbleService;
+import com.morlunk.jumble.net.JumbleUDPMessageType;
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.util.JumbleServiceFragment;
+
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * A fragment that displays known information from the remote server.
+ * Created by andrew on 28/08/13.
+ */
+public class ServerInfoFragment extends JumbleServiceFragment {
+
+ private static final int POLL_RATE = 1000;
+
+ private ScheduledExecutorService mExecutorService = Executors.newSingleThreadScheduledExecutor();
+ private Handler mHandler = new Handler(Looper.getMainLooper());
+
+ private TextView mProtocolView;
+ private TextView mOSVersionView;
+ private TextView mTCPLatencyView;
+ private TextView mUDPLatencyView;
+ private TextView mHostView;
+ private TextView mCodecView;
+ private TextView mMaxBandwidthView;
+ private TextView mCurrentBandwidthView;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_server_info, container, false);
+ mProtocolView = (TextView) view.findViewById(R.id.server_info_protocol);
+ mOSVersionView = (TextView) view.findViewById(R.id.server_info_os_version);
+ mTCPLatencyView = (TextView) view.findViewById(R.id.server_info_tcp_latency);
+ mUDPLatencyView = (TextView) view.findViewById(R.id.server_info_udp_latency);
+ mHostView = (TextView) view.findViewById(R.id.server_info_host);
+ mMaxBandwidthView = (TextView) view.findViewById(R.id.server_info_max_bandwidth);
+ mCurrentBandwidthView = (TextView) view.findViewById(R.id.server_info_current_bandwidth);
+ mCodecView = (TextView) view.findViewById(R.id.server_info_codec);
+ return view;
+ }
+
+ /**
+ * Updates the info from the service.
+ */
+ public void updateData() throws RemoteException {
+ if(getService() == null || !getService().isConnected())
+ return;
+
+ mProtocolView.setText(getString(R.string.server_info_protocol, getService().getServerRelease()));
+ mOSVersionView.setText(getString(R.string.server_info_version, getService().getServerOSName(), getService().getServerOSVersion()));
+ mTCPLatencyView.setText(getString(R.string.server_info_latency, (float)getService().getTCPLatency()*Math.pow(10, -3)));
+ mUDPLatencyView.setText(getString(R.string.server_info_latency, (float)getService().getUDPLatency()*Math.pow(10, -3)));
+ mHostView.setText(getString(R.string.server_info_host, getService().getConnectedServer().getHost(), getService().getConnectedServer().getPort()));
+
+ String codecName;
+ JumbleUDPMessageType codecType = JumbleUDPMessageType.values()[getService().getCodec()];
+ switch (codecType) {
+ case UDPVoiceOpus:
+ codecName = "Opus";
+ break;
+ case UDPVoiceCELTBeta:
+ codecName = "CELT 0.11.0";
+ break;
+ case UDPVoiceCELTAlpha:
+ codecName = "CELT 0.7.0";
+ break;
+ case UDPVoiceSpeex:
+ codecName = "Speex";
+ break;
+ default:
+ codecName = "???";
+ }
+
+ mMaxBandwidthView.setText(getString(R.string.server_info_max_bandwidth, (float)getService().getMaxBandwidth()/1000f));
+ mCurrentBandwidthView.setText(getString(R.string.server_info_current_bandwidth, (float)getService().getCurrentBandwidth()/1000f));
+ mCodecView.setText(getString(R.string.server_info_codec, codecName));
+ }
+
+ @Override
+ public void onServiceBound(IJumbleService service) {
+ // wow this is ugly
+ mExecutorService.scheduleAtFixedRate(new Runnable() {
+ @Override
+ public void run() {
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ updateData();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ }
+ }, 0, POLL_RATE, TimeUnit.MILLISECONDS);
+ }
+
+ @Override
+ public void onDestroy() {
+ mExecutorService.shutdownNow();
+ super.onDestroy();
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/db/DatabaseProvider.java b/Plumble/src/main/java/com/morlunk/mumbleclient/db/DatabaseProvider.java
new file mode 100644
index 0000000..31ae958
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/db/DatabaseProvider.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.db;
+
+/**
+ * Created by andrew on 15/08/13.
+ */
+public interface DatabaseProvider {
+ public PlumbleDatabase getDatabase();
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/db/PlumbleDatabase.java b/Plumble/src/main/java/com/morlunk/mumbleclient/db/PlumbleDatabase.java
new file mode 100644
index 0000000..a7be94c
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/db/PlumbleDatabase.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.db;
+
+import com.morlunk.jumble.model.Server;
+
+import java.util.List;
+
+/**
+ * An interface for persistent storage services (i.e. databases, cloud) to implement.
+ * Created by andrew on 13/08/13.
+ */
+public interface PlumbleDatabase {
+ public List<Server> getServers();
+ public void addServer(Server server);
+ public void updateServer(Server server);
+ public void removeServer(Server server);
+
+ public boolean isCommentSeen(String hash, byte[] commentHash);
+ public void markCommentSeen(String hash, byte[] commentHash);
+
+ public List<Integer> getPinnedChannels(long serverId);
+ public void addPinnedChannel(long serverId, int channelId);
+ public void removePinnedChannel(long serverId, int channelId);
+ public boolean isChannelPinned(long serverId, int channelId);
+
+ public List<String> getAccessTokens(long serverId);
+ public void addAccessToken(long serverId, String token);
+ public void removeAccessToken(long serverId, String token);
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/db/PlumbleSQLiteDatabase.java b/Plumble/src/main/java/com/morlunk/mumbleclient/db/PlumbleSQLiteDatabase.java
new file mode 100644
index 0000000..db3e0bd
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/db/PlumbleSQLiteDatabase.java
@@ -0,0 +1,277 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.db;
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.util.Log;
+
+import com.morlunk.jumble.model.Server;
+import com.morlunk.mumbleclient.Constants;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PlumbleSQLiteDatabase extends SQLiteOpenHelper implements PlumbleDatabase {
+
+ public static final String DATABASE_NAME = "mumble.db";
+
+ public static final String TABLE_SERVER = "server";
+ public static final String SERVER_ID = "_id";
+ public static final String SERVER_NAME = "name";
+ public static final String SERVER_HOST = "host";
+ public static final String SERVER_PORT = "port";
+ public static final String SERVER_USERNAME = "username";
+ public static final String SERVER_PASSWORD = "password";
+ public static final String TABLE_SERVER_CREATE_SQL = "CREATE TABLE IF NOT EXISTS `" + TABLE_SERVER + "` ("
+ + "`" + SERVER_ID + "` INTEGER PRIMARY KEY AUTOINCREMENT,"
+ + "`" + SERVER_NAME + "` TEXT NOT NULL,"
+ + "`" + SERVER_HOST + "` TEXT NOT NULL,"
+ + "`" + SERVER_PORT + "` INTEGER,"
+ + "`" + SERVER_USERNAME + "` TEXT NOT NULL,"
+ + "`" + SERVER_PASSWORD + "` TEXT"
+ + ");";
+
+ public static final String TABLE_FAVOURITES = "favourites";
+ public static final String FAVOURITES_ID = "_id";
+ public static final String FAVOURITES_CHANNEL = "channel";
+ public static final String FAVOURITES_SERVER = "server";
+ public static final String TABLE_FAVOURITES_CREATE_SQL = "CREATE TABLE IF NOT EXISTS `" + TABLE_FAVOURITES + "` ("
+ + "`" + FAVOURITES_ID + "` INTEGER PRIMARY KEY AUTOINCREMENT,"
+ + "`" + FAVOURITES_CHANNEL + "` TEXT NOT NULL,"
+ + "`" + FAVOURITES_SERVER + "` INTEGER NOT NULL"
+ + ");";
+
+ public static final String TABLE_TOKENS = "tokens";
+ public static final String TOKENS_ID = "_id";
+ public static final String TOKENS_VALUE = "value";
+ public static final String TOKENS_SERVER = "server";
+ public static final String TABLE_TOKENS_CREATE_SQL = "CREATE TABLE IF NOT EXISTS `" + TABLE_TOKENS + "` ("
+ + "`" + TOKENS_ID + "` INTEGER PRIMARY KEY AUTOINCREMENT,"
+ + "`" + TOKENS_VALUE + "` TEXT NOT NULL,"
+ + "`" + TOKENS_SERVER + "` INTEGER NOT NULL"
+ + ");";
+
+ public static final String TABLE_COMMENTS = "comments";
+ public static final String COMMENTS_WHO = "who";
+ public static final String COMMENTS_COMMENT = "comment";
+ public static final String COMMENTS_SEEN = "seen";
+ public static final String TABLE_COMMENTS_CREATE_SQL = "CREATE TABLE IF NOT EXISTS `" + TABLE_COMMENTS + "` ("
+ + "`" + COMMENTS_WHO + "` TEXT NOT NULL,"
+ + "`" + COMMENTS_COMMENT + "` TEXT NOT NULL,"
+ + "`" + COMMENTS_SEEN + "` DATE NOT NULL"
+ + ");";
+
+ public static final Integer PRE_FAVOURITES_DB_VERSION = 2;
+ public static final Integer PRE_TOKENS_DB_VERSION = 3;
+ public static final Integer PRE_COMMENTS_DB_VERSION = 4;
+ public static final Integer CURRENT_DB_VERSION = 5;
+
+ public PlumbleSQLiteDatabase(Context context) {
+ super(context, DATABASE_NAME, null, CURRENT_DB_VERSION);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL(TABLE_SERVER_CREATE_SQL);
+ db.execSQL(TABLE_FAVOURITES_CREATE_SQL);
+ db.execSQL(TABLE_TOKENS_CREATE_SQL);
+ db.execSQL(TABLE_COMMENTS_CREATE_SQL);
+ }
+
+ @Override
+ public void onUpgrade(
+ SQLiteDatabase db,
+ int oldVersion,
+ int newVersion) {
+ Log.w(Constants.TAG, "Database upgrade from " + oldVersion + " to " + newVersion);
+ if (oldVersion <= PRE_FAVOURITES_DB_VERSION) {
+ db.execSQL(TABLE_FAVOURITES_CREATE_SQL);
+ }
+
+ if (oldVersion <= PRE_TOKENS_DB_VERSION) {
+ db.execSQL(TABLE_TOKENS_CREATE_SQL);
+ }
+
+ if (oldVersion <= PRE_COMMENTS_DB_VERSION) {
+ db.execSQL(TABLE_COMMENTS_CREATE_SQL);
+ }
+ }
+
+ @Override
+ public List<Server> getServers() {
+ Cursor c = getReadableDatabase().query(
+ TABLE_SERVER,
+ new String[]{SERVER_ID, SERVER_NAME, SERVER_HOST,
+ SERVER_PORT, SERVER_USERNAME, SERVER_PASSWORD},
+ null,
+ null,
+ null,
+ null,
+ null);
+
+ List<Server> servers = new ArrayList<Server>();
+
+ c.moveToFirst();
+ while (!c.isAfterLast()) {
+ Server server = new Server(c.getInt(c.getColumnIndex(SERVER_ID)),
+ c.getString(c.getColumnIndex(SERVER_NAME)),
+ c.getString(c.getColumnIndex(SERVER_HOST)),
+ c.getInt(c.getColumnIndex(SERVER_PORT)),
+ c.getString(c.getColumnIndex(SERVER_USERNAME)),
+ c.getString(c.getColumnIndex(SERVER_PASSWORD)));
+ servers.add(server);
+ c.moveToNext();
+ }
+
+ c.close();
+
+ return servers;
+ }
+
+ @Override
+ public void addServer(Server server) {
+ ContentValues values = new ContentValues();
+ values.put(SERVER_NAME, server.getName());
+ values.put(SERVER_HOST, server.getHost());
+ values.put(SERVER_PORT, server.getPort());
+ values.put(SERVER_USERNAME, server.getUsername());
+ values.put(SERVER_PASSWORD, server.getPassword());
+
+ server.setId(getWritableDatabase().insert(TABLE_SERVER, null, values));
+ }
+
+ @Override
+ public void updateServer(Server server) {
+ ContentValues values = new ContentValues();
+ values.put(SERVER_NAME, server.getName());
+ values.put(SERVER_HOST, server.getHost());
+ values.put(SERVER_PORT, server.getPort());
+ values.put(SERVER_USERNAME, server.getUsername());
+ values.put(SERVER_PASSWORD, server.getPassword());
+ getWritableDatabase().update(
+ TABLE_SERVER,
+ values,
+ SERVER_ID + "=?",
+ new String[]{Long.toString(server.getId())});
+ }
+
+ @Override
+ public void removeServer(Server server) {
+ getWritableDatabase().delete(TABLE_SERVER, SERVER_ID + " = " + server.getId(), null);
+ }
+
+ public List<Integer> getPinnedChannels(long serverId) {
+
+ final Cursor c = getReadableDatabase().query(
+ TABLE_FAVOURITES,
+ new String[]{FAVOURITES_CHANNEL},
+ FAVOURITES_SERVER + "=?",
+ new String[]{String.valueOf(serverId)},
+ null,
+ null,
+ null);
+
+ List<Integer> favourites = new ArrayList<Integer>();
+ c.moveToFirst();
+ while (!c.isAfterLast()) {
+ favourites.add(c.getInt(0));
+ c.moveToNext();
+ }
+
+ c.close();
+
+ return favourites;
+ }
+
+ @Override
+ public void addPinnedChannel(long serverId, int channelId) {
+ ContentValues contentValues = new ContentValues();
+ contentValues.put(FAVOURITES_CHANNEL, channelId);
+ contentValues.put(FAVOURITES_SERVER, serverId);
+ getWritableDatabase().insert(TABLE_FAVOURITES, null, contentValues);
+ }
+
+ @Override
+ public boolean isChannelPinned(long serverId, int channelId) {
+ Cursor c = getReadableDatabase().query(
+ TABLE_FAVOURITES,
+ new String[]{FAVOURITES_CHANNEL},
+ FAVOURITES_SERVER + "=? AND " +
+ FAVOURITES_CHANNEL + "=?",
+ new String[]{String.valueOf(serverId), String.valueOf(channelId)},
+ null,
+ null,
+ null);
+ c.moveToFirst();
+ return !c.isAfterLast();
+ }
+
+ public void removePinnedChannel(long serverId, int channelId) {
+ getWritableDatabase().delete(TABLE_FAVOURITES, "server = ? AND channel = ?", new String[] { Long.toString(serverId), Integer.toString(channelId)});
+ }
+
+ @Override
+ public List<String> getAccessTokens(long serverId) {
+ Cursor cursor = getReadableDatabase().query(TABLE_TOKENS, new String[] { TOKENS_VALUE }, TOKENS_SERVER+"=?", new String[] { String.valueOf(serverId) }, null, null, null);
+ cursor.moveToFirst();
+ List<String> tokens = new ArrayList<String>();
+ while(!cursor.isAfterLast()) {
+ tokens.add(cursor.getString(0));
+ cursor.moveToNext();
+ }
+ cursor.close();
+ return tokens;
+ }
+
+ @Override
+ public void addAccessToken(long serverId, String token) {
+ ContentValues contentValues = new ContentValues();
+ contentValues.put(TOKENS_SERVER, serverId);
+ contentValues.put(TOKENS_VALUE, token);
+ getWritableDatabase().insert(TABLE_TOKENS, null, contentValues);
+ }
+
+ @Override
+ public void removeAccessToken(long serverId, String token) {
+ getWritableDatabase().delete(TABLE_TOKENS, TOKENS_SERVER+"=? AND "+TOKENS_VALUE+"=?", new String[] {String.valueOf(serverId), token });
+ }
+
+ @Override
+ public boolean isCommentSeen(String hash, byte[] commentHash) {
+ Cursor cursor = getReadableDatabase().query(TABLE_COMMENTS,
+ new String[]{COMMENTS_WHO, COMMENTS_COMMENT, COMMENTS_SEEN}, COMMENTS_WHO + "=? AND " + COMMENTS_COMMENT + "=?",
+ new String[]{hash, new String(commentHash)},
+ null, null, null);
+ boolean hasNext = cursor.moveToNext();
+ cursor.close();
+ return hasNext;
+ }
+
+ @Override
+ public void markCommentSeen(String hash, byte[] commentHash) {
+ ContentValues values = new ContentValues();
+ values.put(COMMENTS_WHO, hash);
+ values.put(COMMENTS_COMMENT, commentHash);
+ values.put(COMMENTS_SEEN, "datetime('now')");
+ getWritableDatabase().replace(TABLE_COMMENTS, null, values);
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/db/PublicServer.java b/Plumble/src/main/java/com/morlunk/mumbleclient/db/PublicServer.java
new file mode 100644
index 0000000..3e91400
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/db/PublicServer.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.db;
+
+
+import com.morlunk.jumble.model.Server;
+
+public class PublicServer extends Server {
+
+ private String mCA;
+ private String mContinentCode;
+ private String mCountry;
+ private String mCountryCode;
+ private String mRegion;
+ private String mUrl;
+
+ public PublicServer(String name, String ca, String continentCode, String country, String countryCode, String ip, Integer port, String region, String url) {
+ super(-1, name, ip, port, "", "");
+ mCA = ca;
+ mContinentCode = continentCode;
+ mCountry = country;
+ mCountryCode = countryCode;
+ mRegion = region;
+ mUrl = url;
+ }
+
+ public String getCA() {
+ return mCA;
+ }
+
+ public String getContinentCode() {
+ return mContinentCode;
+ }
+
+ public String getCountry() {
+ return mCountry;
+ }
+
+ public String getCountryCode() {
+ return mCountryCode;
+ }
+
+ public String getRegion() {
+ return mRegion;
+ }
+
+ public String getUrl() {
+ return mUrl;
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/preference/KeySelectDialogPreference.java b/Plumble/src/main/java/com/morlunk/mumbleclient/preference/KeySelectDialogPreference.java
new file mode 100644
index 0000000..fac62e6
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/preference/KeySelectDialogPreference.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.preference;
+
+import android.annotation.TargetApi;
+import android.app.AlertDialog.Builder;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.DialogInterface.OnClickListener;
+import android.content.DialogInterface.OnKeyListener;
+import android.preference.DialogPreference;
+import android.util.AttributeSet;
+import android.util.TypedValue;
+import android.view.Gravity;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.ViewGroup.LayoutParams;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.morlunk.mumbleclient.R;
+
+public class KeySelectDialogPreference extends DialogPreference implements OnKeyListener {
+
+ //private static final String ANDROID_NAMESPACE = "http://schemas.android.com/apk/res/android";
+
+ private TextView valueTextView;
+ private int keyCode;
+
+ public KeySelectDialogPreference(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ protected void onPrepareDialogBuilder(Builder builder) {
+ super.onPrepareDialogBuilder(builder);
+
+ builder.setOnKeyListener(this);
+ builder.setNeutralButton(R.string.reset_key, new OnClickListener() {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ keyCode = 0;
+ valueTextView.setText("No Key");
+ }
+ });
+ }
+
+ @Override
+ protected View onCreateDialogView() {
+ LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
+ LinearLayout layout = new LinearLayout(getContext());
+ layout.setOrientation(LinearLayout.VERTICAL);
+ layout.setPadding(6,6,6,6);
+
+ TextView promptTextView = new TextView(getContext());
+ promptTextView.setText(R.string.pressKey);
+ promptTextView.setGravity(Gravity.CENTER_HORIZONTAL);
+
+ valueTextView = new TextView(getContext());
+ valueTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22);
+ valueTextView.setGravity(Gravity.CENTER_HORIZONTAL);
+ valueTextView.setPadding(0, 12, 0, 12);
+
+ TextView alertTextView = new TextView(getContext());
+ alertTextView.setText(R.string.pressKeyInfo);
+ alertTextView.setGravity(Gravity.CENTER_HORIZONTAL);
+ alertTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
+
+ layout.addView(promptTextView, params);
+ layout.addView(valueTextView, params);
+ layout.addView(alertTextView);
+
+ return layout;
+ }
+
+ @Override
+ protected void onSetInitialValue(boolean restorePersistedValue,
+ Object defaultValue) {
+ super.onSetInitialValue(restorePersistedValue, defaultValue);
+ if(restorePersistedValue) {
+ keyCode = getPersistedInt(0);
+ } else {
+ keyCode = (Integer)defaultValue;
+ }
+ }
+
+ @Override
+ protected void onDialogClosed(boolean positiveResult) {
+ if(positiveResult) {
+ persistInt(keyCode);
+ }
+
+ super.onDialogClosed(positiveResult);
+ }
+
+ @TargetApi(12)
+ @Override
+ protected void onBindDialogView(View view) {
+ super.onBindDialogView(view);
+ if(keyCode == 0) {
+ valueTextView.setText("No Key");
+ } else {
+ if(android.os.Build.VERSION.SDK_INT >= 12) {
+ valueTextView.setText(KeyEvent.keyCodeToString(keyCode));
+ } else {
+ valueTextView.setText("Key code: "+keyCode);
+ }
+ }
+ }
+
+ @TargetApi(12)
+ @Override
+ public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
+ if(keyCode != KeyEvent.KEYCODE_BACK) {
+ this.keyCode = keyCode;
+
+ if(android.os.Build.VERSION.SDK_INT >= 12) {
+ valueTextView.setText(KeyEvent.keyCodeToString(keyCode));
+ } else {
+ valueTextView.setText("Key code: "+keyCode);
+ }
+ } else {
+ dialog.dismiss();
+ }
+ return true;
+ }
+
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/preference/PlumbleCertificateGenerateTask.java b/Plumble/src/main/java/com/morlunk/mumbleclient/preference/PlumbleCertificateGenerateTask.java
new file mode 100644
index 0000000..8a94d36
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/preference/PlumbleCertificateGenerateTask.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.preference;
+
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.DialogInterface.OnCancelListener;
+import android.os.AsyncTask;
+import android.widget.Toast;
+
+import com.morlunk.mumbleclient.R;
+
+import java.io.File;
+
+public class PlumbleCertificateGenerateTask extends AsyncTask<Void, Void, File> {
+
+ private Context context;
+ private ProgressDialog loadingDialog;
+
+ public PlumbleCertificateGenerateTask(Context context) {
+ this.context = context;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+
+ loadingDialog = new ProgressDialog(context);
+ loadingDialog.setIndeterminate(true);
+ loadingDialog.setMessage(context.getString(R.string.generateCertProgress));
+ loadingDialog.setOnCancelListener(new OnCancelListener() {
+
+ @Override
+ public void onCancel(DialogInterface arg0) {
+ cancel(true);
+
+ }
+ });
+ loadingDialog.show();
+ }
+ @Override
+ protected File doInBackground(Void... params) {
+ try {
+ File certificate = PlumbleCertificateManager.generateCertificate();
+ return certificate;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ @Override
+ protected void onPostExecute(File result) {
+ super.onPostExecute(result);
+ if(result != null) {
+ Toast.makeText(context, context.getString(R.string.generateCertSuccess, result.getName()), Toast.LENGTH_SHORT).show();
+ } else {
+ Toast.makeText(context, R.string.generateCertFailure, Toast.LENGTH_SHORT).show();
+ }
+
+ loadingDialog.dismiss();
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/preference/PlumbleCertificateManager.java b/Plumble/src/main/java/com/morlunk/mumbleclient/preference/PlumbleCertificateManager.java
new file mode 100644
index 0000000..d7cb884
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/preference/PlumbleCertificateManager.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.preference;
+
+import android.os.Environment;
+
+import com.morlunk.jumble.net.JumbleCertificateGenerator;
+
+import org.spongycastle.operator.OperatorCreationException;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.cert.CertificateException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+
+public class PlumbleCertificateManager {
+
+ private static final String PLUMBLE_CERTIFICATE_FOLDER = "Plumble";
+ private static final String PLUMBLE_CERTIFICATE_FORMAT = "plumble-%d.p12";
+ private static final String PLUMBLE_CERTIFICATE_EXTENSION = "p12";
+
+ /**
+ * Generates a new X.509 passwordless certificate in PKCS12 format for connection to a Mumble server.
+ * This certificate is stored in the {@value #PLUMBLE_CERTIFICATE_FOLDER} folder on the external storage, in the format {@value #PLUMBLE_CERTIFICATE_FORMAT} where the timestamp is substituted in.
+ * @return The path of the generated certificate if the operation was a success. Otherwise, null.
+ */
+ public static File generateCertificate() throws NoSuchAlgorithmException, OperatorCreationException, CertificateException, KeyStoreException, NoSuchProviderException, IOException {
+ File certificateDirectory = getCertificateDirectory();
+
+ String certificateName = String.format(Locale.US, PLUMBLE_CERTIFICATE_FORMAT, System.currentTimeMillis() / 1000L);
+ File certificateFile = new File(certificateDirectory, certificateName);
+ FileOutputStream outputStream = new FileOutputStream(certificateFile);
+ JumbleCertificateGenerator.generateCertificate(outputStream);
+ return certificateFile;
+ }
+
+ /**
+ * Returns a list of certificates in the {@value #PLUMBLE_CERTIFICATE_FOLDER} folder on external storage, ending with {@value #PLUMBLE_CERTIFICATE_EXTENSION}.
+ * @return A list of {@link File} objects containing certificates.
+ */
+ public static List<File> getAvailableCertificates() {
+ File certificateDirectory = getCertificateDirectory();
+
+ File[] p12Files = certificateDirectory.listFiles(new FileFilter() {
+ @Override
+ public boolean accept(File pathname) {
+ return pathname.getName().endsWith(PLUMBLE_CERTIFICATE_EXTENSION);
+ }
+ });
+
+ return Arrays.asList(p12Files);
+ }
+
+ /**
+ * Returns the certificate directory, {@value #PLUMBLE_CERTIFICATE_FOLDER}, on external storage.
+ * Will create if does not exist, and throw an assert if the external storage is not mounted.
+ * @return The {@link File} object of the directory.
+ */
+ public static File getCertificateDirectory() {
+ assert Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);
+ File certificateDirectory = new File(Environment.getExternalStorageDirectory(), PLUMBLE_CERTIFICATE_FOLDER);
+ if(!certificateDirectory.exists())
+ certificateDirectory.mkdir();
+ return certificateDirectory;
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/preference/Preferences.java b/Plumble/src/main/java/com/morlunk/mumbleclient/preference/Preferences.java
new file mode 100644
index 0000000..f0dd95a
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/preference/Preferences.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.preference;
+
+import android.annotation.TargetApi;
+import android.media.AudioFormat;
+import android.media.AudioRecord;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Environment;
+import android.preference.ListPreference;
+import android.preference.Preference;
+import android.preference.Preference.OnPreferenceClickListener;
+import android.preference.PreferenceActivity;
+import android.preference.PreferenceCategory;
+import android.preference.PreferenceFragment;
+import android.preference.PreferenceScreen;
+
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.Settings;
+
+import java.io.File;
+import java.util.List;
+
+import info.guardianproject.onionkit.ui.OrbotHelper;
+
+public class Preferences extends PreferenceActivity {
+
+ public static final String ACTION_PREFS_GENERAL = "com.morlunk.mumbleclient.app.PREFS_GENERAL";
+ public static final String ACTION_PREFS_AUTHENTICATION = "com.morlunk.mumbleclient.app.PREFS_AUTHENTICATION";
+ public static final String ACTION_PREFS_AUDIO = "com.morlunk.mumbleclient.app.PREFS_AUDIO";
+ public static final String ACTION_PREFS_APPEARANCE = "com.morlunk.mumbleclient.app.PREFS_APPEARANCE";
+ public static final String ACTION_PREFS_ABOUT = "com.morlunk.mumbleclient.app.PREFS_ABOUT";
+
+ private static final String CERTIFICATE_GENERATE_KEY = "certificateGenerate";
+ private static final String CERTIFICATE_PATH_KEY = "certificatePath";
+ private static final String USE_TOR_KEY = "useTor";
+
+ @Override
+ protected void onCreate(final Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ // Legacy preference section handling
+
+ String action = getIntent().getAction();
+ if (action != null) {
+ if (ACTION_PREFS_GENERAL.equals(action)) {
+ addPreferencesFromResource(R.xml.settings_general);
+ configureOrbotPreferences(getPreferenceScreen());
+ } else if (ACTION_PREFS_AUTHENTICATION.equals(action)) {
+ addPreferencesFromResource(R.xml.settings_authentication);
+ configureCertificatePreferences(getPreferenceScreen());
+ } else if (ACTION_PREFS_AUDIO.equals(action)) {
+ addPreferencesFromResource(R.xml.settings_audio);
+ configureAudioPreferences(getPreferenceScreen());
+ } else if (ACTION_PREFS_APPEARANCE.equals(action)) {
+ addPreferencesFromResource(R.xml.settings_appearance);
+ } else if (ACTION_PREFS_ABOUT.equals(action)) {
+ addPreferencesFromResource(R.xml.settings_about);
+ }
+ } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
+ addPreferencesFromResource(R.xml.preference_headers_legacy);
+ }
+ }
+
+ @Override
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB)
+ public void onBuildHeaders(List<Header> target) {
+ loadHeadersFromResource(R.xml.preference_headers, target);
+ }
+
+ @Override
+ protected boolean isValidFragment(String fragmentName) {
+ return PlumblePreferenceFragment.class.getName().equals(fragmentName);
+ }
+
+ private static void configureCertificatePreferences(PreferenceScreen screen) {
+ final Preference certificateGeneratePreference = screen.findPreference(CERTIFICATE_GENERATE_KEY);
+ final ListPreference certificatePathPreference = (ListPreference) screen.findPreference(CERTIFICATE_PATH_KEY);
+
+ certificateGeneratePreference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ generateCertificate(certificatePathPreference);
+ return true;
+ }
+ });
+
+ // Make sure media is mounted, otherwise do not allow certificate loading.
+ if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+ try {
+ updateCertificatePath(certificatePathPreference);
+ } catch (NullPointerException exception) {
+ certificatePathPreference.setEnabled(false);
+ certificatePathPreference.setSummary(R.string.externalStorageUnavailable);
+ }
+ } else {
+ certificatePathPreference.setEnabled(false);
+ certificatePathPreference.setSummary(R.string.externalStorageUnavailable);
+ }
+ }
+
+ private static void configureOrbotPreferences(PreferenceScreen screen) {
+ OrbotHelper orbotHelper = new OrbotHelper(screen.getContext());
+ Preference useOrbotPreference = screen.findPreference(USE_TOR_KEY);
+ useOrbotPreference.setEnabled(orbotHelper.isOrbotInstalled());
+ }
+
+ private static void configureAudioPreferences(final PreferenceScreen screen) {
+ ListPreference inputPreference = (ListPreference) screen.findPreference(Settings.PREF_INPUT_METHOD);
+ inputPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ updateAudioDependents(screen, (String) newValue);
+ return true;
+ }
+ });
+
+ // Scan each bitrate and determine if the device supports it
+ ListPreference inputQualityPreference = (ListPreference) screen.findPreference(Settings.PREF_INPUT_QUALITY);
+ String[] bitrateNames = new String[inputQualityPreference.getEntries().length];
+ for(int x=0;x<inputQualityPreference.getEntries().length;x++) {
+ int bitrate = Integer.parseInt(inputQualityPreference.getEntryValues()[x].toString());
+ boolean supported = AudioRecord.getMinBufferSize(bitrate, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT) > 0;
+ bitrateNames[x] = bitrate+"Hz" + (supported ? "" : " (unsupported)");
+ }
+ inputQualityPreference.setEntries(bitrateNames);
+
+ updateAudioDependents(screen, inputPreference.getValue());
+ }
+
+ private static void updateAudioDependents(PreferenceScreen screen, String inputMethod) {
+ PreferenceCategory pttCategory = (PreferenceCategory) screen.findPreference("ptt_settings");
+ PreferenceCategory vadCategory = (PreferenceCategory) screen.findPreference("vad_settings");
+ pttCategory.setEnabled(Settings.ARRAY_INPUT_METHOD_PTT.equals(inputMethod));
+ vadCategory.setEnabled(Settings.ARRAY_INPUT_METHOD_VOICE.equals(inputMethod));
+ }
+
+ /**
+ * Updates the passed preference with the certificate paths found on external storage.
+ *
+ * @param preference The ListPreference to update.
+ */
+ private static void updateCertificatePath(ListPreference preference) throws NullPointerException {
+ List<File> certificateFiles = PlumbleCertificateManager.getAvailableCertificates();
+
+ // Get arrays of certificate paths and names.
+ String[] certificateNames = new String[certificateFiles.size() + 1]; // Extra space for 'None' option
+ String[] certificatePaths = new String[certificateFiles.size() + 1];
+ for (int x = 0; x < certificateFiles.size(); x++) {
+ certificateNames[x] = certificateFiles.get(x).getName();
+ certificatePaths[x] = certificateFiles.get(x).getAbsolutePath();
+ }
+
+ certificateNames[certificateNames.length - 1] = preference.getContext().getString(R.string.noCert);
+ certificatePaths[certificatePaths.length - 1] = "";
+
+ preference.setEntries(certificateNames);
+ preference.setEntryValues(certificatePaths);
+ }
+
+ /**
+ * Generates a new certificate and sets it as active.
+ *
+ * @param certificateList If passed, will update the list of certificates available. Messy.
+ */
+ private static void generateCertificate(final ListPreference certificateList) {
+ PlumbleCertificateGenerateTask generateTask = new PlumbleCertificateGenerateTask(certificateList.getContext()) {
+ @Override
+ protected void onPostExecute(File result) {
+ super.onPostExecute(result);
+
+ if (result != null) {
+ updateCertificatePath(certificateList); // Update cert path after
+ certificateList.setValue(result.getAbsolutePath());
+ }
+ }
+ };
+ generateTask.execute();
+ }
+
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB)
+ public static class PlumblePreferenceFragment extends PreferenceFragment {
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ String section = getArguments().getString("settings");
+ if ("general".equals(section)) {
+ addPreferencesFromResource(R.xml.settings_general);
+ configureOrbotPreferences(getPreferenceScreen());
+ } else if ("authentication".equals(section)) {
+ addPreferencesFromResource(R.xml.settings_authentication);
+ configureCertificatePreferences(getPreferenceScreen());
+ } else if ("audio".equals(section)) {
+ addPreferencesFromResource(R.xml.settings_audio);
+ configureAudioPreferences(getPreferenceScreen());
+ } else if ("appearance".equals(section)) {
+ addPreferencesFromResource(R.xml.settings_appearance);
+ } else if ("about".equals(section)) {
+ addPreferencesFromResource(R.xml.settings_about);
+ }
+ }
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/preference/SeekBarDialogPreference.java b/Plumble/src/main/java/com/morlunk/mumbleclient/preference/SeekBarDialogPreference.java
new file mode 100644
index 0000000..caf17a4
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/preference/SeekBarDialogPreference.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+/* The following code was written by Matthew Wiggins
+ * and is released under the Apache 2.0 license
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * I added some extra functionality like a multiplier + better persistence.
+ * - Andrew Comminos
+ */
+package com.morlunk.mumbleclient.preference;
+
+import android.content.Context;
+import android.preference.DialogPreference;
+import android.util.AttributeSet;
+import android.view.Gravity;
+import android.view.View;
+import android.widget.LinearLayout;
+import android.widget.SeekBar;
+import android.widget.TextView;
+
+
+public class SeekBarDialogPreference extends DialogPreference implements SeekBar.OnSeekBarChangeListener {
+ private static final String androidns = "http://schemas.android.com/apk/res/android";
+ private SeekBar mSeekBar;
+ private TextView mSplashText, mValueText;
+ private Context mContext;
+ private String mDialogMessage, mSuffix;
+ private int mDefault, mMax, mValue, mMultiplier = 0;
+
+ public SeekBarDialogPreference(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ mContext = context;
+
+ mDialogMessage = attrs.getAttributeValue(androidns, "dialogMessage");
+ mSuffix = attrs.getAttributeValue(androidns, "text");
+ mDefault = attrs.getAttributeIntValue(androidns, "defaultValue", 0);
+ mMax = attrs.getAttributeIntValue(androidns, "max", 100);
+ mMultiplier = attrs.getAttributeIntValue(null, "multiplier", 1);
+
+ }
+
+ @Override
+ protected View onCreateDialogView() {
+ LinearLayout.LayoutParams params;
+ LinearLayout layout = new LinearLayout(mContext);
+ layout.setOrientation(LinearLayout.VERTICAL);
+ layout.setPadding(6, 6, 6, 6);
+
+ mSplashText = new TextView(mContext);
+ if (mDialogMessage != null)
+ mSplashText.setText(mDialogMessage);
+ layout.addView(mSplashText);
+
+ mValueText = new TextView(mContext);
+ mValueText.setGravity(Gravity.CENTER_HORIZONTAL);
+ mValueText.setTextSize(18);
+ params = new LinearLayout.LayoutParams(
+ LinearLayout.LayoutParams.MATCH_PARENT,
+ LinearLayout.LayoutParams.WRAP_CONTENT);
+ layout.addView(mValueText, params);
+
+ mSeekBar = new SeekBar(mContext);
+ mSeekBar.setOnSeekBarChangeListener(this);
+ layout.addView(mSeekBar, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
+
+ if (shouldPersist())
+ mValue = getPersistedInt(-1) != -1 ? getPersistedInt(mDefault) / mMultiplier : getPersistedInt(mDefault);
+
+ mSeekBar.setMax(mMax);
+ mSeekBar.setProgress(mValue);
+ return layout;
+ }
+
+ @Override
+ protected void onBindDialogView(View v) {
+ super.onBindDialogView(v);
+ mSeekBar.setMax(mMax);
+ mSeekBar.setProgress(mValue);
+ }
+
+ @Override
+ protected void onSetInitialValue(boolean restore, Object defaultValue) {
+ super.onSetInitialValue(restore, defaultValue);
+ if (restore)
+ mValue = shouldPersist() ? getPersistedInt(mDefault) / mMultiplier : 0;
+ else
+ mValue = (Integer) defaultValue / mMultiplier;
+ }
+
+ public void onProgressChanged(SeekBar seek, int value, boolean fromTouch) {
+ String t = String.valueOf(value * mMultiplier);
+ mValueText.setText(mSuffix == null ? t : t.concat(mSuffix));
+ }
+
+ public void onStartTrackingTouch(SeekBar seek) {
+ }
+
+ public void onStopTrackingTouch(SeekBar seek) {
+ }
+
+ /* (non-Javadoc)
+ * @see android.preference.DialogPreference#onDialogClosed(boolean)
+ */
+ @Override
+ protected void onDialogClosed(boolean positiveResult) {
+ super.onDialogClosed(positiveResult);
+ if (positiveResult && shouldPersist()) {
+ persistInt(mSeekBar.getProgress() * mMultiplier);
+ }
+ }
+
+ public int getMax() {
+ return mMax;
+ }
+
+ public void setMax(int max) {
+ mMax = max;
+ }
+
+ public int getProgress() {
+ return mValue;
+ }
+
+ public void setProgress(int progress) {
+ mValue = progress;
+ if (mSeekBar != null)
+ mSeekBar.setProgress(progress);
+ }
+} \ No newline at end of file
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/servers/PublicServerListFragment.java b/Plumble/src/main/java/com/morlunk/mumbleclient/servers/PublicServerListFragment.java
new file mode 100644
index 0000000..8b48691
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/servers/PublicServerListFragment.java
@@ -0,0 +1,663 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.servers;
+
+import android.annotation.SuppressLint;
+import android.annotation.TargetApi;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.os.AsyncTask;
+import android.os.Build;
+import android.os.Build.VERSION;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.util.Log;
+import android.util.Xml;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.view.inputmethod.EditorInfo;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.ArrayAdapter;
+import android.widget.EditText;
+import android.widget.GridView;
+import android.widget.ImageView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import android.widget.TextView.OnEditorActionListener;
+import android.widget.Toast;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+import com.morlunk.mumbleclient.Constants;
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.Settings;
+import com.morlunk.mumbleclient.db.DatabaseProvider;
+import com.morlunk.mumbleclient.db.PublicServer;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * Displays a list of public servers that can be connected to, sorted, and favourited.
+ * @author morlunk
+ *
+ */
+public class PublicServerListFragment extends Fragment implements OnItemClickListener {
+
+ public static final int MAX_ACTIVE_PINGS = 50;
+
+ private ServerListFragment.ServerConnectHandler mConnectHandler;
+ private DatabaseProvider mDatabaseProvider;
+ private List<PublicServer> mServers;
+ private GridView mServerGrid;
+ private ProgressBar mServerProgress;
+ private PublicServerAdapter mServerAdapter;
+ private int mActivePingCount = 0;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ setHasOptionsMenu(true);
+ }
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+
+ try {
+ mConnectHandler = (ServerListFragment.ServerConnectHandler)activity;
+ mDatabaseProvider = (DatabaseProvider) activity;
+ } catch (ClassCastException e) {
+ throw new ClassCastException(activity.toString()+" must implement ServerConnectHandler and DatabaseProvider!");
+ }
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+ fillPublicList();
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_public_server_list, container, false);
+ mServerGrid = (GridView) view.findViewById(R.id.server_list_grid);
+ mServerGrid.setOnItemClickListener(this);
+ if(mServerAdapter != null)
+ mServerGrid.setAdapter(mServerAdapter);
+ mServerProgress = (ProgressBar) view.findViewById(R.id.serverProgress);
+ mServerProgress.setVisibility(mServerAdapter == null ? View.VISIBLE : View.GONE);
+ return view;
+ }
+
+ @Override
+ public void onPrepareOptionsMenu(Menu menu) {
+ super.onPrepareOptionsMenu(menu);
+ menu.findItem(R.id.menu_match_server).setVisible(VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB); // Executors only supported on Honeycomb +
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ super.onCreateOptionsMenu(menu, inflater);
+ inflater.inflate(R.menu.fragment_public_server_list, menu);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (isFilled()) {
+ switch(item.getItemId()) {
+ case R.id.menu_match_server:
+ showMatchDialog();
+ break;
+ case R.id.menu_sort_server_item:
+ showSortDialog();
+ return true;
+ case R.id.menu_search_server_item:
+ showFilterDialog();
+ return true;
+ }
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ public void setServers(List<PublicServer> servers) {
+ mServers = servers;
+ mServerProgress.setVisibility(View.GONE);
+ mServerAdapter = new PublicServerAdapter(getActivity(), servers);
+ mServerGrid.setAdapter(mServerAdapter);
+ }
+
+ public boolean isFilled() {
+ return mServerAdapter != null;
+ }
+
+ private void showMatchDialog() {
+ AlertDialog.Builder adb = new AlertDialog.Builder(getActivity());
+ adb.setTitle(R.string.server_match);
+ adb.setMessage(R.string.server_match_description);
+ adb.setPositiveButton(R.string.search, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ findOptimalServer();
+ }
+ });
+ adb.setNegativeButton(android.R.string.cancel, null);
+ adb.show();
+ }
+
+ private void findOptimalServer() {
+ MatchServerTask matchServerTask = new MatchServerTask();
+ matchServerTask.execute(Locale.getDefault().getCountry());
+ }
+
+ private void showSortDialog() {
+ AlertDialog.Builder alertBuilder = new AlertDialog.Builder(getActivity());
+ alertBuilder.setTitle(R.string.sortBy);
+ alertBuilder.setItems(new String[] { getString(R.string.name), getString(R.string.country)}, new SortClickListener());
+ alertBuilder.show();
+ }
+
+ private void showFilterDialog() {
+ View dialogView = ((LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.dialog_server_search, null);
+ final EditText nameText = (EditText) dialogView.findViewById(R.id.server_search_name);
+ final EditText countryText = (EditText) dialogView.findViewById(R.id.server_search_country);
+
+ final AlertDialog dlg = new AlertDialog.Builder(getActivity()).
+ setTitle(R.string.search).
+ setView(dialogView).
+ setPositiveButton(R.string.search, new DialogInterface.OnClickListener() {
+ public void onClick(final DialogInterface dialog, final int which)
+ {
+ String queryName = nameText.getText().toString().toUpperCase(Locale.US);
+ String queryCountry = countryText.getText().toString().toUpperCase(Locale.US);
+ mServerAdapter.filter(queryName, queryCountry);
+ dialog.dismiss();
+ }
+ }).create();
+
+ nameText.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
+ nameText.setOnEditorActionListener(new OnEditorActionListener() {
+ @Override
+ public boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event)
+ {
+ String queryName = nameText.getText().toString().toUpperCase(Locale.US);
+ String queryCountry = countryText.getText().toString().toUpperCase(Locale.US);
+ mServerAdapter.filter(queryName, queryCountry);
+ dlg.dismiss();
+ return true;
+ }
+ });
+
+ countryText.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
+ countryText.setOnEditorActionListener(new OnEditorActionListener() {
+ @Override
+ public boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event)
+ {
+ String queryName = nameText.getText().toString().toUpperCase(Locale.US);
+ String queryCountry = countryText.getText().toString().toUpperCase(Locale.US);
+ mServerAdapter.filter(queryName, queryCountry);
+ dlg.dismiss();
+ return true;
+ }
+ });
+
+ // Show keyboard automatically
+ nameText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+ @Override
+ public void onFocusChange(View v, boolean hasFocus) {
+ if (hasFocus) {
+ dlg.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
+ }
+ }
+ });
+
+ dlg.show();
+ }
+
+ @Override
+ public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
+ mConnectHandler.connectToPublicServer(mServerAdapter.getItem(arg2));
+ }
+
+ private class PublicServerAdapter extends ArrayAdapter<PublicServer> {
+ private Map<PublicServer, ServerInfoResponse> infoResponses = new HashMap<PublicServer, ServerInfoResponse>();
+ private List<PublicServer> originalServers;
+
+ private boolean mLightTheme;
+
+ public PublicServerAdapter(Context context, List<PublicServer> servers) {
+ super(context, android.R.id.text1, servers);
+ originalServers = new ArrayList<PublicServer>(servers);
+ mLightTheme = R.style.Theme_Plumble == Settings.getInstance(context).getTheme();
+ }
+
+ public void filter(String queryName, String queryCountry) {
+ clear();
+
+ for(PublicServer server : originalServers) {
+ String serverName = server.getName() != null ? server.getName().toUpperCase(Locale.US) : "";
+ String serverCountry = server.getCountry() != null ? server.getCountry().toUpperCase(Locale.US) : "";
+
+ if(serverName.contains(queryName) && serverCountry.contains(queryCountry))
+ add(server);
+ }
+ }
+
+ @SuppressLint("NewApi")
+ @Override
+ public final View getView(
+ final int position,
+ final View v,
+ final ViewGroup parent) {
+ View view = v;
+
+ if(v == null) {
+ LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ view = inflater.inflate(R.layout.public_server_list_row, parent, false);
+ }
+
+ final PublicServer server = getItem(position);
+ view.setTag(server);
+
+ TextView nameText = (TextView) view.findViewById(R.id.server_row_name);
+ TextView addressText = (TextView) view.findViewById(R.id.server_row_address);
+
+ if(server.getName().equals("")) {
+ nameText.setText(server.getHost());
+ } else {
+ nameText.setText(server.getName());
+ }
+
+ addressText.setText(server.getHost()+":"+server.getPort());
+
+ TextView locationText = (TextView) view.findViewById(R.id.server_row_location);
+ locationText.setText(server.getCountry());
+
+ // Ping server if available
+ if(!infoResponses.containsKey(server) && mActivePingCount < MAX_ACTIVE_PINGS) {
+ mActivePingCount++;
+ final View serverView = view; // Create final instance of view for use in asynctask
+ ServerInfoTask task = new ServerInfoTask() {
+ protected void onPostExecute(ServerInfoResponse result) {
+ super.onPostExecute(result);
+ infoResponses.put(server, result);
+ if(serverView != null && serverView.isShown() && serverView.getTag() == server)
+ updateInfoResponseView(serverView, server);
+ mActivePingCount--;
+ Log.d(Constants.TAG, "DEBUG: Servers remaining in queue: "+ mActivePingCount);
+ };
+ };
+
+ // Execute on parallel threads if API >= 11. RACE CAR THREADING, WOOOOOOOOOOOOOOOOOOOOOO
+ if(VERSION.SDK_INT >= 11)
+ task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, server);
+ else
+ task.execute(server);
+ }
+
+ ImageView favoriteButton = (ImageView)view.findViewById(R.id.server_row_favorite);
+
+ favoriteButton.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ AlertDialog.Builder alertBuilder = new AlertDialog.Builder(getContext());
+
+ Settings settings = Settings.getInstance(getActivity());
+
+ // Allow username entry
+ final EditText usernameField = new EditText(getContext());
+ usernameField.setHint(settings.getDefaultUsername());
+ alertBuilder.setView(usernameField);
+
+ alertBuilder.setTitle(R.string.addFavorite);
+
+ alertBuilder.setPositiveButton(R.string.add, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ String username = usernameField.getText().toString();
+ if(username.equals(""))
+ server.setUsername(usernameField.getHint().toString());
+
+ mDatabaseProvider.getDatabase().addServer(server);
+ }
+ });
+
+ alertBuilder.show();
+ }
+
+ });
+
+ updateInfoResponseView(view, server);
+
+ return view;
+ }
+
+ private void updateInfoResponseView(View view, PublicServer server) {
+ ServerInfoResponse infoResponse = infoResponses.get(server);
+ // If there is a null value for the server info (rather than none at all), the request must have failed.
+ boolean requestExists = infoResponse != null;
+ boolean requestFailure = infoResponse != null && infoResponse.isDummy();
+
+ TextView serverVersionText = (TextView) view.findViewById(R.id.server_row_version_status);
+ TextView serverUsersText = (TextView) view.findViewById(R.id.server_row_usercount);
+ ProgressBar serverInfoProgressBar = (ProgressBar) view.findViewById(R.id.server_row_ping_progress);
+
+ serverVersionText.setVisibility(!requestFailure && !requestExists ? View.INVISIBLE : View.VISIBLE);
+ serverUsersText.setVisibility(!requestFailure && !requestExists ? View.INVISIBLE : View.VISIBLE);
+ serverInfoProgressBar.setVisibility(!requestExists ? View.VISIBLE : View.INVISIBLE);
+
+ if(infoResponse != null && !requestFailure) {
+ serverVersionText.setText(getResources().getString(R.string.online)+" ("+infoResponse.getVersionString()+")");
+ serverUsersText.setText(infoResponse.getCurrentUsers()+"/"+infoResponse.getMaximumUsers());
+ } else if(requestFailure) {
+ serverVersionText.setText(R.string.offline);
+ serverUsersText.setText("");
+ } else {
+ serverVersionText.setText(R.string.noServerInfo);
+ }
+ }
+ }
+
+ private void fillPublicList() {
+ new PublicServerFetchTask() {
+ protected void onPostExecute(List<PublicServer> result) {
+ super.onPostExecute(result);
+
+ if (result == null) {
+ // Handle error
+ Toast.makeText(getActivity(), R.string.error_fetching_servers, Toast.LENGTH_SHORT).show();
+ return;
+ }
+
+ if(isVisible()) // Prevents NPEs when fragment is detached.
+ setServers(result);
+ };
+ }.execute();
+ }
+
+ private class SortClickListener implements DialogInterface.OnClickListener {
+
+ private static final int SORT_NAME = 0;
+ private static final int SORT_COUNTRY = 1;
+
+ private Comparator<PublicServer> nameComparator = new Comparator<PublicServer>() {
+ @Override
+ public int compare(PublicServer lhs, PublicServer rhs) {
+ return lhs.getName().compareTo(rhs.getName());
+ }
+ };
+
+ private Comparator<PublicServer> countryComparator = new Comparator<PublicServer>() {
+ @Override
+ public int compare(PublicServer lhs, PublicServer rhs) {
+ if(rhs.getCountry() == null) return -1;
+ else if(lhs.getCountry() == null) return 1;
+ return lhs.getCountry().compareTo(rhs.getCountry());
+ }
+ };
+
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ ArrayAdapter<PublicServer> arrayAdapter = mServerAdapter;
+ if(which == SORT_NAME) {
+ arrayAdapter.sort(nameComparator);
+ } else if(which == SORT_COUNTRY) {
+ arrayAdapter.sort(countryComparator);
+ }
+ }
+ }
+
+ private class PublicServerFetchTask extends AsyncTask<Void, Void, List<PublicServer>> {
+
+ private static final String MUMBLE_PUBLIC_URL = "http://www.mumble.info/list2.cgi";
+
+ @Override
+ protected List<PublicServer> doInBackground(Void... params) {
+ try {
+ // Fetch XML from server
+ URL url = new URL(MUMBLE_PUBLIC_URL);
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ connection.setRequestMethod("GET");
+ connection.addRequestProperty("version", com.morlunk.jumble.Constants.PROTOCOL_STRING);
+ connection.connect();
+ InputStream stream = connection.getInputStream();
+
+ XmlPullParser parser = Xml.newPullParser();
+ parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
+ parser.setInput(stream, "UTF-8");
+ parser.nextTag();
+
+ List<PublicServer> serverList = new ArrayList<PublicServer>();
+
+ parser.require(XmlPullParser.START_TAG, null, "servers");
+ while(parser.next() != XmlPullParser.END_TAG) {
+ if (parser.getEventType() != XmlPullParser.START_TAG) {
+ continue;
+ }
+
+ serverList.add(readEntry(parser));
+ }
+ parser.require(XmlPullParser.END_TAG, null, "servers");
+
+ return serverList;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ private PublicServer readEntry(XmlPullParser parser) throws XmlPullParserException, IOException {
+ String name = parser.getAttributeValue(null, "name");
+ String ca = parser.getAttributeValue(null, "ca");
+ String continentCode = parser.getAttributeValue(null, "continent_code");
+ String country = parser.getAttributeValue(null, "country");
+ String countryCode = parser.getAttributeValue(null, "country_code");
+ String ip = parser.getAttributeValue(null, "ip");
+ String port = parser.getAttributeValue(null, "port");
+ String region = parser.getAttributeValue(null, "region");
+ String url = parser.getAttributeValue(null, "url");
+
+ parser.nextTag();
+
+ PublicServer server = new PublicServer(name, ca, continentCode, country, countryCode, ip, Integer.parseInt(port), region, url);
+
+ return server;
+ }
+ }
+
+ /**
+ * Finds an empty server in the user's country code with low latency.
+ * By default, it will show a ProgressDialog while it performs this and an AlertDialog allowing the user to connect.
+ */
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB)
+ private class MatchServerTask extends AsyncTask<String, Void, ServerInfoResponse> {
+
+ /**
+ * Query until we find up to SEARCH_RANGE empty servers that meet the zero user and location requirements.
+ * Once we have that, then we'll sort them based on latency.
+ * TODO make this a user-changeable option.
+ */
+ public static final int SEARCH_RANGE = 20;
+
+ private Comparator<ServerInfoResponse> mLatencyComparator = new Comparator<ServerInfoResponse>() {
+ @Override
+ public int compare(ServerInfoResponse lhs, ServerInfoResponse rhs) {
+ return lhs.getLatency() == rhs.getLatency() ? 0 :
+ lhs.getLatency() < rhs.getLatency() ? -1 : 1;
+ }
+ };
+
+ private class MatchServerInfoTask extends ServerInfoTask {
+ @Override
+ protected void onPostExecute(ServerInfoResponse serverInfoResponse) {
+ mResponseCount++;
+ if(serverInfoResponse == null) {
+ // TODO handle bad responses
+ } else if(serverInfoResponse.getCurrentUsers() == 0 &&
+ serverInfoResponse.getVersion() == com.morlunk.jumble.Constants.PROTOCOL_VERSION) {
+ mGoodResponses.add(serverInfoResponse);
+ }
+
+ // Once we have a good sample of results, shut down the ping threads.
+ if(mResponseCount >= mResponsesToSend) {
+ synchronized (mLock) {
+ mLock.notify();
+ }
+ mPingExecutor.shutdownNow();
+ }
+ }
+
+ }
+
+ private ExecutorService mPingExecutor = Executors.newFixedThreadPool(5); // Run 5 concurrent pings at a time
+ private Object mLock = new Object();
+
+ private List<ServerInfoResponse> mGoodResponses = Collections.synchronizedList(new ArrayList<ServerInfoResponse>());
+ private volatile int mResponseCount = 0;
+ private int mResponsesToSend = SEARCH_RANGE;
+
+ private ProgressDialog mProgressDialog;
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+ mProgressDialog = ProgressDialog.show(getActivity(), null, getString(R.string.server_match_progress));
+ mProgressDialog.setCancelable(true);
+ mProgressDialog.setCanceledOnTouchOutside(true);
+ mProgressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
+ @Override
+ public void onCancel(DialogInterface dialog) {
+ cancel(true);
+ }
+ });
+ }
+
+ @Override
+ protected ServerInfoResponse doInBackground(String... params) {
+ final String country = params.length > 0 ? params[0] : null; // If a country is provided, search within country
+
+ Collection<PublicServer> servers;
+ if(country != null)
+ servers = Collections2.filter(mServers, new Predicate<PublicServer>() {
+ @Override
+ public boolean apply(PublicServer publicServer) {
+ return country.equals(publicServer.getCountryCode());
+ }
+ });
+ else
+ servers = mServers;
+
+ // For countries with 0 servers, immediately return null.
+ if(servers.size() == 0)
+ return null;
+
+ // If there are less servers than the value of our range, deal with it.
+ mResponsesToSend = Math.min(SEARCH_RANGE, servers.size());
+
+ Iterator iterator = servers.iterator();
+ while(iterator.hasNext() && mGoodResponses.size() < mResponsesToSend) {
+ PublicServer server = (PublicServer) iterator.next();
+ new MatchServerInfoTask().executeOnExecutor(mPingExecutor, server);
+ }
+ try {
+ synchronized (mLock) {
+ mLock.wait();
+ }
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ Collections.sort(mGoodResponses, mLatencyComparator);
+
+ if(mGoodResponses.size() > 0)
+ return mGoodResponses.get(0);
+ else
+ return null;
+ }
+
+ @Override
+ protected void onPostExecute(ServerInfoResponse response) {
+ super.onPostExecute(response);
+ final PublicServer publicServer = response == null ? null : (PublicServer) response.getServer();
+ mProgressDialog.hide();
+
+ AlertDialog.Builder adb = new AlertDialog.Builder(getActivity());
+ if(publicServer != null) {
+ adb.setTitle(R.string.server_match_found);
+ adb.setMessage(getString(R.string.server_match_info,
+ publicServer.getName(),
+ publicServer.getHost(),
+ publicServer.getPort(),
+ response.getCurrentUsers(),
+ response.getMaximumUsers(),
+ response.getVersionString(),
+ publicServer.getCountry(),
+ response.getLatency()));
+ adb.setPositiveButton(R.string.connect, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ mConnectHandler.connectToPublicServer(publicServer);
+ }
+ });
+ } else {
+ adb.setTitle(R.string.server_match_not_found);
+ adb.setMessage(R.string.server_match_expand_country);
+ adb.setPositiveButton(R.string.expand, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ MatchServerTask matchTask = new MatchServerTask();
+ matchTask.execute();
+ }
+ });
+ }
+ adb.setNegativeButton(android.R.string.cancel, null);
+ adb.show();
+ }
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerEditFragment.java b/Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerEditFragment.java
new file mode 100644
index 0000000..f09e404
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerEditFragment.java
@@ -0,0 +1,190 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.servers;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.DialogInterface.OnCancelListener;
+import android.content.DialogInterface.OnClickListener;
+import android.os.Bundle;
+import android.support.v4.app.DialogFragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.TextView;
+
+import com.morlunk.jumble.Constants;
+import com.morlunk.jumble.model.Server;
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.Settings;
+import com.morlunk.mumbleclient.db.DatabaseProvider;
+
+public class ServerEditFragment extends DialogFragment {
+
+ public interface ServerEditListener {
+ public void serverInfoUpdated();
+ public void connectToServer(Server server);
+ }
+
+ private TextView mNameTitle;
+ private EditText mNameEdit;
+ private EditText mHostEdit;
+ private EditText mPortEdit;
+ private EditText mUsernameEdit;
+ private EditText mPasswordEdit;
+
+ private ServerEditListener mListener;
+ private DatabaseProvider mDatabaseProvider;
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+
+ try {
+ mDatabaseProvider = (DatabaseProvider) activity;
+ mListener = (ServerEditListener) activity;
+ } catch (ClassCastException e) {
+ throw new ClassCastException(activity.toString()+" must implement DatabaseProvider and ServerEditListener!");
+ }
+ }
+
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ AlertDialog.Builder alertBuilder = new AlertDialog.Builder(getActivity());
+
+ Settings settings = Settings.getInstance(getActivity());
+
+ View view = inflater.inflate(R.layout.dialog_server_edit, null, false);
+ alertBuilder.setView(view);
+
+ mNameTitle = (TextView) view.findViewById(R.id.server_edit_name_title);
+ mNameEdit = (EditText) view.findViewById(R.id.server_edit_name);
+ mHostEdit = (EditText) view.findViewById(R.id.server_edit_host);
+ mPortEdit = (EditText) view.findViewById(R.id.server_edit_port);
+ mUsernameEdit = (EditText) view.findViewById(R.id.server_edit_username);
+ mUsernameEdit.setHint(settings.getDefaultUsername());
+ mPasswordEdit = (EditText) view.findViewById(R.id.server_edit_password);
+ if (getServer() != null) {
+ Server oldServer = getServer();
+ mNameEdit.setText(oldServer.getName());
+ mHostEdit.setText(oldServer.getHost());
+ mPortEdit.setText(String.valueOf(oldServer.getPort()));
+ mUsernameEdit.setText(oldServer.getUsername());
+ mPasswordEdit.setText(oldServer.getPassword());
+ }
+
+ if(!shouldSave()) {
+ mNameTitle.setVisibility(View.GONE);
+ mNameEdit.setVisibility(View.GONE);
+ }
+
+ int actionTitle;
+ if(shouldSave() && getServer() == null) {
+ actionTitle = R.string.add;
+ } else if(shouldSave()) {
+ actionTitle = R.string.save;
+ } else {
+ actionTitle = R.string.connect;
+ }
+
+ alertBuilder.setPositiveButton(actionTitle, new OnClickListener() {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ Server server = createServer(shouldSave());
+
+ // If we're not committing this server, connect immediately.
+ if(!shouldSave()) mListener.connectToServer(server);
+
+ dismiss();
+ }
+ });
+
+ alertBuilder.setNegativeButton(android.R.string.cancel, new OnClickListener() {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ dismiss();
+ }
+ });
+
+ alertBuilder.setOnCancelListener(new OnCancelListener() {
+
+ @Override
+ public void onCancel(DialogInterface dialog) {
+ dismiss();
+ }
+ });
+
+ return alertBuilder.create();
+ }
+
+ private boolean shouldSave() {
+ return getArguments() == null || getArguments().getBoolean("save", true);
+ }
+
+ private Server getServer() {
+ return getArguments() != null ? (Server) getArguments().getParcelable("server") : null;
+ }
+
+ /**
+ * Creates or updates a server with the information in this fragment.
+ * @param shouldCommit Whether to commit the created service to the DB.
+ * @return The new or updated server.
+ */
+ public Server createServer(boolean shouldCommit) {
+ String name = (mNameEdit).getText().toString().trim();
+ String host = (mHostEdit).getText().toString().trim();
+
+ int port;
+ try {
+ port = Integer.parseInt((mPortEdit).getText().toString());
+ } catch (final NumberFormatException ex) {
+ port = Constants.DEFAULT_PORT;
+ }
+
+ String username = (mUsernameEdit).getText().toString().trim();
+ String password = mPasswordEdit.getText().toString();
+
+ if(username.equals(""))
+ username = mUsernameEdit.getHint().toString();
+
+ Server server;
+
+ if (getServer() != null) {
+ server = getServer();
+ server.setName(name);
+ server.setHost(host);
+ server.setPort(port);
+ server.setUsername(username);
+ server.setPassword(password);
+ if(shouldCommit) mDatabaseProvider.getDatabase().updateServer(server);
+ } else {
+ server = new Server(-1, name, host, port, username, password);
+ if(shouldCommit) mDatabaseProvider.getDatabase().addServer(server);
+ }
+
+ if(shouldCommit) mListener.serverInfoUpdated();
+
+ return server;
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerInfoResponse.java b/Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerInfoResponse.java
new file mode 100644
index 0000000..9661135
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerInfoResponse.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.servers;
+
+import com.morlunk.jumble.model.Server;
+
+import java.nio.ByteBuffer;
+
+/**
+ * Response from server pings.
+ * @see http://mumble.sourceforge.net/Protocol
+ * @author morlunk
+ */
+public class ServerInfoResponse {
+
+ private long mIdentifier;
+ private int mVersion;
+ private int mCurrentUsers;
+ private int mMaximumUsers;
+ private int mAllowedBandwidth;
+ private int mLatency;
+ private Server mServer;
+
+ /**
+ * Whether or not this server info response represents a failure to retrieve a response. Used to efficiently denote failed responses.
+ */
+ private boolean mDummy = false;
+
+ /**
+ * Creates a ServerInfoResponse object with the bytes obtained from the server.
+ * @param response The response to the UDP pings sent by the server.
+ * @see http://mumble.sourceforge.net/Protocol
+ */
+ public ServerInfoResponse(Server server, byte[] response, int latency) {
+ ByteBuffer buffer = ByteBuffer.wrap(response);
+ mVersion = buffer.getInt();
+ mIdentifier = buffer.getLong();
+ mCurrentUsers = buffer.getInt();
+ mMaximumUsers = buffer.getInt();
+ mAllowedBandwidth = buffer.getInt();
+ mLatency = latency;
+ mServer = server;
+ }
+
+ /**
+ * Instantiating a ServerInfoResponse with no data will cause it to be considered a 'dummy' response by its handler.
+ */
+ public ServerInfoResponse() {
+ this.mDummy = true;
+ }
+
+ public long getIdentifier() {
+ return mIdentifier;
+ }
+
+ public int getVersion() {
+ return mVersion;
+ }
+
+ public String getVersionString() {
+ byte[] versionBytes = ByteBuffer.allocate(4).putInt(mVersion).array();
+ return String.format("%d.%d.%d", (int)versionBytes[1], (int)versionBytes[2], (int)versionBytes[3]);
+ }
+
+ public int getCurrentUsers() {
+ return mCurrentUsers;
+ }
+
+ public int getMaximumUsers() {
+ return mMaximumUsers;
+ }
+
+ public int getAllowedBandwidth() {
+ return mAllowedBandwidth;
+ }
+
+ public int getLatency() {
+ return mLatency;
+ }
+
+ public Server getServer() {
+ return mServer;
+ }
+
+ public boolean isDummy() {
+ return mDummy;
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerInfoTask.java b/Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerInfoTask.java
new file mode 100644
index 0000000..059102b
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerInfoTask.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.servers;
+
+import android.os.AsyncTask;
+import android.util.Log;
+
+import com.morlunk.jumble.model.Server;
+import com.morlunk.mumbleclient.Constants;
+
+import java.net.DatagramPacket;
+import java.net.DatagramSocket;
+import java.net.InetAddress;
+import java.nio.ByteBuffer;
+
+/**
+ * Pings the requested server and returns a ServerInfoResponse.
+ * Will return a 'dummy' ServerInfoResponse in the case of failure.
+ * @author morlunk
+ *
+ */
+public class ServerInfoTask extends AsyncTask<Server, Void, ServerInfoResponse> {
+
+ private Server server;
+
+ @Override
+ protected ServerInfoResponse doInBackground(Server... params) {
+ server = params[0];
+ try {
+ InetAddress host = InetAddress.getByName(server.getHost());
+
+ // Create ping message
+ ByteBuffer buffer = ByteBuffer.allocate(12);
+ buffer.putInt(0); // Request type
+ buffer.putLong(server.getId()); // Identifier
+ DatagramPacket requestPacket = new DatagramPacket(buffer.array(), 12, host, server.getPort());
+
+ // Send packet and wait for response
+ DatagramSocket socket = new DatagramSocket();
+ socket.setSoTimeout(1000);
+ socket.setReceiveBufferSize(1024);
+
+ long startTime = System.nanoTime();
+
+ socket.send(requestPacket);
+
+ byte[] responseBuffer = new byte[24];
+ DatagramPacket responsePacket = new DatagramPacket(responseBuffer, responseBuffer.length);
+ socket.receive(responsePacket);
+
+ int latencyInMs = (int) ((System.nanoTime()-startTime)/1000000);
+
+ ServerInfoResponse response = new ServerInfoResponse(server, responseBuffer, latencyInMs);
+
+ Log.i(Constants.TAG, "DEBUG: Server version: "+response.getVersionString()+"\nUsers: "+response.getCurrentUsers()+"/"+response.getMaximumUsers());
+
+ return response;
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return new ServerInfoResponse(); // Return dummy in case of failure
+ }
+
+} \ No newline at end of file
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerListFragment.java b/Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerListFragment.java
new file mode 100644
index 0000000..ea3bae5
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/servers/ServerListFragment.java
@@ -0,0 +1,295 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.servers;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v7.widget.PopupMenu;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.ArrayAdapter;
+import android.widget.GridView;
+import android.widget.ImageView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+import com.morlunk.jumble.model.Server;
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.Settings;
+import com.morlunk.mumbleclient.db.DatabaseProvider;
+import com.morlunk.mumbleclient.db.PublicServer;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Displays a list of servers, and allows the user to connect and edit them.
+ * @author morlunk
+ *
+ */
+public class ServerListFragment extends Fragment implements OnItemClickListener {
+
+ public interface ServerConnectHandler {
+ public void connectToServer(Server server);
+ public void connectToPublicServer(PublicServer server);
+ }
+
+ private ServerConnectHandler mConnectHandler;
+ private DatabaseProvider mDatabaseProvider;
+ private GridView mServerGrid;
+ private ServerAdapter mServerAdapter;
+ private Map<Server, ServerInfoResponse> mInfoResponses = new HashMap<Server, ServerInfoResponse>();
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ setHasOptionsMenu(true);
+ }
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+
+ try {
+ mConnectHandler = (ServerConnectHandler)activity;
+ mDatabaseProvider = (DatabaseProvider) activity;
+ } catch (ClassCastException e) {
+ throw new ClassCastException(activity.toString()+" must implement ServerConnectHandler!");
+ }
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_server_list, container, false);
+ mServerGrid = (GridView) view.findViewById(R.id.server_list_grid);
+ mServerGrid.setOnItemClickListener(this);
+ mServerGrid.setEmptyView(view.findViewById(R.id.server_list_grid_empty));
+ registerForContextMenu(mServerGrid);
+ return view;
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ super.onCreateOptionsMenu(menu, inflater);
+ inflater.inflate(R.menu.fragment_server_list, menu);
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ updateServers();
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if(item.getItemId() == R.id.menu_add_server_item) {
+ addServer();
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ private void addServer() {
+ ServerEditFragment infoDialog = new ServerEditFragment();
+ infoDialog.show(getFragmentManager(), "serverInfo");
+ }
+
+ private void editServer(Server server) {
+ ServerEditFragment infoDialog = new ServerEditFragment();
+ Bundle args = new Bundle();
+ args.putParcelable("server", server);
+ infoDialog.setArguments(args);
+ infoDialog.show(getFragmentManager(), "serverInfo");
+ }
+
+ private void shareServer(Server server) {
+ // Build Mumble server URL
+ String serverUrl = "mumble://"+server.getHost()+":"+server.getPort()+"/";
+
+ Intent intent = new Intent();
+ intent.setAction(Intent.ACTION_SEND);
+ intent.putExtra(Intent.EXTRA_TEXT, getString(R.string.shareMessage, serverUrl));
+ intent.setType("text/plain");
+ startActivity(intent);
+ }
+
+ private void deleteServer(final Server server) {
+ AlertDialog.Builder alertBuilder = new AlertDialog.Builder(getActivity());
+ alertBuilder.setMessage(R.string.confirm_delete_server);
+ alertBuilder.setPositiveButton(R.string.delete, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ mDatabaseProvider.getDatabase().removeServer(server);
+ mServerAdapter.remove(server);
+ }
+ });
+ alertBuilder.setNegativeButton(android.R.string.cancel, null);
+ alertBuilder.show();
+ }
+
+ public void updateServers() {
+ List<Server> servers = getServers();
+ mServerAdapter = new ServerAdapter(getActivity(), servers);
+ mServerGrid.setAdapter(mServerAdapter);
+
+ for(final Server server : servers) {
+ new ServerInfoTask() {
+ protected void onPostExecute(ServerInfoResponse result) {
+ super.onPostExecute(result);
+ mInfoResponses.put(server, result);
+ mServerAdapter.notifyDataSetChanged();
+ };
+ }.execute(server);
+ }
+ }
+
+
+
+ public List<Server> getServers() {
+ List<Server> servers = mDatabaseProvider.getDatabase().getServers();
+ return servers;
+ }
+
+ @Override
+ public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
+ mConnectHandler.connectToServer(mServerAdapter.getItem(arg2));
+ }
+
+ private class ServerAdapter extends ArrayAdapter<Server> {
+
+ private boolean mLightTheme;
+
+ public ServerAdapter(Context context, List<Server> servers) {
+ super(context, android.R.id.text1, servers);
+ mLightTheme = R.style.Theme_Plumble == Settings.getInstance(context).getTheme();
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return getItem(position).getId();
+ }
+
+ @Override
+ public final View getView(
+ final int position,
+ final View v,
+ final ViewGroup parent) {
+ View view = v;
+
+ if(v == null) {
+ LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ view = inflater.inflate(R.layout.server_list_row, parent, false);
+
+ }
+
+ final Server server = getItem(position);
+
+ ServerInfoResponse infoResponse = mInfoResponses.get(server);
+ // If there is a null value for the server info (rather than none at all), the request must have failed.
+ boolean requestExists = infoResponse != null;
+ boolean requestFailure = infoResponse != null && infoResponse.isDummy();
+
+ TextView nameText = (TextView) view.findViewById(R.id.server_row_name);
+ TextView userText = (TextView) view.findViewById(R.id.server_row_user);
+ TextView addressText = (TextView) view.findViewById(R.id.server_row_address);
+
+ if(server.getName().equals("")) {
+ nameText.setText(server.getHost());
+ } else {
+ nameText.setText(server.getName());
+ }
+
+ userText.setText(server.getUsername());
+ addressText.setText(server.getHost()+":"+server.getPort());
+
+ ImageView moreButton = (ImageView) view.findViewById(R.id.server_row_more);
+ moreButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ PopupMenu popupMenu = new PopupMenu(getContext(), v);
+ MenuInflater inflater = popupMenu.getMenuInflater();
+ inflater.inflate(R.menu.popup_server_row, popupMenu.getMenu());
+ ServerPopupMenuItemClickListener listener = new ServerPopupMenuItemClickListener(server);
+ popupMenu.setOnMenuItemClickListener(listener);
+ popupMenu.show();
+ }
+ });
+
+ TextView serverVersionText = (TextView) view.findViewById(R.id.server_row_version_status);
+ TextView serverLatencyText = (TextView) view.findViewById(R.id.server_row_latency);
+ TextView serverUsersText = (TextView) view.findViewById(R.id.server_row_usercount);
+ ProgressBar serverInfoProgressBar = (ProgressBar) view.findViewById(R.id.server_row_ping_progress);
+
+ serverVersionText.setVisibility(!requestExists ? View.INVISIBLE : View.VISIBLE);
+ serverUsersText.setVisibility(!requestExists ? View.INVISIBLE : View.VISIBLE);
+ serverLatencyText.setVisibility(!requestExists ? View.INVISIBLE : View.VISIBLE);
+ serverInfoProgressBar.setVisibility(!requestExists ? View.VISIBLE : View.INVISIBLE);
+
+ if(infoResponse != null && !requestFailure) {
+ serverVersionText.setText(getResources().getString(R.string.online)+" ("+infoResponse.getVersionString()+")");
+ serverUsersText.setText(infoResponse.getCurrentUsers()+"/"+infoResponse.getMaximumUsers());
+ serverLatencyText.setText(infoResponse.getLatency()+"ms");
+ } else if(requestFailure) {
+ serverVersionText.setText(R.string.offline);
+ serverUsersText.setText("");
+ serverLatencyText.setText("");
+ }
+
+ return view;
+ }
+ }
+
+ private class ServerPopupMenuItemClickListener implements PopupMenu.OnMenuItemClickListener {
+
+ private Server server;
+
+ public ServerPopupMenuItemClickListener(Server server) {
+ this.server = server;
+ }
+
+ public boolean onMenuItemClick(android.view.MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.menu_edit_item:
+ editServer(server);
+ return true;
+ case R.id.menu_share_item:
+ shareServer(server);
+ return true;
+ case R.id.menu_delete_item:
+ deleteServer(server);
+ return true;
+ }
+ return false;
+ }
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/service/PlumbleOverlay.java b/Plumble/src/main/java/com/morlunk/mumbleclient/service/PlumbleOverlay.java
new file mode 100644
index 0000000..9b4ead8
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/service/PlumbleOverlay.java
@@ -0,0 +1,230 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.service;
+
+import android.content.Context;
+import android.graphics.PixelFormat;
+import android.os.RemoteException;
+import android.util.DisplayMetrics;
+import android.view.Gravity;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.WindowManager;
+import android.widget.ImageView;
+import android.widget.ListView;
+
+import com.morlunk.jumble.model.Channel;
+import com.morlunk.jumble.model.User;
+import com.morlunk.jumble.net.JumbleObserver;
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.channel.ChannelAdapter;
+
+/**
+ * An onscreen interactive overlay displaying the users in the current channel.
+ * Created by andrew on 26/09/13.
+ */
+public class PlumbleOverlay {
+
+ public static final int DEFAULT_WIDTH = 200;
+ public static final int DEFAULT_HEIGHT = 240;
+
+ private JumbleObserver mObserver = new JumbleObserver() {
+ @Override
+ public void onUserTalkStateUpdated(User user) throws RemoteException {
+ mChannelAdapter.notifyDataSetChanged();
+ }
+
+ @Override
+ public void onUserStateUpdated(User user) throws RemoteException {
+ if(user.getChannelId() == mService.getBinder().getSessionChannel().getId())
+ mChannelAdapter.notifyDataSetChanged();
+ }
+
+ @Override
+ public void onUserJoinedChannel(User user, Channel newChannel, Channel oldChannel) throws RemoteException {
+ if(user.getSession() == mService.getSession()) // Session user has changed channels
+ mChannelAdapter.setChannel(mService.getBinder().getSessionChannel());
+ else if(newChannel.getId() == mService.getBinder().getSessionChannel().getId() ||
+ oldChannel.getId() == mService.getBinder().getSessionChannel().getId())
+ mChannelAdapter.notifyDataSetChanged();
+ }
+ };
+
+ private View mOverlayView;
+ private ListView mOverlayList;
+ private ChannelAdapter mChannelAdapter;
+ private ImageView mTalkButton;
+// private ImageView mToggleButton;
+ private ImageView mCloseButton;
+ private ImageView mDragButton;
+ private View mTitleView;
+ private WindowManager.LayoutParams mOverlayParams;
+ private boolean mShown = false;
+// private boolean mShowChat = false;
+
+ private PlumbleService mService;
+
+ public PlumbleOverlay(PlumbleService service) {
+ mService = service;
+ mOverlayView = View.inflate(service, R.layout.overlay, null);
+ mTalkButton = (ImageView) mOverlayView.findViewById(R.id.overlay_talk);
+ mDragButton = (ImageView) mOverlayView.findViewById(R.id.overlay_drag);
+ mCloseButton = (ImageView) mOverlayView.findViewById(R.id.overlay_close);
+// mToggleButton = (ImageView) mOverlayView.findViewById(R.id.overlay_mode_toggle);
+ mTitleView = mOverlayView.findViewById(R.id.overlay_title);
+ mOverlayList = (ListView) mOverlayView.findViewById(R.id.overlay_list);
+
+ mTitleView.setOnTouchListener(new View.OnTouchListener() {
+ private final WindowManager mWindowManager = (WindowManager) mService.getSystemService(Context.WINDOW_SERVICE);
+ private float mInitialX;
+ private float mInitialY;
+
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ if(MotionEvent.ACTION_DOWN == event.getAction()) {
+ mInitialX = event.getRawX() - mOverlayParams.x;
+ mInitialY = event.getRawY() - mOverlayParams.y;
+ }
+ else if(MotionEvent.ACTION_MOVE == event.getAction()) {
+ mOverlayParams.x = (int) (event.getRawX() - mInitialX);
+ mOverlayParams.y = (int) (event.getRawY() - mInitialY);
+ mWindowManager.updateViewLayout(mOverlayView, mOverlayParams);
+ }
+ return true;
+ }
+ });
+
+ mDragButton.setOnTouchListener(new View.OnTouchListener() {
+
+ private final WindowManager mWindowManager = (WindowManager) mService.getSystemService(Context.WINDOW_SERVICE);
+ private float mInitialX;
+ private float mInitialY;
+ private float mInitialWidth;
+ private float mInitialHeight;
+
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ switch (event.getAction()) {
+ case MotionEvent.ACTION_DOWN:
+ mInitialX = event.getRawX();
+ mInitialY = event.getRawY();
+ mInitialWidth = mOverlayView.getWidth();
+ mInitialHeight = mOverlayView.getHeight();
+ return true;
+ case MotionEvent.ACTION_MOVE:
+ mOverlayParams.width = (int) (mInitialWidth + (event.getRawX() - mInitialX));
+ mOverlayParams.height = (int) (mInitialHeight + (event.getRawY() - mInitialY));
+ mWindowManager.updateViewLayout(mOverlayView, mOverlayParams);
+ return true;
+ }
+ return false;
+ }
+ });
+
+ /*
+ mToggleButton.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ mShowChat = !mShowChat;
+ // TODO implement chat
+ if(mShowChat) {
+
+ } else {
+
+ }
+ }
+ });
+ */
+
+ mTalkButton.setOnTouchListener(new View.OnTouchListener() {
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ if(MotionEvent.ACTION_DOWN == event.getAction()) {
+ try {
+ mService.getBinder().setTalkingState(true);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ } else if(MotionEvent.ACTION_UP == event.getAction()) {
+ try {
+ mService.getBinder().setTalkingState(false);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ return false;
+ }
+ });
+
+ mCloseButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ hide();
+ }
+ });
+
+ DisplayMetrics metrics = mService.getResources().getDisplayMetrics();
+ mOverlayParams = new WindowManager.LayoutParams((int)(DEFAULT_WIDTH*metrics.density),
+ (int)(DEFAULT_HEIGHT*metrics.density),
+ WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
+ WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
+ | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
+ | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
+ PixelFormat.TRANSLUCENT);
+ mOverlayParams.gravity = Gravity.TOP | Gravity.LEFT;
+ mOverlayParams.windowAnimations = android.R.style.Animation_Dialog;
+ }
+
+ public boolean isShown() {
+ return mShown;
+ }
+
+ public void show() {
+ if(mShown)
+ return;
+ mShown = true;
+ try {
+ mChannelAdapter = new ChannelAdapter(mService, mService.getBinder(), mService.getBinder().getSessionChannel());
+ mOverlayList.setAdapter(mChannelAdapter);
+ mService.getBinder().registerObserver(mObserver);
+ WindowManager windowManager = (WindowManager) mService.getSystemService(Context.WINDOW_SERVICE);
+ windowManager.addView(mOverlayView, mOverlayParams);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void hide() {
+ if(!mShown)
+ return;
+ mShown = false;
+ try {
+ mService.getBinder().unregisterObserver(mObserver);
+ mOverlayList.setAdapter(null);
+ WindowManager windowManager = (WindowManager) mService.getSystemService(Context.WINDOW_SERVICE);
+ windowManager.removeView(mOverlayView);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/service/PlumbleService.java b/Plumble/src/main/java/com/morlunk/mumbleclient/service/PlumbleService.java
new file mode 100644
index 0000000..892a8c8
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/service/PlumbleService.java
@@ -0,0 +1,467 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.service;
+
+import android.app.PendingIntent;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.SharedPreferences;
+import android.graphics.PixelFormat;
+import android.os.RemoteException;
+import android.preference.PreferenceManager;
+import android.speech.tts.TextToSpeech;
+import android.support.v4.app.NotificationCompat;
+import android.view.Gravity;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.WindowManager;
+
+import com.morlunk.jumble.Constants;
+import com.morlunk.jumble.JumbleService;
+import com.morlunk.jumble.model.Message;
+import com.morlunk.jumble.model.User;
+import com.morlunk.jumble.net.JumbleObserver;
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.Settings;
+import com.morlunk.mumbleclient.app.PlumbleActivity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * An extension of the Jumble service with some added Plumble-exclusive non-standard Mumble features.
+ * Created by andrew on 28/07/13.
+ */
+public class PlumbleService extends JumbleService implements SharedPreferences.OnSharedPreferenceChangeListener {
+
+ public static final int TTS_THRESHOLD = 250; // Maximum number of characters to read
+
+ public static final String BROADCAST_MUTE = "broadcast_mute";
+ public static final String BROADCAST_DEAFEN = "broadcast_deafen";
+ public static final String BROADCAST_TOGGLE_OVERLAY = "broadcast_toggle_overlay";
+
+ public static final int STATUS_NOTIFICATION_ID = 1;
+
+ private NotificationCompat.Builder mStatusNotificationBuilder;
+ /** A list of messages to be displayed in the chat notification. Should be cleared when notification pressed. */
+ private List<String> mUnreadMessages = new ArrayList<String>();
+
+ private Settings mSettings;
+ private boolean mHotCornerEnabled;
+ /** The view representing the hot corner. */
+ private View mHotCornerView;
+ /** The overlay that's shown when talking using a hot corner. */
+ private View mHotCornerOverlay;
+ /** Channel view overlay. */
+ private PlumbleOverlay mChannelOverlay;
+
+ private TextToSpeech mTTS;
+ private TextToSpeech.OnInitListener mTTSInitListener = new TextToSpeech.OnInitListener() {
+ @Override
+ public void onInit(int status) {
+ if(status == TextToSpeech.ERROR)
+ logWarning(getString(R.string.tts_failed));
+ }
+ };
+
+ private BroadcastReceiver mNotificationReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ try {
+ if(BROADCAST_MUTE.equals(intent.getAction())) {
+ User user = getBinder().getSessionUser();
+ boolean muted = !user.isSelfMuted();
+ boolean deafened = user.isSelfDeafened();
+ deafened &= muted;
+ getBinder().setSelfMuteDeafState(muted, deafened);
+ } else if(BROADCAST_DEAFEN.equals(intent.getAction())) {
+ User user = getBinder().getSessionUser();
+ getBinder().setSelfMuteDeafState(!user.isSelfDeafened(), !user.isSelfDeafened());
+ } else if(BROADCAST_TOGGLE_OVERLAY.equals(intent.getAction())) {
+ if(!mChannelOverlay.isShown())
+ mChannelOverlay.show();
+ else
+ mChannelOverlay.hide();
+ } else if(PlumbleActivity.ACTION_PLUMBLE_SHOWN.equals(intent.getAction())) {
+ if(getBinder().isConnected()) {
+ mUnreadMessages.clear();
+ updateNotificationState();
+ }
+ }
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ };
+
+ private JumbleObserver mObserver = new JumbleObserver() {
+
+ @Override
+ public void onConnectionError(String message, boolean reconnecting) throws RemoteException {
+ String tickerMessage = null;
+ if(reconnecting) tickerMessage += "\n"+getString(R.string.reconnecting, PlumbleActivity.RECONNECT_DELAY/1000);
+ else tickerMessage = getString(R.string.plumbleDisconnected);
+ updateNotificationTicker(tickerMessage);
+ updateNotificationState();
+ if(!reconnecting) hideNotification();
+ }
+
+ @Override
+ public void onUserStateUpdated(User user) throws RemoteException {
+ if(user.getSession() == getSession()) {
+ mSettings.setMutedAndDeafened(user.isSelfMuted(), user.isSelfDeafened()); // Update settings mute/deafen state
+ updateNotificationState();
+ }
+ }
+
+ @Override
+ public void onMessageLogged(Message message) throws RemoteException {
+ // Strip all HTML tags.
+ String strippedMessage = message.getMessage().replaceAll("<[^>]*>", "");
+
+ // Only read text messages. TODO: make this an option.
+ if(message.getType() == Message.Type.TEXT_MESSAGE) {
+ User actor = getBinder().getUser(message.getActor());
+ String actorName = actor != null ? actor.getName() : getString(R.string.server);
+
+ String formattedMessage = actorName + ": " + strippedMessage;
+ mUnreadMessages.add(formattedMessage);
+
+ if(mSettings.isChatNotifyEnabled()) {
+ // Set the ticker to be the last message received
+ mStatusNotificationBuilder.setTicker(mUnreadMessages.get(mUnreadMessages.size() - 1));
+ updateNotificationState();
+ }
+
+ // Read if TTS is enabled, the message is less than threshold, is a text message, and not deafened
+ if(mSettings.isTextToSpeechEnabled() &&
+ mTTS != null &&
+ message.getType() == Message.Type.TEXT_MESSAGE &&
+ strippedMessage.length() <= TTS_THRESHOLD &&
+ !getBinder().getSessionUser().isSelfDeafened()) {
+ mTTS.speak(formattedMessage, TextToSpeech.QUEUE_ADD, null);
+ }
+ }
+ }
+
+ @Override
+ public void onPermissionDenied(String reason) throws RemoteException {
+ if(!mSettings.isChatNotifyEnabled()) return;
+ updateNotificationTicker(reason);
+ }
+ };
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ // Register for notification actions
+ IntentFilter notificationIntentFilter = new IntentFilter();
+ notificationIntentFilter.addAction(BROADCAST_MUTE);
+ notificationIntentFilter.addAction(BROADCAST_DEAFEN);
+ notificationIntentFilter.addAction(BROADCAST_TOGGLE_OVERLAY);
+ notificationIntentFilter.addAction(PlumbleActivity.ACTION_PLUMBLE_SHOWN);
+ registerReceiver(mNotificationReceiver, notificationIntentFilter);
+
+ try {
+ getBinder().registerObserver(mObserver);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+
+ // Register for preference changes
+ mSettings = Settings.getInstance(this);
+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
+ preferences.registerOnSharedPreferenceChangeListener(this);
+
+ // Instantiate overlay view
+ mChannelOverlay = new PlumbleOverlay(this);
+
+ // Set up TTS
+ if(mSettings.isTextToSpeechEnabled())
+ mTTS = new TextToSpeech(this, mTTSInitListener);
+ }
+
+ @Override
+ public void connect() {
+ super.connect();
+ createNotification(); // TODO: move this to a better place!
+ }
+
+ @Override
+ public void onDestroy() {
+ stopForeground(true);
+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
+ preferences.unregisterOnSharedPreferenceChangeListener(this);
+ unregisterReceiver(mNotificationReceiver);
+ try {
+ getBinder().unregisterObserver(mObserver);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ if(mTTS != null) mTTS.shutdown();
+ super.onDestroy();
+ }
+
+ @Override
+ public void onConnectionEstablished() {
+ super.onConnectionEstablished();
+ updateNotificationTicker(getString(R.string.plumbleConnected));
+ try {
+ // Restore mute/deafen state
+ Settings settings = Settings.getInstance(this);
+ User sessionUser = getBinder().getSessionUser();
+ if(sessionUser.isSelfMuted() != settings.isMuted() ||
+ sessionUser.isSelfDeafened() != settings.isDeafened())
+ getBinder().setSelfMuteDeafState(settings.isMuted(), settings.isDeafened());
+
+ // Update setting-dependent connection properties
+ configureHotCorner();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void onConnectionDisconnected() {
+ super.onConnectionDisconnected();
+ // Remove overlay if present.
+ mChannelOverlay.hide();
+
+ // Remove hot corner if present.
+ if(mHotCornerView != null) {
+ WindowManager windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
+ try {
+ windowManager.removeView(mHotCornerView);
+ windowManager.removeView(mHotCornerOverlay);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ }
+ mHotCornerEnabled = false;
+ }
+
+ try {
+ if(!getBinder().isReconnecting()) hideNotification();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Sets up or updates the hot corner with the latest values from settings.
+ */
+ public void configureHotCorner() {
+ // Hot corner configuration
+ String hotCorner = mSettings.getHotCorner();
+ final WindowManager windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
+ if(!Settings.ARRAY_HOT_CORNER_NONE.equals(hotCorner) && isConnected()) {
+ final WindowManager.LayoutParams cornerParams = new WindowManager.LayoutParams(WindowManager.LayoutParams.WRAP_CONTENT,
+ WindowManager.LayoutParams.WRAP_CONTENT,
+ WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
+ WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,
+ PixelFormat.TRANSLUCENT);
+
+ if(Settings.ARRAY_HOT_CORNER_TOP_LEFT.equals(hotCorner))
+ cornerParams.gravity = Gravity.TOP | Gravity.LEFT;
+ else if(Settings.ARRAY_HOT_CORNER_TOP_RIGHT.equals(hotCorner))
+ cornerParams.gravity = Gravity.TOP | Gravity.RIGHT;
+ else if(Settings.ARRAY_HOT_CORNER_BOTTOM_LEFT.equals(hotCorner))
+ cornerParams.gravity = Gravity.BOTTOM | Gravity.LEFT;
+ else if(Settings.ARRAY_HOT_CORNER_BOTTOM_RIGHT.equals(hotCorner))
+ cornerParams.gravity = Gravity.BOTTOM | Gravity.RIGHT;
+
+ final WindowManager.LayoutParams overlayParams = new WindowManager.LayoutParams(WindowManager.LayoutParams.WRAP_CONTENT,
+ WindowManager.LayoutParams.WRAP_CONTENT,
+ WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
+ WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
+ PixelFormat.TRANSLUCENT);
+ overlayParams.gravity = Gravity.CENTER | Gravity.BOTTOM;
+
+ if(mHotCornerEnabled) {
+ windowManager.updateViewLayout(mHotCornerView, cornerParams);
+ windowManager.updateViewLayout(mHotCornerOverlay, overlayParams);
+ } else {
+ mHotCornerView = View.inflate(this, R.layout.ptt_corner, null);
+ mHotCornerOverlay = View.inflate(this, R.layout.ptt_overlay, null);
+ mHotCornerOverlay.setVisibility(View.GONE);
+
+ mHotCornerView.setOnTouchListener(new View.OnTouchListener() {
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ try {
+ if(MotionEvent.ACTION_DOWN == event.getAction()) {
+ mHotCornerOverlay.setVisibility(View.VISIBLE);
+ if(mSettings.isPushToTalkToggle()) {
+ boolean newState = !getBinder().isTalking();
+ getBinder().setTalkingState(newState);
+ mHotCornerOverlay.setVisibility(newState ? View.VISIBLE : View.GONE);
+ } else {
+ getBinder().setTalkingState(true);
+ mHotCornerOverlay.setVisibility(View.VISIBLE);
+ }
+ return true;
+ } else if(MotionEvent.ACTION_UP == event.getAction()) {
+ if(!mSettings.isPushToTalkToggle()) {
+ mHotCornerOverlay.setVisibility(View.GONE);
+ getBinder().setTalkingState(false);
+ }
+ return true;
+ }
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
+ });
+
+ windowManager.addView(mHotCornerView, cornerParams);
+ windowManager.addView(mHotCornerOverlay, overlayParams);
+
+ mHotCornerEnabled = true;
+ }
+ } else if(mHotCornerEnabled) {
+ windowManager.removeView(mHotCornerView);
+ windowManager.removeView(mHotCornerOverlay);
+ mHotCornerEnabled = false;
+ }
+ }
+
+ /**
+ * Called when the user makes a change to their preferences. Should update all preferences relevant to the service.
+ */
+ @Override
+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
+ if(Settings.PREF_INPUT_METHOD.equals(key)) {
+ /* Convert input method defined in settings to an integer format used by Jumble. */
+ int inputMethod = 0;
+ String prefInputMethod = mSettings.getInputMethod();
+ if(Settings.ARRAY_INPUT_METHOD_VOICE.equals(prefInputMethod))
+ inputMethod = Constants.TRANSMIT_VOICE_ACTIVITY;
+ if(Settings.ARRAY_INPUT_METHOD_PTT.equals(prefInputMethod))
+ inputMethod = Constants.TRANSMIT_PUSH_TO_TALK;
+ if(Settings.ARRAY_INPUT_METHOD_CONTINUOUS.equals(prefInputMethod))
+ inputMethod = Constants.TRANSMIT_CONTINUOUS;
+ try {
+ getBinder().setTransmitMode(inputMethod);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+ else if(Settings.PREF_THRESHOLD.equals(key))
+ try {
+ getBinder().setVADThreshold(mSettings.getDetectionThreshold());
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ else if(Settings.PREF_HOT_CORNER_KEY.equals(key))
+ configureHotCorner();
+ else if(Settings.PREF_USE_TTS.equals(key)) {
+ if(mTTS == null && mSettings.isTextToSpeechEnabled())
+ mTTS = new TextToSpeech(this, mTTSInitListener);
+ else if(mTTS != null && !mSettings.isTextToSpeechEnabled()) {
+ mTTS.shutdown();
+ mTTS = null;
+ }
+ }
+ }
+
+ /**
+ * Creates a new NotificationCompat.Builder configured for the service, and shows it.
+ */
+ public void createNotification() {
+ NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
+ builder.setSmallIcon(R.drawable.ic_stat_notify);
+ builder.setTicker(getResources().getString(R.string.plumbleConnecting));
+ builder.setContentTitle(getResources().getString(R.string.app_name));
+ builder.setContentText(getResources().getString(R.string.connected));
+ builder.setPriority(NotificationCompat.PRIORITY_HIGH);
+ builder.setOngoing(true);
+
+ // Add notification triggers
+ Intent muteIntent = new Intent(BROADCAST_MUTE);
+ Intent deafenIntent = new Intent(BROADCAST_DEAFEN);
+ Intent overlayIntent = new Intent(BROADCAST_TOGGLE_OVERLAY);
+
+ builder.addAction(R.drawable.ic_action_microphone,
+ getString(R.string.mute), PendingIntent.getBroadcast(this, 1,
+ muteIntent, PendingIntent.FLAG_CANCEL_CURRENT));
+ builder.addAction(R.drawable.ic_action_audio_on,
+ getString(R.string.deafen), PendingIntent.getBroadcast(this, 1,
+ deafenIntent, PendingIntent.FLAG_CANCEL_CURRENT));
+ builder.addAction(R.drawable.ic_action_channels,
+ getString(R.string.overlay), PendingIntent.getBroadcast(this, 2,
+ overlayIntent, PendingIntent.FLAG_CANCEL_CURRENT));
+
+ Intent channelListIntent = new Intent(this, PlumbleActivity.class);
+
+ PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, channelListIntent, 0);
+
+ builder.setContentIntent(pendingIntent);
+
+ mStatusNotificationBuilder = builder;
+ startForeground(STATUS_NOTIFICATION_ID, builder.build());
+ }
+
+ /**
+ * Updates the status notification with unread messages (if applicable), or status updates.
+ */
+ public void updateNotificationState() {
+ if(mStatusNotificationBuilder == null) return;
+ String contentText;
+ if(isConnected()) {
+ User currentUser = getUserHandler().getUser(getSession());
+ if(currentUser.isSelfMuted() && currentUser.isSelfDeafened())
+ contentText = getString(R.string.status_notify_muted_and_deafened);
+ else if(currentUser.isSelfMuted())
+ contentText = getString(R.string.status_notify_muted);
+ else
+ contentText = getString(R.string.connected);
+ } else {
+ contentText = getString(R.string.disconnected);
+ }
+
+ try {
+ if(getBinder().isReconnecting()) contentText = getString(R.string.reconnecting, PlumbleActivity.RECONNECT_DELAY/1000);
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+
+ if(!mUnreadMessages.isEmpty() && isConnected()) {
+ NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
+ for(String message : mUnreadMessages)
+ inboxStyle.addLine(message);
+ mStatusNotificationBuilder.setStyle(inboxStyle);
+ } else {
+ mStatusNotificationBuilder.setStyle(null);
+ }
+
+ mStatusNotificationBuilder.setContentText(contentText);
+ startForeground(STATUS_NOTIFICATION_ID, mStatusNotificationBuilder.build());
+ }
+
+ public void updateNotificationTicker(String message) {
+ if(mStatusNotificationBuilder == null) return;
+ mStatusNotificationBuilder.setTicker(message);
+ startForeground(STATUS_NOTIFICATION_ID, mStatusNotificationBuilder.build());
+ }
+
+ public void hideNotification() {
+ stopForeground(true);
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/util/JumbleServiceFragment.java b/Plumble/src/main/java/com/morlunk/mumbleclient/util/JumbleServiceFragment.java
new file mode 100644
index 0000000..64eced3
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/util/JumbleServiceFragment.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.util;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.os.RemoteException;
+import android.support.v4.app.Fragment;
+
+import com.morlunk.jumble.IJumbleObserver;
+import com.morlunk.jumble.IJumbleService;
+
+/**
+ * Fragment class intended to make binding the Jumble service to fragments easier.
+ * Created by andrew on 04/08/13.
+ */
+public abstract class JumbleServiceFragment extends Fragment {
+
+ private JumbleServiceProvider mServiceProvider;
+
+ /** State boolean to make sure we don't double initialize a fragment once a service has been bound. */
+ private boolean mBound;
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+
+ try {
+ mServiceProvider = (JumbleServiceProvider) activity;
+ } catch (ClassCastException e) {
+ throw new ClassCastException(activity.toString() + " must implement JumbleServiceProvider");
+ }
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+ mServiceProvider.addServiceFragment(this);
+ if(mServiceProvider.getService() != null && !mBound)
+ onServiceAttached(mServiceProvider.getService());
+ }
+
+ @Override
+ public void onDestroy() {
+ mServiceProvider.removeServiceFragment(this);
+ if(mServiceProvider.getService() != null && mBound)
+ onServiceDetached(mServiceProvider.getService());
+ super.onDestroy();
+ }
+
+ /** The definitive place where data from the service will be used to initialize the fragment. Only called once per bind, whether the fragment loads first or the service. */
+ public void onServiceBound(IJumbleService service) { }
+
+ /** If implemented, will register the returned observer to the service upon binding. */
+ public IJumbleObserver getServiceObserver() {
+ return null;
+ }
+
+ private void onServiceAttached(IJumbleService service) {
+ mBound = true;
+ try {
+ if(getServiceObserver() != null)
+ service.registerObserver(getServiceObserver());
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+
+ onServiceBound(service);
+ }
+
+ private void onServiceDetached(IJumbleService service) {
+ mBound = false;
+ try {
+ if(getServiceObserver() != null)
+ service.unregisterObserver(getServiceObserver());
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ public void setServiceBound(boolean bound) {
+ if(bound && !mBound)
+ onServiceAttached(mServiceProvider.getService());
+ else if(mBound && !bound)
+ onServiceDetached(mServiceProvider.getService());
+ }
+
+ public IJumbleService getService() {
+ return mServiceProvider.getService();
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/util/JumbleServiceProvider.java b/Plumble/src/main/java/com/morlunk/mumbleclient/util/JumbleServiceProvider.java
new file mode 100644
index 0000000..b9209e4
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/util/JumbleServiceProvider.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.util;
+
+import com.morlunk.jumble.IJumbleService;
+
+/**
+ * Created by andrew on 03/08/13.
+ */
+public interface JumbleServiceProvider {
+ public IJumbleService getService();
+ public void addServiceFragment(JumbleServiceFragment fragment);
+ public void removeServiceFragment(JumbleServiceFragment fragment);
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/view/PlumbleNestedAdapter.java b/Plumble/src/main/java/com/morlunk/mumbleclient/view/PlumbleNestedAdapter.java
new file mode 100644
index 0000000..85d94ab
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/view/PlumbleNestedAdapter.java
@@ -0,0 +1,272 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.view;
+
+import android.content.Context;
+import android.util.Log;
+import android.util.SparseBooleanArray;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ListAdapter;
+
+import com.morlunk.mumbleclient.Constants;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Adapter for PlumbleNestedListView that is designed to hold a channel hierarchy.
+ * The reason group ID is so essential instead of having an implementation-side position is to better abstract the hierarchy, which is messy and confusing.
+ * @param <G> The group class.
+ * @param <C> The child class.
+ */
+public abstract class PlumbleNestedAdapter<G, C> extends BaseAdapter implements ListAdapter {
+
+ protected enum NestMetadataType {
+ META_TYPE_GROUP,
+ META_TYPE_ITEM
+ }
+
+ protected class NestPositionMetadata {
+ NestMetadataType type;
+ NestPositionMetadata parent;
+ int id;
+ int childPosition;
+ int depth;
+ }
+
+ private Context mContext;
+
+ /**
+ * Metadata representations
+ */
+ protected List<NestPositionMetadata> mFlatMeta = new ArrayList<NestPositionMetadata>();
+ protected List<NestPositionMetadata> mVisibleMeta = new ArrayList<NestPositionMetadata>();
+ protected SparseBooleanArray mExpandedGroups = new SparseBooleanArray();
+
+ public abstract View getGroupView(int groupId, int depth, View convertView, ViewGroup parent);
+ public abstract View getChildView(int groupId, int childPosition, int depth, View convertView, ViewGroup parent);
+
+ public abstract List<Integer> getRootIds();
+
+ public abstract int getGroupCount(int parentId);
+ public abstract int getGroupId(int parentId, int groupPosition);
+ public abstract int getChildCount(int groupId);
+ public abstract int getChildId(int groupId, int childPosition);
+
+ public C getChild(int groupId, int childPosition) { return null; };
+ public G getGroup(int groupId) { return null; };
+ public boolean isGroupExpandedByDefault(int groupId) { return false; };
+
+ public PlumbleNestedAdapter(Context context) {
+ mContext = context;
+ }
+
+ private final void buildFlatMetadata() {
+ List<NestPositionMetadata> metadata = new ArrayList<NestPositionMetadata>();
+ // Start with root element(s), them populate downwards.
+ for(int rootId : getRootIds()) {
+ mExpandedGroups.put(rootId, true); // Always expand root
+ NestPositionMetadata root = new NestPositionMetadata();
+ root.id = rootId;
+ root.type = NestMetadataType.META_TYPE_GROUP;
+ populateHierarchy(root, metadata);
+ }
+ mFlatMeta = metadata;
+ }
+
+ /**
+ * Recursively flatten the channel hierarchy, including both subchannels and users.
+ * @param parent
+ * @param metaList
+ */
+ private void populateHierarchy(NestPositionMetadata parent, final List<NestPositionMetadata> metaList) {
+ metaList.add(parent);
+
+ int childCount = getChildCount(parent.id);
+ for(int x=0;x<childCount;x++) {
+ NestPositionMetadata childMeta = new NestPositionMetadata();
+ childMeta.parent = parent;
+ childMeta.id = getChildId(parent.id, x);
+ childMeta.type = NestMetadataType.META_TYPE_ITEM;
+ childMeta.childPosition = x;
+ childMeta.depth = parent.depth+1;
+ metaList.add(childMeta);
+ }
+
+ int subgroups = getGroupCount(parent.id);
+ for(int x=0;x<subgroups;x++) {
+ NestPositionMetadata subMeta = new NestPositionMetadata();
+ subMeta.parent = parent;
+ subMeta.id = getGroupId(parent.id, x);
+ subMeta.type = NestMetadataType.META_TYPE_GROUP;
+ subMeta.depth = 1+parent.depth;
+ populateHierarchy(subMeta, metaList);
+ }
+ }
+
+ /**
+ * TODO move this over to PlumbleNestedListView
+ */
+ protected final void buildVisibleMetadata() {
+ long startTime = System.currentTimeMillis();
+ mVisibleMeta.clear();
+ for(int x=0;x< mFlatMeta.size();x++) {
+ NestPositionMetadata metadata = mFlatMeta.get(x);
+ if(metadata.type == NestMetadataType.META_TYPE_GROUP) {
+ if(isParentExpanded(metadata))
+ mVisibleMeta.add(metadata);
+ } else if(metadata.type == NestMetadataType.META_TYPE_ITEM) {
+ if(mVisibleMeta.contains(metadata.parent) &&
+ mExpandedGroups.get(metadata.parent.id, isGroupExpandedByDefault(metadata.parent.id))) // Don't insert a child group with no parent.
+ mVisibleMeta.add(metadata);
+ }
+ }
+ Log.d(Constants.TAG, "OPT: built visible metadata, took "+(System.currentTimeMillis()-startTime)+"ms");
+ }
+
+ /**
+ * Iterates up the group hierarchy and returns whether or not any of the group's parents are not expanded.
+ */
+ private boolean isParentExpanded(NestPositionMetadata metadata) {
+ if(metadata.parent == null)
+ return true; // Return true for top of tree.
+ if(!mExpandedGroups.get(metadata.parent.id, isGroupExpandedByDefault(metadata.parent.id)))
+ return false;
+ else
+ return isParentExpanded(metadata.parent);
+ }
+
+ protected void collapseGroup(int groupId) {
+ mExpandedGroups.put(groupId, false);
+ }
+
+ protected void expandGroup(int groupId) {
+ mExpandedGroups.put(groupId, true);
+ }
+
+ public boolean isGroupExpanded(int groupId) {
+ return mExpandedGroups.get(groupId, isGroupExpandedByDefault(groupId));
+ }
+
+ public int getFlatChildPosition(int childId) {
+ for(int x=0;x< mFlatMeta.size();x++) {
+ NestPositionMetadata metadata = mFlatMeta.get(x);
+ if(metadata.type == NestMetadataType.META_TYPE_ITEM &&
+ metadata.id == childId)
+ return x;
+ }
+ return -1;
+ }
+
+ public int getVisibleFlatChildPosition(int childId) {
+ for(int x=0;x< mVisibleMeta.size();x++) {
+ NestPositionMetadata metadata = mVisibleMeta.get(x);
+ if(metadata.type == NestMetadataType.META_TYPE_ITEM &&
+ metadata.id == childId)
+ return x;
+ }
+ return -1;
+ }
+
+ public int getFlatGroupPosition(int groupId) {
+ for(int x=0;x< mFlatMeta.size();x++) {
+ NestPositionMetadata metadata = mFlatMeta.get(x);
+ if(metadata.type == NestMetadataType.META_TYPE_GROUP &&
+ metadata.id == groupId)
+ return x;
+ }
+ return -1;
+ }
+
+ public int getVisibleFlatGroupPosition(int groupId) {
+ for(int x=0;x< mVisibleMeta.size();x++) {
+ NestPositionMetadata metadata = mVisibleMeta.get(x);
+ if(metadata.type == NestMetadataType.META_TYPE_ITEM &&
+ metadata.id == groupId)
+ return x;
+ }
+ return -1;
+ }
+
+ @Override
+ public void notifyDataSetChanged() {
+ long startTime = System.currentTimeMillis();
+ buildFlatMetadata();
+ buildVisibleMetadata();
+ super.notifyDataSetChanged();
+ Log.d(Constants.TAG, "OPT: reloaded data set, took "+(System.currentTimeMillis()-startTime)+"ms");
+ }
+
+ /**
+ * Does not rebuild flat hierarchy metadata.
+ */
+ protected void notifyVisibleSetChanged() {
+ buildVisibleMetadata();
+ super.notifyDataSetChanged();
+ }
+
+ @Override
+ public final int getCount() {
+ return mVisibleMeta.size();
+ }
+
+ @Override
+ public int getViewTypeCount() {
+ return 2;
+ }
+
+ @Override
+ public int getItemViewType(int position) {
+ NestPositionMetadata metadata = mVisibleMeta.get(position);
+ return metadata.type.ordinal();
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return 0;
+ }
+
+ @Override
+ public final Object getItem(int position) {
+ NestPositionMetadata metadata = mVisibleMeta.get(position);
+ if(metadata.type == NestMetadataType.META_TYPE_GROUP)
+ return getGroup(metadata.id);
+ else if(metadata.type == NestMetadataType.META_TYPE_ITEM)
+ return getChild(metadata.id, metadata.childPosition);
+ return null;
+ }
+
+ @Override
+ public final View getView(int position, View convertView, ViewGroup parent) {
+ NestPositionMetadata metadata = mVisibleMeta.get(position);
+ NestMetadataType mType = NestMetadataType.values()[getItemViewType(position)];
+ View view = null;
+ if(mType == NestMetadataType.META_TYPE_GROUP)
+ view = getGroupView(metadata.id, metadata.depth, convertView, parent);
+ else if(mType == NestMetadataType.META_TYPE_ITEM)
+ view = getChildView(metadata.parent.id, metadata.childPosition, metadata.depth, convertView, parent);
+ return view;
+ }
+
+ public Context getContext() {
+ return mContext;
+ }
+
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/view/PlumbleNestedListView.java b/Plumble/src/main/java/com/morlunk/mumbleclient/view/PlumbleNestedListView.java
new file mode 100644
index 0000000..2c801e5
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/view/PlumbleNestedListView.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.view;
+
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.ListView;
+
+import com.morlunk.mumbleclient.view.PlumbleNestedAdapter.NestMetadataType;
+import com.morlunk.mumbleclient.view.PlumbleNestedAdapter.NestPositionMetadata;
+
+public class PlumbleNestedListView extends ListView implements OnItemClickListener {
+
+ public interface OnNestedChildClickListener {
+ public void onNestedChildClick(AdapterView<?> parent, View view, int groupId, int childPosition);
+ }
+ public interface OnNestedGroupClickListener {
+ public void onNestedGroupClick(AdapterView<?> parent, View view, int groupId);
+ }
+
+ private PlumbleNestedAdapter mNestedAdapter;
+ private OnNestedChildClickListener mChildClickListener;
+ private OnNestedGroupClickListener mGroupClickListener;
+
+ //private boolean mMaintainPosition;
+
+ public PlumbleNestedListView(Context context) {
+ this(context, null);
+ }
+
+ public PlumbleNestedListView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+
+ setOnItemClickListener(this);
+ /*
+ TypedArray array = context.getTheme().obtainStyledAttributes(attrs, R.styleable.PlumbleNestedListView, 0, 0);
+ try {
+ mMaintainPosition = array.getBoolean(R.styleable.PlumbleNestedListView_maintainPosition, false);
+ } finally {
+ array.recycle();
+ }
+ */
+ }
+
+ public void setAdapter(PlumbleNestedAdapter adapter) {
+ super.setAdapter(adapter);
+ mNestedAdapter = adapter;
+ }
+
+ public void expandGroup(int groupId) {
+ mNestedAdapter.expandGroup(groupId);
+ }
+
+ public void collapseGroup(int groupId) {
+ mNestedAdapter.collapseGroup(groupId);
+ }
+
+ public OnNestedChildClickListener getOnChildClickListener() {
+ return mChildClickListener;
+ }
+
+ public void setOnChildClickListener(
+ OnNestedChildClickListener mChildClickListener) {
+ this.mChildClickListener = mChildClickListener;
+ }
+
+ public OnNestedGroupClickListener getOnGroupClickListener() {
+ return mGroupClickListener;
+ }
+
+ public void setOnGroupClickListener(
+ OnNestedGroupClickListener mGroupClickListener) {
+ this.mGroupClickListener = mGroupClickListener;
+ }
+
+ @Override
+ public void setOnItemClickListener(OnItemClickListener listener) {
+ if(listener != this)
+ throw new RuntimeException(
+ "For PlumbleNestedListView, please use the child and group equivalents of setOnItemClickListener.");
+ super.setOnItemClickListener(listener);
+ }
+
+ @Override
+ public void onItemClick(AdapterView<?> parent, View view, int position,
+ long id) {
+ NestPositionMetadata metadata = (NestPositionMetadata) mNestedAdapter.mVisibleMeta.get(position);
+ if(metadata.type == NestMetadataType.META_TYPE_GROUP && mGroupClickListener != null) {
+ mGroupClickListener.onNestedGroupClick(parent, view, metadata.id);
+ } else if(metadata.type == NestMetadataType.META_TYPE_ITEM && mChildClickListener != null)
+ mChildClickListener.onNestedChildClick(parent, view, metadata.parent.id, metadata.childPosition);
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardActivity.java b/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardActivity.java
new file mode 100644
index 0000000..00188b0
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardActivity.java
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.wizard;
+
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentPagerAdapter;
+import android.support.v4.view.ViewPager;
+import android.support.v7.app.ActionBarActivity;
+import android.view.View;
+import android.widget.Button;
+
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.Settings;
+
+/**
+ * A simple activity_wizard providing an easy to use interface for configuring useful settings.
+ * Created by andrew on 01/11/13.
+ */
+public class WizardActivity extends ActionBarActivity implements WizardNavigation {
+ private Settings mSettings;
+ private ViewPager mViewPager;
+ private WizardPagerAdapter mPagerAdapter;
+ private ViewPager.OnPageChangeListener mPageListener = new ViewPager.OnPageChangeListener() {
+ @Override
+ public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+
+ }
+
+ @Override
+ public void onPageScrollStateChanged(int state) {
+
+ }
+
+ @Override
+ public void onPageSelected(int position) {
+ updateNavigationButtons(position);
+ setTitle(mPagerAdapter.getPageTitle(position));
+ }
+ };
+ private Button mBackButton;
+ private Button mNextButton;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_wizard);
+
+ getSupportActionBar().setDisplayShowHomeEnabled(false);
+
+ mSettings = Settings.getInstance(this);
+ mViewPager = (ViewPager) findViewById(R.id.wizard_pager);
+ mPagerAdapter = new WizardPagerAdapter(getSupportFragmentManager());
+ mViewPager.setAdapter(mPagerAdapter);
+ mViewPager.setOnPageChangeListener(mPageListener);
+ mBackButton = (Button) findViewById(R.id.wizard_back_button);
+ mNextButton = (Button) findViewById(R.id.wizard_next_button);
+
+ mBackButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ back();
+ }
+ });
+ mNextButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ next();
+ }
+ });
+
+ updateNavigationButtons(0);
+ setTitle(mPagerAdapter.getPageTitle(0));
+ }
+
+ @Override
+ public void onBackPressed() {
+ back();
+ }
+
+ private void updateNavigationButtons(int pagerPosition) {
+ mBackButton.setText(pagerPosition == 0 ? R.string.wizard_cancel : R.string.wizard_back);
+ mNextButton.setText(pagerPosition == mPagerAdapter.getCount() - 1 ? R.string.wizard_finish : R.string.wizard_next);
+ }
+
+ private void showConfirmQuitDialog() {
+ new AlertDialog.Builder(this)
+ .setMessage(R.string.wizard_confirm_close)
+ .setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ mSettings.setFirstRun(false); // Mark in settings never to run this wizard again
+ finish();
+ }
+ }).setNegativeButton(android.R.string.cancel, null)
+ .show();
+ }
+
+ @Override
+ public void next() {
+ if (mViewPager.getCurrentItem() == (mPagerAdapter.getCount() - 1)) {
+ mSettings.setFirstRun(false); // Mark in settings never to run this wizard again
+ finish();
+ } else
+ mViewPager.setCurrentItem(mViewPager.getCurrentItem() + 1, true);
+ }
+
+ @Override
+ public void back() {
+ if(mViewPager.getCurrentItem() == 0)
+ showConfirmQuitDialog(); // If cancel is pressed at the beginning of the pager, prompt the user to quit.
+ else
+ mViewPager.setCurrentItem(mViewPager.getCurrentItem()-1, true);
+ }
+
+ private class WizardPagerAdapter extends FragmentPagerAdapter {
+
+ private final Class<? extends Fragment> WIZARD_FRAGMENTS[] = new Class[] {
+ WizardWelcomeFragment.class,
+ WizardCertificateFragment.class,
+ WizardAudioFragment.class,
+ WizardCertificateFragment.class
+ };
+
+ public WizardPagerAdapter(FragmentManager fm) {
+ super(fm);
+ }
+
+ @Override
+ public Fragment getItem(int i) {
+ return Fragment.instantiate(WizardActivity.this, WIZARD_FRAGMENTS[i].getName());
+ }
+
+ @Override
+ public CharSequence getPageTitle(int position) {
+ switch (position) {
+ case 0:
+ return getString(R.string.wizard_welcome_title);
+ case 1:
+ return getString(R.string.wizard_certificate_title);
+ case 2:
+ return getString(R.string.wizard_audio_title);
+ case 3:
+ return getString(R.string.wizard_general_title);
+ }
+ return null;
+ }
+
+ @Override
+ public int getCount() {
+ return WIZARD_FRAGMENTS.length;
+ }
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardAudioFragment.java b/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardAudioFragment.java
new file mode 100644
index 0000000..1150da4
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardAudioFragment.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.wizard;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.Spinner;
+import android.widget.SpinnerAdapter;
+import android.widget.TextView;
+
+import com.morlunk.mumbleclient.R;
+
+/**
+ * Created by andrew on 04/11/13.
+ */
+public class WizardAudioFragment extends Fragment {
+
+ private Spinner mInputSpinner;
+ private AudioInputSpinnerAdapter mSpinnerAdapter;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_wizard_audio, container, false);
+ mSpinnerAdapter = new AudioInputSpinnerAdapter();
+ mInputSpinner = (Spinner) view.findViewById(R.id.wizard_audio_input_spinner);
+ mInputSpinner.setAdapter(mSpinnerAdapter);
+ return view;
+ }
+
+ private class AudioInputSpinnerAdapter extends BaseAdapter implements SpinnerAdapter {
+
+ @Override
+ public int getCount() {
+ return 3;
+ }
+
+ @Override
+ public Object getItem(int position) {
+ switch (position) {
+ case 0:
+ return "Voice Activity";
+ case 1:
+ return "Push to Talk";
+ case 2:
+ return "Continuous";
+ }
+ return null;
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View view = convertView;
+ if(view == null) {
+ LayoutInflater inflater = getActivity().getLayoutInflater();
+ view = inflater.inflate(android.R.layout.simple_spinner_item, parent, false);
+ }
+ TextView textView = (TextView) view.findViewById(android.R.id.text1);
+ textView.setText((CharSequence) getItem(position));
+ return view;
+ }
+
+ @Override
+ public View getDropDownView(int position, View convertView, ViewGroup parent) {
+ View view = convertView;
+ if(view == null) {
+ LayoutInflater inflater = getActivity().getLayoutInflater();
+ view = inflater.inflate(android.R.layout.simple_spinner_dropdown_item, parent, false);
+ }
+ TextView textView = (TextView) view.findViewById(android.R.id.text1);
+ textView.setText((CharSequence) getItem(position));
+ return view;
+ }
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardCertificateFragment.java b/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardCertificateFragment.java
new file mode 100644
index 0000000..fb2edc5
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardCertificateFragment.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.wizard;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+
+import com.morlunk.mumbleclient.R;
+import com.morlunk.mumbleclient.Settings;
+import com.morlunk.mumbleclient.preference.PlumbleCertificateGenerateTask;
+
+import java.io.File;
+
+/**
+ * Created by andrew on 02/11/13.
+ */
+public class WizardCertificateFragment extends Fragment {
+
+ private Button mGenerateButton;
+ private WizardNavigation mNavigation;
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+ try {
+ mNavigation = (WizardNavigation) activity;
+ } catch (ClassCastException e) {
+ throw new RuntimeException(activity.getClass().getName()+" must implement WizardNavigation!");
+ }
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_wizard_certificate, container, false);
+ mGenerateButton = (Button) view.findViewById(R.id.wizard_certificate_generate);
+ mGenerateButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ generateCertificate();
+ }
+ });
+ return view;
+ }
+
+ private void generateCertificate() {
+ final Settings settings = Settings.getInstance(getActivity());
+ PlumbleCertificateGenerateTask task = new PlumbleCertificateGenerateTask(getActivity()) {
+ @Override
+ protected void onPostExecute(File result) {
+ super.onPostExecute(result);
+ settings.setCertificatePath(result.getAbsolutePath());
+ mGenerateButton.setEnabled(false);
+ mNavigation.next();
+ }
+ };
+ task.execute();
+ }
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardNavigation.java b/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardNavigation.java
new file mode 100644
index 0000000..eeb4b29
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardNavigation.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.wizard;
+
+/**
+ * Created by andrew on 04/11/13.
+ */
+public interface WizardNavigation {
+ public void back();
+ public void next();
+}
diff --git a/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardWelcomeFragment.java b/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardWelcomeFragment.java
new file mode 100644
index 0000000..a86e0f6
--- /dev/null
+++ b/Plumble/src/main/java/com/morlunk/mumbleclient/wizard/WizardWelcomeFragment.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.morlunk.mumbleclient.wizard;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.morlunk.mumbleclient.R;
+
+/**
+ * Created by andrew on 03/11/13.
+ */
+public class WizardWelcomeFragment extends Fragment {
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ return inflater.inflate(R.layout.fragment_wizard_welcome, container, false);
+ }
+}
diff --git a/Plumble/src/main/res/anim/fade_in.xml b/Plumble/src/main/res/anim/fade_in.xml
new file mode 100644
index 0000000..6120925
--- /dev/null
+++ b/Plumble/src/main/res/anim/fade_in.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:fillAfter="true"
+ android:fillEnabled="true">
+ <alpha android:fromAlpha="0.0"
+ android:toAlpha="1.0"
+ android:interpolator="@android:anim/accelerate_interpolator"
+ android:duration="300"
+ />
+
+</set> \ No newline at end of file
diff --git a/Plumble/src/main/res/anim/fade_out.xml b/Plumble/src/main/res/anim/fade_out.xml
new file mode 100644
index 0000000..a46bf5f
--- /dev/null
+++ b/Plumble/src/main/res/anim/fade_out.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:fillAfter="true"
+ android:fillEnabled="true">
+ <alpha android:fromAlpha="1.0"
+ android:toAlpha="0.0"
+ android:interpolator="@android:anim/accelerate_interpolator"
+ android:duration="300"
+ />
+
+</set> \ No newline at end of file
diff --git a/Plumble/src/main/res/anim/slide_down.xml b/Plumble/src/main/res/anim/slide_down.xml
new file mode 100644
index 0000000..dea3272
--- /dev/null
+++ b/Plumble/src/main/res/anim/slide_down.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+ <translate android:fromYDelta="-100%" android:toYDelta="0%" android:duration="300" android:interpolator="@android:anim/decelerate_interpolator"/>
+</set> \ No newline at end of file
diff --git a/Plumble/src/main/res/anim/slide_up.xml b/Plumble/src/main/res/anim/slide_up.xml
new file mode 100644
index 0000000..836ec33
--- /dev/null
+++ b/Plumble/src/main/res/anim/slide_up.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+ <translate android:fromYDelta="0%" android:toYDelta="-100%" android:duration="300" android:interpolator="@android:anim/accelerate_interpolator"/>
+</set> \ No newline at end of file
diff --git a/Plumble/src/main/res/drawable-hdpi/drawer_shadow.9.png b/Plumble/src/main/res/drawable-hdpi/drawer_shadow.9.png
new file mode 100644
index 0000000..224cc4f
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/drawer_shadow.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_add_dark.png b/Plumble/src/main/res/drawable-hdpi/ic_action_add_dark.png
new file mode 100644
index 0000000..241bf6a
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_add_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_add_light.png b/Plumble/src/main/res/drawable-hdpi/ic_action_add_light.png
new file mode 100644
index 0000000..f8768f0
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_add_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_audio_muted.png b/Plumble/src/main/res/drawable-hdpi/ic_action_audio_muted.png
new file mode 100644
index 0000000..e8848aa
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_audio_muted.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_audio_muted_active.png b/Plumble/src/main/res/drawable-hdpi/ic_action_audio_muted_active.png
new file mode 100644
index 0000000..44c694c
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_audio_muted_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_audio_on.png b/Plumble/src/main/res/drawable-hdpi/ic_action_audio_on.png
new file mode 100644
index 0000000..2f3bfce
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_audio_on.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_audio_on_active.png b/Plumble/src/main/res/drawable-hdpi/ic_action_audio_on_active.png
new file mode 100644
index 0000000..c39ae3e
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_audio_on_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_audio_on_dark.png b/Plumble/src/main/res/drawable-hdpi/ic_action_audio_on_dark.png
new file mode 100644
index 0000000..0ab30d1
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_audio_on_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_channels.png b/Plumble/src/main/res/drawable-hdpi/ic_action_channels.png
new file mode 100644
index 0000000..ba6ddab
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_channels.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_chat_active.png b/Plumble/src/main/res/drawable-hdpi/ic_action_chat_active.png
new file mode 100644
index 0000000..37ea30a
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_chat_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_chat_dark.png b/Plumble/src/main/res/drawable-hdpi/ic_action_chat_dark.png
new file mode 100644
index 0000000..0ab8653
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_chat_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_chat_light.png b/Plumble/src/main/res/drawable-hdpi/ic_action_chat_light.png
new file mode 100644
index 0000000..7bc0d5f
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_chat_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_comment.png b/Plumble/src/main/res/drawable-hdpi/ic_action_comment.png
new file mode 100644
index 0000000..baefb3d
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_comment.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_comment_active.png b/Plumble/src/main/res/drawable-hdpi/ic_action_comment_active.png
new file mode 100644
index 0000000..0891440
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_comment_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_delete_dark.png b/Plumble/src/main/res/drawable-hdpi/ic_action_delete_dark.png
new file mode 100644
index 0000000..ccff159
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_delete_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_delete_light.png b/Plumble/src/main/res/drawable-hdpi/ic_action_delete_light.png
new file mode 100644
index 0000000..098082c
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_delete_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_drag_handle.png b/Plumble/src/main/res/drawable-hdpi/ic_action_drag_handle.png
new file mode 100644
index 0000000..106edfb
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_drag_handle.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_edit_dark.png b/Plumble/src/main/res/drawable-hdpi/ic_action_edit_dark.png
new file mode 100644
index 0000000..cc89d2d
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_edit_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_edit_light.png b/Plumble/src/main/res/drawable-hdpi/ic_action_edit_light.png
new file mode 100644
index 0000000..c08565e
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_edit_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_favorite_dark.png b/Plumble/src/main/res/drawable-hdpi/ic_action_favorite_dark.png
new file mode 100644
index 0000000..f0708a4
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_favorite_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_favourite_off.png b/Plumble/src/main/res/drawable-hdpi/ic_action_favourite_off.png
new file mode 100644
index 0000000..ab5f385
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_favourite_off.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_favourite_on.png b/Plumble/src/main/res/drawable-hdpi/ic_action_favourite_on.png
new file mode 100644
index 0000000..196a182
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_favourite_on.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_fullscreen.png b/Plumble/src/main/res/drawable-hdpi/ic_action_fullscreen.png
new file mode 100644
index 0000000..52601b0
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_fullscreen.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_headphones.png b/Plumble/src/main/res/drawable-hdpi/ic_action_headphones.png
new file mode 100644
index 0000000..9eab1f4
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_headphones.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_headphones_deafened.png b/Plumble/src/main/res/drawable-hdpi/ic_action_headphones_deafened.png
new file mode 100644
index 0000000..ba92ec5
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_headphones_deafened.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_info_dark.png b/Plumble/src/main/res/drawable-hdpi/ic_action_info_dark.png
new file mode 100644
index 0000000..840034d
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_info_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_info_light.png b/Plumble/src/main/res/drawable-hdpi/ic_action_info_light.png
new file mode 100644
index 0000000..c60544c
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_info_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_microphone.png b/Plumble/src/main/res/drawable-hdpi/ic_action_microphone.png
new file mode 100644
index 0000000..732157d
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_microphone.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_microphone_dark.png b/Plumble/src/main/res/drawable-hdpi/ic_action_microphone_dark.png
new file mode 100644
index 0000000..eae90e3
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_microphone_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_microphone_muted.png b/Plumble/src/main/res/drawable-hdpi/ic_action_microphone_muted.png
new file mode 100644
index 0000000..109c095
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_microphone_muted.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_minus_light.png b/Plumble/src/main/res/drawable-hdpi/ic_action_minus_light.png
new file mode 100644
index 0000000..840d4be
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_minus_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_more.png b/Plumble/src/main/res/drawable-hdpi/ic_action_more.png
new file mode 100644
index 0000000..0f24645
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_more.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_save.png b/Plumble/src/main/res/drawable-hdpi/ic_action_save.png
new file mode 100644
index 0000000..d48ecd5
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_save.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_search.png b/Plumble/src/main/res/drawable-hdpi/ic_action_search.png
new file mode 100644
index 0000000..df13872
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_search.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_send.png b/Plumble/src/main/res/drawable-hdpi/ic_action_send.png
new file mode 100644
index 0000000..5b971a0
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_send.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_settings.png b/Plumble/src/main/res/drawable-hdpi/ic_action_settings.png
new file mode 100644
index 0000000..e37e41c
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_settings.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_sort.png b/Plumble/src/main/res/drawable-hdpi/ic_action_sort.png
new file mode 100644
index 0000000..c787c1d
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_sort.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_unfullscreen.png b/Plumble/src/main/res/drawable-hdpi/ic_action_unfullscreen.png
new file mode 100644
index 0000000..30da6c4
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_unfullscreen.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_action_user_dark.png b/Plumble/src/main/res/drawable-hdpi/ic_action_user_dark.png
new file mode 100644
index 0000000..0997e31
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_action_user_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_carriage_return.png b/Plumble/src/main/res/drawable-hdpi/ic_carriage_return.png
new file mode 100644
index 0000000..b011d74
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_carriage_return.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_comment.png b/Plumble/src/main/res/drawable-hdpi/ic_comment.png
new file mode 100644
index 0000000..11e7fb8
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_comment.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_comment_seen.png b/Plumble/src/main/res/drawable-hdpi/ic_comment_seen.png
new file mode 100644
index 0000000..9021dfd
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_comment_seen.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_deafened.png b/Plumble/src/main/res/drawable-hdpi/ic_deafened.png
new file mode 100644
index 0000000..e081794
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_deafened.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_drawer.png b/Plumble/src/main/res/drawable-hdpi/ic_drawer.png
new file mode 100644
index 0000000..ff7b1de
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_drawer.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_launcher.png b/Plumble/src/main/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..5de2b03
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_menu_moreoverflow_card_dark_normal.png b/Plumble/src/main/res/drawable-hdpi/ic_menu_moreoverflow_card_dark_normal.png
new file mode 100644
index 0000000..9647776
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_menu_moreoverflow_card_dark_normal.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_menu_moreoverflow_card_dark_pressed.png b/Plumble/src/main/res/drawable-hdpi/ic_menu_moreoverflow_card_dark_pressed.png
new file mode 100644
index 0000000..93c653a
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_menu_moreoverflow_card_dark_pressed.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_microphone_muted_strike.png b/Plumble/src/main/res/drawable-hdpi/ic_microphone_muted_strike.png
new file mode 100644
index 0000000..bae4745
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_microphone_muted_strike.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_muted.png b/Plumble/src/main/res/drawable-hdpi/ic_muted.png
new file mode 100644
index 0000000..7b515d3
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_muted.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_muted_local.png b/Plumble/src/main/res/drawable-hdpi/ic_muted_local.png
new file mode 100644
index 0000000..fc0a5e4
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_muted_local.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_registered.png b/Plumble/src/main/res/drawable-hdpi/ic_registered.png
new file mode 100644
index 0000000..2aa17dd
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_registered.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_server_deafened.png b/Plumble/src/main/res/drawable-hdpi/ic_server_deafened.png
new file mode 100644
index 0000000..1edb7b8
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_server_deafened.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_server_light.png b/Plumble/src/main/res/drawable-hdpi/ic_server_light.png
new file mode 100644
index 0000000..2c728ee
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_server_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_server_location.png b/Plumble/src/main/res/drawable-hdpi/ic_server_location.png
new file mode 100644
index 0000000..0d0333b
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_server_location.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_server_muted.png b/Plumble/src/main/res/drawable-hdpi/ic_server_muted.png
new file mode 100644
index 0000000..03142f6
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_server_muted.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_stat_notify.png b/Plumble/src/main/res/drawable-hdpi/ic_stat_notify.png
new file mode 100644
index 0000000..e8b3165
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_stat_notify.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_stat_notify_active.png b/Plumble/src/main/res/drawable-hdpi/ic_stat_notify_active.png
new file mode 100644
index 0000000..bad6c70
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_stat_notify_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_suppressed.png b/Plumble/src/main/res/drawable-hdpi/ic_suppressed.png
new file mode 100644
index 0000000..5002276
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_suppressed.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_talking_off.png b/Plumble/src/main/res/drawable-hdpi/ic_talking_off.png
new file mode 100644
index 0000000..e910b5b
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_talking_off.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_talking_on.png b/Plumble/src/main/res/drawable-hdpi/ic_talking_on.png
new file mode 100644
index 0000000..0a992db
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_talking_on.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_up_arrow.png b/Plumble/src/main/res/drawable-hdpi/ic_up_arrow.png
new file mode 100644
index 0000000..bd405ba
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_up_arrow.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/ic_user_light.png b/Plumble/src/main/res/drawable-hdpi/ic_user_light.png
new file mode 100644
index 0000000..29b1f04
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/ic_user_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/list_longpressed.9.png b/Plumble/src/main/res/drawable-hdpi/list_longpressed.9.png
new file mode 100644
index 0000000..4ea7afa
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/list_longpressed.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/list_pressed.9.png b/Plumble/src/main/res/drawable-hdpi/list_pressed.9.png
new file mode 100644
index 0000000..5654cd6
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/list_pressed.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/list_selector_disabled.9.png b/Plumble/src/main/res/drawable-hdpi/list_selector_disabled.9.png
new file mode 100644
index 0000000..ca8e9a2
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/list_selector_disabled.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/list_selector_focused.9.png b/Plumble/src/main/res/drawable-hdpi/list_selector_focused.9.png
new file mode 100644
index 0000000..99bb246
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/list_selector_focused.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-hdpi/server_card.9.png b/Plumble/src/main/res/drawable-hdpi/server_card.9.png
new file mode 100644
index 0000000..0be425a
--- /dev/null
+++ b/Plumble/src/main/res/drawable-hdpi/server_card.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/drawer_shadow.9.png b/Plumble/src/main/res/drawable-mdpi/drawer_shadow.9.png
new file mode 100644
index 0000000..3797f99
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/drawer_shadow.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_add_dark.png b/Plumble/src/main/res/drawable-mdpi/ic_action_add_dark.png
new file mode 100644
index 0000000..e1e1ffc
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_add_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_add_light.png b/Plumble/src/main/res/drawable-mdpi/ic_action_add_light.png
new file mode 100644
index 0000000..e796e50
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_add_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_audio_muted.png b/Plumble/src/main/res/drawable-mdpi/ic_action_audio_muted.png
new file mode 100644
index 0000000..a1d9bc6
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_audio_muted.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_audio_muted_active.png b/Plumble/src/main/res/drawable-mdpi/ic_action_audio_muted_active.png
new file mode 100644
index 0000000..25775c9
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_audio_muted_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_audio_on.png b/Plumble/src/main/res/drawable-mdpi/ic_action_audio_on.png
new file mode 100644
index 0000000..4232a00
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_audio_on.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_audio_on_active.png b/Plumble/src/main/res/drawable-mdpi/ic_action_audio_on_active.png
new file mode 100644
index 0000000..04f384c
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_audio_on_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_audio_on_dark.png b/Plumble/src/main/res/drawable-mdpi/ic_action_audio_on_dark.png
new file mode 100644
index 0000000..bf9361c
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_audio_on_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_channels.png b/Plumble/src/main/res/drawable-mdpi/ic_action_channels.png
new file mode 100644
index 0000000..d2f3af5
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_channels.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_chat_active.png b/Plumble/src/main/res/drawable-mdpi/ic_action_chat_active.png
new file mode 100644
index 0000000..c2480f6
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_chat_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_chat_dark.png b/Plumble/src/main/res/drawable-mdpi/ic_action_chat_dark.png
new file mode 100644
index 0000000..f2bb3e0
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_chat_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_chat_light.png b/Plumble/src/main/res/drawable-mdpi/ic_action_chat_light.png
new file mode 100644
index 0000000..7f6977d
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_chat_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_comment.png b/Plumble/src/main/res/drawable-mdpi/ic_action_comment.png
new file mode 100644
index 0000000..726c602
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_comment.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_comment_active.png b/Plumble/src/main/res/drawable-mdpi/ic_action_comment_active.png
new file mode 100644
index 0000000..5f95dbb
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_comment_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_delete_dark.png b/Plumble/src/main/res/drawable-mdpi/ic_action_delete_dark.png
new file mode 100644
index 0000000..ffa1d92
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_delete_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_delete_light.png b/Plumble/src/main/res/drawable-mdpi/ic_action_delete_light.png
new file mode 100644
index 0000000..349b21b
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_delete_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_drag_handle.png b/Plumble/src/main/res/drawable-mdpi/ic_action_drag_handle.png
new file mode 100644
index 0000000..f037f6f
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_drag_handle.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_edit_dark.png b/Plumble/src/main/res/drawable-mdpi/ic_action_edit_dark.png
new file mode 100644
index 0000000..f37fdf9
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_edit_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_edit_light.png b/Plumble/src/main/res/drawable-mdpi/ic_action_edit_light.png
new file mode 100644
index 0000000..be73cbf
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_edit_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_favorite_dark.png b/Plumble/src/main/res/drawable-mdpi/ic_action_favorite_dark.png
new file mode 100644
index 0000000..1bb0d85
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_favorite_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_favourite_off.png b/Plumble/src/main/res/drawable-mdpi/ic_action_favourite_off.png
new file mode 100644
index 0000000..819dde1
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_favourite_off.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_favourite_on.png b/Plumble/src/main/res/drawable-mdpi/ic_action_favourite_on.png
new file mode 100644
index 0000000..02a84aa
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_favourite_on.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_fullscreen.png b/Plumble/src/main/res/drawable-mdpi/ic_action_fullscreen.png
new file mode 100644
index 0000000..6fdcd5f
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_fullscreen.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_headphones.png b/Plumble/src/main/res/drawable-mdpi/ic_action_headphones.png
new file mode 100644
index 0000000..acbe9f6
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_headphones.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_headphones_deafened.png b/Plumble/src/main/res/drawable-mdpi/ic_action_headphones_deafened.png
new file mode 100644
index 0000000..b6d8c2a
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_headphones_deafened.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_info_dark.png b/Plumble/src/main/res/drawable-mdpi/ic_action_info_dark.png
new file mode 100644
index 0000000..a5dba6d
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_info_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_info_light.png b/Plumble/src/main/res/drawable-mdpi/ic_action_info_light.png
new file mode 100644
index 0000000..cac2039
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_info_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_microphone.png b/Plumble/src/main/res/drawable-mdpi/ic_action_microphone.png
new file mode 100644
index 0000000..e605b53
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_microphone.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_microphone_dark.png b/Plumble/src/main/res/drawable-mdpi/ic_action_microphone_dark.png
new file mode 100644
index 0000000..7f15433
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_microphone_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_microphone_muted.png b/Plumble/src/main/res/drawable-mdpi/ic_action_microphone_muted.png
new file mode 100644
index 0000000..40e5474
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_microphone_muted.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_minus_light.png b/Plumble/src/main/res/drawable-mdpi/ic_action_minus_light.png
new file mode 100644
index 0000000..464d99b
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_minus_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_more.png b/Plumble/src/main/res/drawable-mdpi/ic_action_more.png
new file mode 100644
index 0000000..2be1fe8
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_more.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_save.png b/Plumble/src/main/res/drawable-mdpi/ic_action_save.png
new file mode 100644
index 0000000..6f1e97c
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_save.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_search.png b/Plumble/src/main/res/drawable-mdpi/ic_action_search.png
new file mode 100644
index 0000000..9ba0abd
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_search.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_send.png b/Plumble/src/main/res/drawable-mdpi/ic_action_send.png
new file mode 100644
index 0000000..8ee25f4
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_send.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_settings.png b/Plumble/src/main/res/drawable-mdpi/ic_action_settings.png
new file mode 100644
index 0000000..d7b21c9
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_settings.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_sort.png b/Plumble/src/main/res/drawable-mdpi/ic_action_sort.png
new file mode 100644
index 0000000..5398e41
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_sort.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_unfullscreen.png b/Plumble/src/main/res/drawable-mdpi/ic_action_unfullscreen.png
new file mode 100644
index 0000000..909a0b2
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_unfullscreen.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_action_user_dark.png b/Plumble/src/main/res/drawable-mdpi/ic_action_user_dark.png
new file mode 100644
index 0000000..b1f8be1
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_action_user_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_carriage_return.png b/Plumble/src/main/res/drawable-mdpi/ic_carriage_return.png
new file mode 100644
index 0000000..1de712c
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_carriage_return.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_comment.png b/Plumble/src/main/res/drawable-mdpi/ic_comment.png
new file mode 100644
index 0000000..14e5544
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_comment.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_comment_seen.png b/Plumble/src/main/res/drawable-mdpi/ic_comment_seen.png
new file mode 100644
index 0000000..dbcc531
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_comment_seen.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_deafened.png b/Plumble/src/main/res/drawable-mdpi/ic_deafened.png
new file mode 100644
index 0000000..ef808c4
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_deafened.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_drawer.png b/Plumble/src/main/res/drawable-mdpi/ic_drawer.png
new file mode 100644
index 0000000..fb681ba
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_drawer.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_launcher.png b/Plumble/src/main/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..90e32e5
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_menu_moreoverflow_card_dark_normal.png b/Plumble/src/main/res/drawable-mdpi/ic_menu_moreoverflow_card_dark_normal.png
new file mode 100644
index 0000000..7b03a2e
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_menu_moreoverflow_card_dark_normal.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_menu_moreoverflow_card_dark_pressed.png b/Plumble/src/main/res/drawable-mdpi/ic_menu_moreoverflow_card_dark_pressed.png
new file mode 100644
index 0000000..e666a9e
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_menu_moreoverflow_card_dark_pressed.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_microphone_muted_strike.png b/Plumble/src/main/res/drawable-mdpi/ic_microphone_muted_strike.png
new file mode 100644
index 0000000..217e6ff
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_microphone_muted_strike.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_muted.png b/Plumble/src/main/res/drawable-mdpi/ic_muted.png
new file mode 100644
index 0000000..2f09895
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_muted.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_muted_local.png b/Plumble/src/main/res/drawable-mdpi/ic_muted_local.png
new file mode 100644
index 0000000..3375db1
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_muted_local.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_registered.png b/Plumble/src/main/res/drawable-mdpi/ic_registered.png
new file mode 100644
index 0000000..64fb550
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_registered.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_server_deafened.png b/Plumble/src/main/res/drawable-mdpi/ic_server_deafened.png
new file mode 100644
index 0000000..b8773c5
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_server_deafened.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_server_light.png b/Plumble/src/main/res/drawable-mdpi/ic_server_light.png
new file mode 100644
index 0000000..f86a46e
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_server_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_server_location.png b/Plumble/src/main/res/drawable-mdpi/ic_server_location.png
new file mode 100644
index 0000000..846b323
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_server_location.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_server_muted.png b/Plumble/src/main/res/drawable-mdpi/ic_server_muted.png
new file mode 100644
index 0000000..602fd9b
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_server_muted.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_stat_notify.png b/Plumble/src/main/res/drawable-mdpi/ic_stat_notify.png
new file mode 100644
index 0000000..5e35380
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_stat_notify.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_stat_notify_active.png b/Plumble/src/main/res/drawable-mdpi/ic_stat_notify_active.png
new file mode 100644
index 0000000..3d6d834
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_stat_notify_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_suppressed.png b/Plumble/src/main/res/drawable-mdpi/ic_suppressed.png
new file mode 100644
index 0000000..4ece694
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_suppressed.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_talking_off.png b/Plumble/src/main/res/drawable-mdpi/ic_talking_off.png
new file mode 100644
index 0000000..ce34ac1
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_talking_off.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_talking_on.png b/Plumble/src/main/res/drawable-mdpi/ic_talking_on.png
new file mode 100644
index 0000000..ea8ec5d
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_talking_on.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_up_arrow.png b/Plumble/src/main/res/drawable-mdpi/ic_up_arrow.png
new file mode 100644
index 0000000..6673c7a
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_up_arrow.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/ic_user_light.png b/Plumble/src/main/res/drawable-mdpi/ic_user_light.png
new file mode 100644
index 0000000..38da41b
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/ic_user_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/list_longpressed.9.png b/Plumble/src/main/res/drawable-mdpi/list_longpressed.9.png
new file mode 100644
index 0000000..3bf8e03
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/list_longpressed.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/list_pressed.9.png b/Plumble/src/main/res/drawable-mdpi/list_pressed.9.png
new file mode 100644
index 0000000..6e77525
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/list_pressed.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/list_selector_disabled.9.png b/Plumble/src/main/res/drawable-mdpi/list_selector_disabled.9.png
new file mode 100644
index 0000000..42cb646
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/list_selector_disabled.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/list_selector_focused.9.png b/Plumble/src/main/res/drawable-mdpi/list_selector_focused.9.png
new file mode 100644
index 0000000..d799fbf
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/list_selector_focused.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-mdpi/server_card.9.png b/Plumble/src/main/res/drawable-mdpi/server_card.9.png
new file mode 100644
index 0000000..f5a0297
--- /dev/null
+++ b/Plumble/src/main/res/drawable-mdpi/server_card.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/drawer_shadow.9.png b/Plumble/src/main/res/drawable-xhdpi/drawer_shadow.9.png
new file mode 100644
index 0000000..fa3d853
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/drawer_shadow.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_add_dark.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_add_dark.png
new file mode 100644
index 0000000..23b9a1c
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_add_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_add_light.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_add_light.png
new file mode 100644
index 0000000..9b48a63
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_add_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_muted.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_muted.png
new file mode 100644
index 0000000..67bc820
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_muted.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_muted_active.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_muted_active.png
new file mode 100644
index 0000000..f4e3e1c
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_muted_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_on.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_on.png
new file mode 100644
index 0000000..dfd2b33
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_on.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_on_active.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_on_active.png
new file mode 100644
index 0000000..e88c6a9
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_on_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_on_dark.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_on_dark.png
new file mode 100644
index 0000000..777fab8
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_audio_on_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_bad.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_bad.png
new file mode 100644
index 0000000..931a4c5
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_bad.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_channels.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_channels.png
new file mode 100644
index 0000000..9570823
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_channels.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_chat_active.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_chat_active.png
new file mode 100644
index 0000000..b7d9650
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_chat_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_chat_dark.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_chat_dark.png
new file mode 100644
index 0000000..be04b06
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_chat_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_chat_light.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_chat_light.png
new file mode 100644
index 0000000..3f58695
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_chat_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_comment.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_comment.png
new file mode 100644
index 0000000..6111cab
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_comment.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_comment_active.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_comment_active.png
new file mode 100644
index 0000000..10b9a0c
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_comment_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_delete_dark.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_delete_dark.png
new file mode 100644
index 0000000..f391760
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_delete_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_delete_light.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_delete_light.png
new file mode 100644
index 0000000..ca7d159
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_delete_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_drag_handle.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_drag_handle.png
new file mode 100644
index 0000000..722dfd7
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_drag_handle.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_edit_dark.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_edit_dark.png
new file mode 100644
index 0000000..4215579
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_edit_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_edit_light.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_edit_light.png
new file mode 100644
index 0000000..1ead8fc
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_edit_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_error.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_error.png
new file mode 100644
index 0000000..aeb96b0
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_error.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_favorite_dark.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_favorite_dark.png
new file mode 100644
index 0000000..e6acafd
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_favorite_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_favourite_off.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_favourite_off.png
new file mode 100644
index 0000000..3c618a1
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_favourite_off.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_favourite_on.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_favourite_on.png
new file mode 100644
index 0000000..7576cc1
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_favourite_on.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_fullscreen.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_fullscreen.png
new file mode 100644
index 0000000..791240f
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_fullscreen.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_info_dark.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_info_dark.png
new file mode 100644
index 0000000..4ee903f
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_info_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_info_light.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_info_light.png
new file mode 100644
index 0000000..2641f14
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_info_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_match.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_match.png
new file mode 100644
index 0000000..52ca8ab
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_match.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_microphone.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_microphone.png
new file mode 100644
index 0000000..1909d19
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_microphone.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_microphone_dark.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_microphone_dark.png
new file mode 100644
index 0000000..2f5a1e2
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_microphone_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_microphone_muted.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_microphone_muted.png
new file mode 100644
index 0000000..46ae4fd
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_microphone_muted.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_minus_light.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_minus_light.png
new file mode 100644
index 0000000..e63dfc9
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_minus_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_more.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_more.png
new file mode 100644
index 0000000..930ca8d
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_more.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_save.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_save.png
new file mode 100644
index 0000000..2720602
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_save.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_search.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_search.png
new file mode 100644
index 0000000..d699c6b
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_search.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_send.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_send.png
new file mode 100644
index 0000000..0c870d2
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_send.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_settings.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_settings.png
new file mode 100644
index 0000000..09b0148
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_settings.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_sort.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_sort.png
new file mode 100644
index 0000000..cb2dff3
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_sort.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_unfullscreen.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_unfullscreen.png
new file mode 100644
index 0000000..741774b
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_unfullscreen.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_action_user_dark.png b/Plumble/src/main/res/drawable-xhdpi/ic_action_user_dark.png
new file mode 100644
index 0000000..46ef148
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_action_user_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_carriage_return.png b/Plumble/src/main/res/drawable-xhdpi/ic_carriage_return.png
new file mode 100644
index 0000000..8372773
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_carriage_return.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_comment.png b/Plumble/src/main/res/drawable-xhdpi/ic_comment.png
new file mode 100644
index 0000000..5453172
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_comment.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_comment_seen.png b/Plumble/src/main/res/drawable-xhdpi/ic_comment_seen.png
new file mode 100644
index 0000000..dbaba1d
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_comment_seen.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_deafened.png b/Plumble/src/main/res/drawable-xhdpi/ic_deafened.png
new file mode 100644
index 0000000..7a0f9da
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_deafened.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_drawer.png b/Plumble/src/main/res/drawable-xhdpi/ic_drawer.png
new file mode 100644
index 0000000..b9bc3d7
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_drawer.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_launcher.png b/Plumble/src/main/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..f1c4de9
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_menu_moreoverflow_card_dark_normal.png b/Plumble/src/main/res/drawable-xhdpi/ic_menu_moreoverflow_card_dark_normal.png
new file mode 100644
index 0000000..7a2c7f1
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_menu_moreoverflow_card_dark_normal.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_menu_moreoverflow_card_dark_pressed.png b/Plumble/src/main/res/drawable-xhdpi/ic_menu_moreoverflow_card_dark_pressed.png
new file mode 100644
index 0000000..910dc20
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_menu_moreoverflow_card_dark_pressed.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_microphone_muted_strike.png b/Plumble/src/main/res/drawable-xhdpi/ic_microphone_muted_strike.png
new file mode 100644
index 0000000..a8348e8
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_microphone_muted_strike.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_muted.png b/Plumble/src/main/res/drawable-xhdpi/ic_muted.png
new file mode 100644
index 0000000..2108be3
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_muted.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_muted_local.png b/Plumble/src/main/res/drawable-xhdpi/ic_muted_local.png
new file mode 100644
index 0000000..6539d05
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_muted_local.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_registered.png b/Plumble/src/main/res/drawable-xhdpi/ic_registered.png
new file mode 100644
index 0000000..cfb4933
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_registered.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_server_deafened.png b/Plumble/src/main/res/drawable-xhdpi/ic_server_deafened.png
new file mode 100644
index 0000000..e0f11d5
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_server_deafened.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_server_light.png b/Plumble/src/main/res/drawable-xhdpi/ic_server_light.png
new file mode 100644
index 0000000..1f7df20
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_server_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_server_location.png b/Plumble/src/main/res/drawable-xhdpi/ic_server_location.png
new file mode 100644
index 0000000..e01c5c6
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_server_location.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_server_muted.png b/Plumble/src/main/res/drawable-xhdpi/ic_server_muted.png
new file mode 100644
index 0000000..3238d9b
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_server_muted.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_stat_notify.png b/Plumble/src/main/res/drawable-xhdpi/ic_stat_notify.png
new file mode 100644
index 0000000..7f7a9a6
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_stat_notify.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_stat_notify_active.png b/Plumble/src/main/res/drawable-xhdpi/ic_stat_notify_active.png
new file mode 100644
index 0000000..50776a1
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_stat_notify_active.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_suppressed.png b/Plumble/src/main/res/drawable-xhdpi/ic_suppressed.png
new file mode 100644
index 0000000..bf63962
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_suppressed.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_talking_off.png b/Plumble/src/main/res/drawable-xhdpi/ic_talking_off.png
new file mode 100644
index 0000000..e9bf6e2
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_talking_off.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_talking_on.png b/Plumble/src/main/res/drawable-xhdpi/ic_talking_on.png
new file mode 100644
index 0000000..fe129ba
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_talking_on.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_up_arrow.png b/Plumble/src/main/res/drawable-xhdpi/ic_up_arrow.png
new file mode 100644
index 0000000..be6a768
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_up_arrow.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/ic_user_light.png b/Plumble/src/main/res/drawable-xhdpi/ic_user_light.png
new file mode 100644
index 0000000..dad3ea9
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/ic_user_light.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/list_longpressed.9.png b/Plumble/src/main/res/drawable-xhdpi/list_longpressed.9.png
new file mode 100644
index 0000000..eda10e6
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/list_longpressed.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/list_pressed.9.png b/Plumble/src/main/res/drawable-xhdpi/list_pressed.9.png
new file mode 100644
index 0000000..e4b3393
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/list_pressed.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/list_selector_disabled.9.png b/Plumble/src/main/res/drawable-xhdpi/list_selector_disabled.9.png
new file mode 100644
index 0000000..c6a7d4d
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/list_selector_disabled.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/list_selector_focused.9.png b/Plumble/src/main/res/drawable-xhdpi/list_selector_focused.9.png
new file mode 100644
index 0000000..7ea2b21
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/list_selector_focused.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xhdpi/server_card.9.png b/Plumble/src/main/res/drawable-xhdpi/server_card.9.png
new file mode 100644
index 0000000..7810a68
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xhdpi/server_card.9.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xxhdpi/ic_action_drag_handle.png b/Plumble/src/main/res/drawable-xxhdpi/ic_action_drag_handle.png
new file mode 100644
index 0000000..cd975b4
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xxhdpi/ic_action_drag_handle.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xxhdpi/ic_action_microphone_dark.png b/Plumble/src/main/res/drawable-xxhdpi/ic_action_microphone_dark.png
new file mode 100644
index 0000000..ea7abd0
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xxhdpi/ic_action_microphone_dark.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable-xxhdpi/ic_launcher.png b/Plumble/src/main/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..735da52
--- /dev/null
+++ b/Plumble/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable/card_background.xml b/Plumble/src/main/res/drawable/card_background.xml
new file mode 100644
index 0000000..3f142fb
--- /dev/null
+++ b/Plumble/src/main/res/drawable/card_background.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:state_pressed="true">
+ <shape android:shape="rectangle">
+ <stroke android:color="?android:attr/textColorPrimary"/>
+ <solid android:color="?attr/cardBackground"/>
+ </shape>
+ </item>
+
+</selector> \ No newline at end of file
diff --git a/Plumble/src/main/res/drawable/ic_card_overflow.xml b/Plumble/src/main/res/drawable/ic_card_overflow.xml
new file mode 100644
index 0000000..8caf136
--- /dev/null
+++ b/Plumble/src/main/res/drawable/ic_card_overflow.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="false" android:drawable="@drawable/ic_menu_moreoverflow_card_dark_normal"/>
+ <item android:state_pressed="true" android:drawable="@drawable/ic_menu_moreoverflow_card_dark_pressed"/>
+</selector> \ No newline at end of file
diff --git a/Plumble/src/main/res/drawable/ic_stat_notify.png b/Plumble/src/main/res/drawable/ic_stat_notify.png
new file mode 100644
index 0000000..d9d8ba1
--- /dev/null
+++ b/Plumble/src/main/res/drawable/ic_stat_notify.png
Binary files differ
diff --git a/Plumble/src/main/res/drawable/list_selector_transition.xml b/Plumble/src/main/res/drawable/list_selector_transition.xml
new file mode 100644
index 0000000..d968e74
--- /dev/null
+++ b/Plumble/src/main/res/drawable/list_selector_transition.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<transition xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/list_pressed" />
+ <item android:drawable="@drawable/list_longpressed" />
+</transition>
diff --git a/Plumble/src/main/res/drawable/overlay_background.xml b/Plumble/src/main/res/drawable/overlay_background.xml
new file mode 100644
index 0000000..97b87db
--- /dev/null
+++ b/Plumble/src/main/res/drawable/overlay_background.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+ <solid android:color="#EEFFFFFF"/>
+ <stroke android:color="#DDD" android:width="1dp"/>
+</shape> \ No newline at end of file
diff --git a/Plumble/src/main/res/drawable/popup_menu_item_background.xml b/Plumble/src/main/res/drawable/popup_menu_item_background.xml
new file mode 100644
index 0000000..1818fbd
--- /dev/null
+++ b/Plumble/src/main/res/drawable/popup_menu_item_background.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true" android:drawable="@color/holo_blue_light"/>
+ <item android:state_pressed="false" android:drawable="@color/popup_menu_item_background"/>
+</selector> \ No newline at end of file
diff --git a/Plumble/src/main/res/drawable/ptt_indicator_background.xml b/Plumble/src/main/res/drawable/ptt_indicator_background.xml
new file mode 100644
index 0000000..ae1b88d
--- /dev/null
+++ b/Plumble/src/main/res/drawable/ptt_indicator_background.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+ <corners android:topRightRadius="24dp"
+ android:topLeftRadius="24dp"
+ android:bottomLeftRadius="0dp"
+ android:bottomRightRadius="0dp"/>
+ <solid android:color="#DD333333"/>
+</shape> \ No newline at end of file
diff --git a/Plumble/src/main/res/drawable/selectable_background.xml b/Plumble/src/main/res/drawable/selectable_background.xml
new file mode 100644
index 0000000..5f07d7f
--- /dev/null
+++ b/Plumble/src/main/res/drawable/selectable_background.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:state_window_focused="false" android:drawable="@android:color/transparent" />
+
+ <!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
+ <item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/list_selector_disabled" />
+ <item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/list_selector_disabled" />
+ <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/list_selector_transition" />
+ <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/list_selector_transition" />
+ <item android:state_focused="true" android:drawable="@drawable/list_selector_focused" />
+ <item android:drawable="@android:color/transparent" />
+
+</selector> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout-sw600dp-v11/fragment_channel.xml b/Plumble/src/main/res/layout-sw600dp-v11/fragment_channel.xml
new file mode 100644
index 0000000..7db8078
--- /dev/null
+++ b/Plumble/src/main/res/layout-sw600dp-v11/fragment_channel.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ android:divider="?android:attr/dividerHorizontal"
+ android:orientation="horizontal"
+ android:showDividers="middle"
+ tools:context=".ChannelActivity" >
+
+ <LinearLayout
+ android:id="@+id/left_split"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1" >
+
+ <FrameLayout
+ android:id="@+id/chat_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/right_split"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:orientation="vertical" >
+
+ <FrameLayout
+ android:id="@+id/list_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+ <LinearLayout
+ android:id="@+id/pushtotalk_view"
+ android:layout_width="match_parent"
+ android:layout_height="51dp"
+ android:gravity="center_horizontal"
+ android:orientation="vertical" >
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:background="#dadada" />
+
+ <Button
+ android:id="@+id/pushtotalk"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/ptt"
+ android:textSize="12sp"
+ android:textColor="#858585"
+ android:textStyle="bold"
+ android:background="@null" />
+ </LinearLayout>
+ </LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout-sw720dp-v11/fragment_channel.xml b/Plumble/src/main/res/layout-sw720dp-v11/fragment_channel.xml
new file mode 100644
index 0000000..c4349c0
--- /dev/null
+++ b/Plumble/src/main/res/layout-sw720dp-v11/fragment_channel.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ android:divider="?android:attr/dividerHorizontal"
+ android:orientation="horizontal"
+ android:showDividers="middle"
+ tools:context=".ChannelActivity" >
+
+ <LinearLayout
+ android:id="@+id/left_split"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1" >
+
+ <FrameLayout
+ android:id="@+id/chat_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/right_split"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="3"
+ android:orientation="vertical" >
+
+ <FrameLayout
+ android:id="@+id/list_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+ <LinearLayout
+ android:id="@+id/pushtotalk_view"
+ android:layout_width="match_parent"
+ android:layout_height="51dp"
+ android:gravity="center_horizontal"
+ android:orientation="vertical" >
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:background="#dadada" />
+
+ <Button
+ android:id="@+id/pushtotalk"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/ptt"
+ android:textSize="12sp"
+ android:textColor="#858585"
+ android:textStyle="bold"
+ android:background="@null" />
+ </LinearLayout>
+ </LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/activity_main.xml b/Plumble/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..c91a406
--- /dev/null
+++ b/Plumble/src/main/res/layout/activity_main.xml
@@ -0,0 +1,35 @@
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<android.support.v4.widget.DrawerLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/drawer_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <FrameLayout
+ android:id="@+id/content_frame"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+ <ListView android:id="@+id/left_drawer"
+ android:layout_width="240dp"
+ android:layout_height="match_parent"
+ android:layout_gravity="start"
+ android:choiceMode="singleChoice"
+ android:divider="@android:color/transparent"
+ android:dividerHeight="0dp"
+ android:background="?attr/secondaryBackground"/>
+</android.support.v4.widget.DrawerLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/activity_wizard.xml b/Plumble/src/main/res/layout/activity_wizard.xml
new file mode 100644
index 0000000..433b40d
--- /dev/null
+++ b/Plumble/src/main/res/layout/activity_wizard.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <android.support.v4.view.ViewPager
+ android:id="@+id/wizard_pager"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1">
+ </android.support.v4.view.ViewPager>
+
+ <View
+ android:layout_height="1dp"
+ android:layout_width="match_parent"
+ android:background="#DDD"/>
+
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal">
+ <Button
+ android:id="@+id/wizard_back_button"
+ android:layout_height="wrap_content"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:text="@string/wizard_back"
+ style="@style/Plumble.BorderlessButton"/>
+
+ <View
+ android:layout_height="match_parent"
+ android:layout_width="1dp"
+ android:background="#DDD"/>
+
+ <Button
+ android:id="@+id/wizard_next_button"
+ android:layout_height="wrap_content"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:text="@string/wizard_next"
+ style="@style/Plumble.BorderlessButton"/>
+ </LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/channel_row.xml b/Plumble/src/main/res/layout/channel_row.xml
new file mode 100644
index 0000000..0e58969
--- /dev/null
+++ b/Plumble/src/main/res/layout/channel_row.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/channel_row_title"
+ android:layout_width="match_parent"
+ android:layout_height="50dp"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@+id/channel_row_expand"
+ android:layout_width="48dp"
+ android:layout_height="match_parent"
+ android:padding="12dp"
+ style="@style/Plumble.BorderlessButton"
+ android:src="@drawable/ic_action_add_light"
+ android:tint="?android:attr/textColorPrimary"/>
+
+ <TextView
+ android:id="@+id/channel_row_name"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:gravity="center_vertical|left"
+ android:text="Channel name"
+ android:padding="4dp"/>
+
+ <TextView
+ android:id="@+id/channel_row_count"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:gravity="center"
+ android:text="10"
+ android:textStyle="bold"
+ android:textColor="@color/holo_blue_light"/>
+
+ <ImageView
+ android:id="@+id/channel_row_more"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp"
+ android:src="@drawable/ic_card_overflow"/>
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/channel_user_row.xml b/Plumble/src/main/res/layout/channel_user_row.xml
new file mode 100644
index 0000000..5e18a2f
--- /dev/null
+++ b/Plumble/src/main/res/layout/channel_user_row.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/channel_user_row_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:padding="8dp">
+
+ <ImageView
+ android:id="@+id/userRowState"
+ android:layout_width="24dp"
+ android:layout_height="match_parent"
+ android:src="@drawable/ic_talking_off" />
+
+ <TextView
+ android:id="@+id/userRowName"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:ellipsize="end"
+ android:gravity="center_vertical"
+ android:paddingLeft="10dp"
+ android:text="The quick brown fox"
+ android:textSize="14sp"/>
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/dialog_comment.xml b/Plumble/src/main/res/layout/dialog_comment.xml
new file mode 100644
index 0000000..f6b3cdc
--- /dev/null
+++ b/Plumble/src/main/res/layout/dialog_comment.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <TabHost
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/comment_tabhost">
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical">
+
+ <TabWidget
+ android:id="@android:id/tabs"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"></TabWidget>
+
+ <FrameLayout
+ android:id="@android:id/tabcontent"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <LinearLayout
+ android:id="@+id/comment_tab_view"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <WebView
+ android:layout_width="320dp"
+ android:layout_height="300dp"
+ android:id="@+id/comment_view"/>
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/comment_tab_edit"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <EditText
+ android:layout_width="320dp"
+ android:layout_height="300dp"
+ android:id="@+id/comment_edit"
+ android:inputType="textMultiLine|textNoSuggestions"
+ android:gravity="top|left"/>
+ </LinearLayout>
+ </FrameLayout>
+ </LinearLayout>
+ </TabHost>
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/dialog_server_edit.xml b/Plumble/src/main/res/layout/dialog_server_edit.xml
new file mode 100644
index 0000000..f69305f
--- /dev/null
+++ b/Plumble/src/main/res/layout/dialog_server_edit.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:padding="10dp"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/server_edit_name_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/server_label"></TextView>
+
+ <EditText
+ android:id="@+id/server_edit_name"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:inputType="text"></EditText>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/server_host"></TextView>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <EditText
+ android:id="@+id/server_edit_host"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:inputType="textUri" />
+
+ <EditText
+ android:id="@+id/server_edit_port"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:hint="@string/default_server_port"
+ android:inputType="number">
+
+ </EditText>
+
+ </LinearLayout>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/server_username"></TextView>
+
+ <EditText
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:id="@+id/server_edit_username"
+ android:inputType="text"></EditText>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/server_password"></TextView>
+
+ <EditText
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:id="@+id/server_edit_password"
+ android:inputType="textPassword"></EditText>
+</LinearLayout>
diff --git a/Plumble/src/main/res/layout/dialog_server_search.xml b/Plumble/src/main/res/layout/dialog_server_search.xml
new file mode 100644
index 0000000..85f7db0
--- /dev/null
+++ b/Plumble/src/main/res/layout/dialog_server_search.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:padding="10dp" >
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/search_name"/>
+ <EditText
+ android:id="@+id/server_search_name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:imeOptions="actionSearch"
+ android:inputType="text"/>
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/search_country"/>
+ <EditText
+ android:id="@+id/server_search_country"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:imeOptions="actionSearch"
+ android:inputType="text"/>
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/fragment_channel.xml b/Plumble/src/main/res/layout/fragment_channel.xml
new file mode 100644
index 0000000..026b583
--- /dev/null
+++ b/Plumble/src/main/res/layout/fragment_channel.xml
@@ -0,0 +1,62 @@
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/channelcontainer"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ tools:context=".ChannelActivity" >
+
+ <android.support.v4.view.ViewPager
+ android:id="@+id/channel_view_pager"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" >
+ <android.support.v4.view.PagerTabStrip
+ android:id="@+id/channel_tab_strip"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"/>
+ </android.support.v4.view.ViewPager>
+
+ <LinearLayout
+ android:id="@+id/pushtotalk_view"
+ android:layout_width="match_parent"
+ android:layout_height="50dp"
+ android:gravity="center_horizontal"
+ android:orientation="vertical"
+ android:background="?attr/secondaryBackground">
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:background="?android:attr/textColorPrimaryInverse"/>
+
+ <Button
+ android:id="@+id/pushtotalk"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/ptt"
+ android:textColor="?android:attr/textColorPrimaryInverse"
+ android:textStyle="bold"
+ android:textSize="12sp"
+ style="@style/Plumble.BorderlessButton"/>
+ </LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/fragment_channel_edit.xml b/Plumble/src/main/res/layout/fragment_channel_edit.xml
new file mode 100644
index 0000000..6fd20b4
--- /dev/null
+++ b/Plumble/src/main/res/layout/fragment_channel_edit.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:padding="8dp">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:text="@string/name"/>
+
+ <EditText
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/channel_edit_name"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:text="@string/description"/>
+
+ <!-- TODO rich text editing / HTML -->
+ <EditText
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="90dp"
+ android:inputType="textMultiLine"
+ android:ems="10"
+ android:id="@+id/channel_edit_description" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:text="@string/position"/>
+
+ <EditText
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:inputType="numberSigned"
+ android:ems="10"
+ android:text="0"
+ android:id="@+id/channel_edit_position" />
+
+ <CheckBox
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/temporary"
+ android:id="@+id/channel_edit_temporary"
+ android:checked="false" />
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/fragment_channel_list.xml b/Plumble/src/main/res/layout/fragment_channel_list.xml
new file mode 100644
index 0000000..dddf2c2
--- /dev/null
+++ b/Plumble/src/main/res/layout/fragment_channel_list.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:custom="http://schemas.android.com/apk/res-auto"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <com.morlunk.mumbleclient.view.PlumbleNestedListView
+ android:id="@+id/channelUsers"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ custom:maintainPosition="true"
+ android:divider="@android:color/transparent"
+ android:dividerHeight="0dp"
+ android:fastScrollEnabled="true"/>
+
+</LinearLayout>
diff --git a/Plumble/src/main/res/layout/fragment_chat.xml b/Plumble/src/main/res/layout/fragment_chat.xml
new file mode 100644
index 0000000..2c40361
--- /dev/null
+++ b/Plumble/src/main/res/layout/fragment_chat.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:orientation="vertical"
+ android:layout_height="fill_parent"
+ android:layout_width="fill_parent"
+ tools:ignore="NewApi"
+ android:divider="?android:attr/dividerVertical"
+ android:showDividers="middle" >
+
+ <ListView
+ android:id="@+id/chat_list"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:dividerHeight="4dp"
+ android:divider="@android:color/transparent"
+ android:clipToPadding="false"
+ android:padding="8dp"
+ tools:listitem="@layout/list_chat_item"></ListView>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:divider="?android:attr/dividerHorizontal"
+ android:showDividers="middle">
+
+ <EditText
+ android:id="@+id/chatTextEdit"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:minHeight="48dp"
+ android:hint="@string/messageToChannel"
+ android:inputType="textAutoCorrect"
+ android:imeOptions="actionSend"
+ android:layout_marginLeft="10dp"
+ android:layout_marginRight="10dp" >
+ </EditText>
+
+ <ImageButton
+ android:id="@+id/chatTextSend"
+ style="@android:style/Widget.Holo.Light.Button.Borderless.Small"
+ android:layout_width="48dp"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_action_send"
+ android:tint="?android:attr/textColorPrimary"
+ android:enabled="false"/>
+
+ </LinearLayout>
+</LinearLayout>
diff --git a/Plumble/src/main/res/layout/fragment_public_server_list.xml b/Plumble/src/main/res/layout/fragment_public_server_list.xml
new file mode 100644
index 0000000..99ba180
--- /dev/null
+++ b/Plumble/src/main/res/layout/fragment_public_server_list.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<RelativeLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <GridView
+ android:id="@+id/server_list_grid"
+ android:layout_height="fill_parent"
+ android:layout_width="fill_parent"
+ android:gravity="center"
+ android:columnWidth="320dp"
+ android:numColumns="auto_fit"
+ android:verticalSpacing="10dp"
+ android:horizontalSpacing="10dp"
+ android:padding="10dp"
+ android:stretchMode="columnWidth"
+ android:clipToPadding="false"
+ android:fastScrollEnabled="true"/>
+
+ <ProgressBar
+ android:id="@+id/serverProgress"
+ android:layout_width="50dp"
+ android:layout_height="50dp"
+ android:layout_centerInParent="true"
+ android:indeterminate="true"
+ android:visibility="gone"/>
+</RelativeLayout>
diff --git a/Plumble/src/main/res/layout/fragment_server_info.xml b/Plumble/src/main/res/layout/fragment_server_info.xml
new file mode 100644
index 0000000..8ca73cb
--- /dev/null
+++ b/Plumble/src/main/res/layout/fragment_server_info.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:padding="8dp">
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Version"
+ android:textSize="24sp"
+ android:fontFamily="sans-serif-condensed"
+ android:layout_marginBottom="8dp"/>
+ <TextView
+ android:id="@+id/server_info_protocol"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Protocol 1.2.4."
+ android:layout_marginBottom="8dp"
+ />
+
+ <TextView
+ android:id="@+id/server_info_os_version"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Debian GNU/Linux 7.0 (wheezy)"
+ android:layout_marginBottom="8dp"
+ />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Control channel"
+ android:textSize="24sp"
+ android:fontFamily="sans-serif-condensed"
+ android:layout_marginBottom="8dp"
+ android:layout_marginTop="16dp" />
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Encrypted with 256 bit AES256-SHA"
+ android:layout_marginBottom="8dp"
+ />
+
+ <TextView
+ android:id="@+id/server_info_tcp_latency"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="108.51 ms average latency (69.84 deviation)"
+ android:layout_marginBottom="8dp"
+ />
+ <TextView
+ android:id="@+id/server_info_host"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Remote host www.morlunk.com (port 64738)"
+ android:layout_marginBottom="8dp"
+ />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Voice channel"
+ android:textSize="24sp"
+ android:fontFamily="sans-serif-condensed"
+ android:layout_marginBottom="8dp"
+ android:layout_marginTop="16dp" />
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Encrypted with 128 bit OCB-AES128"
+ android:layout_marginBottom="8dp"
+ />
+
+ <TextView
+ android:id="@+id/server_info_udp_latency"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="105.76 ms average latency (20.34 deviation)"
+ android:layout_marginBottom="8dp"
+ />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Audio bandwidth"
+ android:textSize="24sp"
+ android:fontFamily="sans-serif-condensed"
+ android:layout_marginBottom="8dp"
+ android:layout_marginTop="16dp" />
+ <TextView
+ android:id="@+id/server_info_max_bandwidth"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Maximum 72.0kbit/s"
+ android:layout_marginBottom="8dp"
+ />
+
+ <TextView
+ android:id="@+id/server_info_current_bandwidth"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Current 54.8kbit/s"
+ android:layout_marginBottom="8dp"
+ />
+
+ <TextView
+ android:id="@+id/server_info_codec"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Codec: Opus"
+ android:layout_marginBottom="8dp"
+ />
+
+ </LinearLayout>
+</ScrollView>
diff --git a/Plumble/src/main/res/layout/fragment_server_list.xml b/Plumble/src/main/res/layout/fragment_server_list.xml
new file mode 100644
index 0000000..6b2864d
--- /dev/null
+++ b/Plumble/src/main/res/layout/fragment_server_list.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<RelativeLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <GridView
+ android:id="@+id/server_list_grid"
+ android:layout_height="fill_parent"
+ android:layout_width="fill_parent"
+ android:gravity="center"
+ android:columnWidth="320dp"
+ android:numColumns="auto_fit"
+ android:verticalSpacing="10dp"
+ android:horizontalSpacing="10dp"
+ android:padding="10dp"
+ android:stretchMode="columnWidth"
+ android:clipToPadding="false"
+ android:fastScrollEnabled="true"/>
+
+ <TextView
+ android:id="@+id/server_list_grid_empty"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:text="@string/no_servers"
+ android:fontFamily="sans-serif-light"
+ android:gravity="center"
+ android:visibility="gone"
+ android:layout_centerInParent="true"/>
+</RelativeLayout>
diff --git a/Plumble/src/main/res/layout/fragment_tokens.xml b/Plumble/src/main/res/layout/fragment_tokens.xml
new file mode 100644
index 0000000..751dc72
--- /dev/null
+++ b/Plumble/src/main/res/layout/fragment_tokens.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:divider="?android:attr/dividerVertical"
+ xmlns:tools="http://schemas.android.com/tools"
+ tools:ignore="NewApi"
+ android:showDividers="middle" >
+
+ <ListView
+ android:id="@+id/tokenList"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ tools:listitem="@layout/token_row">
+ </ListView>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <EditText
+ android:id="@+id/tokenField"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:inputType="text"
+ android:imeOptions="actionSend"
+ android:hint="@string/accessAdd"
+ android:layout_weight="1"/>
+
+ <ImageButton
+ android:id="@+id/tokenAddButton"
+ android:layout_width="64dp"
+ android:layout_height="48dp"
+ android:src="@drawable/ic_action_add_light"
+ style="@style/Plumble.BorderlessButton"/>
+ </LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/fragment_wizard_audio.xml b/Plumble/src/main/res/layout/fragment_wizard_audio.xml
new file mode 100644
index 0000000..a297c67
--- /dev/null
+++ b/Plumble/src/main/res/layout/fragment_wizard_audio.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:padding="8dp">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/audioInputMethod"/>
+
+ <Spinner
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/wizard_audio_input_spinner" />
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/fragment_wizard_certificate.xml b/Plumble/src/main/res/layout/fragment_wizard_certificate.xml
new file mode 100644
index 0000000..85384b6
--- /dev/null
+++ b/Plumble/src/main/res/layout/fragment_wizard_certificate.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:padding="8dp"
+ android:gravity="center_horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="0dp"
+ android:text="Creating a certificate uniquely identifies yourself on Mumble servers, and provides a basic degree of security. Certificate usage is highly recommended, and often mandatory."
+ android:fontFamily="sans-serif-light"
+ android:textSize="16sp"
+ android:layout_weight="1"/>
+
+ <Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/generateCert"
+ android:id="@+id/wizard_certificate_generate"
+ android:layout_gravity="right"
+ android:layout_marginBottom="8dp"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:fontFamily="sans-serif-light"
+ android:textStyle="italic"
+ android:text="If you already have a certificate you would like to use with Plumble, you can put it in the Plumble folder on your external storage and load it in settings later."
+ android:padding="4dp"
+ android:gravity="right"/>
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/fragment_wizard_welcome.xml b/Plumble/src/main/res/layout/fragment_wizard_welcome.xml
new file mode 100644
index 0000000..4807ec0
--- /dev/null
+++ b/Plumble/src/main/res/layout/fragment_wizard_welcome.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="28sp"
+ android:text="Welcome to Plumble"
+ android:id="@+id/wizard_welcome_title"
+ android:layout_centerVertical="true"
+ android:layout_centerHorizontal="true"
+ android:layout_marginBottom="10dp"
+ android:fontFamily="sans-serif-light"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:text="Thanks for installing Plumble!\nLet's get started."
+ android:gravity="center"
+ android:layout_below="@+id/wizard_welcome_title"
+ android:layout_alignRight="@+id/wizard_welcome_title"
+ android:layout_alignLeft="@+id/wizard_welcome_title"
+ android:fontFamily="sans-serif-light" />
+</RelativeLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/list_chat_item.xml b/Plumble/src/main/res/layout/list_chat_item.xml
new file mode 100644
index 0000000..5c7e72c
--- /dev/null
+++ b/Plumble/src/main/res/layout/list_chat_item.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ style="@style/Plumble.Card">
+
+ <LinearLayout
+ android:id="@+id/list_chat_item_box"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:padding="8dp">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:text="Richard Stallman → FSF"
+ android:textSize="11sp"
+ android:id="@+id/list_chat_item_target"
+ android:textColor="#999"
+ android:layout_marginBottom="4dp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="I FIGHT FOR THE USERS!"
+ android:id="@+id/list_chat_item_text"
+ android:layout_marginBottom="4dp"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:text="9:06 PM"
+ android:textSize="11sp"
+ android:id="@+id/list_chat_item_time"
+ android:textColor="#999"/>
+ </LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/list_drawer_header.xml b/Plumble/src/main/res/layout/list_drawer_header.xml
new file mode 100644
index 0000000..ad5cec5
--- /dev/null
+++ b/Plumble/src/main/res/layout/list_drawer_header.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:textColor="?android:textColorSecondaryInverse"
+ android:text="@string/app_name"
+ android:id="@+id/drawer_header_title"
+ android:padding="8dp"
+ android:textAllCaps="true"
+ android:textStyle="bold"
+ android:textSize="12sp"
+ android:layout_gravity="left|center_vertical"/>
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1px"
+ android:background="?android:textColorSecondaryInverse"/>
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/list_drawer_item.xml b/Plumble/src/main/res/layout/list_drawer_item.xml
new file mode 100644
index 0000000..ae57032
--- /dev/null
+++ b/Plumble/src/main/res/layout/list_drawer_item.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:padding="8dp">
+
+ <ImageView
+ android:layout_width="32dp"
+ android:layout_height="32dp"
+ android:id="@+id/drawer_item_icon"
+ android:src="@drawable/ic_action_user_dark"
+ android:padding="4dp"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="32dp"
+ android:text="@string/action_settings"
+ android:id="@+id/drawer_item_title"
+ android:gravity="center_vertical"
+ android:layout_marginLeft="8dp"
+ android:textSize="16dp"
+ android:fontFamily="sans-serif-light"
+ android:textColor="?android:textColorPrimaryInverse"
+ android:layout_weight="1"/>
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/nested_dropdown_item.xml b/Plumble/src/main/res/layout/nested_dropdown_item.xml
new file mode 100644
index 0000000..bd35aca
--- /dev/null
+++ b/Plumble/src/main/res/layout/nested_dropdown_item.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="35dp"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@+id/return_image"
+ android:layout_width="35dp"
+ android:layout_height="match_parent"
+ android:scaleType="fitCenter"
+ android:src="@drawable/ic_carriage_return" />
+
+ <TextView
+ android:id="@+id/channel_name"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:gravity="center|left"
+ android:text="@string/app_name"
+ android:textColor="#FFFFFF"
+ android:lines="2"
+ android:ellipsize="marquee"
+ android:layout_weight="1"/>
+
+ <TextView
+ android:id="@+id/channel_count"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:textColor="#FFFFFF"
+ android:lines="1"
+ android:paddingLeft="5dp"
+ android:gravity="center|right"
+ android:layout_gravity="right"/>
+
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/overlay.xml b/Plumble/src/main/res/layout/overlay.xml
new file mode 100644
index 0000000..7c8f583
--- /dev/null
+++ b/Plumble/src/main/res/layout/overlay.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ tools:ignore="NewApi"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@drawable/overlay_background"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:id="@+id/overlay_titlebar"
+ android:layout_width="fill_parent"
+ android:layout_height="40dp"
+ android:textSize="12sp"
+ android:orientation="horizontal">
+
+ <TextView
+ android:id="@+id/overlay_title"
+ android:layout_width="0dp"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:text="@string/app_name"
+ android:textColor="#777"
+ android:textAllCaps="true"
+ android:gravity="left|center_vertical"
+ android:layout_marginLeft="16dp"/>
+
+ <View
+ android:layout_width="1dp"
+ android:layout_height="fill_parent"
+ android:background="#DDD"/>
+
+ <ImageView
+ android:id="@+id/overlay_talk"
+ android:layout_width="40dp"
+ android:layout_height="40dp"
+ android:padding="11dp"
+ android:scaleType="fitCenter"
+ android:src="@drawable/ic_action_microphone_dark"
+ style="@style/Plumble.BorderlessButton"/>
+
+ <View
+ android:layout_width="1dp"
+ android:layout_height="fill_parent"
+ android:background="#DDD"/>
+
+ <ImageView
+ android:layout_width="40dp"
+ android:layout_height="40dp"
+ android:padding="11dp"
+ android:id="@+id/overlay_close"
+ android:src="@drawable/ic_action_delete_light"
+ android:scaleType="fitCenter"
+ style="@style/Plumble.BorderlessButton"/>
+
+ </LinearLayout>
+
+ <View
+ android:layout_width="fill_parent"
+ android:layout_height="1dp"
+ android:background="#DDD"/>
+
+ <ListView
+ android:layout_width="fill_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:id="@+id/overlay_list"
+ android:dividerHeight="0dp"
+ android:divider="@null"
+ android:padding="4dp"
+ tools:listitem="@layout/overlay_user_row" />
+
+ <View
+ android:layout_width="fill_parent"
+ android:layout_height="1dp"
+ android:background="#DDD"/>
+
+ </LinearLayout>
+
+ <ImageView
+ android:id="@+id/overlay_drag"
+ android:layout_width="32dp"
+ android:layout_height="32dp"
+ android:padding="8dp"
+ android:layout_gravity="right|bottom"
+ android:src="@drawable/ic_action_drag_handle"
+ style="@style/Plumble.BorderlessButton"/>
+</FrameLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/overlay_user_row.xml b/Plumble/src/main/res/layout/overlay_user_row.xml
new file mode 100644
index 0000000..24bc875
--- /dev/null
+++ b/Plumble/src/main/res/layout/overlay_user_row.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/channel_user_row_layout"
+ android:layout_width="match_parent"
+ android:layout_height="24dp"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@+id/userRowState"
+ android:layout_width="18dp"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="8dp"
+ android:src="@drawable/ic_talking_off" />
+
+ <TextView
+ android:id="@+id/userRowName"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:ellipsize="end"
+ android:gravity="center_vertical"
+ android:lines="1"
+ android:paddingLeft="4dp"
+ android:paddingRight="4dp"
+ android:singleLine="true"
+ android:text="User name"
+ android:textColor="#333"
+ android:textSize="12sp"/>
+
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/popup_menu.xml b/Plumble/src/main/res/layout/popup_menu.xml
new file mode 100644
index 0000000..40e4d89
--- /dev/null
+++ b/Plumble/src/main/res/layout/popup_menu.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="?android:colorBackground"
+ android:orientation="vertical">
+
+ <GridView
+ android:id="@+id/user_menu_grid"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ tools:listitem="@layout/popup_user_menu_item"
+ android:numColumns="auto_fit"
+ android:clickable="false"
+ android:stretchMode="columnWidth"
+ android:columnWidth="80dp"
+ android:verticalSpacing="1dp"
+ android:horizontalSpacing="1dp"/>
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:background="?android:attr/listDivider"/>
+
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/popup_user_menu_item.xml b/Plumble/src/main/res/layout/popup_user_menu_item.xml
new file mode 100644
index 0000000..b82c149
--- /dev/null
+++ b/Plumble/src/main/res/layout/popup_user_menu_item.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="64dp">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:padding="4dp">
+
+ <ImageView
+ android:id="@+id/user_menu_item_icon"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:src="@drawable/ic_action_chat_dark"
+ android:scaleType="center"/>
+
+ <TextView
+ android:id="@+id/user_menu_item_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:text="@string/chat"
+ android:textAllCaps="true"
+ android:textSize="11sp"
+ android:maxLines="1"
+ android:textColor="?android:textColorSecondary"/>
+ </LinearLayout>
+
+</FrameLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/ptt_corner.xml b/Plumble/src/main/res/layout/ptt_corner.xml
new file mode 100644
index 0000000..1bf4b2d
--- /dev/null
+++ b/Plumble/src/main/res/layout/ptt_corner.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+ <View
+ android:layout_width="8dp"
+ android:layout_height="80dp"/>
+</FrameLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/ptt_overlay.xml b/Plumble/src/main/res/layout/ptt_overlay.xml
new file mode 100644
index 0000000..8dacc0e
--- /dev/null
+++ b/Plumble/src/main/res/layout/ptt_overlay.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ptt_indicator_background"
+ android:orientation="vertical">
+
+ <ImageView
+ android:layout_width="96dp"
+ android:layout_height="48dp"
+ android:src="@drawable/ic_action_microphone"
+ android:padding="4dp"/>
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textColor="#FFFFFF"
+ android:textSize="11sp"
+ android:gravity="center"
+ android:text="TALKING"
+ android:layout_marginBottom="8dp"/>
+
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/public_server_list_row.xml b/Plumble/src/main/res/layout/public_server_list_row.xml
new file mode 100644
index 0000000..22a24e2
--- /dev/null
+++ b/Plumble/src/main/res/layout/public_server_list_row.xml
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ tools:ignore="NewApi"
+ style="@style/Plumble.Card">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:paddingBottom="18dp"
+ android:paddingLeft="18dp"
+ android:paddingRight="18dp"
+ android:paddingTop="10dp" >
+
+ <TextView
+ android:id="@+id/server_row_name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:ellipsize="end"
+ android:fontFamily="sans-serif-light"
+ android:gravity="left|center_vertical"
+ android:lines="1"
+ android:text="@string/server_host"
+ android:textColor="#808080"
+ android:textSize="24sp" />
+
+ <RelativeLayout
+ android:id="@+id/server_row_info"
+ android:layout_width="match_parent"
+ android:layout_height="30dp"
+ android:paddingBottom="2dp" >
+
+ <TextView
+ android:id="@+id/server_row_version_status"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:focusable="false"
+ android:fontFamily="sans-serif-light"
+ android:gravity="center_vertical"
+ android:lines="1"
+ android:text="@string/noServerInfo"
+ android:textColor="#808080" />
+
+ <TextView
+ android:id="@+id/server_row_usercount"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_alignParentRight="true"
+ android:fontFamily="sans-serif-light"
+ android:gravity="center_vertical"
+ android:singleLine="true"
+ android:text="15/100"
+ android:textColor="#808080" />
+
+ <ProgressBar
+ android:id="@+id/server_row_ping_progress"
+ style="@style/Plumble.HorizontalProgressBar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true"
+ android:indeterminate="true" />
+ </RelativeLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="left|center_vertical"
+ android:paddingBottom="4dp" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_marginRight="5dp"
+ android:src="@drawable/ic_server_light" />
+
+ <TextView
+ android:id="@+id/server_row_address"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/server_host"
+ android:textColor="#808080" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="left|center_vertical" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_marginRight="5dp"
+ android:src="@drawable/ic_server_location" />
+
+ <TextView
+ android:id="@+id/server_row_location"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Somewhere"
+ android:textColor="#808080" />
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+
+ <ImageView
+ android:id="@+id/server_row_favorite"
+ style="@style/Plumble.BorderlessButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentTop="true"
+ android:padding="5dp"
+ android:src="@drawable/ic_action_favorite_dark" />
+
+</RelativeLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/server_list_row.xml b/Plumble/src/main/res/layout/server_list_row.xml
new file mode 100644
index 0000000..8c8e54c
--- /dev/null
+++ b/Plumble/src/main/res/layout/server_list_row.xml
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ tools:ignore="NewApi"
+ style="@style/Plumble.Card">
+
+ <LinearLayout
+ android:id="@+id/server_card"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:paddingBottom="18dp"
+ android:paddingLeft="18dp"
+ android:paddingRight="18dp"
+ android:paddingTop="10dp" >
+
+ <TextView
+ android:id="@+id/server_row_name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:ellipsize="end"
+ android:fontFamily="sans-serif-light"
+ android:gravity="left|center_vertical"
+ android:lines="1"
+ android:text="@string/server_host"
+ android:textColor="?android:textColorSecondary"
+ android:textSize="24sp" />
+
+ <RelativeLayout
+ android:id="@+id/server_row_info"
+ android:layout_width="match_parent"
+ android:layout_height="30dp"
+ android:paddingBottom="2dp" >
+
+ <TextView
+ android:id="@+id/server_row_version_status"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:fontFamily="sans-serif-light"
+ android:gravity="center_vertical"
+ android:textColor="?android:textColorSecondary"
+ android:text="Version status"
+ android:layout_alignParentLeft="true"/>
+
+ <TextView
+ android:id="@+id/server_row_usercount"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:ellipsize="marquee"
+ android:focusable="false"
+ android:fontFamily="sans-serif-light"
+ android:gravity="center_vertical"
+ android:marqueeRepeatLimit="marquee_forever"
+ android:scrollHorizontally="true"
+ android:singleLine="true"
+ android:textColor="?android:textColorSecondary"
+ android:layout_toRightOf="@id/server_row_version_status"
+ android:layout_marginLeft="8dp"
+ android:text="15/100" />
+
+ <TextView
+ android:id="@+id/server_row_latency"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:fontFamily="sans-serif-light"
+ android:textColor="?android:textColorSecondary"
+ android:text="100ms"
+ android:gravity="center_vertical"
+ android:layout_centerVertical="true"
+ android:layout_alignParentRight="true"/>
+
+ <ProgressBar
+ android:id="@+id/server_row_ping_progress"
+ style="@style/Plumble.HorizontalProgressBar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true"
+ android:visibility="invisible"
+ android:indeterminate="true" />
+ </RelativeLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="left|center_vertical"
+ android:paddingBottom="4dp" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_marginRight="5dp"
+ android:src="@drawable/ic_user_light"
+ android:tint="?android:attr/textColorPrimary" />
+
+ <TextView
+ android:id="@+id/server_row_user"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="?android:textColorSecondary"
+ android:text="@string/server_username"/>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="left|center_vertical" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_marginRight="5dp"
+ android:src="@drawable/ic_server_light"
+ android:tint="?android:attr/textColorPrimary" />
+
+ <TextView
+ android:id="@+id/server_row_address"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="?android:textColorSecondary"
+ android:text="@string/server_host"/>
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+
+ <!-- We can't have a focusable element in a GridView item -->
+
+ <ImageView
+ android:id="@+id/server_row_more"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingRight="8dp"
+ android:paddingTop="4dp"
+ android:layout_alignTop="@id/server_card"
+ android:layout_alignRight="@id/server_card"
+ android:src="@drawable/ic_card_overflow" />
+
+</RelativeLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/layout/token_row.xml b/Plumble/src/main/res/layout/token_row.xml
new file mode 100644
index 0000000..7a380f9
--- /dev/null
+++ b/Plumble/src/main/res/layout/token_row.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal">
+
+ <TextView
+ android:id="@+id/tokenItemTitle"
+ android:layout_width="0dp"
+ android:layout_height="48dp"
+ android:textSize="18sp"
+ android:layout_marginLeft="10dp"
+ android:layout_marginRight="10dp"
+ android:gravity="left|center_vertical"
+ android:layout_weight="1"/>
+
+ <ImageButton
+ android:id="@+id/tokenItemDelete"
+ android:layout_width="64dp"
+ android:layout_height="48dp"
+ android:src="@drawable/ic_action_delete_light"
+ style="@style/Plumble.BorderlessButton"/>
+
+</LinearLayout> \ No newline at end of file
diff --git a/Plumble/src/main/res/menu/activity_server_info.xml b/Plumble/src/main/res/menu/activity_server_info.xml
new file mode 100644
index 0000000..7630e42
--- /dev/null
+++ b/Plumble/src/main/res/menu/activity_server_info.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item android:id="@+id/menu_save_button" android:title="@string/save" android:icon="@drawable/ic_action_save" android:showAsAction="ifRoom"></item>
+ <item android:id="@+id/menu_delete_button" android:title="@string/delete" android:icon="@drawable/ic_action_delete_dark" android:showAsAction="ifRoom"></item>
+
+
+</menu> \ No newline at end of file
diff --git a/Plumble/src/main/res/menu/activity_server_list.xml b/Plumble/src/main/res/menu/activity_server_list.xml
new file mode 100644
index 0000000..7b943a0
--- /dev/null
+++ b/Plumble/src/main/res/menu/activity_server_list.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item android:id="@+id/menu_preferences" android:title="@string/preferences" android:showAsAction="ifRoom" android:icon="@drawable/ic_action_settings" android:orderInCategory="100"></item>
+</menu> \ No newline at end of file
diff --git a/Plumble/src/main/res/menu/channel_list_context.xml b/Plumble/src/main/res/menu/channel_list_context.xml
new file mode 100644
index 0000000..44edbab
--- /dev/null
+++ b/Plumble/src/main/res/menu/channel_list_context.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item android:id="@+id/menu_local_mute_item" android:title="@string/togglelocalmute"></item>
+
+
+</menu> \ No newline at end of file
diff --git a/Plumble/src/main/res/menu/channel_list_menu.xml b/Plumble/src/main/res/menu/channel_list_menu.xml
new file mode 100644
index 0000000..efd30e9
--- /dev/null
+++ b/Plumble/src/main/res/menu/channel_list_menu.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item android:id="@+id/menu_chat_item" android:title="@string/chat" android:showAsAction="always|withText"></item>
+ <item android:id="@+id/menu_disconnect_item" android:title="@string/disconnect"></item>
+
+
+
+</menu> \ No newline at end of file
diff --git a/Plumble/src/main/res/menu/channel_modify_menu.xml b/Plumble/src/main/res/menu/channel_modify_menu.xml
new file mode 100644
index 0000000..2486c2f
--- /dev/null
+++ b/Plumble/src/main/res/menu/channel_modify_menu.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+id/menu_channel_add" android:title="@string/add"/>
+ <item android:id="@+id/menu_channel_edit" android:title="@string/edit"/>
+ <item android:id="@+id/menu_channel_remove" android:title="@string/remove"/>
+ <item android:id="@+id/menu_channel_send_message" android:checkable="true" android:title="@string/user_menu_send_message"/>
+ <item android:id="@+id/menu_channel_pin" android:checkable="true" android:title="@string/channel_menu_pin"/>
+</menu> \ No newline at end of file
diff --git a/Plumble/src/main/res/menu/fragment_channel_list.xml b/Plumble/src/main/res/menu/fragment_channel_list.xml
new file mode 100644
index 0000000..10819ba
--- /dev/null
+++ b/Plumble/src/main/res/menu/fragment_channel_list.xml
@@ -0,0 +1,24 @@
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:plumble="http://schemas.android.com/apk/res-auto">
+ <item android:id="@+id/menu_mute_button" android:title="@string/mute" plumble:showAsAction="ifRoom" android:icon="@drawable/ic_action_microphone"></item>
+ <item android:id="@+id/menu_deafen_button" android:title="@string/deafen" plumble:showAsAction="ifRoom" android:icon="@drawable/ic_action_audio_on"></item>
+ <item android:id="@+id/menu_search" android:title="@string/search" plumble:actionViewClass="android.support.v7.widget.SearchView" plumble:showAsAction="ifRoom|collapseActionView" android:icon="@drawable/ic_action_search"></item>
+ <item android:id="@+id/menu_bluetooth" android:title="@string/bluetooth" android:checkable="true" plumble:showAsAction="never"></item>
+</menu>
diff --git a/Plumble/src/main/res/menu/fragment_chat.xml b/Plumble/src/main/res/menu/fragment_chat.xml
new file mode 100644
index 0000000..32124a4
--- /dev/null
+++ b/Plumble/src/main/res/menu/fragment_chat.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:plumble="http://schemas.android.com/apk/res-auto">
+ <item
+ android:id="@+id/menu_clear_chat"
+ android:title="@string/clearChat"
+ android:icon="@drawable/ic_action_delete_dark"
+ plumble:showAsAction="ifRoom"/>
+</menu> \ No newline at end of file
diff --git a/Plumble/src/main/res/menu/fragment_public_server_list.xml b/Plumble/src/main/res/menu/fragment_public_server_list.xml
new file mode 100644
index 0000000..5dcf24e
--- /dev/null
+++ b/Plumble/src/main/res/menu/fragment_public_server_list.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:plumble="http://schemas.android.com/apk/res-auto" >
+
+ <item android:id="@+id/menu_match_server" android:title="@string/server_match" android:icon="@drawable/ic_action_match" plumble:showAsAction="ifRoom" android:orderInCategory="0"/>
+ <item android:id="@+id/menu_sort_server_item" android:title="@string/sort" android:icon="@drawable/ic_action_sort" plumble:showAsAction="ifRoom" android:orderInCategory="2"></item>
+ <item android:id="@+id/menu_search_server_item" android:title="@string/search" android:icon="@drawable/ic_action_search" plumble:showAsAction="ifRoom" android:orderInCategory="1"></item>
+
+</menu> \ No newline at end of file
diff --git a/Plumble/src/main/res/menu/fragment_server_list.xml b/Plumble/src/main/res/menu/fragment_server_list.xml
new file mode 100644
index 0000000..c6d3f58
--- /dev/null
+++ b/Plumble/src/main/res/menu/fragment_server_list.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:plumble="http://schemas.android.com/apk/res-auto">
+ <item android:id="@+id/menu_add_server_item" android:title="@string/add" android:icon="@drawable/ic_action_add_dark" plumble:showAsAction="ifRoom" android:orderInCategory="0"></item>
+</menu> \ No newline at end of file
diff --git a/Plumble/src/main/res/menu/plumble.xml b/Plumble/src/main/res/menu/plumble.xml
new file mode 100644
index 0000000..821edd0
--- /dev/null
+++ b/Plumble/src/main/res/menu/plumble.xml
@@ -0,0 +1,26 @@
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+id/action_disconnect"
+ android:title="@string/disconnect"
+ android:orderInCategory="99" />
+ <item android:id="@+id/action_settings"
+ android:title="@string/action_settings"
+ android:orderInCategory="100"
+ android:showAsAction="never" />
+</menu>
diff --git a/Plumble/src/main/res/menu/popup_server_row.xml b/Plumble/src/main/res/menu/popup_server_row.xml
new file mode 100644
index 0000000..b3c0d5f
--- /dev/null
+++ b/Plumble/src/main/res/menu/popup_server_row.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item android:id="@+id/menu_edit_item" android:title="@string/edit"></item>
+ <item android:id="@+id/menu_share_item" android:title="@string/share"></item>
+ <item android:id="@+id/menu_delete_item" android:title="@string/delete"></item>
+
+
+</menu> \ No newline at end of file
diff --git a/Plumble/src/main/res/values-de/preference.xml b/Plumble/src/main/res/values-de/preference.xml
new file mode 100644
index 0000000..6c18e63
--- /dev/null
+++ b/Plumble/src/main/res/values-de/preference.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources>
+
+ <string-array
+ name="audioInputNames">
+ <item>Sprachaktivierung</item>
+ <item>zum Sprechen drücken</item>
+ <item>Continuous</item>
+ </string-array>
+
+ <string-array
+ name="audioInputValues">
+ <item>voiceActivity</item>
+ <item>ptt</item>
+ <item>continuous</item>
+ </string-array>
+
+ <string-array
+ name="themeNames">
+ <item>Hell-Dunkel</item>
+ <item>Dunkel</item>
+ </string-array>
+
+ <string-array
+ name="themeValues">
+ <item>lightDark</item>
+ <item>dark</item>
+ </string-array>
+
+ <string-array name="callModeNames">
+ <item>Freisprechen</item>
+ <item>Telefonanruf</item>
+ </string-array>
+
+ <string-array name="callModeValues">
+ <item>speakerphone</item>
+ <item>voice</item>
+ </string-array>
+
+ <string-array name="hotCornerNames">
+ <item>Keine</item>
+ <item>Oben Links</item>
+ <item>Unten Links</item>
+ <item>Oben Rechts</item>
+ <item>Unten Rechts</item>
+ </string-array>
+
+ <string-array name="hotCornerValues">
+ <item>none</item>
+ <item>topLeft</item>
+ <item>bottomLeft</item>
+ <item>topRight</item>
+ <item>bottomRight</item>
+ </string-array>
+
+ <string-array name="rowheightText">
+ <item>Niedrig</item>
+ <item>Mittel</item>
+ <item>Höher</item>
+ <item>Sehr hoch</item>
+ </string-array>
+
+ <string-array name="rowheightValues">
+ <item>30</item>
+ <item>35</item>
+ <item>40</item>
+ <item>50</item>
+ </string-array>
+
+ <string name="authentication">Authentifizierung</string>
+ <string name="certificateFile">Zertifikatsdatei</string>
+ <string name="certificateFileSum">Das gewünschte P12 Zertifikats aus dem \"Plumble\" Verzeichnis auf dem externen Speicher.</string>
+ <string name="certificatePassword">Zertifikatspasswort</string>
+ <string name="certificatePasswordSum">Das Passwort für dein PKCS12 Zertifikat. (optional)</string>
+ <string name="audioInput">Audioeingabe</string>
+ <string name="audioInputMethodSum">Wann Sprache übertragen werden soll.</string>
+ <string name="audioInputMethod">Eingabemethode</string>
+ <string name="callMode">Gesprächsmodus</string>
+ <string name="callModeSum">Der Gesprächsmodus von Plumble: Entweder wie bei einem Telefonanruf oder bei Freisprechen verhalten.</string>
+ <string name="detectionThreshold">Signalwerterkennung</string>
+ <string name="detectionThresholdSum">Der minimalste benötigte Ausschlag, um als Sprache erkannt zu werden (nur bei Sprachaktivierung).</string>
+ <string name="pttKey">Sprechtaste</string>
+ <string name="pttKeySum">Eine Hardwaretaste für die Sprachaktivierung. (optional)</string>
+ <string name="hotCorner">Bildschirmecke als Sprechtaste</string>
+ <string name="hotCornerSum">Eine festgelegte Ecke des Bildschirms die beim drücken als Sprechtaste genutzt wird.</string>
+ <string name="appearance">Aussehen</string>
+ <string name="themeSum">Das Erscheinungsbild der Kanalansicht.</string>
+ <string name="theme">Erscheinungsbild</string>
+ <string name="advancedAudio">Erweiterte Audioeigenschaften</string>
+ <string name="forceTcp">Erzwinge TCP</string>
+ <string name="forceTcpSum">Es wird ausschließlich TCP benutzt und UDP wird abgeschaltet.</string>
+ <string name="audioQuality">Audio Qualität</string>
+ <string name="noCert">Kein Zertifikat</string>
+ <string name="rowheight">Zeilenhöhe in Kanalauswahl</string>
+ <string name="rowheightSum">Legt die Höhe einer Zeile in der Kanalauswahl fest.</string>
+ <string name="colorizechannels">Kanäle in der Auswahl einfärben</string>
+ <string name="colorizechannelsSum">Hauptkanäle werden gelb, benutzte Kanäle cyan und stark genutzte Kanäle in Rot dargestellt.</string>
+ <string name="colorthreshold">Limit für zweite Farbe</string>
+ <string name="colorthresholdSum">Wenn diese Anzahl Benutzer erreicht ist, wird der Kanal in der Kanalauswahl Rot dargestellt.</string>
+ <string name="chatNotifications">Chat Mitteilung</string>
+ <string name="chatNotificationsSum">Zeige eine Mitteilung wenn ein Benutzer im Chat schreibt.</string>
+ <string name="certificateGenerate">Zertifikat erzeugen</string>
+ <string name="certificateGenerateSum">Erzeugt ein self-signed Plumble Zertifikat. Empfohlen für unerfahrene Benutzer.</string>
+ <string name="pttSettings">Push to Talk Einstellungen</string>
+ <string name="pttSettingsSum">Konfigurieren von Push to Talk falls eingeschaltet.</string>
+ <string name="voiceActivitySettings">Einstellunge Sprachaktivierung</string>
+ <string name="voiceActivitySettingsSum">Konfiguration der Sprachaktivierung falls eingeschaltet.</string>
+ <string name="audioOutput">Audio Ausgabe</string>
+ <string name="disableOpus">Opus Codec deaktivieren</string>
+ <string name="disableOpusSum">Opus unterstüzung für Mumble 1.2.4 Server deaktivieren. Hilfreich bei Schwierigkeiten mit dem Ton auf Mumble 1.2.4 Servern.</string>
+ <string name="hidePtt">Verstecke die Push to Talk Taste</string>
+ <string name="hidePttSum">Versteckt die Push to Talk Taste. Nützlich bei Verwendung von Bildschirmecken oder Hardwaretasten zur Sprachaktivierung.</string>
+ <string name="useTts">Text-zu-Sprache</string>
+ <string name="useTtsSum">Aktiviert Text-zu-Sprache für eingehende Nachrichten.</string>
+ <string name="togglePtt">Push to Talk Taste feststellen</string>
+ <string name="togglePttSum">Die Sprachübertragung wird beim drücken der Push to Talk Taste dauerhaft aktiviert/deaktiviert.</string>
+</resources> \ No newline at end of file
diff --git a/Plumble/src/main/res/values-de/strings.xml b/Plumble/src/main/res/values-de/strings.xml
new file mode 100644
index 0000000..b046ec1
--- /dev/null
+++ b/Plumble/src/main/res/values-de/strings.xml
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources>
+
+ <string name="channels">Räume</string>
+ <string name="no_servers">keine Server hinzugefügt</string>
+ <string name="server_add">Server hinzufügen</string>
+ <string name="server_password">Passwort (Optional)</string>
+ <string name="server_username">Benutzername</string>
+ <string name="server_port">Port</string>
+ <string name="server_host">Adresse</string>
+ <string name="server_label">Beschriftung (Optional)</string>
+ <string name="app_name">Plumble</string>
+ <string name="chatReceiverLabel">Empfänger</string>
+ <string name="chatReceiverPrompt">Empfänger wählen</string>
+ <string name="default_server_port">64738</string>
+ <string name="fragment_chat">Chat</string>
+ <string name="fragment_channel">Raum</string>
+ <string name="hello_world">Hallo Welt!</string>
+ <string name="menu_settings">Einstellungen</string>
+ <string name="pressKey">Drücke eine Hardwaretaste für die Sprachaktivierung (PTT).</string>
+ <string name="pressKeyInfo">Hinweis: Aufgrund der Limitierungen von Android muss die App geöffnet sein, um eine Hardwaretaste für die Sprachaktivierung (PTT) zu nutzen.</string>
+ <string name="ptt">Sprechen</string>
+ <string name="mute">Stumm stellen</string>
+ <string name="deafen">Taub stellen</string>
+ <string name="disconnect">Verbindung trennen</string>
+ <string name="disconnectSure">Bist du dir sicher, dass du die Verbindung zu Mumble trennen möchtest?</string>
+ <string name="save">Speichern</string>
+ <string name="add">Hinzufügen</string>
+ <string name="preferences">Einstellungen</string>
+ <string name="togglelocalmute">lokale Stummschaltung wechseln</string>
+ <string name="chat">Chat</string>
+ <string name="perm_denied">Zugriff verboten!</string>
+ <string name="connectionRefused">Verbindung abgelehnt</string>
+ <string name="confirm_delete_server">Bist du dir sicher, dass du diesen Server löschen möchtest?</string>
+ <string name="disconnected">Getrennt</string>
+ <string name="kicked_message">Kicked vom Server. Grund: %s</string>
+ <string name="loading">Lade...</string>
+ <string name="reset_key">Keine Hardware Taste</string>
+ <string name="externalStorageUnavailable">Externer Speicher nicht verfügbar, kann Zertifikat nicht laden</string>
+ <string name="audioQualitySum">Die Audio Bitrate die Plumble zu nutzen versuchen wird.</string>
+ <string name="addFavorite">Favorit hinzufügen</string>
+ <string name="removeFavorite">Favorit entfernen</string>
+ <string name="viewFavorites">View Favorites</string>
+ <string name="favorites">Favoriten</string>
+ <string name="favoriteRemoved">Favorit entfernt.</string>
+ <string name="favoriteAdded">Favorit zugefügt.</string>
+ <string name="noFavorites">Keine Favoriten gespeichert.</string>
+ <string name="accessTokens">Access Tokens</string>
+ <string name="accessAdd">Access Token hinzufügen</string>
+ <string name="pushToTalkHint">(checkbox setzen zum einrasten der Taste)</string>
+ <string name="messageReceived">Neue Mitteilung</string>
+ <string name="general">General</string>
+ <string name="generateCert">Zertifikat erzeugen</string>
+ <string name="generateCertSuccess">Dein Zertifikat wurde gesetzt und gespeichert unter %s!</string>
+ <string name="generateCertFailure">Zertifikat konnte nicht erzeugt werden.</string>
+ <string name="generateCertProgress">Erzeuge Zertifikat...</string>
+ <string name="search">Suche Kanal</string>
+ <string name="searchHint">Kanalsuche</string>
+ <string name="undocumentedWakeLock">Leider kann auf deinem Gerät der Proximity Sensor nicht genutzt werden um den Standby zu verhindern. Bitte ändere den Modus zu \'Freisprechen\'.</string>
+ <string name="recordingVolume">Aufnahmelautstärke Boost</string>
+ <string name="quickConnect">Schnelle Verbindung</string>
+ <string name="connect">Verbinden</string>
+ <string name="connectToServer">Verbindung zum Server</string>
+ <string name="edit">Bearbeiten</string>
+ <string name="delete">Löschen</string>
+ <string name="retry">Erneut versuchen</string>
+ <string name="messageToUser">Schreibe Mitteilung an \'%s\'</string>
+ <string name="messageToChannel">Schreibe Mitteilung an Kanal \'%s\'</string>
+ <string name="online">Online</string>
+ <string name="offline">Offline</string>
+ <string name="clearChat">Chatverlauf löschen</string>
+ <string name="connected">Verbunden</string>
+ <string name="plumbleConnected">Plumble ist Verbunden</string>
+ <string name="lostConnection">Verbindung zum Server wurde unterbrochen.</string>
+ <string name="resume">Wiederaufnehmen</string>
+ <string name="channel">Kanal</string>
+ <string name="server">Server</string>
+ <string name="chat_message">An %1$s: %2$s</string>
+ <string name="chat_notify_moved">%1$s wurde von %3$s aus %2$s verschoben.</string>
+ <string name="chat_notify_muted_deafened">Stumm und taub.</string>
+ <string name="chat_notify_muted">Stumm.</string>
+ <string name="chat_notify_unmuted">Nicht stumm.</string>
+ <string name="chat_notify_unmuted_undeafened">Nicht stumm und nicht taub.</string>
+ <string name="chat_notify_now_muted_deafened">%s ist nun stumm und taub.</string>
+ <string name="chat_notify_now_muted">%s ist nun stumm.</string>
+ <string name="chat_notify_now_unmuted">%s ist nicht mehr stumm.</string>
+ <string name="chat_notify_now_unmuted_undeafened">%s ist nicht mehr stumm und nicht mehr taub.</string>
+ <string name="chat_notify_connected">%s ist verbunden.</string>
+ <string name="chat_notify_disconnected">%s hat den Server verlassen.</string>
+ <string name="unknown">Unbekannt</string>
+ <string name="server_list_title_favorite">FAVORITEN</string>
+ <string name="server_list_title_lan">LAN</string>
+ <string name="server_list_title_public_internet">INTERNET - ÖFFENTLICH</string>
+ <string name="ping">Ping</string>
+ <string name="sort">Sortierung</string>
+ <string name="sortBy">Sortieren nach…</string>
+ <string name="name">Name</string>
+ <string name="country">Land</string>
+ <string name="share">Teilen</string>
+ <string name="shareMessage">Trete diesem Server mit Plumble bei %s</string>
+ <string name="noServerInfo">Pingen um Informationen abzurufen</string>
+ <string name="status_notify_muted_and_deafened">Stumm und taub.</string>
+ <string name="status_notify_muted">Stumm.</string>
+ <string name="comment">Kommentar</string>
+ <string name="close">Schließen</string>
+ <string name="retrieving">Empfangen…</string>
+ <string name="search_name">Name</string>
+ <string name="search_country">Land</string>
+ <string name="preferences_immutable">Diese Einstellung kann nicht geändert werden, solange du mit einem Server verbunden bist.</string>
+ <string name="fullscreen">Vollbild</string>
+ <string name="fullscreen_chat">Chat</string>
+ <string name="fullscreen_channel">Kanal</string>
+ <string name="fetchingServers">Bitte warten, die Liste der öffentlichen Server wird abgerufen.</string>
+ <string name="information">Informationen</string>
+ <string name="register">Registrieren</string>
+ <string name="userControl">Benutzerkontrolle</string>
+ <string name="registerSelfSuccess">Registrationsanfrage gesendet</string>
+ <string name="error_fetching_servers">Fehler beim Abrufen der Serverliste!\nÜberprüfe deine Internetverbindung.</string>
+ <string name="coming_soon">Diese Funktion ist demnächst verfügbar.</string>
+ <string name="channel_user_row_chat">CHAT</string>
+ <string name="channel_user_row_mute">STUMM STELLEN</string>
+ <string name="channel_user_row_muted">STUMM</string>
+ <string name="channel_user_row_comment">KOMMENTAR</string>
+ <string name="channel_user_row_registered">REGISTRIERT</string>
+</resources>
diff --git a/Plumble/src/main/res/values-large/dimens.xml b/Plumble/src/main/res/values-large/dimens.xml
new file mode 100644
index 0000000..06a6d2d
--- /dev/null
+++ b/Plumble/src/main/res/values-large/dimens.xml
@@ -0,0 +1,24 @@
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources>
+
+ <dimen name="padding_small">8dp</dimen>
+ <dimen name="padding_medium">16dp</dimen>
+ <dimen name="padding_large">16dp</dimen>
+
+</resources> \ No newline at end of file
diff --git a/Plumble/src/main/res/values-pl/preference.xml b/Plumble/src/main/res/values-pl/preference.xml
new file mode 100644
index 0000000..8111b37
--- /dev/null
+++ b/Plumble/src/main/res/values-pl/preference.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources>
+
+ <string-array
+ name="audioInputNames">
+ <item>Aktywacja głosowa</item>
+ <item>Aktywacja przyciskiem</item>
+ <item>Continuous</item>
+ </string-array>
+
+ <string-array
+ name="audioInputValues">
+ <item>voiceActivity</item>
+ <item>ptt</item>
+ <item>continuous</item>
+ </string-array>
+
+ <string-array
+ name="themeNames">
+ <item>Jasny</item>
+ <item>Ciemny</item>
+ </string-array>
+
+ <string-array
+ name="themeValues">
+ <item>lightDark</item>
+ <item>dark</item>
+ </string-array>
+
+ <string-array name="callModeNames">
+ <item>Głośnik</item>
+ <item>Słuchawka</item>
+ </string-array>
+
+ <string-array name="callModeValues">
+ <item>speakerphone</item>
+ <item>voice</item>
+ </string-array>
+
+ <string-array name="hotCornerNames">
+ <item>Żaden</item>
+ <item>Lewy górny</item>
+ <item>Lewy dolny</item>
+ <item>Prawy górny</item>
+ <item>Prawy dolny</item>
+ </string-array>
+
+ <string-array name="hotCornerValues">
+ <item>none</item>
+ <item>topLeft</item>
+ <item>bottomLeft</item>
+ <item>topRight</item>
+ <item>bottomRight</item>
+ </string-array>
+
+ <string-array name="rowheightText">
+ <item>Wąski</item>
+ <item>Średni</item>
+ <item>Większy</item>
+ <item>Bardzo duży</item>
+ </string-array>
+
+ <string-array name="rowheightValues">
+ <item>30</item>
+ <item>35</item>
+ <item>40</item>
+ <item>50</item>
+ </string-array>
+
+ <string name="authentication">Uwierzytelnianie</string>
+ <string name="certificateFile">Plik certyfikatu</string>
+ <string name="certificateFileSum">Wybór certyfikatu P12, znajdującego się w katalogu \"Plumble\" w pamięci zewnętrznej.</string>
+ <string name="certificatePassword">Hasło certyfikatu</string>
+ <string name="certificatePasswordSum">Hasło do twojego certyfikatu PKCS12. (Opcjonalne)</string>
+ <string name="audioInput">Wejście Dźwięku</string>
+ <string name="audioInputMethodSum">Wybór między trybami aktywacji.</string>
+ <string name="audioInputMethod">Tryb aktywacji</string>
+ <string name="callMode">Tryb wyjścia dźwięku</string>
+ <string name="callModeSum">Wybór między głośnikiem a słuchawką.</string>
+ <string name="detectionThreshold">Próg detekcji</string>
+ <string name="detectionThresholdSum">Minimalna amplituda głosu wymagana by został wykryty (dotyczy wyłącznie aktywacji głosowej).</string>
+ <string name="pttKey">Aktywacja przyciskiem</string>
+ <string name="pttKeySum">Wybór sprzętowego przycisku do aktywacji transmisji. (Opcjonalny)</string>
+ <string name="hotCorner">Gorące narożniki</string>
+ <string name="hotCornerSum">Określa róg ekranu, który będzie służył do aktywacji przyciskiem w całym systemie Android.</string>
+ <string name="appearance">Wygląd</string>
+ <string name="themeSum">Wygląd listy kanałów.</string>
+ <string name="theme">Motyw</string>
+ <string name="advancedAudio">Zaawansowane Ustawienia Dźwięku</string>
+ <string name="forceTcp">Wymuś TCP</string>
+ <string name="forceTcpSum">Definiuje czy wymuszać połączenie TCP (wyłącza UDP).</string>
+ <string name="audioQuality">Jakość dźwięku</string>
+ <string name="noCert">Brak certyfikatu</string>
+ <string name="rowheight">Wysokość wiersza kanałów</string>
+ <string name="rowheightSum">Wysokość wiersza listy wyboru kanału.</string>
+ <string name="colorizechannels">Koloruj kanały</string>
+ <string name="colorizechannelsSum">Włącza i wyłącza kolorowanie wyróżniające główne oraz aktywne kanały.</string>
+ <string name="colorthreshold">Próg alternatywnego koloru</string>
+ <string name="colorthresholdSum">Jeżeli liczba użytkowników przekroczy ustaloną wartość, kanał zostanie oznaczony kolorem czerwonym.</string>
+ <string name="chatNotifications">Powiadomienia czatu</string>
+ <string name="chatNotificationsSum">Wyświetlaj powiadomienia, gdy ktoś napisze wiadomość.</string>
+ <string name="certificateGenerate">Generowanie certyfikatu</string>
+ <string name="certificateGenerateSum">Generuje nowy własnoręcznie podpisany certyfikat Plumble. Zalecane dla początkujących.</string>
+ <string name="pttSettings">Konfiguracja aktywacji przyciskiem</string>
+ <string name="pttSettingsSum">Konfiguracja aktywacji przyciskiem, gdy jest włączona.</string>
+ <string name="voiceActivitySettings">Konfiguracja aktywacji głosowej</string>
+ <string name="voiceActivitySettingsSum">Konfiguracja aktywacji głosowej, gdy jest włączona.</string>
+ <string name="audioOutput">Wyjście Dźwięku</string>
+ <string name="disableOpus">Wyłącz kodek Opus</string>
+ <string name="disableOpusSum">Wyłącza wsparcie kodeka Opus dla serwerów w wersji 1.2.4. Zaznacz jeżeli masz problemy z dźwiękiem na serwerach w wersji 1.2.4.</string>
+ <string name="hidePtt">Ukryj przycisk aktywacji przyciskiem</string>
+ <string name="hidePttSum">Ukrywa przycisk aktywacji przyciskiem. Ukryj go jeżeli korzystasz ze sprzętowego przycisku lub gorących narożników.</string>
+ <string name="useTts">Tekst-Na-Mowę</string>
+ <string name="useTtsSum">Aktywuje Tekst-Na-Mowę dla przychdzących wiadomości.</string>
+ <string name="togglePtt">Przycisk aktywacji jako przełącznik</string>
+ <string name="togglePttSum">Naciśnięcie przycisku aktywacji powoduje ciągłe nadawanie do czasu ponownego jego naciśnięcia.</string>
+</resources> \ No newline at end of file
diff --git a/Plumble/src/main/res/values-pl/strings.xml b/Plumble/src/main/res/values-pl/strings.xml
new file mode 100644
index 0000000..781c860
--- /dev/null
+++ b/Plumble/src/main/res/values-pl/strings.xml
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources>
+
+ <string name="channels">Kanały</string>
+ <string name="no_servers">Żaden serwer nie został dodany.\nNaciśnij przycisk \'Dodaj\', aby dodać serwer.</string>
+ <string name="server_add">Dodaj serwer</string>
+ <string name="server_password">Hasło (Opcjonalne)</string>
+ <string name="server_username">Nazwa użytkownika</string>
+ <string name="server_port">Port</string>
+ <string name="server_host">Adres (IP lub domena)</string>
+ <string name="server_label">Etykieta</string>
+ <string name="app_name">Plumble</string>
+ <string name="chatReceiverLabel">Odbiorca</string>
+ <string name="chatReceiverPrompt">Wybierz odbiorcę</string>
+ <string name="default_server_port">64738</string>
+ <string name="fragment_chat">Czat</string>
+ <string name="fragment_channel">Kanał</string>
+ <string name="hello_world">Witaj Świecie!</string>
+ <string name="menu_settings">Ustawienia</string>
+ <string name="pressKey">Naciśnij sprzętowy przycisk by go wybrać.</string>
+ <string name="pressKeyInfo">Uwaga: Ze względu na ograniczenia w systemie Android aplikacja musi być otwarta, aby można było używać sprzętowego przycisku.</string>
+ <string name="ptt">Aktywacja przyciskiem</string>
+ <string name="mute">Wycisz</string>
+ <string name="deafen">Ogłusz</string>
+ <string name="disconnect">Rozłącz</string>
+ <string name="disconnectSure">Na pewno chcesz się rozłączyć?</string>
+ <string name="save">Zapisz</string>
+ <string name="add">Dodaj</string>
+ <string name="preferences">Konfiguracja</string>
+ <string name="togglelocalmute">Przełącz lokalne wyciszenie</string>
+ <string name="chat">Czat</string>
+ <string name="perm_denied">Brak dostępu!</string>
+ <string name="connectionRefused">Połączenie Odrzucone</string>
+ <string name="confirm_delete_server">Usunąć ten serwer?</string>
+ <string name="disconnected">Rozłączono</string>
+ <string name="kicked_message">Zostałeś wykopany z serwera z powodu: %s</string>
+ <string name="loading">Ładowanie…</string>
+ <string name="reset_key">Resetuj</string>
+ <string name="externalStorageUnavailable">Pamięć zewnętrzna jest niedostępna, nie można załadować certyfikatu</string>
+ <string name="audioQualitySum">Bitrate dźwięku, którego będzie używał Plumble (w kbit/s)</string>
+ <string name="addFavorite">Dodaj do ulubionych</string>
+ <string name="removeFavorite">Usuń z ulubionych</string>
+ <string name="viewFavorites">Ulubione</string>
+ <string name="favorites">Ulubione</string>
+ <string name="favoriteRemoved">Usunięto z ulubionych</string>
+ <string name="favoriteAdded">Dodano do ulubionych</string>
+ <string name="noFavorites">Brak ulubionych kanałów</string>
+ <string name="accessTokens">Hasła dostępu</string>
+ <string name="accessAdd">Dodaj hasło dostępu</string>
+ <string name="pushToTalkHint">(zaznacz, aby przełączać)</string>
+ <string name="messageReceived">Nowa wiadomość</string>
+ <string name="general">Ogólne</string>
+ <string name="generateCert">Generuj certyfikat</string>
+ <string name="generateCertSuccess">Twój certyfikat został utworzony i zapisany jako %s!</string>
+ <string name="generateCertFailure">Generowanie certyfikatu nie powiodło się.</string>
+ <string name="generateCertProgress">Trwa generowanie certyfikatu…</string>
+ <string name="search">Szukaj</string>
+ <string name="searchHint">Wyszukiwanie kanału</string>
+ <string name="undocumentedWakeLock">Niestety, Plumble nie jest w stanie zapewnić obsługi sensora zbliżeniowego w twoim urządzeniu. Proszę zmienić tryb wyjścia dźwięku na głośnik.</string>
+ <string name="recordingVolume">Opcja pozwala na regulację poziomu głośności mikrofonu.</string>
+ <string name="quickConnect">Szybkie połączenie</string>
+ <string name="connect">Połącz</string>
+ <string name="connectToServer">Połącz do serwera</string>
+ <string name="edit">Edytuj</string>
+ <string name="delete">Usuń</string>
+ <string name="retry">Ponów</string>
+ <string name="messageToUser">Wiadomość do: \'%s\'</string>
+ <string name="messageToChannel">Wiadomość do kanału \'%s\'</string>
+ <string name="online">Online</string>
+ <string name="offline">Offline</string>
+ <string name="clearChat">Wyczyść czat</string>
+ <string name="connected">Połączony</string>
+ <string name="plumbleConnected">Plumble - Połączono</string>
+ <string name="lostConnection">Utracono połączenie z serwerem.</string>
+ <string name="resume">Wznów</string>
+ <string name="channel">Kanał</string>
+ <string name="server">Serwer</string>
+ <string name="chat_message">Do %1$s: %2$s</string>
+ <string name="chat_notify_moved">%1$s został przeniesiony z kanału %2$s przez %3$s.</string>
+ <string name="chat_notify_muted_deafened">Ogłuszono oraz wyciszono mikrofon.</string>
+ <string name="chat_notify_muted">Wyciszono mikrofon.</string>
+ <string name="chat_notify_unmuted">Wyłączono wyciszenie mikrofonu.</string>
+ <string name="chat_notify_unmuted_undeafened">Wyłączono ogłuszenie oraz wyciszenie mikrofonu.</string>
+ <string name="chat_notify_now_muted_deafened">%s jest teraz ogłuszony oraz wyciszony.</string>
+ <string name="chat_notify_now_muted">%s jest teraz wyciszony.</string>
+ <string name="chat_notify_now_unmuted">%s nie jest już wyciszony.</string>
+ <string name="chat_notify_now_unmuted_undeafened">%s nie jest już ogłuszony.</string>
+ <string name="chat_notify_connected">%s połączony.</string>
+ <string name="chat_notify_disconnected">%s rozłączony.</string>
+ <string name="unknown">Nieznany</string>
+ <string name="server_list_title_favorite">ULUBIONE</string>
+ <string name="server_list_title_lan">LAN</string>
+ <string name="server_list_title_public_internet">SERWERY PUBLICZNE</string>
+ <string name="ping">Ping</string>
+ <string name="sort">Sortuj</string>
+ <string name="sortBy">Sortuj po…</string>
+ <string name="name">Nazwie</string>
+ <string name="country">Kraju</string>
+ <string name="share">Udostępnij</string>
+ <string name="shareMessage">Dołącz na ten serwer z Plumble! %s</string>
+ <string name="noServerInfo">Użyj Ping, aby zebrać informacje</string>
+ <string name="status_notify_muted_and_deafened">Ogłuszony oraz wyciszony mikrofon.</string>
+ <string name="status_notify_muted">Wyciszony mikrofon</string>
+ <string name="comment">Komentarz</string>
+ <string name="close">Zamknij</string>
+ <string name="retrieving">Trwa pobieranie…</string>
+ <string name="search_name">Nazwa</string>
+ <string name="search_country">Kraj</string>
+ <string name="preferences_immutable">Ta opcja nie może zostać zmieniona podczas połączenia z serwerem.</string>
+ <string name="fullscreen">Pełny ekran</string>
+ <string name="fullscreen_chat">Czat</string>
+ <string name="fullscreen_channel">Kanał</string>
+ <string name="fetchingServers">Proszę czekać, trwa pobieranie listy publicznych serwerów.</string>
+ <string name="information">Informacje</string>
+ <string name="register">Rejestracja</string>
+ <string name="userControl">Kontrola użytkownika</string>
+ <string name="registerSelfSuccess">Wysłano żądanie rejestracji</string>
+ <string name="error_fetching_servers">Wystąpił błąd podczas pobierania publicznej listy serwerów!\nSprawdź swoje połączenie z internetem.</string>
+ <string name="coming_soon">Funkcja będzie dostępna wkrótce.</string>
+ <string name="channel_user_row_chat">CZAT</string>
+ <string name="channel_user_row_mute">WYCISZ</string>
+ <string name="channel_user_row_muted">WYCISZONY</string>
+ <string name="channel_user_row_comment">KOMENTARZ</string>
+ <string name="channel_user_row_registered">ZAREJESTROWANY</string>
+</resources>
diff --git a/Plumble/src/main/res/values-sw600dp/dimens.xml b/Plumble/src/main/res/values-sw600dp/dimens.xml
new file mode 100644
index 0000000..03745c1
--- /dev/null
+++ b/Plumble/src/main/res/values-sw600dp/dimens.xml
@@ -0,0 +1,21 @@
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources>
+ <!-- Customize dimensions originally defined in res/values/dimens.xml (such as
+ screen margins) for sw600dp devices (e.g. 7" tablets) here. -->
+</resources>
diff --git a/Plumble/src/main/res/values-sw720dp-land/dimens.xml b/Plumble/src/main/res/values-sw720dp-land/dimens.xml
new file mode 100644
index 0000000..be006cd
--- /dev/null
+++ b/Plumble/src/main/res/values-sw720dp-land/dimens.xml
@@ -0,0 +1,22 @@
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources>
+ <!-- Customize dimensions originally defined in res/values/dimens.xml (such as
+ screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. -->
+ <dimen name="activity_horizontal_margin">128dp</dimen>
+</resources>
diff --git a/Plumble/src/main/res/values-v11/styles.xml b/Plumble/src/main/res/values-v11/styles.xml
new file mode 100644
index 0000000..358ed74
--- /dev/null
+++ b/Plumble/src/main/res/values-v11/styles.xml
@@ -0,0 +1,23 @@
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources>
+ <style name="Plumble.BorderlessButton" parent="@android:style/Widget">
+ <item name="android:background">?android:attr/selectableItemBackground</item>
+ </style>
+ <style name="Plumble.HorizontalProgressBar" parent="@android:style/Widget.Holo.Light.ProgressBar.Horizontal"></style>
+</resources> \ No newline at end of file
diff --git a/Plumble/src/main/res/values/attrs.xml b/Plumble/src/main/res/values/attrs.xml
new file mode 100644
index 0000000..47fc86f
--- /dev/null
+++ b/Plumble/src/main/res/values/attrs.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources>
+ <declare-styleable name="PlumbleNestedListView">
+ <!-- Maintain the scrolling position across list updates. -->
+ <attr name="maintainPosition" format="boolean"/>
+ </declare-styleable>
+
+ <!-- Highlight color used a lot around the app when pressing on items and such. -->
+ <attr name="highlightColor" format="color"/>
+ <!-- Used in places like the drawer and pager bar for showing contrast with the content. -->
+ <attr name="secondaryBackground" format="color"/>
+ <!-- Server list card color -->
+ <attr name="cardBackground" format="color"/>
+</resources> \ No newline at end of file
diff --git a/Plumble/src/main/res/values/colors.xml b/Plumble/src/main/res/values/colors.xml
new file mode 100644
index 0000000..47b3436
--- /dev/null
+++ b/Plumble/src/main/res/values/colors.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources>
+ <color name="cardOutline">#d3d3d3</color>
+ <color name="push_to_talk_background">#555555</color>
+
+ <color name="popup_menu_item_background">#555555</color>
+ <color name="popup_menu_item_disabled_mask">#66000000</color>
+
+ <!-- A light Holo shade of blue -->
+ <color name="holo_blue_light">#ff33b5e5</color>
+ <!-- A light Holo shade of green -->
+ <color name="holo_green_light">#ff99cc00</color>
+ <!-- A light Holo shade of red -->
+ <color name="holo_red_light">#ffff4444</color>
+ <!-- A dark Holo shade of blue -->
+ <color name="holo_blue_dark">#ff0099cc</color>
+ <!-- A dark Holo shade of green -->
+ <color name="holo_green_dark">#ff669900</color>
+ <!-- A dark Holo shade of red -->
+ <color name="holo_red_dark">#ffcc0000</color>
+ <!-- A Holo shade of purple -->
+ <color name="holo_purple">#ffaa66cc</color>
+ <!-- A light Holo shade of orange -->
+ <color name="holo_orange_light">#ffffbb33</color>
+ <!-- A dark Holo shade of orange -->
+ <color name="holo_orange_dark">#ffff8800</color>
+ <!-- A really bright Holo shade of blue -->
+ <color name="holo_blue_bright">#ff00ddff</color>
+
+ <!-- Solarized -->
+ <color name="solarized_base03">#002b36</color>
+ <color name="solarized_base02">#073642</color>
+ <color name="solarized_base01">#586e75</color>
+ <color name="solarized_base00">#657b83</color>
+ <color name="solarized_base0">#839496</color>
+ <color name="solarized_base1">#93a1a1</color>
+ <color name="solarized_base2">#eee8d5</color>
+ <color name="solarized_base3">#fdf6e3</color>
+</resources> \ No newline at end of file
diff --git a/Plumble/src/main/res/values/dimens.xml b/Plumble/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..2bd8285
--- /dev/null
+++ b/Plumble/src/main/res/values/dimens.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+<resources>
+
+ <dimen name="padding_small">8dp</dimen>
+ <dimen name="padding_medium">8dp</dimen>
+ <dimen name="padding_large">16dp</dimen>
+ <dimen name="activity_horizontal_margin">16dp</dimen>
+ <dimen name="activity_vertical_margin">16dp</dimen>
+
+</resources> \ No newline at end of file
diff --git a/Plumble/src/main/res/values/preference.xml b/Plumble/src/main/res/values/preference.xml
new file mode 100644
index 0000000..b16e548
--- /dev/null
+++ b/Plumble/src/main/res/values/preference.xml
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources>
+
+ <string-array
+ name="audioInputNames">
+ <item>Voice Activity</item>
+ <item>Push to Talk</item>
+ <item>Continuous</item>
+ </string-array>
+
+ <string-array
+ name="audioInputValues">
+ <item>voiceActivity</item>
+ <item>ptt</item>
+ <item>continuous</item>
+ </string-array>
+
+ <string-array
+ name="audioInputQualityNames">
+ <!-- Experimental -->
+ <item>128000Hz (experimental)</item>
+ <item>96000Hz (experimental)</item>
+ <item>72000Hz (experimental)</item>
+
+ <item>48000Hz</item>
+ <item>44100Hz</item>
+ <item>22050Hz</item>
+ <item>16000Hz</item>
+ <item>11025Hz</item>
+ <item>8000Hz</item>
+ </string-array>
+
+ <string-array
+ name="audioInputQualityValues">
+ <!-- Experimental -->
+ <item>128000</item>
+ <item>96000</item>
+ <item>72000</item>
+
+ <item>48000</item>
+ <item>44100</item>
+ <item>22050</item>
+ <item>16000</item>
+ <item>11025</item>
+ <item>8000</item>
+ </string-array>
+
+ <string-array
+ name="themeNames">
+ <item>Light</item>
+ <item>Dark</item>
+ <item>Solarized Light</item>
+ <item>Solarized Dark</item>
+ </string-array>
+
+ <string-array
+ name="themeValues">
+ <item>lightDark</item>
+ <item>dark</item>
+ <item>solarizedLight</item>
+ <item>solarizedDark</item>
+ </string-array>
+
+ <string-array name="callModeNames">
+ <item>Speakerphone</item>
+ <item>Voice Call</item>
+ </string-array>
+
+ <string-array name="callModeValues">
+ <item>speakerphone</item>
+ <item>voice</item>
+ </string-array>
+
+ <string-array name="hotCornerNames">
+ <item>None</item>
+ <item>Top Left</item>
+ <item>Bottom Left</item>
+ <item>Top Right</item>
+ <item>Bottom Right</item>
+ </string-array>
+
+ <string-array name="hotCornerValues">
+ <item>none</item>
+ <item>topLeft</item>
+ <item>bottomLeft</item>
+ <item>topRight</item>
+ <item>bottomRight</item>
+ </string-array>
+
+ <string name="authentication">Authentication</string>
+ <string name="authenticationSum">Manage and create certificates</string>
+ <string name="certificateFile">Certificate File</string>
+ <string name="certificateFileSum">The path of the P12 certificate you wish to use, placed in the \&quot;Plumble\&quot; folder on external storage.</string>
+ <string name="certificatePassword">Certificate Password</string>
+ <string name="certificatePasswordSum">The password for your PKCS12 certificate. (optional)</string>
+ <string name="audioInput">Audio Input</string>
+ <string name="audioInputMethodSum">The way audio is sent to the server.</string>
+ <string name="audioInputMethod">Input Method</string>
+ <string name="audioInputVolume">Microphone Volume</string>
+ <string name="audioInputVolumeSum">Microphone volume multiplier used to artificially normalize audio.</string>
+ <string name="callMode">Call Mode</string>
+ <string name="callModeSum">The call mode of Plumble, whether to act as a voice call or speakerphone.</string>
+ <string name="detectionThreshold">Detection Threshold</string>
+ <string name="detectionThresholdSum">The minimum amplitude required for voice to be detected (only applicable for voice activity).</string>
+ <string name="pttKey">Push to Talk Key</string>
+ <string name="pttKeySum">A hardware key to bind to Push to Talk.</string>
+ <string name="hotCorner">Push to Talk Hot Corner</string>
+ <string name="hotCornerSum">A specified corner of the screen that, when pressed down, will push to talk throughout Android.</string>
+ <string name="general">General</string>
+ <string name="generalSum">Adjust general settings</string>
+ <string name="appearance">Appearance</string>
+ <string name="appearanceSum">Tweak the app\'s visuals</string>
+ <string name="themeSum">The app-wide theme.</string>
+ <string name="theme">Theme</string>
+ <string name="advancedAudio">Advanced</string>
+ <string name="forceTcp">Force TCP</string>
+ <string name="forceTcpSum">Whether to force TCP (disable UDP) communications.</string>
+ <string name="audio">Audio</string>
+ <string name="audioSum">Adjust audio input and output</string>
+ <string name="audioQuality">Input Quality</string>
+ <string name="noCert">No Certificate</string>
+ <string name="rowheight">Channel Row Height</string>
+ <string name="rowheightSum">The height of a row in channel selection.</string>
+ <string name="colorizechannels">Colorize channels</string>
+ <string name="colorizechannelsSum">Whether to use color to highlight root channels and active channels.</string>
+ <string name="colorthreshold">Secondary Color Threshold</string>
+ <string name="colorthresholdSum">If this number of users is reached in a channel, the channel name appears red.</string>
+ <string name="chatNotifications">Chat Notifications</string>
+ <string name="chatNotificationsSum">Show notifications when a user posts in chat.</string>
+ <string name="defaultUsername">Default Username</string>
+ <string name="defaultUsernameSum">The default username to use when connecting to servers.</string>
+ <string name="defaultUsernameDefault">Plumble_User</string>
+ <string name="certificateGenerate">Generate Certificate</string>
+ <string name="certificateGenerateSum">Generates a new self-signed Plumble certificate. Recommended for beginners.</string>
+ <string name="pttSettings">Push to Talk Settings</string>
+ <string name="pttSettingsSum">Configure Push to Talk if it is enabled.</string>
+ <string name="voiceActivitySettings">Voice Activity Settings</string>
+ <string name="voiceActivitySettingsSum">Configure Voice Activity if it is enabled.</string>
+ <string name="audioOutput">Audio Output</string>
+ <string name="disableOpus">Disable Opus Codec</string>
+ <string name="disableOpusSum">Disable Opus support for Mumble 1.2.4 servers.</string>
+ <string name="hidePtt">Hide Push to Talk Button</string>
+ <string name="hidePttSum">Hides the push to talk button when in push to talk mode. Useful if you use hot corners or a hardware key exclusively.</string>
+ <string name="useTts">Text-to-Speech</string>
+ <string name="useTtsSum">Enable Text-to-Speech for incoming messages.</string>
+ <string name="togglePtt">Toggle Push to Talk</string>
+ <string name="togglePttSum">Toggles push to talk on and off when pressed.</string>
+ <string name="autoReconnect">Auto Reconnect</string>
+ <string name="autoReconnectSum">Automatically try to re-establish a connection when the server connection is lost.</string>
+ <string name="useTor">Connect via Tor</string>
+ <string name="useTorSum">Requires Orbot app</string>
+
+ <!-- About -->
+ <string name="about">About</string>
+ <string name="aboutSum">Legal and acknowledgments</string>
+ <string name="copyright">Copyright &#169; Andrew Comminos 2013</string>
+ <string name="acknowledgements">Acknowledgments</string>
+ <string name="acknowledgementsSum">See who contributed to Plumble</string>
+ <string name="acknowledgements_link">https://raw.github.com/Morlunk/Plumble/master/THANKS</string>
+ <string name="licenses">Licenses</string>
+ <string name="license_gplv3">GNU General Public License v3.0</string>
+ <string name="license_gplv3_link">https://www.gnu.org/copyleft/gpl.html</string>
+ <string name="license_apache2">Apache License Version 2.0</string>
+ <string name="license_apache2_link">https://www.apache.org/licenses/LICENSE-2.0.html</string>
+</resources> \ No newline at end of file
diff --git a/Plumble/src/main/res/values/strings.xml b/Plumble/src/main/res/values/strings.xml
new file mode 100644
index 0000000..b3009b1
--- /dev/null
+++ b/Plumble/src/main/res/values/strings.xml
@@ -0,0 +1,228 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+<resources>
+ <!-- Common -->
+ <string name="app_name">Plumble</string>
+ <string name="channels">Channels</string>
+ <string name="no_servers">No servers added.\nPress the \'add\' button on the action bar to begin.</string>
+ <string name="server_add">Add Server</string>
+ <string name="server_password">Password</string>
+ <string name="server_username">Username</string>
+ <string name="server_port">Port</string>
+ <string name="server_host">Address</string>
+ <string name="server_label">Label</string>
+ <string name="connecting">Connecting</string>
+ <string name="connecting_to_server">Connecting to %1$s:%2$s</string>
+ <string name="default_server_port">64738</string>
+ <string name="fragment_chat">Chat</string>
+ <string name="fragment_channel">Channel</string>
+ <string name="menu_settings">Settings</string>
+ <string name="pressKey">Press a hardware key to bind to push-to-talk.</string>
+ <string name="pressKeyInfo">Note: due to limitations in Android, the app must be open to use hardware key push to talk.</string>
+ <string name="ptt">PUSH TO TALK</string>
+ <string name="mute">Mute</string>
+ <string name="deafen">Deafen</string>
+ <string name="disconnect">Disconnect</string>
+ <string name="disconnectSure">Are you sure you want to disconnect from Mumble?</string>
+ <string name="save">Save</string>
+ <string name="add">Add</string>
+ <string name="preferences">Preferences</string>
+ <string name="togglelocalmute">Toggle Local Mute</string>
+ <string name="chat">Chat</string>
+ <string name="perm_denied">Permission denied!</string>
+ <string name="connectionRefused">Connection Refused</string>
+ <string name="confirm_delete_server">Are you sure you want to delete this server?</string>
+ <string name="confirm_delete_channel">Are you sure you want to delete this channel?</string>
+ <string name="disconnected">Disconnected</string>
+ <string name="kicked_message">Kicked from server.\nReason: %s</string>
+ <string name="loading">Loading…</string>
+ <string name="reset_key">Reset Key</string>
+ <string name="externalStorageUnavailable">External storage unavailable, cannot load certificate</string>
+ <string name="audioQualitySum">The preferred audio bitrate. Not all bitrates are supported by all devices.</string>
+ <string name="addFavorite">Add Favorite</string>
+ <string name="removeFavorite">Remove Favorite</string>
+ <string name="viewFavorites">View Favorites</string>
+ <string name="favorites">Favorites</string>
+ <string name="favoriteRemoved">Favorite removed.</string>
+ <string name="favoriteAdded">Favorite added.</string>
+ <string name="noFavorites">No favorited channels.</string>
+ <string name="accessTokens">Access Tokens</string>
+ <string name="accessAdd">Add Access Token</string>
+ <string name="pushToTalkHint">(tick checkbox to enable toggle)</string>
+ <string name="messageReceived">New message</string>
+ <string name="generateCert">Generate Certificate</string>
+ <string name="generateCertSuccess">Your certificate has been set and saved as %s!</string>
+ <string name="generateCertFailure">Failed to generate certificate.</string>
+ <string name="generateCertProgress">Generating certificate…</string>
+ <string name="search">Search</string>
+ <string name="searchHint">Search channels and users</string>
+ <string name="undocumentedWakeLock">Unfortunately, it doesn\'t look like we can provide proximity sensor wake lock support for your device. Please change the call mode to speakerphone.</string>
+ <string name="bluetooth">Bluetooth</string>
+ <string name="recordingVolume">Recording Volume Boost</string>
+ <string name="quickConnect">Quick Connect</string>
+ <string name="connect">Connect</string>
+ <string name="connectToServer">Connect to Server</string>
+ <string name="edit">Edit</string>
+ <string name="remove">Remove</string>
+ <string name="delete">Delete</string>
+ <string name="retry">Retry</string>
+ <string name="messageToUser">Type message to user \'%s\'</string>
+ <string name="messageToChannel">Type message to channel \'%s\' here</string>
+ <string name="online">Online</string>
+ <string name="offline">Offline</string>
+ <string name="clearChat">Clear Chat</string>
+ <string name="connected">Connected</string>
+ <string name="plumbleConnected">Plumble Connected</string>
+ <string name="plumbleConnecting">Plumble Connecting</string>
+ <string name="plumbleDisconnected">Plumble Disconnected</string>
+ <string name="lostConnection">Lost connection to the server.</string>
+ <string name="resume">Resume</string>
+ <string name="channel">Channel</string>
+ <string name="user">User</string>
+ <string name="server">Server</string>
+ <string name="chat_notify_moved">%1$s moved in from %2$s by %3$s.</string>
+ <string name="chat_notify_muted_deafened">Muted and deafened.</string>
+ <string name="chat_notify_muted">Muted.</string>
+ <string name="chat_notify_unmuted">Unmuted.</string>
+ <string name="chat_notify_unmuted_undeafened">Unmuted and undeafened.</string>
+ <string name="chat_notify_now_muted_deafened">%s is now muted and deafened.</string>
+ <string name="chat_notify_now_muted">%s is now muted.</string>
+ <string name="chat_notify_now_unmuted">%s is now unmuted.</string>
+ <string name="chat_notify_now_unmuted_undeafened">%s is now unmuted and undeafened.</string>
+ <string name="chat_notify_connected">%s connected.</string>
+ <string name="chat_notify_disconnected">%s disconnected.</string>
+ <string name="unknown">Unknown</string>
+ <string name="server_list_title_favorite">Favourites</string>
+ <string name="server_list_title_lan">LAN</string>
+ <string name="server_list_title_public_internet">Public Internet</string>
+ <string name="ping">Ping</string>
+ <string name="sort">Sort</string>
+ <string name="sortBy">Sort by…</string>
+ <string name="name">Name</string>
+ <string name="country">Country</string>
+ <string name="share">Share</string>
+ <string name="description">Description</string>
+ <string name="shareMessage">Join this Mumble server with Plumble! %s</string>
+ <string name="noServerInfo">Ping to fetch info</string>
+ <string name="status_notify_muted_and_deafened">Muted and deafened.</string>
+ <string name="status_notify_muted">Muted.</string>
+ <string name="comment">Comment</string>
+ <string name="close">Close</string>
+ <string name="retrieving">Retrieving…</string>
+ <string name="search_name">Name</string>
+ <string name="search_country">Country</string>
+ <string name="preferences_immutable">This setting cannot be changed while connected to a server.</string>
+ <string name="fullscreen">Fullscreen</string>
+ <string name="fullscreen_chat">Chat</string>
+ <string name="fullscreen_channel">Channel</string>
+ <string name="fetchingServers">Please wait, fetching list of public servers.</string>
+ <string name="information">Information</string>
+ <string name="register">Register Self</string>
+ <string name="userControl">User Control</string>
+ <string name="registerSelfSuccess">Sent registration request</string>
+ <string name="error_fetching_servers">Error fetching servers!\nCheck your internet connection.</string>
+ <string name="coming_soon">This feature is coming soon.</string>
+ <string name="search_channel_users">%d users</string>
+ <string name="reconnecting">Reconnecting in %d seconds.</string>
+ <string name="tapToReconnect">Tap to reconnect</string>
+ <string name="overlay">Overlay</string>
+ <string name="hint_reason">Reason</string>
+ <string name="hint_ptt">Push to Talk</string>
+ <string name="hint_ptt_summary">Simply press this button down to talk. Double-tap to toggle it.</string>
+ <string name="hint_server_add">Welcome to Plumble</string>
+ <string name="hint_server_add_summary">To begin, add a favourite server by pressing the add button on the action bar.</string>
+ <string name="hint_switching">Switching Between Views</string>
+ <string name="hint_switching_summary">Switch between the chat and channel views by using the buttons in the top left, or swiping.</string>
+ <string name="action_settings">Settings</string>
+ <string name="reconnect">Reconnect</string>
+ <string name="reconnect_dialog_message">You are already connected to a server. Connect to this server instead?</string>
+ <string name="confirm_reset_comment">Are you sure you want to reset the comment of user %s?</string>
+ <string name="confirm">Confirm</string>
+ <string name="expand">Expand</string>
+ <string name="temporary">Temporary</string>
+ <string name="position">Position</string>
+ <string name="channel_edit">Edit Channel</string>
+ <string name="channel_add">Add Channel</string>
+ <string name="tts_failed">TTS failed to initialize</string>
+ <string name="mumble_url_parse_failed">Failed to parse Mumble URL!</string>
+ <string name="first_run_generate_certificate_title">Welcome to Plumble! </string>
+ <string name="first_run_generate_certificate">Generating a certificate is highly recommended, and necessary for connection to some servers.</string>
+ <string name="generate">Generate</string>
+
+ <!-- Drawer pane -->
+ <string name="drawer_open">Open Drawer</string>
+ <string name="drawer_close">Close Drawer</string>
+ <string name="drawer_not_connected">Not Connected</string>
+ <string name="drawer_server">Server</string>
+ <string name="drawer_info">Information</string>
+ <string name="drawer_tokens">Access Tokens</string>
+ <string name="drawer_pinned">Pinned Channels</string>
+ <string name="drawer_header_servers">Servers</string>
+ <string name="drawer_favorites">Favorites</string>
+ <string name="drawer_lan">LAN</string>
+ <string name="drawer_public">Public Servers</string>
+
+ <!-- Chat formatting -->
+ <string name="chat_message_tree">(Tree)</string>
+ <string name="chat_message_channel">(Channel)</string>
+ <string name="chat_message_to">%1$s → %2$s</string>
+
+ <!-- User menu -->
+ <string name="user_menu_admin">Admin</string>
+ <string name="user_menu_kick">Kick</string>
+ <string name="user_menu_ban">Ban</string>
+ <string name="user_menu_mute">Mute</string>
+ <string name="user_menu_deafen">Deafen</string>
+ <string name="user_menu_priority_speaker">Priority Speaker</string>
+ <string name="user_menu_local_mute">Local Mute</string>
+ <string name="user_menu_ignore_messages">Ignore Messages</string>
+ <string name="user_menu_change_comment">Change Comment</string>
+ <string name="user_menu_view_comment">View Comment</string>
+ <string name="user_menu_reset_comment">Reset Comment</string>
+ <string name="user_menu_send_message">Send Message</string>
+ <string name="user_menu_information">Information</string>
+ <string name="user_menu_register">Register</string>
+ <string name="user_menu_registered">Registered</string>
+
+ <!-- Channel menu -->
+ <string name="channel_menu_pin">Pin</string>
+
+ <!-- Comment Fragment -->
+ <string name="comment_view">DISPLAY</string>
+ <string name="comment_edit_source">EDIT SOURCE</string>
+ <string name="comment_view_source">VIEW SOURCE</string>
+
+ <!-- Server Info Fragment -->
+ <string name="server_info_protocol">Protocol %s.</string>
+ <string name="server_info_version">%1$s (%2$s)</string>
+ <string name="server_info_latency">%.2f ms latency</string>
+ <string name="server_info_host">Remote host %1$s (port %2$d)</string>
+ <string name="server_info_codec">Codec: %s</string>
+ <string name="server_info_max_bandwidth">Maximum %.1f kbit/s</string>
+ <string name="server_info_current_bandwidth">Current %.1f kbit/s</string>
+
+ <!-- Server matching -->
+ <string name="server_match">Find Server</string>
+ <string name="server_match_progress">Finding a server...</string>
+ <string name="server_match_found">Server found</string>
+ <string name="server_match_not_found">Couldn\'t find server</string>
+ <string name="server_match_expand_country">Couldn\'t find any optimal servers in your country. Expand search worldwide?</string>
+ <string name="server_match_info">Name: %1$s\nHost: %2$s:%3$d\nUsers: %4$d / %5$d\nVersion: %6$s \nCountry: %7$s \nLatency: %8$d ms</string>
+ <string name="server_match_description">Plumble can automatically find you an empty server, optimizing based on the server\'s location, version, and latency.</string>
+</resources>
diff --git a/Plumble/src/main/res/values/styles.xml b/Plumble/src/main/res/values/styles.xml
new file mode 100644
index 0000000..9e3ba47
--- /dev/null
+++ b/Plumble/src/main/res/values/styles.xml
@@ -0,0 +1,110 @@
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" tools:ignore="NewApi">
+ <style name="Plumble.BorderlessButton" parent="@android:style/Widget">
+ <item name="android:background">@drawable/selectable_background</item>
+ </style>
+
+ <style name="Plumble.Card" parent="@android:style/Widget">
+ <item name="android:background">?attr/cardBackground</item>
+ <item name="android:padding">2dp</item>
+ </style>
+
+ <style name="Plumble.HorizontalProgressBar" parent="@android:style/Widget.ProgressBar.Horizontal"></style>
+
+ <style name="Theme.Plumble" parent="@style/Theme.AppCompat.Light.DarkActionBar">
+ <item name="android:textColorPrimary">#000</item>
+ <item name="android:textColorSecondary">#666</item>
+ <item name="android:textColorPrimaryInverse">#FFF</item>
+ <item name="android:textColorSecondaryInverse">#AAA</item>
+ <item name="highlightColor">#33b5e5</item>
+ <item name="secondaryBackground">#333333</item>
+ <item name="cardBackground">#FFFFFF</item>
+ </style>
+
+ <style name="Theme.Plumble.Dark" parent="@style/Theme.AppCompat">
+ <item name="android:textColorPrimary">#FFF</item>
+ <item name="android:textColorSecondary">#DDD</item>
+ <item name="android:textColorPrimaryInverse">#FFF</item>
+ <item name="android:textColorSecondaryInverse">#AAA</item>
+ <item name="android:windowBackground">@android:color/black</item>
+ <item name="android:colorBackground">@android:color/black</item>
+ <item name="secondaryBackground">#000000</item>
+ <item name="cardBackground">#111111</item>
+ </style>
+
+ <!-- Solarized theme sets based off of Ethan Schoonover's work: http://ethanschoonover.com/solarized -->
+
+ <style name="Theme.Plumble.Solarized.Light" parent="@style/Theme.AppCompat.Light">
+ <item name="android:textColor">?android:textColorPrimary</item>
+ <item name="android:textColorPrimary">@color/solarized_base00</item>
+ <item name="android:textColorSecondary">@color/solarized_base01</item>
+ <item name="android:textColorPrimaryInverse">?android:textColorPrimary</item>
+ <item name="android:textColorSecondaryInverse">?android:textColorSecondary</item>
+
+ <item name="android:windowBackground">@color/solarized_base3</item>
+ <item name="android:colorBackground">@color/solarized_base3</item>
+
+ <item name="android:actionBarStyle">@style/SolarizedLightActionBar</item>
+ <item name="actionBarStyle">@style/SolarizedLightActionBar</item>
+
+ <item name="highlightColor">@color/solarized_base2</item>
+ <item name="secondaryBackground">@color/solarized_base3</item>
+ <item name="cardBackground">@color/solarized_base2</item>
+ </style>
+
+ <style name="Theme.Plumble.Solarized.Dark" parent="@style/Theme.AppCompat">
+ <item name="android:textColor">?android:textColorPrimary</item>
+ <item name="android:textColorPrimary">@color/solarized_base0</item>
+ <item name="android:textColorSecondary">@color/solarized_base1</item>
+ <item name="android:textColorPrimaryInverse">?android:textColorPrimary</item>
+ <item name="android:textColorSecondaryInverse">?android:textColorSecondary</item>
+
+ <item name="android:windowBackground">@color/solarized_base03</item>
+ <item name="android:colorBackground">@color/solarized_base03</item>
+
+ <item name="android:actionBarStyle">@style/SolarizedDarkActionBar</item>
+ <item name="actionBarStyle">@style/SolarizedDarkActionBar</item>
+
+ <item name="highlightColor">@color/solarized_base02</item>
+ <item name="secondaryBackground">@color/solarized_base03</item>
+ <item name="cardBackground">@color/solarized_base02</item>
+ </style>
+
+ <style name="SolarizedLightActionBar" parent="@style/Widget.AppCompat.ActionBar">
+ <item name="android:background">@color/solarized_base2</item>
+ <item name="background">@color/solarized_base2</item>
+ <item name="android:titleTextStyle">@style/SolarizedLightActionBarText</item>
+ <item name="titleTextStyle">@style/SolarizedLightActionBarText</item>
+ </style>
+
+ <style name="SolarizedLightActionBarText" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
+ <item name="android:textColor">@color/solarized_base00</item>
+ </style>
+
+ <style name="SolarizedDarkActionBar" parent="@style/Widget.AppCompat.ActionBar">
+ <item name="android:background">@color/solarized_base02</item>
+ <item name="background">@color/solarized_base02</item>
+ <item name="android:titleTextStyle">@style/SolarizedDarkActionBarText</item>
+ <item name="titleTextStyle">@style/SolarizedDarkActionBarText</item>
+ </style>
+
+ <style name="SolarizedDarkActionBarText" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
+ <item name="android:textColor">@color/solarized_base0</item>
+ </style>
+</resources> \ No newline at end of file
diff --git a/Plumble/src/main/res/values/wizard.xml b/Plumble/src/main/res/values/wizard.xml
new file mode 100644
index 0000000..8bb94f9
--- /dev/null
+++ b/Plumble/src/main/res/values/wizard.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources>
+ <string name="wizard_next">Next</string>
+ <string name="wizard_back">Back</string>
+ <string name="wizard_cancel">Cancel</string>
+ <string name="wizard_finish">Finish</string>
+ <string name="wizard_confirm_close">Are you sure you wish to quit the setup wizard? You can resume it at any time in the app\'s settings.</string>
+
+ <!-- Welcome screen -->
+ <string name="wizard_welcome_title">Welcome to Plumble</string>
+
+ <!-- Certificate setup -->
+ <string name="wizard_certificate_title">Create a Certificate</string>
+
+ <!-- Audio setup -->
+ <string name="wizard_audio_title">Setup Audio</string>
+
+ <!-- General settings -->
+ <string name="wizard_general_title">Useful Options</string>
+</resources> \ No newline at end of file
diff --git a/Plumble/src/main/res/xml/preference_headers.xml b/Plumble/src/main/res/xml/preference_headers.xml
new file mode 100644
index 0000000..3c015f4
--- /dev/null
+++ b/Plumble/src/main/res/xml/preference_headers.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
+ <header
+ android:title="@string/general"
+ android:summary="@string/generalSum"
+ android:fragment="com.morlunk.mumbleclient.preference.Preferences$PlumblePreferenceFragment">
+ <extra android:name="settings" android:value="general"></extra>
+ </header>
+ <header
+ android:title="@string/authentication"
+ android:summary="@string/authenticationSum"
+ android:fragment="com.morlunk.mumbleclient.preference.Preferences$PlumblePreferenceFragment">
+ <extra android:name="settings" android:value="authentication"></extra>
+ </header>
+ <header
+ android:title="@string/audio"
+ android:summary="@string/audioSum"
+ android:fragment="com.morlunk.mumbleclient.preference.Preferences$PlumblePreferenceFragment">
+ <extra android:name="settings" android:value="audio"></extra>
+ </header>
+ <header
+ android:title="@string/appearance"
+ android:summary="@string/appearanceSum"
+ android:fragment="com.morlunk.mumbleclient.preference.Preferences$PlumblePreferenceFragment">
+ <extra android:name="settings" android:value="appearance"></extra>
+ </header>
+ <header
+ android:title="@string/about"
+ android:summary="@string/aboutSum"
+ android:fragment="com.morlunk.mumbleclient.preference.Preferences$PlumblePreferenceFragment">
+ <extra android:name="settings" android:value="about"></extra>
+ </header>
+</preference-headers> \ No newline at end of file
diff --git a/Plumble/src/main/res/xml/preference_headers_legacy.xml b/Plumble/src/main/res/xml/preference_headers_legacy.xml
new file mode 100644
index 0000000..a3f4208
--- /dev/null
+++ b/Plumble/src/main/res/xml/preference_headers_legacy.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+ <Preference
+ android:title="@string/general"
+ android:summary="@string/generalSum">
+ <intent
+ android:targetPackage="com.morlunk.mumbleclient"
+ android:targetClass="com.morlunk.mumbleclient.preference.Preferences"
+ android:action="com.morlunk.mumbleclient.app.PREFS_GENERAL"/>
+ </Preference>
+ <Preference
+ android:title="@string/authentication"
+ android:summary="@string/authenticationSum">
+ <intent
+ android:targetPackage="com.morlunk.mumbleclient"
+ android:targetClass="com.morlunk.mumbleclient.preference.Preferences"
+ android:action="com.morlunk.mumbleclient.app.PREFS_AUTHENTICATION"/>
+ </Preference>
+ <Preference
+ android:title="@string/audio"
+ android:summary="@string/audioSum">
+ <intent
+ android:targetPackage="com.morlunk.mumbleclient"
+ android:targetClass="com.morlunk.mumbleclient.preference.Preferences"
+ android:action="com.morlunk.mumbleclient.app.PREFS_AUDIO"/>
+ </Preference>
+ <Preference
+ android:title="@string/appearance"
+ android:summary="@string/appearanceSum">
+ <intent
+ android:targetPackage="com.morlunk.mumbleclient"
+ android:targetClass="com.morlunk.mumbleclient.preference.Preferences"
+ android:action="com.morlunk.mumbleclient.app.PREFS_APPEARANCE"/>
+ </Preference>
+ <Preference
+ android:title="@string/about"
+ android:summary="@string/aboutSum">
+ <intent
+ android:targetPackage="com.morlunk.mumbleclient"
+ android:targetClass="com.morlunk.mumbleclient.preference.Preferences"
+ android:action="com.morlunk.mumbleclient.app.PREFS_ABOUT"/>
+ </Preference>
+</PreferenceScreen> \ No newline at end of file
diff --git a/Plumble/src/main/res/xml/searchable.xml b/Plumble/src/main/res/xml/searchable.xml
new file mode 100644
index 0000000..4642593
--- /dev/null
+++ b/Plumble/src/main/res/xml/searchable.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<searchable xmlns:android="http://schemas.android.com/apk/res/android"
+ android:label="@string/app_name"
+ android:hint="@string/searchHint"
+ android:searchSuggestAuthority="com.morlunk.mumbleclient.channel.ChannelSearchProvider"
+ android:searchSuggestSelection=" ?"
+ android:searchSuggestThreshold="1"
+ android:searchSuggestIntentAction="android.intent.action.SEARCH"
+ android:inputType="textNoSuggestions"
+ android:imeOptions="actionNone">
+</searchable> \ No newline at end of file
diff --git a/Plumble/src/main/res/xml/settings_about.xml b/Plumble/src/main/res/xml/settings_about.xml
new file mode 100644
index 0000000..8ffa023
--- /dev/null
+++ b/Plumble/src/main/res/xml/settings_about.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+ <Preference
+ android:title="@string/app_name"
+ android:summary="@string/copyright"/>
+ <Preference
+ android:title="@string/acknowledgements"
+ android:summary="@string/acknowledgementsSum">
+ <intent
+ android:action="android.intent.action.VIEW"
+ android:data="@string/acknowledgements_link"/>
+ </Preference>
+ <PreferenceCategory
+ android:title="@string/licenses">
+ <Preference android:title="@string/license_gplv3">
+ <intent
+ android:action="android.intent.action.VIEW"
+ android:data="@string/license_gplv3_link"/>
+ </Preference>
+ <Preference android:title="@string/license_apache2">
+ <intent
+ android:action="android.intent.action.VIEW"
+ android:data="@string/license_apache2_link"/>
+ </Preference>
+ </PreferenceCategory>
+</PreferenceScreen> \ No newline at end of file
diff --git a/Plumble/src/main/res/xml/settings_appearance.xml b/Plumble/src/main/res/xml/settings_appearance.xml
new file mode 100644
index 0000000..449fbab
--- /dev/null
+++ b/Plumble/src/main/res/xml/settings_appearance.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+ <ListPreference
+ android:defaultValue="lightDark"
+ android:entries="@array/themeNames"
+ android:entryValues="@array/themeValues"
+ android:key="theme"
+ android:summary="@string/themeSum"
+ android:title="@string/theme" />
+ <!--
+ <ListPreference
+ android:defaultValue="35"
+ android:entries="@array/rowheightText"
+ android:entryValues="@array/rowheightValues"
+ android:key="channellistrowheight"
+ android:summary="@string/rowheightSum"
+ android:title="@string/rowheight" />
+ <CheckBoxPreference
+ android:defaultValue="false"
+ android:key="colorizechannellist"
+ android:summary="@string/colorizechannelsSum"
+ android:title="@string/colorizechannels" />
+
+ <EditTextPreference
+ android:defaultValue="5"
+ android:inputType="number"
+ android:key="colorthresholdnumusers"
+ android:summary="@string/colorthresholdSum"
+ android:title="@string/colorthreshold" />
+ -->
+</PreferenceScreen> \ No newline at end of file
diff --git a/Plumble/src/main/res/xml/settings_audio.xml b/Plumble/src/main/res/xml/settings_audio.xml
new file mode 100644
index 0000000..5429b1a
--- /dev/null
+++ b/Plumble/src/main/res/xml/settings_audio.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+ <ListPreference
+ android:defaultValue="voiceActivity"
+ android:entries="@array/audioInputNames"
+ android:entryValues="@array/audioInputValues"
+ android:key="audioInputMethod"
+ android:summary="@string/audioInputMethodSum"
+ android:title="@string/audioInputMethod" />
+
+ <!-- TODO add an actual min of 8000hz -->
+ <ListPreference
+ android:key="input_quality"
+ android:defaultValue="48000"
+ android:title="@string/audioQuality"
+ android:summary="@string/audioQualitySum"
+ android:entries="@array/audioInputQualityNames"
+ android:entryValues="@array/audioInputQualityValues"/>
+
+ <PreferenceCategory android:title="@string/voiceActivitySettings"
+ android:key="vad_settings">
+ <com.morlunk.mumbleclient.preference.SeekBarDialogPreference
+ multiplier="0.1"
+ android:defaultValue="50"
+ android:key="vadThreshold"
+ android:max="100"
+ android:summary="@string/detectionThresholdSum"
+ android:title="@string/detectionThreshold"/>
+ </PreferenceCategory>
+ <PreferenceCategory android:title="@string/pttSettings"
+ android:key="ptt_settings">
+ <com.morlunk.mumbleclient.preference.KeySelectDialogPreference
+ android:key="talkKey"
+ android:summary="@string/pttKeySum"
+ android:title="@string/pttKey" />
+
+ <ListPreference
+ android:defaultValue="none"
+ android:entries="@array/hotCornerNames"
+ android:entryValues="@array/hotCornerValues"
+ android:key="hotCorner"
+ android:summary="@string/hotCornerSum"
+ android:title="@string/hotCorner"/>
+
+ <CheckBoxPreference
+ android:defaultValue="false"
+ android:key="hidePtt"
+ android:summary="@string/hidePttSum"
+ android:title="@string/hidePtt" />
+ <CheckBoxPreference
+ android:defaultValue="false"
+ android:key="togglePtt"
+ android:summary="@string/togglePttSum"
+ android:title="@string/togglePtt" />
+ </PreferenceCategory>
+ <PreferenceCategory android:title="@string/advancedAudio" >
+
+ <com.morlunk.mumbleclient.preference.SeekBarDialogPreference
+ android:title="@string/audioInputVolume"
+ android:summary="@string/audioInputVolumeSum"
+ android:key="inputVolume"
+ android:max="200"
+ android:defaultValue="100"
+ android:text="%"/>
+
+ <!-- TODO: REIMPLEMENT -->
+ <!--
+ <ListPreference
+ android:defaultValue="speakerphone"
+ android:dialogTitle="@string/callMode"
+ android:entries="@array/callModeNames"
+ android:entryValues="@array/callModeValues"
+ android:key="callMode"
+ android:summary="@string/callModeSum"
+ android:title="@string/callMode" />
+ -->
+
+ <CheckBoxPreference
+ android:defaultValue="false"
+ android:key="disableOpus"
+ android:summary="@string/disableOpusSum"
+ android:title="@string/disableOpus" />
+ </PreferenceCategory>
+</PreferenceScreen> \ No newline at end of file
diff --git a/Plumble/src/main/res/xml/settings_authentication.xml b/Plumble/src/main/res/xml/settings_authentication.xml
new file mode 100644
index 0000000..d474e4c
--- /dev/null
+++ b/Plumble/src/main/res/xml/settings_authentication.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+ <Preference
+ android:key="certificateGenerate"
+ android:summary="@string/certificateGenerateSum"
+ android:title="@string/certificateGenerate" />
+
+ <ListPreference
+ android:key="certificatePath"
+ android:summary="@string/certificateFileSum"
+ android:title="@string/certificateFile" />
+
+ <EditTextPreference
+ android:key="certificatePassword"
+ android:password="true"
+ android:summary="@string/certificatePasswordSum"
+ android:title="@string/certificatePassword" />
+
+ <EditTextPreference
+ android:key="defaultUsername"
+ android:summary="@string/defaultUsernameSum"
+ android:title="@string/defaultUsername"
+ android:defaultValue="@string/defaultUsernameDefault"/>
+</PreferenceScreen> \ No newline at end of file
diff --git a/Plumble/src/main/res/xml/settings_general.xml b/Plumble/src/main/res/xml/settings_general.xml
new file mode 100644
index 0000000..0c5678a
--- /dev/null
+++ b/Plumble/src/main/res/xml/settings_general.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 Andrew Comminos
+ ~
+ ~ 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 3 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, see <http://www.gnu.org/licenses/>.
+ -->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+ <CheckBoxPreference
+ android:defaultValue="true"
+ android:key="chatNotify"
+ android:summary="@string/chatNotificationsSum"
+ android:title="@string/chatNotifications" />
+ <CheckBoxPreference
+ android:defaultValue="true"
+ android:key="useTts"
+ android:summary="@string/useTtsSum"
+ android:title="@string/useTts" />
+ <CheckBoxPreference
+ android:defaultValue="true"
+ android:key="autoReconnect"
+ android:summary="@string/autoReconnectSum"
+ android:title="@string/autoReconnect" />
+
+ <CheckBoxPreference
+ android:defaultValue="false"
+ android:key="forceTcp"
+ android:summary="@string/forceTcpSum"
+ android:title="@string/forceTcp"/>
+
+ <CheckBoxPreference
+ android:defaultValue="false"
+ android:key="useTor"
+ android:summary="@string/useTorSum"
+ android:title="@string/useTor"/>
+</PreferenceScreen> \ No newline at end of file
diff --git a/README.md b/README.md
index 3f2f9bd..81f5e67 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
Plumble
=======
-This is a placeholder for the source of Plumble 3.x.
+Plumble is a robust GPLv3 Mumble client for Android that uses the Jumble protocol implementation.
You can find legacy Plumble code and issues at https://www.github.com/Morlunk/Plumble-Legacy/.
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..e8f2ec9
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+
+
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..8c0fb64
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..b64d1e9
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2014 Andrew Comminos
+#
+# 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 3 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, see <http://www.gnu.org/licenses/>.
+#
+
+#Sat Jan 25 18:17:19 PST 2014
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.9-all.zip
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..91a7e26
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..046fe59
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2014 Andrew Comminos
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+
+
+include ':Plumble',':Plumble:libraries:libonionkit',':Plumble:libraries:Jumble' \ No newline at end of file