From 96b8129b3ef9eef1ab1efbbc3faf5cb5da503158 Mon Sep 17 00:00:00 2001 From: Dmitry Tretyakov <76806170+tretdm@users.noreply.github.com> Date: Wed, 24 Apr 2024 19:57:04 +0700 Subject: [PATCH] Move legacy clients from `tinelix/irc-client-win*` and `https://github.com/tinelix/irc-client-legacy-android` --- android/LICENSE | 674 ++++++ android/README.md | 8 + android/TinelixIRCLegacy.iml | 21 + android/app/app.iml | 89 + android/app/build.gradle | 24 + android/app/build/readme.txt | 1 + android/app/libs/readme.txt | 1 + android/app/readme.txt | 1 + .../irc/android/ExampleInstrumentedTest.java | 26 + .../legacy/ExampleInstrumentedTest.java | 26 + android/app/src/main/AndroidManifest.xml | 62 + .../legacy/AboutApplicationActivity.java | 213 ++ .../legacy/ConnectionManagerActivity.java | 590 ++++++ .../irc/android/legacy/CreateItemFragm.java | 46 + .../irc/android/legacy/CreateItemFragm2.java | 44 + .../legacy/CustomNicknamesActivity.java | 403 ++++ .../android/legacy/CustomSpinnerAdapter.java | 78 + .../irc/android/legacy/CustomSpinnerItem.java | 10 + .../irc/android/legacy/DebugLogsActivity.java | 369 ++++ .../legacy/EnterPasswordDialogFragm.java | 87 + .../android/legacy/EnterTextDialogFragm.java | 105 + .../android/legacy/EnterTextDialogFragm2.java | 227 ++ .../android/legacy/EnterTextDialogFragm3.java | 90 + .../irc/android/legacy/IRCClientApp.java | 58 + .../tinelix/irc/android/legacy/IRCParser.java | 269 +++ .../irc/android/legacy/MainActivity.java | 233 +++ .../android/legacy/MainSettingsActivity.java | 773 +++++++ .../android/legacy/NotificationActivity.java | 52 + .../tinelix/irc/android/legacy/Profile.java | 18 + .../irc/android/legacy/ProfileAdapter.java | 144 ++ .../legacy/ProfileSettingsActivity.java | 1100 ++++++++++ .../legacy/ServerSettingsDialogFragm.java | 196 ++ .../legacy/SetFontSizeDialogFragm.java | 138 ++ .../legacy/SettingsItemsDialogFragm.java | 203 ++ .../irc/android/legacy/StatisticsFragm.java | 207 ++ .../irc/android/legacy/ThreadActivity.java | 1856 +++++++++++++++++ .../drawable-anydpi/button_bottom_border.png | Bin 0 -> 2270 bytes .../res/drawable-hdpi/ic_menu_btn_add.png | Bin 0 -> 2194 bytes .../main/res/drawable-hdpi/ic_menu_delete.png | Bin 0 -> 1413 bytes .../main/res/drawable-hdpi/ic_menu_edit.png | Bin 0 -> 1931 bytes .../ic_menu_moreoverflow_normal_holo_dark.png | Bin 0 -> 144 bytes .../main/res/drawable-hdpi/ic_menu_send.png | Bin 0 -> 1307 bytes .../drawable-hdpi/ic_notification_icon.png | Bin 0 -> 519 bytes .../main/res/drawable-hdpi/ic_stat_name.png | Bin 0 -> 620 bytes .../res/drawable-ldpi/checkbox_checked.png | Bin 0 -> 2268 bytes .../checkbox_checked_disabled.png | Bin 0 -> 2283 bytes .../res/drawable-ldpi/checkbox_disabled.png | Bin 0 -> 2114 bytes .../res/drawable-ldpi/checkbox_unchecked.png | Bin 0 -> 2083 bytes .../res/drawable-mdpi/ic_menu_btn_add.png | Bin 0 -> 1339 bytes .../main/res/drawable-mdpi/ic_menu_delete.png | Bin 0 -> 967 bytes .../main/res/drawable-mdpi/ic_menu_edit.png | Bin 0 -> 1198 bytes .../ic_menu_moreoverflow_normal_holo_dark.png | Bin 0 -> 122 bytes .../main/res/drawable-mdpi/ic_menu_send.png | Bin 0 -> 920 bytes .../drawable-mdpi/ic_notification_icon.png | Bin 0 -> 368 bytes .../main/res/drawable-mdpi/ic_stat_name.png | Bin 0 -> 418 bytes .../res/drawable-nodpi/checkbox_checked.png | Bin 0 -> 2567 bytes .../checkbox_checked_disabled.png | Bin 0 -> 2584 bytes .../res/drawable-nodpi/checkbox_disabled.png | Bin 0 -> 2131 bytes .../res/drawable-nodpi/checkbox_unchecked.png | Bin 0 -> 2114 bytes .../drawable-nodpi/full_application_icon.png | Bin 0 -> 15552 bytes .../drawable-nodpi/spinner_arrow_dialog.png | Bin 0 -> 2287 bytes .../spinner_arrow_dialog_hovered.png | Bin 0 -> 2387 bytes .../spinner_arrow_dialog_light.png | Bin 0 -> 2295 bytes .../spinner_arrow_dialog_pressed.png | Bin 0 -> 2386 bytes .../res/drawable-xhdpi/ic_menu_btn_add.png | Bin 0 -> 3061 bytes .../res/drawable-xhdpi/ic_menu_delete.png | Bin 0 -> 1880 bytes .../main/res/drawable-xhdpi/ic_menu_edit.png | Bin 0 -> 2656 bytes .../ic_menu_moreoverflow_normal_holo_dark.png | Bin 0 -> 167 bytes .../main/res/drawable-xhdpi/ic_menu_send.png | Bin 0 -> 1775 bytes .../drawable-xhdpi/ic_notification_icon.png | Bin 0 -> 687 bytes .../main/res/drawable-xhdpi/ic_stat_name.png | Bin 0 -> 831 bytes .../drawable-xxhdpi/ic_notification_icon.png | Bin 0 -> 1074 bytes .../main/res/drawable-xxhdpi/ic_stat_name.png | Bin 0 -> 1300 bytes .../drawable-xxxhdpi/ic_notification_icon.png | Bin 0 -> 1597 bytes .../res/drawable-xxxhdpi/ic_stat_name.png | Bin 0 -> 2226 bytes .../app/src/main/res/drawable/checkbox.xml | 7 + .../src/main/res/drawable/dialog_spinner.xml | 20 + .../res/drawable/dialog_spinner_light.xml | 20 + .../src/main/res/drawable/dialog_textarea.xml | 14 + .../res/drawable/dialog_textarea_light.xml | 14 + .../res/drawable/successfully_state_shape.xml | 11 + .../app/src/main/res/drawable/tabwidget.xml | 6 + .../main/res/drawable/tabwidget_default.xml | 13 + .../main/res/drawable/tabwidget_selected.xml | 14 + .../app/src/main/res/drawable/textarea.xml | 14 + .../main/res/layout-ldpi/checkbox_prefw.xml | 40 + .../layout-v11/about_application_activity.xml | 110 + .../activity_connection_manager.xml | 44 + .../src/main/res/layout-v11/activity_main.xml | 15 + .../src/main/res/layout-v11/create_item.xml | 36 + .../src/main/res/layout-v11/create_item2.xml | 36 + .../layout-v11/custom_nicknames_activity.xml | 26 + .../layout-v11/custom_preferences_layout.xml | 13 + .../res/layout-v11/debug_log_activity.xml | 31 + .../layout-v11/enter_password_activity.xml | 31 + .../res/layout-v11/enter_server_activity.xml | 98 + .../res/layout-v11/enter_text_activity.xml | 31 + .../src/main/res/layout-v11/profile_item.xml | 93 + .../res/layout-v11/set_font_size_activity.xml | 75 + .../res/layout-v11/statistics_activity.xml | 104 + .../main/res/layout-v11/thread_activity.xml | 152 ++ .../res/layout/about_application_activity.xml | 137 ++ .../layout/activity_connection_manager.xml | 97 + .../app/src/main/res/layout/activity_main.xml | 53 + .../src/main/res/layout/checkbox_prefw.xml | 40 + .../res/layout/custom_nicknames_activity.xml | 80 + .../res/layout/custom_preferences_layout.xml | 36 + .../main/res/layout/custom_spinner_item.xml | 13 + .../main/res/layout/debug_log_activity.xml | 69 + .../res/layout/enter_password_activity.xml | 53 + .../main/res/layout/enter_server_activity.xml | 129 ++ .../main/res/layout/enter_text_activity.xml | 60 + .../main/res/layout/notification_activity.xml | 51 + .../app/src/main/res/layout/pref_widget.xml | 33 + .../app/src/main/res/layout/profile_item.xml | 95 + .../src/main/res/layout/progress_activity.xml | 25 + .../res/layout/set_font_size_activity.xml | 107 + .../main/res/layout/statistics_activity.xml | 133 ++ .../src/main/res/layout/thread_activity.xml | 252 +++ .../main/res/menu/connection_manager_menu.xml | 11 + android/app/src/main/res/menu/main.xml | 7 + android/app/src/main/res/menu/main_menu.xml | 7 + .../main/res/menu/nicknames_manager_menu.xml | 12 + android/app/src/main/res/menu/thread_menu.xml | 27 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3886 bytes .../mipmap-hdpi/ic_launcher_foreground.png | Bin 0 -> 8151 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2244 bytes .../mipmap-mdpi/ic_launcher_foreground.png | Bin 0 -> 4622 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 5737 bytes .../mipmap-xhdpi/ic_launcher_foreground.png | Bin 0 -> 12195 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 10270 bytes .../mipmap-xxhdpi/ic_launcher_foreground.png | Bin 0 -> 22684 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 15552 bytes .../mipmap-xxxhdpi/ic_launcher_foreground.png | Bin 0 -> 35738 bytes .../src/main/res/values-ldpi-v11/styles.xml | 11 + .../app/src/main/res/values-ldpi/styles.xml | 105 + android/app/src/main/res/values-ru/arrays.xml | 18 + .../app/src/main/res/values-ru/strings.xml | 100 + .../app/src/main/res/values-v11/styles.xml | 11 + android/app/src/main/res/values/arrays.xml | 29 + android/app/src/main/res/values/colors.xml | 21 + android/app/src/main/res/values/dimens.xml | 3 + .../res/values/ic_launcher_background.xml | 4 + android/app/src/main/res/values/strings.xml | 107 + android/app/src/main/res/values/styles.xml | 105 + .../src/main/res/xml-v11/main_settings.xml | 32 + .../src/main/res/xml-v16/main_settings.xml | 40 + .../app/src/main/res/xml/main_settings.xml | 35 + .../app/src/main/res/xml/profile_settings.xml | 55 + .../tinelix/irc/android/ExampleUnitTest.java | 17 + .../irc/android/legacy/ExampleUnitTest.java | 17 + android/build.gradle | 19 + android/gradle.properties | 18 + android/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 49896 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + android/gradlew | 164 ++ android/gradlew.bat | 90 + android/settings.gradle | 1 + windows/win16/.gitignore | 17 + windows/win16/LICENSE | 674 ++++++ windows/win16/TLX_IRC.MAK | 160 ++ windows/win16/src/AboutDlg.c | 56 + windows/win16/src/AboutDlg.h | 15 + windows/win16/src/App.c | 63 + windows/win16/src/App.ico | Bin 0 -> 1078 bytes windows/win16/src/CONNMDLG.C | 79 + windows/win16/src/CONNMDLG.H | 14 + windows/win16/src/ETEXTDLG.C | 80 + windows/win16/src/ETEXTDLG.H | 14 + windows/win16/src/Globals.h | 17 + windows/win16/src/IRCCLNT.C | 82 + windows/win16/src/IRCCLNT.H | 7 + windows/win16/src/MainWnd.c | 161 ++ windows/win16/src/MainWnd.h | 15 + windows/win16/src/PRFSTDLG.C | 205 ++ windows/win16/src/PRFSTDLG.H | 17 + windows/win16/src/RESOURCE.H | 70 + windows/win16/src/RESOURCE.RC | 189 ++ windows/win16/src/tlx_irc.def | 9 + windows/win16/src/tlx_irc.ver | 35 + windows/win32s/LICENSE.TXT | 674 ++++++ windows/win32s/README.md | 11 + windows/win32s/StdAfx.cpp | 6 + windows/win32s/StdAfx.h | 16 + windows/win32s/Tinelix IRC.aps | Bin 0 -> 43260 bytes windows/win32s/Tinelix IRC.clw | 208 ++ windows/win32s/Tinelix IRC.cpp | 129 ++ windows/win32s/Tinelix IRC.h | 55 + windows/win32s/Tinelix IRC.mak | 434 ++++ windows/win32s/Tinelix IRC.mdp | Bin 0 -> 39936 bytes windows/win32s/Tinelix IRC.ncb | Bin 0 -> 263168 bytes windows/win32s/Tinelix IRC.rc | 402 ++++ windows/win32s/dialogs/AboutDlg.cpp | 81 + windows/win32s/dialogs/AboutDlg.h | 53 + windows/win32s/dialogs/ConnManDlg.cpp | 171 ++ windows/win32s/dialogs/ConnManDlg.h | 68 + windows/win32s/dialogs/MainDlg.cpp | 560 +++++ windows/win32s/dialogs/MainDlg.h | 79 + windows/win32s/dialogs/ProgressDlg.cpp | 99 + windows/win32s/dialogs/ProgressDlg.h | 60 + windows/win32s/dialogs/StatisticsDlg.cpp | 170 ++ windows/win32s/dialogs/StatisticsDlg.h | 57 + windows/win32s/dialogs/TextBoxDlg.cpp | 93 + windows/win32s/dialogs/TextBoxDlg.h | 37 + .../win32s/libs/IRCParser/Debug/ircpars.dll | Bin 0 -> 91136 bytes windows/win32s/libs/IRCParser/IRCParser.aps | Bin 0 -> 17084 bytes windows/win32s/libs/IRCParser/IRCParser.cpp | 242 +++ windows/win32s/libs/IRCParser/IRCParser.def | 7 + windows/win32s/libs/IRCParser/IRCParser.h | 21 + windows/win32s/libs/IRCParser/IRCParser.rc | 106 + .../libs/IRCParser/Tinelix IRC Parser.mak | 237 +++ .../libs/IRCParser/Tinelix IRC Parser.mdp | Bin 0 -> 36352 bytes .../libs/IRCParser/Tinelix IRC Parser.ncb | Bin 0 -> 214016 bytes windows/win32s/libs/IRCParser/resource.h | 15 + windows/win32s/mfc_readme.txt | 64 + windows/win32s/res/Tinelix IRC.ico | Bin 0 -> 1078 bytes windows/win32s/res/Tinelix IRC.rc2 | 13 + windows/win32s/resource.h | 75 + windows/win32s/tabs/AppThreadTab.cpp | 111 + windows/win32s/tabs/AppThreadTab.h | 55 + 220 files changed, 18433 insertions(+) create mode 100644 android/LICENSE create mode 100644 android/README.md create mode 100644 android/TinelixIRCLegacy.iml create mode 100644 android/app/app.iml create mode 100644 android/app/build.gradle create mode 100644 android/app/build/readme.txt create mode 100644 android/app/libs/readme.txt create mode 100644 android/app/readme.txt create mode 100644 android/app/src/androidTest/java/dev/tinelix/irc/android/ExampleInstrumentedTest.java create mode 100644 android/app/src/androidTest/java/dev/tinelix/irc/android/legacy/ExampleInstrumentedTest.java create mode 100644 android/app/src/main/AndroidManifest.xml create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/AboutApplicationActivity.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/ConnectionManagerActivity.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/CreateItemFragm.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/CreateItemFragm2.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/CustomNicknamesActivity.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/CustomSpinnerAdapter.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/CustomSpinnerItem.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/DebugLogsActivity.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterPasswordDialogFragm.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterTextDialogFragm.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterTextDialogFragm2.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterTextDialogFragm3.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/IRCClientApp.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/IRCParser.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/MainActivity.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/MainSettingsActivity.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/NotificationActivity.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/Profile.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/ProfileAdapter.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/ProfileSettingsActivity.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/ServerSettingsDialogFragm.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/SetFontSizeDialogFragm.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/SettingsItemsDialogFragm.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/StatisticsFragm.java create mode 100644 android/app/src/main/java/dev/tinelix/irc/android/legacy/ThreadActivity.java create mode 100644 android/app/src/main/res/drawable-anydpi/button_bottom_border.png create mode 100644 android/app/src/main/res/drawable-hdpi/ic_menu_btn_add.png create mode 100644 android/app/src/main/res/drawable-hdpi/ic_menu_delete.png create mode 100644 android/app/src/main/res/drawable-hdpi/ic_menu_edit.png create mode 100644 android/app/src/main/res/drawable-hdpi/ic_menu_moreoverflow_normal_holo_dark.png create mode 100644 android/app/src/main/res/drawable-hdpi/ic_menu_send.png create mode 100644 android/app/src/main/res/drawable-hdpi/ic_notification_icon.png create mode 100644 android/app/src/main/res/drawable-hdpi/ic_stat_name.png create mode 100644 android/app/src/main/res/drawable-ldpi/checkbox_checked.png create mode 100644 android/app/src/main/res/drawable-ldpi/checkbox_checked_disabled.png create mode 100644 android/app/src/main/res/drawable-ldpi/checkbox_disabled.png create mode 100644 android/app/src/main/res/drawable-ldpi/checkbox_unchecked.png create mode 100644 android/app/src/main/res/drawable-mdpi/ic_menu_btn_add.png create mode 100644 android/app/src/main/res/drawable-mdpi/ic_menu_delete.png create mode 100644 android/app/src/main/res/drawable-mdpi/ic_menu_edit.png create mode 100644 android/app/src/main/res/drawable-mdpi/ic_menu_moreoverflow_normal_holo_dark.png create mode 100644 android/app/src/main/res/drawable-mdpi/ic_menu_send.png create mode 100644 android/app/src/main/res/drawable-mdpi/ic_notification_icon.png create mode 100644 android/app/src/main/res/drawable-mdpi/ic_stat_name.png create mode 100644 android/app/src/main/res/drawable-nodpi/checkbox_checked.png create mode 100644 android/app/src/main/res/drawable-nodpi/checkbox_checked_disabled.png create mode 100644 android/app/src/main/res/drawable-nodpi/checkbox_disabled.png create mode 100644 android/app/src/main/res/drawable-nodpi/checkbox_unchecked.png create mode 100644 android/app/src/main/res/drawable-nodpi/full_application_icon.png create mode 100644 android/app/src/main/res/drawable-nodpi/spinner_arrow_dialog.png create mode 100644 android/app/src/main/res/drawable-nodpi/spinner_arrow_dialog_hovered.png create mode 100644 android/app/src/main/res/drawable-nodpi/spinner_arrow_dialog_light.png create mode 100644 android/app/src/main/res/drawable-nodpi/spinner_arrow_dialog_pressed.png create mode 100644 android/app/src/main/res/drawable-xhdpi/ic_menu_btn_add.png create mode 100644 android/app/src/main/res/drawable-xhdpi/ic_menu_delete.png create mode 100644 android/app/src/main/res/drawable-xhdpi/ic_menu_edit.png create mode 100644 android/app/src/main/res/drawable-xhdpi/ic_menu_moreoverflow_normal_holo_dark.png create mode 100644 android/app/src/main/res/drawable-xhdpi/ic_menu_send.png create mode 100644 android/app/src/main/res/drawable-xhdpi/ic_notification_icon.png create mode 100644 android/app/src/main/res/drawable-xhdpi/ic_stat_name.png create mode 100644 android/app/src/main/res/drawable-xxhdpi/ic_notification_icon.png create mode 100644 android/app/src/main/res/drawable-xxhdpi/ic_stat_name.png create mode 100644 android/app/src/main/res/drawable-xxxhdpi/ic_notification_icon.png create mode 100644 android/app/src/main/res/drawable-xxxhdpi/ic_stat_name.png create mode 100644 android/app/src/main/res/drawable/checkbox.xml create mode 100644 android/app/src/main/res/drawable/dialog_spinner.xml create mode 100644 android/app/src/main/res/drawable/dialog_spinner_light.xml create mode 100644 android/app/src/main/res/drawable/dialog_textarea.xml create mode 100644 android/app/src/main/res/drawable/dialog_textarea_light.xml create mode 100644 android/app/src/main/res/drawable/successfully_state_shape.xml create mode 100644 android/app/src/main/res/drawable/tabwidget.xml create mode 100644 android/app/src/main/res/drawable/tabwidget_default.xml create mode 100644 android/app/src/main/res/drawable/tabwidget_selected.xml create mode 100644 android/app/src/main/res/drawable/textarea.xml create mode 100644 android/app/src/main/res/layout-ldpi/checkbox_prefw.xml create mode 100644 android/app/src/main/res/layout-v11/about_application_activity.xml create mode 100644 android/app/src/main/res/layout-v11/activity_connection_manager.xml create mode 100644 android/app/src/main/res/layout-v11/activity_main.xml create mode 100644 android/app/src/main/res/layout-v11/create_item.xml create mode 100644 android/app/src/main/res/layout-v11/create_item2.xml create mode 100644 android/app/src/main/res/layout-v11/custom_nicknames_activity.xml create mode 100644 android/app/src/main/res/layout-v11/custom_preferences_layout.xml create mode 100644 android/app/src/main/res/layout-v11/debug_log_activity.xml create mode 100644 android/app/src/main/res/layout-v11/enter_password_activity.xml create mode 100644 android/app/src/main/res/layout-v11/enter_server_activity.xml create mode 100644 android/app/src/main/res/layout-v11/enter_text_activity.xml create mode 100644 android/app/src/main/res/layout-v11/profile_item.xml create mode 100644 android/app/src/main/res/layout-v11/set_font_size_activity.xml create mode 100644 android/app/src/main/res/layout-v11/statistics_activity.xml create mode 100644 android/app/src/main/res/layout-v11/thread_activity.xml create mode 100644 android/app/src/main/res/layout/about_application_activity.xml create mode 100644 android/app/src/main/res/layout/activity_connection_manager.xml create mode 100644 android/app/src/main/res/layout/activity_main.xml create mode 100644 android/app/src/main/res/layout/checkbox_prefw.xml create mode 100644 android/app/src/main/res/layout/custom_nicknames_activity.xml create mode 100644 android/app/src/main/res/layout/custom_preferences_layout.xml create mode 100644 android/app/src/main/res/layout/custom_spinner_item.xml create mode 100644 android/app/src/main/res/layout/debug_log_activity.xml create mode 100644 android/app/src/main/res/layout/enter_password_activity.xml create mode 100644 android/app/src/main/res/layout/enter_server_activity.xml create mode 100644 android/app/src/main/res/layout/enter_text_activity.xml create mode 100644 android/app/src/main/res/layout/notification_activity.xml create mode 100644 android/app/src/main/res/layout/pref_widget.xml create mode 100644 android/app/src/main/res/layout/profile_item.xml create mode 100644 android/app/src/main/res/layout/progress_activity.xml create mode 100644 android/app/src/main/res/layout/set_font_size_activity.xml create mode 100644 android/app/src/main/res/layout/statistics_activity.xml create mode 100644 android/app/src/main/res/layout/thread_activity.xml create mode 100644 android/app/src/main/res/menu/connection_manager_menu.xml create mode 100644 android/app/src/main/res/menu/main.xml create mode 100644 android/app/src/main/res/menu/main_menu.xml create mode 100644 android/app/src/main/res/menu/nicknames_manager_menu.xml create mode 100644 android/app/src/main/res/menu/thread_menu.xml create mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png create mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png create mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png create mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png create mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png create mode 100644 android/app/src/main/res/values-ldpi-v11/styles.xml create mode 100644 android/app/src/main/res/values-ldpi/styles.xml create mode 100644 android/app/src/main/res/values-ru/arrays.xml create mode 100644 android/app/src/main/res/values-ru/strings.xml create mode 100644 android/app/src/main/res/values-v11/styles.xml create mode 100644 android/app/src/main/res/values/arrays.xml create mode 100644 android/app/src/main/res/values/colors.xml create mode 100644 android/app/src/main/res/values/dimens.xml create mode 100644 android/app/src/main/res/values/ic_launcher_background.xml create mode 100644 android/app/src/main/res/values/strings.xml create mode 100644 android/app/src/main/res/values/styles.xml create mode 100644 android/app/src/main/res/xml-v11/main_settings.xml create mode 100644 android/app/src/main/res/xml-v16/main_settings.xml create mode 100644 android/app/src/main/res/xml/main_settings.xml create mode 100644 android/app/src/main/res/xml/profile_settings.xml create mode 100644 android/app/src/test/java/dev/tinelix/irc/android/ExampleUnitTest.java create mode 100644 android/app/src/test/java/dev/tinelix/irc/android/legacy/ExampleUnitTest.java create mode 100644 android/build.gradle create mode 100644 android/gradle.properties create mode 100644 android/gradle/wrapper/gradle-wrapper.jar create mode 100644 android/gradle/wrapper/gradle-wrapper.properties create mode 100644 android/gradlew create mode 100644 android/gradlew.bat create mode 100644 android/settings.gradle create mode 100644 windows/win16/.gitignore create mode 100644 windows/win16/LICENSE create mode 100644 windows/win16/TLX_IRC.MAK create mode 100644 windows/win16/src/AboutDlg.c create mode 100644 windows/win16/src/AboutDlg.h create mode 100644 windows/win16/src/App.c create mode 100644 windows/win16/src/App.ico create mode 100644 windows/win16/src/CONNMDLG.C create mode 100644 windows/win16/src/CONNMDLG.H create mode 100644 windows/win16/src/ETEXTDLG.C create mode 100644 windows/win16/src/ETEXTDLG.H create mode 100644 windows/win16/src/Globals.h create mode 100644 windows/win16/src/IRCCLNT.C create mode 100644 windows/win16/src/IRCCLNT.H create mode 100644 windows/win16/src/MainWnd.c create mode 100644 windows/win16/src/MainWnd.h create mode 100644 windows/win16/src/PRFSTDLG.C create mode 100644 windows/win16/src/PRFSTDLG.H create mode 100644 windows/win16/src/RESOURCE.H create mode 100644 windows/win16/src/RESOURCE.RC create mode 100644 windows/win16/src/tlx_irc.def create mode 100644 windows/win16/src/tlx_irc.ver create mode 100644 windows/win32s/LICENSE.TXT create mode 100644 windows/win32s/README.md create mode 100644 windows/win32s/StdAfx.cpp create mode 100644 windows/win32s/StdAfx.h create mode 100644 windows/win32s/Tinelix IRC.aps create mode 100644 windows/win32s/Tinelix IRC.clw create mode 100644 windows/win32s/Tinelix IRC.cpp create mode 100644 windows/win32s/Tinelix IRC.h create mode 100644 windows/win32s/Tinelix IRC.mak create mode 100644 windows/win32s/Tinelix IRC.mdp create mode 100644 windows/win32s/Tinelix IRC.ncb create mode 100644 windows/win32s/Tinelix IRC.rc create mode 100644 windows/win32s/dialogs/AboutDlg.cpp create mode 100644 windows/win32s/dialogs/AboutDlg.h create mode 100644 windows/win32s/dialogs/ConnManDlg.cpp create mode 100644 windows/win32s/dialogs/ConnManDlg.h create mode 100644 windows/win32s/dialogs/MainDlg.cpp create mode 100644 windows/win32s/dialogs/MainDlg.h create mode 100644 windows/win32s/dialogs/ProgressDlg.cpp create mode 100644 windows/win32s/dialogs/ProgressDlg.h create mode 100644 windows/win32s/dialogs/StatisticsDlg.cpp create mode 100644 windows/win32s/dialogs/StatisticsDlg.h create mode 100644 windows/win32s/dialogs/TextBoxDlg.cpp create mode 100644 windows/win32s/dialogs/TextBoxDlg.h create mode 100644 windows/win32s/libs/IRCParser/Debug/ircpars.dll create mode 100644 windows/win32s/libs/IRCParser/IRCParser.aps create mode 100644 windows/win32s/libs/IRCParser/IRCParser.cpp create mode 100644 windows/win32s/libs/IRCParser/IRCParser.def create mode 100644 windows/win32s/libs/IRCParser/IRCParser.h create mode 100644 windows/win32s/libs/IRCParser/IRCParser.rc create mode 100644 windows/win32s/libs/IRCParser/Tinelix IRC Parser.mak create mode 100644 windows/win32s/libs/IRCParser/Tinelix IRC Parser.mdp create mode 100644 windows/win32s/libs/IRCParser/Tinelix IRC Parser.ncb create mode 100644 windows/win32s/libs/IRCParser/resource.h create mode 100644 windows/win32s/mfc_readme.txt create mode 100644 windows/win32s/res/Tinelix IRC.ico create mode 100644 windows/win32s/res/Tinelix IRC.rc2 create mode 100644 windows/win32s/resource.h create mode 100644 windows/win32s/tabs/AppThreadTab.cpp create mode 100644 windows/win32s/tabs/AppThreadTab.h diff --git a/android/LICENSE b/android/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/android/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + 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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 +. + + 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 +. diff --git a/android/README.md b/android/README.md new file mode 100644 index 0000000..f48f4fc --- /dev/null +++ b/android/README.md @@ -0,0 +1,8 @@ +# Tinelix IRC Client (Legacy edition) +**Minimal Android version:** Android 2.0 Eclair (API level 5) and higher + +**IMPORTANT!** Until May 1, 2024 all files from this repository will be moved to https://github.com/tinelix/irc-client-legacy. + +See https://github.com/tinelix/irc-client/issues/14#issue-2225137465. + + diff --git a/android/TinelixIRCLegacy.iml b/android/TinelixIRCLegacy.iml new file mode 100644 index 0000000..2a02201 --- /dev/null +++ b/android/TinelixIRCLegacy.iml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/app.iml b/android/app/app.iml new file mode 100644 index 0000000..f782803 --- /dev/null +++ b/android/app/app.iml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/build.gradle b/android/app/build.gradle new file mode 100644 index 0000000..fe8c81a --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,24 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 21 + buildToolsVersion "21.1.2" + defaultConfig { + applicationId "dev.tinelix.irc.android.legacy" + minSdkVersion 5 // Android 2.0 Eclair + targetSdkVersion 21 + versionCode 22 + versionName '0.4.0_beta_20220506' + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + debug { + debuggable true + } + } + productFlavors { + } +} diff --git a/android/app/build/readme.txt b/android/app/build/readme.txt new file mode 100644 index 0000000..292c28c --- /dev/null +++ b/android/app/build/readme.txt @@ -0,0 +1 @@ +'build' - folder for output build diff --git a/android/app/libs/readme.txt b/android/app/libs/readme.txt new file mode 100644 index 0000000..4e9d86a --- /dev/null +++ b/android/app/libs/readme.txt @@ -0,0 +1 @@ +'libs' - folder for Gradle libs \ No newline at end of file diff --git a/android/app/readme.txt b/android/app/readme.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/android/app/readme.txt @@ -0,0 +1 @@ + diff --git a/android/app/src/androidTest/java/dev/tinelix/irc/android/ExampleInstrumentedTest.java b/android/app/src/androidTest/java/dev/tinelix/irc/android/ExampleInstrumentedTest.java new file mode 100644 index 0000000..0257a09 --- /dev/null +++ b/android/app/src/androidTest/java/dev/tinelix/irc/android/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package dev.tinelix.irc; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumentation test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() throws Exception { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("dev.tinelix.irc", appContext.getPackageName()); + } +} diff --git a/android/app/src/androidTest/java/dev/tinelix/irc/android/legacy/ExampleInstrumentedTest.java b/android/app/src/androidTest/java/dev/tinelix/irc/android/legacy/ExampleInstrumentedTest.java new file mode 100644 index 0000000..596443b --- /dev/null +++ b/android/app/src/androidTest/java/dev/tinelix/irc/android/legacy/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package dev.tinelix.irc.android; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("dev.tinelix.irc.android", appContext.getPackageName()); + } +} diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..85d0030 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/AboutApplicationActivity.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/AboutApplicationActivity.java new file mode 100644 index 0000000..a639303 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/AboutApplicationActivity.java @@ -0,0 +1,213 @@ +package dev.tinelix.irc.android.legacy; + +import android.app.Activity; +import android.app.Application; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.graphics.Color; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.text.method.LinkMovementMethod; +import android.view.MenuItem; +import android.view.View; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import java.util.Locale; + +public class AboutApplicationActivity extends Activity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + setCustomTheme(global_prefs); + setContentView(R.layout.about_application_activity); + setColorStyle(global_prefs); + Button repoButton = (Button) findViewById(R.id.repo_button); + Button websiteButton = (Button) findViewById(R.id.website_button); + + repoButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Uri uri = Uri.parse("https://github.com/tinelix/irc-client-for-android"); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(intent); + } + }); + websiteButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Uri uri = Uri.parse("http://tinelix.downmail.ru/web1/pages/tinelix/irc-client_utf8.html"); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(intent); + } + }); + if (global_prefs.getString("language", "OS dependent").contains("English")) { + websiteButton.setVisibility(View.GONE); + } + TextView license_label = (TextView) findViewById(R.id.license_label); + license_label.setMovementMethod(LinkMovementMethod.getInstance()); + TextView version_label = (TextView) findViewById(R.id.version_label); + version_label.setText(getResources().getString(R.string.version_str, ((IRCClientApp) getApplicationContext()).version, ((IRCClientApp) getApplicationContext()).build_date)); + }; + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) { + if(id == android.R.id.home) { + onBackPressed(); + } + } + return super.onOptionsItemSelected(item); + } + + @Override + public void onBackPressed() { + finish(); + } + + private void setColorStyle(SharedPreferences global_prefs) { + if (global_prefs.getString("theme", "Light").contains("Light")) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.white_75)); + TextView app_title = (TextView) findViewById(R.id.activity_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.white_75)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.white_75)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.white)); + TextView app_title2 = (TextView) findViewById(R.id.app_title_label); + app_title2.setTextColor(getResources().getColor(R.color.black)); + ((TextView) findViewById(R.id.license_label)).setTextColor(Color.DKGRAY); + } else { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.title_v11_transparent)); + TextView app_title = (TextView) findViewById(R.id.activity_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + TextView app_title2 = (TextView) findViewById(R.id.app_title_label); + app_title2.setTextColor(getResources().getColor(R.color.white)); + ((TextView) findViewById(R.id.license_label)).setTextColor(Color.LTGRAY); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + TextView app_title2 = (TextView) findViewById(R.id.app_title_label); + app_title2.setTextColor(getResources().getColor(R.color.black)); + } else { + TextView app_title2 = (TextView) findViewById(R.id.app_title_label); + app_title2.setTextColor(getResources().getColor(R.color.white)); + } + } + } else { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.title_v11_transparent)); + TextView app_title = (TextView) findViewById(R.id.activity_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + TextView app_title2 = (TextView) findViewById(R.id.app_title_label); + app_title2.setTextColor(getResources().getColor(R.color.white)); + ((TextView) findViewById(R.id.license_label)).setTextColor(Color.LTGRAY); + } else { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.white_75)); + TextView app_title = (TextView) findViewById(R.id.activity_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.white_75)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.white_75)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.white)); + TextView app_title2 = (TextView) findViewById(R.id.app_title_label); + app_title2.setTextColor(getResources().getColor(R.color.black)); + ((TextView) findViewById(R.id.license_label)).setTextColor(Color.DKGRAY); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + TextView app_title2 = (TextView) findViewById(R.id.app_title_label); + app_title2.setTextColor(getResources().getColor(R.color.white)); + } else { + TextView app_title2 = (TextView) findViewById(R.id.app_title_label); + app_title2.setTextColor(getResources().getColor(R.color.black)); + } + } + } + } + + private void setCustomTheme(SharedPreferences global_prefs) { + if (global_prefs.getString("language", "OS dependent").contains("Russian")) { + if (global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + config.locale = locale; + config.setLayoutDirection(locale); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + config.locale = locale; + config.setLayoutDirection(locale); + } + getApplicationContext().getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if (global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + config.locale = locale; + config.setLayoutDirection(locale); + } + getApplicationContext().getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + config.locale = locale; + config.setLayoutDirection(locale); + } + getApplicationContext().getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } + if (global_prefs.getString("theme", "Light").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient_Light); + } else { + setTheme(R.style.IRCClient); + } + } else { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient); + } else { + setTheme(R.style.IRCClient_Light); + } + } + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/ConnectionManagerActivity.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/ConnectionManagerActivity.java new file mode 100644 index 0000000..2a14466 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/ConnectionManagerActivity.java @@ -0,0 +1,590 @@ +package dev.tinelix.irc.android.legacy; + +import android.app.Activity; +import android.app.AlertDialog; +import android.app.Dialog; +import android.app.FragmentManager; +import android.app.FragmentTransaction; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.graphics.Typeface; +import android.os.Build; +import android.os.Bundle; +import android.app.DialogFragment; +import android.preference.PreferenceManager; +import android.text.Editable; +import android.text.TextWatcher; +import android.util.DisplayMetrics; +import android.util.Log; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; +import android.widget.Toast; + +import java.io.File; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; + +public class ConnectionManagerActivity extends Activity implements SharedPreferences.OnSharedPreferenceChangeListener { + public List profilesArray = new ArrayList(); + ArrayList profilesList = new ArrayList(); + ProfileAdapter profilesAdapter; + public String selected_profile_name; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + setCustomTheme(global_prefs); + setContentView(R.layout.activity_connection_manager); + setColorStyle(global_prefs); + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + ImageButton menu_button = (ImageButton) findViewById(R.id.menu_button); + menu_button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + openOptionsMenu(); + } + }); + } else { + getActionBar().setTitle(getResources().getString(R.string.connection_manager_title)); + } + profilesAdapter = new ProfileAdapter(this, profilesList); + String package_name = getApplicationContext().getPackageName(); + String profile_path = "/data/data/" + package_name + "/shared_prefs"; + File prefs_directory = new File(profile_path); + File[] prefs_files = prefs_directory.listFiles(); + ListView profilesListView = (ListView) findViewById(R.id.profiles_list); + LinearLayout profilesLinearLayout = (LinearLayout) findViewById(R.id.empty_profiles_list_layout); + profilesArray = new LinkedList(); + String file_extension; + Context context = getApplicationContext(); + try { + for (int i = 0; i < prefs_files.length; i++) { + if(prefs_files[i].getName().substring(0, (int) (prefs_files[i].getName().length() - 4)).startsWith(getApplicationInfo().packageName + "_preferences")) + { + } else { + SharedPreferences prefs = context.getSharedPreferences(prefs_files[i].getName().substring(0, (int) (prefs_files[i].getName().length() - 4)), 0); + file_extension = prefs_files[i].getName().substring((int) (prefs_files[i].getName().length() - 4)); + if (file_extension.contains(".xml") && file_extension.length() == 4) { + profilesList.add(new Profile(prefs_files[i].getName().substring(0, (int) (prefs_files[i].getName().length() - 4)), + prefs.getString("server", ""), prefs.getInt("port", 0), false, false)); + } + } + } + if(prefs_files == null || profilesList.size() == 0) { + profilesListView.setVisibility(View.GONE); + profilesLinearLayout.setVisibility(View.VISIBLE); + } else { + profilesListView.setVisibility(View.VISIBLE); + profilesLinearLayout.setVisibility(View.GONE); + } + ArrayAdapter profilesAdapter2 = new ArrayAdapter(this, + android.R.layout.simple_list_item_1, profilesArray); + profilesListView.setAdapter(profilesAdapter); + profilesListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapterView, View view, int i, long l) { + Toast.makeText(getApplicationContext(), ((TextView)view.findViewById(R.id.profile_item_label)).getText(), Toast.LENGTH_LONG).show(); + } + }); + } catch(Exception ex) { + ex.printStackTrace(); + } + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) { + FragmentManager fragmentManager = null; + fragmentManager = getFragmentManager(); + FragmentTransaction fragmentTransaction = null; + fragmentTransaction = fragmentManager.beginTransaction(); + CreateItemFragm ci_fragment = new CreateItemFragm(); + fragmentTransaction.add(R.id.create_item_layout2, ci_fragment); + fragmentTransaction.commit(); + } else { + LinearLayout add_item_ll = (LinearLayout) findViewById(R.id.add_item_ll); + add_item_ll.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + showEnterTextDialog(); + } + }); + } + }; + + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.connection_manager_menu, menu); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + getActionBar().setHomeButtonEnabled(true); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + getActionBar().setDisplayHomeAsUpEnabled(true); + } + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + int id = item.getItemId(); + + //noinspection SimplifiableIfStatement + if (id == R.id.add_item) { + return showEnterTextDialog(); + } + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) { + if(id == android.R.id.home) { + onBackPressed(); + } + } + + return super.onOptionsItemSelected(item); + } + + public boolean showEnterTextDialog() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + DialogFragment enterTextDialogFragm = new EnterTextDialogFragm(); + enterTextDialogFragm.show(getFragmentManager(), "enter_text_dlg"); + } else { + final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); + LayoutInflater inflater = this.getLayoutInflater(); + final View dialogView = inflater.inflate(R.layout.enter_text_activity, null); + TextView dialog_title = (TextView) dialogView.findViewById(R.id.dialog_title); + dialog_title.setText(getString(R.string.enter_the_pfn_title)); + final EditText profile_name = (EditText) dialogView.findViewById(R.id.profile_name_text); + DisplayMetrics metrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(metrics); + dialogView.setMinimumWidth(metrics.widthPixels); + dialogBuilder.setView(dialogView); + dialogBuilder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + profileNameOkClicked(profile_name.getText().toString()); + } + }); + dialogBuilder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + + } + }); + final AlertDialog alertDialog = dialogBuilder.create(); + alertDialog.getWindow().setGravity(Gravity.BOTTOM); + profile_name.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { + + } + + @Override + public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { + if(profile_name.getText().toString().contains("/")) { + profile_name.setError(getResources().getString(R.string.text_field_wrong_characters)); + ((AlertDialog) alertDialog).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false); + } else { + ((AlertDialog) alertDialog).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true); + } + } + + @Override + public void afterTextChanged(Editable editable) { + + } + }); + alertDialog.show(); + + Button dialogButton; + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + customizeDialogStyle(dialogButton, global_prefs, alertDialog); + } + return false; + }; + + @Override + protected void onResume() { + super.onResume(); + profilesAdapter = new ProfileAdapter(this, profilesList); + String package_name = getApplicationContext().getPackageName(); + String profile_path = "/data/data/" + package_name + "/shared_prefs"; + File prefs_directory = new File(profile_path); + File[] prefs_files = prefs_directory.listFiles(); + profilesList.clear(); + profilesArray.clear(); + String file_extension; + Context context = getApplicationContext(); + ListView profilesListView = (ListView) findViewById(R.id.profiles_list); + LinearLayout profilesLinearLayout = (LinearLayout) findViewById(R.id.empty_profiles_list_layout); + try { + for (int i = 0; i < prefs_files.length; i++) { + if(prefs_files[i].getName().substring(0, (int) (prefs_files[i].getName().length() - 4)).startsWith(getApplicationInfo().packageName + "_preferences")) + { + } else { + SharedPreferences prefs = context.getSharedPreferences(prefs_files[i].getName().substring(0, (int) (prefs_files[i].getName().length() - 4)), 0); + file_extension = prefs_files[i].getName().substring((int) (prefs_files[i].getName().length() - 4)); + if (file_extension.contains(".xml") && file_extension.length() == 4) { + profilesList.add(new Profile(prefs_files[i].getName().substring(0, (int) (prefs_files[i].getName().length() - 4)), + prefs.getString("server", ""), prefs.getInt("port", 0), false, false)); + } + } + } + if(prefs_files == null || profilesList.size() == 0) { + profilesListView.setVisibility(View.GONE); + profilesLinearLayout.setVisibility(View.VISIBLE); + } else { + profilesListView.setVisibility(View.VISIBLE); + profilesLinearLayout.setVisibility(View.GONE); + } + ArrayAdapter profilesAdapter2 = new ArrayAdapter(this, + android.R.layout.simple_list_item_1, profilesArray); + profilesListView.setAdapter(profilesAdapter); + } catch(Exception ex) { + ex.printStackTrace(); + } + } + + public void profileNameOkClicked(String profile_name) { + profilesArray.clear(); + profilesList.clear(); + profilesAdapter = new ProfileAdapter(this, profilesList); + String package_name = getApplicationContext().getPackageName(); + String profile_path = "/data/data/" + package_name + "/shared_prefs"; + File prefs_directory = new File(profile_path); + File[] prefs_files = prefs_directory.listFiles(); + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(profile_name, 0); + SharedPreferences.Editor editor = prefs.edit(); + editor.putString("name", profile_name); + editor.putString("auth_method", "Disabled"); + editor.putString("hide_ip", "Disabled"); + editor.putString("quit_message", getString(R.string.default_quit_msg)); + editor.putBoolean("connected", false); + editor.commit(); + Intent intent = new Intent(this, ProfileSettingsActivity.class); + intent.putExtra("profile_name", profile_name); + intent.putExtra("package_name", getApplicationContext().getPackageName()); + startActivity(intent); + } + + public void selectProfile(View v) { + } + + public void connectProfile(int position) { + Context context = getApplicationContext(); + Intent intent = new Intent(context, ThreadActivity.class); + Intent parentIntent = new Intent(); + Profile profile_item = null; + profile_item = (Profile) profilesAdapter.getItem(position); + intent.putExtra("profile_name", profile_item.name); + SharedPreferences prefs = context.getSharedPreferences(profile_item.name, 0); + SharedPreferences.Editor editor = prefs.edit(); + editor.putBoolean("connected", true); + editor.commit(); + SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + if(prefs.getString("nicknames", "").length() > 0) { + if (global_prefs.getBoolean("connected", false) == false) { + editor = global_prefs.edit(); + editor.putBoolean("connected", true); + editor.commit(); + setResult(RESULT_OK, parentIntent); + intent.setAction(Intent.ACTION_MAIN); + intent.addCategory(Intent.CATEGORY_LAUNCHER); + startActivity(intent); + } else { + if(prefs.getBoolean("connected", false)) { + Toast.makeText(getApplicationContext(), getResources().getString(R.string.first_end_session), Toast.LENGTH_LONG).show(); + } + } + finish(); + } else { + Toast.makeText(getApplicationContext(), getResources().getString(R.string.forgot_nicknames), Toast.LENGTH_LONG).show(); + } + } + + public void editProfile(int position) { + Context context = getApplicationContext(); + Intent intent = new Intent(context, ProfileSettingsActivity.class); + Profile profile_item = null; + profile_item = (Profile) profilesAdapter.getItem(position); + intent.putExtra("profile_name", profile_item.name); + intent.putExtra("package_name", getApplicationContext().getPackageName()); + startActivity(intent); + } + + public void deleteProfile(int position) { + profilesAdapter = new ProfileAdapter(this, profilesList); + String package_name = getApplicationContext().getPackageName(); + Profile profile_item = null; + profile_item = (Profile) profilesAdapter.getItem(position); + profilesArray.clear(); + profilesList.clear(); + String profile_path = "/data/data/" + package_name + "/shared_prefs/" + profile_item.name + ".xml"; + File file = new File(profile_path); + file.delete(); + profilesAdapter = new ProfileAdapter(this, profilesList); + package_name = getApplicationContext().getPackageName(); + profile_path = "/data/data/" + package_name + "/shared_prefs"; + File prefs_directory = new File(profile_path); + File[] prefs_files = prefs_directory.listFiles(); + profilesList.clear(); + profilesArray.clear(); + String file_extension; + Context context = getApplicationContext(); + ListView profilesListView = (ListView) findViewById(R.id.profiles_list); + LinearLayout profilesLinearLayout = (LinearLayout) findViewById(R.id.empty_profiles_list_layout); + try { + for (int i = 0; i < prefs_files.length; i++) { + if(prefs_files[i].getName().substring(0, (int) (prefs_files[i].getName().length() - 4)).startsWith(getApplicationInfo().packageName + "_preferences")) + { + } else { + SharedPreferences prefs = context.getSharedPreferences(prefs_files[i].getName().substring(0, (int) (prefs_files[i].getName().length() - 4)), 0); + file_extension = prefs_files[i].getName().substring((int) (prefs_files[i].getName().length() - 4)); + if (file_extension.contains(".xml") && file_extension.length() == 4) { + profilesList.add(new Profile(prefs_files[i].getName().substring(0, (int) (prefs_files[i].getName().length() - 4)), + prefs.getString("server", ""), prefs.getInt("port", 0), false, false)); + } + } + } + if(prefs_files == null || profilesList.size() == 0) { + profilesListView.setVisibility(View.GONE); + profilesLinearLayout.setVisibility(View.VISIBLE); + } else { + profilesListView.setVisibility(View.VISIBLE); + profilesLinearLayout.setVisibility(View.GONE); + } + ArrayAdapter profilesAdapter2 = new ArrayAdapter(this, + android.R.layout.simple_list_item_1, profilesArray); + profilesListView.setAdapter(profilesAdapter); + profilesListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapterView, View view, int i, long l) { + Toast.makeText(getApplicationContext(), ((TextView)view.findViewById(R.id.profile_item_label)).getText(), Toast.LENGTH_LONG).show(); + } + }); + } catch(Exception ex) { + ex.printStackTrace(); + } + } + + public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { + + } + + private void setColorStyle(SharedPreferences global_prefs) { + if (global_prefs.getString("theme", "Light").contains("Light")) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.white_75)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.white_75)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.white_75)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.white)); + } else { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.title_v11_transparent)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + } + } + } else { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.title_v11_transparent)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + } else { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.white_75)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.white_75)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.white_75)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.white)); + } + } + } + } + + private void setCustomTheme(SharedPreferences global_prefs) { + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } + if (global_prefs.getString("theme", "Light").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient_Light); + } else { + setTheme(R.style.IRCClient); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient); + } else { + setTheme(R.style.IRCClient_Light); + } + } + } + + private void customizeDialogStyle(Button dialogButton, SharedPreferences global_prefs, AlertDialog alertDialog) { + if(global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } else { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } else { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } + } + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/CreateItemFragm.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/CreateItemFragm.java new file mode 100644 index 0000000..5802b86 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/CreateItemFragm.java @@ -0,0 +1,46 @@ +package dev.tinelix.irc.android.legacy; + +import android.annotation.TargetApi; +import android.app.Fragment; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.os.Build; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.TextView; + +import java.util.Locale; + +@TargetApi(Build.VERSION_CODES.HONEYCOMB) +public class CreateItemFragm extends Fragment { + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + View view = inflater.inflate(R.layout.create_item, + container, false); + if(global_prefs.getString("theme", "Dark").contains("Light")) { + TextView add_item_label = (TextView) view.findViewById(R.id.add_item_label); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + add_item_label.setTextColor(getResources().getColor(android.R.color.holo_blue_light)); + } else { + add_item_label.setTextColor(getResources().getColor(R.color.orange)); + } + } + Button create_item_button = (Button) view.findViewById(R.id.create_item_button); + create_item_button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + ((ConnectionManagerActivity) getActivity()).showEnterTextDialog(); + } + } + }); + + return view; + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/CreateItemFragm2.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/CreateItemFragm2.java new file mode 100644 index 0000000..5f9f135 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/CreateItemFragm2.java @@ -0,0 +1,44 @@ +package dev.tinelix.irc.android.legacy; + +import android.annotation.SuppressLint; +import android.app.Fragment; +import android.content.SharedPreferences; +import android.os.Build; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.TextView; + +@SuppressLint("NewApi") +public class CreateItemFragm2 extends Fragment { + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + View view = inflater.inflate(R.layout.create_item2, + container, false); + if(global_prefs.getString("theme", "Dark").contains("Light")) { + TextView add_item_label = (TextView) view.findViewById(R.id.add_item_label); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + add_item_label.setTextColor(getResources().getColor(android.R.color.holo_blue_light)); + } else { + add_item_label.setTextColor(getResources().getColor(R.color.orange)); + } + } + Button create_item_button = (Button) view.findViewById(R.id.create_item_button2); + create_item_button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + ((CustomNicknamesActivity) getActivity()).showEnterTextDialog(); + } + } + }); + + return view; + } + +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/CustomNicknamesActivity.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/CustomNicknamesActivity.java new file mode 100644 index 0000000..86d0be3 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/CustomNicknamesActivity.java @@ -0,0 +1,403 @@ +package dev.tinelix.irc.android.legacy; + +import android.app.Activity; +import android.app.AlertDialog; +import android.app.DialogFragment; +import android.content.Context; +import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.graphics.Typeface; +import android.os.Build; +import android.os.Bundle; +import android.preference.Preference; +import android.preference.PreferenceManager; +import android.util.DisplayMetrics; +import android.util.Log; +import android.view.ContextThemeWrapper; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; + +public class CustomNicknamesActivity extends Activity { + + List nicknamesArray = new ArrayList(); + String nicknamesString; + String old_profile_name; + public String current_parameter; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + setCustomTheme(global_prefs); + setContentView(R.layout.custom_nicknames_activity); + setColorStyle(global_prefs); + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + getActionBar().setHomeButtonEnabled(true); + } + getActionBar().setTitle(getResources().getString(R.string.nicknames_manager_title)); + } + current_parameter = "creating_nickname"; + if (savedInstanceState == null) { + Bundle extras = getIntent().getExtras(); + if(extras == null) { + old_profile_name = null; + } else { + old_profile_name = extras.getString("profile_name"); + } + } else { + old_profile_name = (String) savedInstanceState.getSerializable("profile_name"); + }; + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + nicknamesArray = new LinkedList(Arrays.asList(prefs.getString("nicknames", "").split(", "))); + if(nicknamesArray.size() == 1 && nicknamesArray.get(0).length() == 0) { + nicknamesArray.remove(0); + } + ListView nicknamesList = (ListView) findViewById(R.id.nicknames_list); + ArrayAdapter nicknamesAdapter = new ArrayAdapter(this, + android.R.layout.simple_list_item_1, nicknamesArray); + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + LinearLayout add_item_ll = (LinearLayout) findViewById(R.id.create_item_layout2); + add_item_ll.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + showEnterTextDialog(); + } + }); + } + + nicknamesList.setAdapter(nicknamesAdapter); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.nicknames_manager_menu, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + int id = item.getItemId(); + + //noinspection SimplifiableIfStatement + if(id == R.id.add_nickname_item) { + showEnterTextDialog(); + } else if (id == R.id.clear_nicknames_item) { + nicknamesArray.clear(); + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + SharedPreferences.Editor editor = prefs.edit(); + editor.putString("nicknames", ""); + editor.commit(); + ListView nicknamesList = (ListView) findViewById(R.id.nicknames_list); + ArrayAdapter nicknamesAdapter = new ArrayAdapter(this, + android.R.layout.simple_list_item_1, nicknamesArray); + nicknamesList.setAdapter(nicknamesAdapter); + return true; + } + + return super.onOptionsItemSelected(item); + } + + public void onCreatingNicknames(String parameter, String value) { + if(parameter == "creating_nickname") { + StringBuilder nicknames_sb = new StringBuilder(); + if(value.length() > 0) { + + nicknamesArray.add(value); + }; + for (int i = 0; i < nicknamesArray.size(); i++) { + if(i < nicknamesArray.size() - 1 && nicknamesArray.get(i).length() > 0) { + nicknames_sb.append(nicknamesArray.get(i)).append(", "); + } else if(nicknamesArray.get(i).length() > 0) { + nicknames_sb.append(nicknamesArray.get(i)); + } + }; + ListView nicknamesList = (ListView) findViewById(R.id.nicknames_list); + ArrayAdapter nicknamesAdapter = new ArrayAdapter(this, + android.R.layout.simple_list_item_1, nicknamesArray); + nicknamesList.setAdapter(nicknamesAdapter); + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + SharedPreferences.Editor editor = prefs.edit(); + editor.putString("nicknames", nicknames_sb.toString()); + editor.commit(); + } + } + + public String getCurrentParameter() { + return current_parameter; + } + + public boolean showEnterTextDialog() { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + DialogFragment enterTextDialogFragm = new EnterTextDialogFragm3(); + enterTextDialogFragm.show(getFragmentManager(), "enter_text_dlg"); + } else { + AlertDialog.Builder dialogBuilder; + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(CustomNicknamesActivity.this, R.style.IRCClient_Light)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(CustomNicknamesActivity.this, R.style.IRCClient)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(CustomNicknamesActivity.this, R.style.IRCClient)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(CustomNicknamesActivity.this, R.style.IRCClient_Light)); + } + } + LayoutInflater inflater = getLayoutInflater(); + final View dialogView = inflater.inflate(R.layout.enter_text_activity, null); + DisplayMetrics metrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(metrics); + dialogView.setMinimumWidth(metrics.widthPixels); + dialogBuilder.setView(dialogView); + dialogBuilder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + EditText profile_name = (EditText) dialogView.findViewById(R.id.profile_name_text); + onCreatingNicknames(current_parameter, profile_name.getText().toString()); + } + }); + dialogBuilder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + + } + }); + TextView textAreaTitle = (TextView) dialogView.findViewById(R.id.profile_name_label); + textAreaTitle.setText(R.string.your_nickname); + TextView dialog_title = (TextView) dialogView.findViewById(R.id.dialog_title); + dialog_title.setText(getString(R.string.enter_the_nick_title)); + AlertDialog alertDialog = dialogBuilder.create(); + alertDialog.getWindow().setGravity(Gravity.BOTTOM); + alertDialog.show(); + Button dialogButton; + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + customizeDialogStyle(dialogButton, global_prefs, alertDialog); + } + return false; + }; + + private void setColorStyle(SharedPreferences global_prefs) { + if (global_prefs.getString("theme", "Light").contains("Light")) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.white_75)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.white_75)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.white_75)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.white)); + } else { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.title_v11_transparent)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + } + } + } else { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.title_v11_transparent)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + } else { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.white_75)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.white_75)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.white_75)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.white)); + } + } + } + } + + private void setCustomTheme(SharedPreferences global_prefs) { + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getApplicationContext().getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getApplicationContext().getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getApplicationContext().getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getApplicationContext().getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } + if (global_prefs.getString("theme", "Light").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient_Light); + } else { + setTheme(R.style.IRCClient); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient); + } else { + setTheme(R.style.IRCClient_Light); + } + } + } + private void customizeDialogStyle(Button dialogButton, SharedPreferences global_prefs, AlertDialog alertDialog) { + if(global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } else { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } else { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } + } + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/CustomSpinnerAdapter.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/CustomSpinnerAdapter.java new file mode 100644 index 0000000..f250f78 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/CustomSpinnerAdapter.java @@ -0,0 +1,78 @@ +package dev.tinelix.irc.android.legacy; + +import android.content.Context; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.TextView; + +import java.util.ArrayList; + +public class CustomSpinnerAdapter extends BaseAdapter { + Context ctx; + LayoutInflater inflater; + ArrayList objects; + + CustomSpinnerAdapter(Context context, ArrayList products) { + ctx = context; + objects = products; + inflater = (LayoutInflater) ctx + .getSystemService(Context.LAYOUT_INFLATER_SERVICE); + } + + @Override + public int getCount() { + return objects.size(); + } + + @Override + public Object getItem(int position) { + return objects.get(position); + } + + @Override + public long getItemId(int position) { + return position; + } + + CustomSpinnerItem getProfile(int position) { + return ((CustomSpinnerItem) getItem(position)); + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + View view = convertView; + if (view == null) { + view = inflater.inflate(R.layout.custom_spinner_item, parent, false); + } + + CustomSpinnerItem p = getProfile(position); + ((TextView) view.findViewById(R.id.spinner_item_text)).setText(p.name); + TextView item_name = (TextView) view.findViewById(R.id.spinner_item_text); + SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(ctx); + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + item_name.setTextColor(ctx.getResources().getColor(R.color.black)); + } else { + item_name.setTextColor(ctx.getResources().getColor(R.color.white)); + } + } else { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + item_name.setTextColor(ctx.getResources().getColor(R.color.white)); + } else { + item_name.setTextColor(ctx.getResources().getColor(R.color.black)); + } + } + return view; + } + + public class ViewHolder { + public TextView profile_name; + public TextView server; + } + + +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/CustomSpinnerItem.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/CustomSpinnerItem.java new file mode 100644 index 0000000..8da2f6d --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/CustomSpinnerItem.java @@ -0,0 +1,10 @@ +package dev.tinelix.irc.android.legacy; + +public class CustomSpinnerItem { + + String name; + + CustomSpinnerItem(String _describe) { + name = _describe; + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/DebugLogsActivity.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/DebugLogsActivity.java new file mode 100644 index 0000000..ac4bd9d --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/DebugLogsActivity.java @@ -0,0 +1,369 @@ +package dev.tinelix.irc.android.legacy; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.app.Activity; +import android.app.AlertDialog; +import android.app.Fragment; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.PackageManager; +import android.content.res.Configuration; +import android.graphics.Typeface; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Environment; +import android.preference.PreferenceManager; +import android.provider.Settings; +import android.util.Log; +import android.util.TypedValue; +import android.view.MotionEvent; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; +import android.widget.Toast; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStreamReader; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; + +import static android.Manifest.permission.READ_EXTERNAL_STORAGE; +import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE; + +public class DebugLogsActivity extends Activity { + + public EditText debug_log_text; + public String log_text; + + @SuppressLint("ClickableViewAccessibility") + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + setCustomTheme(global_prefs); + setContentView(R.layout.debug_log_activity); + setColorStyle(global_prefs); + try { + Process process = Runtime.getRuntime().exec("logcat -d"); + BufferedReader bufferedReader = new BufferedReader( + new InputStreamReader(process.getInputStream())); + + StringBuilder log = new StringBuilder(); + String line = ""; + while ((line = bufferedReader.readLine()) != null) { + log.append(line + "\r\n"); + } + final EditText debug_log_text = (EditText) findViewById(R.id.debug_log_text); + log_text = log.toString(); + debug_log_text.setText(log_text); + debug_log_text.setKeyListener(null); + debug_log_text.setTypeface(Typeface.MONOSPACE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + debug_log_text.setTextIsSelectable(true); + } + if(global_prefs.getInt("font_size", 0) >= 12) { + debug_log_text.setTextSize(TypedValue.COMPLEX_UNIT_SP, global_prefs.getInt("font_size", 0)); + } + } catch (IOException e) { + // Handle Exception + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + getActionBar().setHomeButtonEnabled(true); + } + Button save_log_btn = (Button) findViewById(R.id.save_log_btn); + save_log_btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + + File directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "Tinelix"); + if (!directory.exists()) { + directory.mkdirs(); + } + + directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Tinelix", "IRC Client"); + if (!directory.exists()) { + directory.mkdirs(); + } + directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Tinelix/IRC Client", "App Logs"); + if (!directory.exists()) { + directory.mkdirs(); + } + + try { + Date dt = new Date(System.currentTimeMillis()); + Log.d("App", "Attempting creating log file..."); + File file = new File(directory, "LOG_" + new SimpleDateFormat("yyyyMMdd_HHmmss").format(dt) + ".log"); + if (!file.exists()) { + file.createNewFile(); + } + Log.d("App", "Log file created!"); + FileWriter writer = new FileWriter(file); + writer.append(log_text); + writer.flush(); + writer.close(); + Toast.makeText(getApplicationContext(), getResources().getString(R.string.saved_log, "Tinelix/IRC Client/App Logs"), Toast.LENGTH_LONG).show(); + } catch (Exception e) { + Log.e("App", "Could not save log to file: " + e.getMessage()); + } + } + }); + } + + private void showMissingPermssionDialog() { + AlertDialog dialog; + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(getResources().getString(R.string.allow_permisssion_in_storage_title)); + builder.setMessage(getResources().getString(R.string.allow_permisssion_in_storage)); + builder.setPositiveButton(getResources().getString(R.string.open_button), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); + Uri uri = Uri.fromParts("package", getPackageName(), null); + intent.setData(uri); + startActivity(intent); + } + }); + builder.setNegativeButton(getResources().getString(R.string.cancel_button), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + return; + } + }); + dialog = builder.create(); + dialog.show(); + } + + private void setCustomTheme(SharedPreferences global_prefs) { + if (global_prefs.getString("language", "OS dependent").contains("Russian")) { + if (global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + config.locale = locale; + config.setLayoutDirection(locale); + } + getApplicationContext().getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + config.locale = locale; + config.setLayoutDirection(locale); + } + getApplicationContext().getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if (global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + config.locale = locale; + config.setLayoutDirection(locale); + } + getApplicationContext().getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + config.locale = locale; + config.setLayoutDirection(locale); + } + getApplicationContext().getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } + if (global_prefs.getString("theme", "Light").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient_Light); + } else { + setTheme(R.style.IRCClient); + } + } else { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient); + } else { + setTheme(R.style.IRCClient_Light); + } + } + } + + private void customizeDialogStyle(Button dialogButton, SharedPreferences global_prefs, AlertDialog alertDialog) { + if(global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } else { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } else { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } + } + } + + private void setColorStyle(SharedPreferences global_prefs) { + if (global_prefs.getString("theme", "Light").contains("Light")) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.white_75)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.white_75)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.white_75)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.white)); + ListView main_menu = (ListView) findViewById(R.id.mainmenu); + debug_log_text = (EditText) findViewById(R.id.debug_log_text); + debug_log_text.setBackgroundColor(getResources().getColor(R.color.white_90)); + } else { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.title_v11_transparent)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + ListView main_menu = (ListView) findViewById(R.id.mainmenu); + debug_log_text = (EditText) findViewById(R.id.debug_log_text); + debug_log_text.setBackgroundColor(getResources().getColor(R.color.gray_v2)); + } + } + } else { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.title_v11_transparent)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + debug_log_text = (EditText) findViewById(R.id.debug_log_text); + debug_log_text.setBackgroundColor(getResources().getColor(R.color.gray_v2)); + } else { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.white_75)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.white_75)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.white_75)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.white)); + debug_log_text = (EditText) findViewById(R.id.debug_log_text); + debug_log_text.setBackgroundColor(getResources().getColor(R.color.white_90)); + } + } + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterPasswordDialogFragm.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterPasswordDialogFragm.java new file mode 100644 index 0000000..3359497 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterPasswordDialogFragm.java @@ -0,0 +1,87 @@ +package dev.tinelix.irc.android.legacy; + +import android.annotation.SuppressLint; +import android.app.AlertDialog; +import android.app.Dialog; +import android.app.DialogFragment; +import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.EditText; + +import java.util.Locale; + +@SuppressLint("NewApi") +public class EnterPasswordDialogFragm extends DialogFragment { + + public String current_parameter; + + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + setLocale(global_prefs); + current_parameter = ((ProfileSettingsActivity) getActivity()).getCurrentParameter(); + String current_value; + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + if(current_parameter == "setting_password") { + LayoutInflater inflater = getActivity().getLayoutInflater(); + final View view = inflater.inflate(R.layout.enter_password_activity, null); + builder.setView(view); + builder.setTitle(R.string.enter_the_password_title); + builder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + EditText profile_name = (EditText) view.findViewById(R.id.password_text); + ((ProfileSettingsActivity) getActivity()).onChangingValues(current_parameter, profile_name.getText().toString()); + } + }); + builder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + return; + } + }); + }; + return builder.create(); + } + + private void setLocale(SharedPreferences global_prefs) { + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterTextDialogFragm.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterTextDialogFragm.java new file mode 100644 index 0000000..b91dc60 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterTextDialogFragm.java @@ -0,0 +1,105 @@ +package dev.tinelix.irc.android.legacy; + +import android.annotation.SuppressLint; +import android.app.AlertDialog; +import android.app.Dialog; +import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.os.Bundle; +import android.app.DialogFragment; +import android.preference.PreferenceManager; +import android.text.Editable; +import android.text.TextWatcher; +import android.view.KeyEvent; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.EditText; +import android.widget.TextView; + +import java.util.Locale; + +@SuppressLint("NewApi") +public class EnterTextDialogFragm extends DialogFragment { + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + setLocale(global_prefs); + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + LayoutInflater inflater = getActivity().getLayoutInflater(); + final View view = inflater.inflate(R.layout.enter_text_activity, null); + final EditText profile_name = (EditText) view.findViewById(R.id.profile_name_text); + profile_name.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { + + } + + @Override + public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { + if(profile_name.getText().toString().contains("/")) { + profile_name.setError(getResources().getString(R.string.text_field_wrong_characters)); + ((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false); + } else { + ((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true); + } + } + + @Override + public void afterTextChanged(Editable editable) { + + } + }); + builder.setView(view); + builder.setTitle(R.string.enter_the_pfn_title); + builder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + ((ConnectionManagerActivity) getActivity()).profileNameOkClicked(profile_name.getText().toString()); + } + }); + builder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + return; + } + }); + return builder.create(); + } + + private void setLocale(SharedPreferences global_prefs) { + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterTextDialogFragm2.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterTextDialogFragm2.java new file mode 100644 index 0000000..3faf38d --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterTextDialogFragm2.java @@ -0,0 +1,227 @@ +package dev.tinelix.irc.android.legacy; + +import android.annotation.SuppressLint; +import android.app.AlertDialog; +import android.app.Dialog; +import android.app.DialogFragment; +import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.text.Editable; +import android.text.TextWatcher; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.EditText; +import android.widget.TextView; + +import java.util.Locale; + +@SuppressLint("NewApi") +public class EnterTextDialogFragm2 extends DialogFragment { + + public String current_parameter; + + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + setLocale(global_prefs); + current_parameter = ((ProfileSettingsActivity) getActivity()).getCurrentParameter(); + String current_value; + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + if(current_parameter == "changing_profile_name") { + current_value = ((ProfileSettingsActivity) getActivity()).getCurrentValue(current_parameter); + LayoutInflater inflater = getActivity().getLayoutInflater(); + final View view = inflater.inflate(R.layout.enter_text_activity, null); + final EditText profile_name = (EditText) view.findViewById(R.id.profile_name_text); + profile_name.setText(current_value); + profile_name.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { + + } + + @Override + public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { + if(profile_name.getText().toString().contains("/")) { + profile_name.setError(getResources().getString(R.string.text_field_wrong_characters)); + ((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false); + } else { + ((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true); + } + } + + @Override + public void afterTextChanged(Editable editable) { + + } + }); + builder.setView(view); + builder.setTitle(R.string.enter_the_pfn_title); + builder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + EditText profile_name = (EditText) view.findViewById(R.id.profile_name_text); + ((ProfileSettingsActivity) getActivity()).onChangingValues(current_parameter, profile_name.getText().toString()); + } + }); + builder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + return; + } + }); + } else if(current_parameter == "changing_auth_method") { + current_value = ((ProfileSettingsActivity) getActivity()).getCurrentValue(current_parameter); + String[] auth_methods = getResources().getStringArray(R.array.auth_method); + builder.setTitle(R.string.auth_method); + if(current_value.contains("NickServ")) { + builder.setSingleChoiceItems(auth_methods, 1, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + String value; + if(item == 0) { + value = "Disabled"; + } else { + value = "NickServ"; + } + ((ProfileSettingsActivity) getActivity()).onChangingValues(current_parameter, value); + } + }); + } else { + builder.setSingleChoiceItems(auth_methods, 0, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + String value; + if(item == 0) { + value = "Disabled"; + } else { + value = "NickServ"; + } + ((ProfileSettingsActivity) getActivity()).onChangingValues(current_parameter, value); + } + }); + } + builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + } + }); + builder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + } + }); + } else if(current_parameter == "changing_realname") { + current_value = ((ProfileSettingsActivity) getActivity()).getCurrentValue(current_parameter); + LayoutInflater inflater = getActivity().getLayoutInflater(); + final View view = inflater.inflate(R.layout.enter_text_activity, null); + builder.setView(view); + builder.setTitle(R.string.enter_the_realname_title); + TextView realname_label = (TextView) view.findViewById(R.id.profile_name_label); + realname_label.setText(R.string.realname); + EditText realname_text = (EditText) view.findViewById(R.id.profile_name_text); + realname_text.setText(current_value); + builder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + EditText profile_name = (EditText) view.findViewById(R.id.profile_name_text); + ((ProfileSettingsActivity) getActivity()).onChangingValues(current_parameter, profile_name.getText().toString()); + } + }); + builder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + return; + } + }); + } else if(current_parameter == "changing_hostname") { + current_value = ((ProfileSettingsActivity) getActivity()).getCurrentValue(current_parameter); + LayoutInflater inflater = getActivity().getLayoutInflater(); + final View view = inflater.inflate(R.layout.enter_text_activity, null); + builder.setView(view); + builder.setTitle(R.string.enter_the_hostname_title); + TextView realname_label = (TextView) view.findViewById(R.id.profile_name_label); + realname_label.setText(R.string.hostname); + EditText realname_text = (EditText) view.findViewById(R.id.profile_name_text); + realname_text.setText(current_value); + builder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + EditText profile_name = (EditText) view.findViewById(R.id.profile_name_text); + ((ProfileSettingsActivity) getActivity()).onChangingValues(current_parameter, profile_name.getText().toString()); + } + }); + builder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + return; + } + }); + } else if(current_parameter == "changing_quitmsg") { + current_value = ((ProfileSettingsActivity) getActivity()).getCurrentValue(current_parameter); + LayoutInflater inflater = getActivity().getLayoutInflater(); + final View view = inflater.inflate(R.layout.enter_text_activity, null); + builder.setView(view); + builder.setTitle(R.string.enter_the_quiting_message); + TextView quitmsgname_label = (TextView) view.findViewById(R.id.profile_name_label); + quitmsgname_label.setText(R.string.quit_message); + EditText quitmsgname_text = (EditText) view.findViewById(R.id.profile_name_text); + quitmsgname_text.setText(current_value); + builder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + EditText profile_name = (EditText) view.findViewById(R.id.profile_name_text); + ((ProfileSettingsActivity) getActivity()).onChangingValues(current_parameter, profile_name.getText().toString()); + } + }); + builder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + return; + } + }); + } + return builder.create(); + } + + private void setLocale(SharedPreferences global_prefs) { + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterTextDialogFragm3.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterTextDialogFragm3.java new file mode 100644 index 0000000..bb01a9a --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/EnterTextDialogFragm3.java @@ -0,0 +1,90 @@ +package dev.tinelix.irc.android.legacy; + +import android.annotation.SuppressLint; +import android.app.AlertDialog; +import android.app.Dialog; +import android.app.DialogFragment; +import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.EditText; +import android.widget.TextView; + +import java.util.Locale; + +@SuppressLint("NewApi") +public class EnterTextDialogFragm3 extends DialogFragment { + + public String current_parameter; + + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + setLocale(global_prefs); + current_parameter = ((CustomNicknamesActivity) getActivity()).getCurrentParameter(); + String current_value; + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + if(current_parameter == "creating_nickname") { + LayoutInflater inflater = getActivity().getLayoutInflater(); + final View view = inflater.inflate(R.layout.enter_text_activity, null); + TextView text_area_title = (TextView) view.findViewById(R.id.profile_name_label); + text_area_title.setText(R.string.your_nickname); + builder.setView(view); + builder.setTitle(R.string.enter_the_nick_title); + builder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + EditText profile_name = (EditText) view.findViewById(R.id.profile_name_text); + ((CustomNicknamesActivity) getActivity()).onCreatingNicknames(current_parameter, profile_name.getText().toString()); + } + }); + builder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + return; + } + }); + }; + return builder.create(); + } + + private void setLocale(SharedPreferences global_prefs) { + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/IRCClientApp.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/IRCClientApp.java new file mode 100644 index 0000000..e95d0ba --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/IRCClientApp.java @@ -0,0 +1,58 @@ +package dev.tinelix.irc.android.legacy; + +import android.app.Application; +import android.content.Context; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; + +import java.io.File; +import java.util.ArrayList; +import java.util.LinkedList; + +public class IRCClientApp extends Application { + ArrayList profilesList = new ArrayList(); + + public String version = "0.4.0 Beta"; + public String build_date = "2022-05-06"; + + @Override + public void onCreate() { + String package_name = getApplicationContext().getPackageName(); + String profile_path = "/data/data/" + package_name + "/shared_prefs"; + File prefs_directory = new File(profile_path); + File[] prefs_files = prefs_directory.listFiles(); + SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + SharedPreferences.Editor editor = global_prefs.edit(); + if(prefs_files != null) { + String file_extension; + Context context = getApplicationContext(); + for (int i = 0; i < prefs_files.length; i++) { + if (prefs_files[i].getName().substring(0, (int) (prefs_files[i].getName().length() - 4)).startsWith(getApplicationInfo().packageName + "_preferences")) { + } else { + SharedPreferences prefs = context.getSharedPreferences(prefs_files[i].getName().substring(0, (int) (prefs_files[i].getName().length() - 4)), 0); + file_extension = prefs_files[i].getName().substring((int) (prefs_files[i].getName().length() - 4)); + if (file_extension.contains(".xml") && file_extension.length() == 4) { + editor = prefs.edit(); + editor.putBoolean("connected", false); + editor.commit(); + } + } + } + } + editor = global_prefs.edit(); + editor.putBoolean("connected", false); + editor.putBoolean("theme_requires_restart", false); + editor.putBoolean("language_requires_restart", false); + if(global_prefs.contains("theme") == false) { + editor.putString("theme", "Dark"); + } + if(global_prefs.contains("language") == false) { + editor.putString("language", "OS dependent"); + } + if(global_prefs.contains("show_msg_timestamps") == false) { + editor.putBoolean("show_msg_timestamps", false); + } + editor.commit(); + super.onCreate(); + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/IRCParser.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/IRCParser.java new file mode 100644 index 0000000..13ec2c4 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/IRCParser.java @@ -0,0 +1,269 @@ +package dev.tinelix.irc.android.legacy; + +import android.app.PendingIntent; +import android.util.Log; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.concurrent.TimeUnit; + +public class IRCParser { + public String parseString(String raw, boolean showTimestamp) { + String[] array = raw.split(" "); + String[] member_msgs_array = array[0].split("!"); + StringBuilder stringBuilder = new StringBuilder(); + String parsed = new String(); + if(raw.startsWith("PING")) { + Log.w("Tinelix IRC Parser", "PING messages ignored."); + parsed = ""; + } else if(array[1].startsWith("372")) { + for(int index = 3; index < array.length; index++) { + if(index == 3) { + stringBuilder.append(array[index].replace(":","")); + } else { + stringBuilder.append(" " + array[index]); + } + } + parsed = "MOTD: " + stringBuilder.toString(); + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } else if(array[1].startsWith("371")) { + for(int index = 3; index < array.length; index++) { + if(index == 3) { + stringBuilder.append(array[index].replace(":","")); + } else { + stringBuilder.append(" " + array[index]); + } + } + parsed = "Info: " + stringBuilder.toString(); + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } else if(array[1].startsWith("671")) { + parsed = array[3] + " using a TLS/SSL connection."; + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } else if(array[1].startsWith("318")) { + Log.w("Tinelix IRC Parser", "Messages with \"318\" code ignored."); + parsed = ""; + } else if(array[1].startsWith("321")) { + Log.w("Tinelix IRC Parser", "Messages with \"321\" code ignored."); + parsed = ""; + } else if(array[1].startsWith("374")) { + Log.w("Tinelix IRC Parser", "Messages with \"374\" code ignored."); + parsed = ""; + } else if(array[1].startsWith("374")) { + Log.w("Tinelix IRC Parser", "Messages with \"374\" code ignored."); + parsed = ""; + } else if(array[1].startsWith("366")) { + Log.w("Tinelix IRC Parser", "Messages with \"366\" code ignored."); + parsed = ""; + } else if(array[1].startsWith("376")) { + Log.w("Tinelix IRC Parser", "Messages with \"376\" code ignored."); + parsed = ""; + } else if(array[1].startsWith("JOIN")) { + parsed = member_msgs_array[0].replace(":", "") + " joined on the " + array[2].replace(":", "") + " channel."; + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } else if(array[1].startsWith("PART")) { + parsed = member_msgs_array[0].replace(":", "") + " left the " + array[2].replace(":", "") + " channel."; + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } else if(array[1].startsWith("QUIT")) { + if(array.length > 3) { + for(int index = 2; index < array.length; index++) { + if(index == 2) { + stringBuilder.append(array[index].substring(1).replace("http//", "http://") + .replace("https//", "https://").replace("ftp//", "ftp://")); + } else { + stringBuilder.append(" " + array[index]); + } + } + parsed = member_msgs_array[0].replace(":", "") + " quited with reason: " + stringBuilder; + } else { + parsed = member_msgs_array[0].replace(":", "") + " quited."; + } + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } else if(array[1].startsWith("PRIVMSG")) { + for(int index = 3; index < array.length; index++) { + if(index == 3) { + stringBuilder.append(array[index].substring(1).replace("http//", "http://") + .replace("https//", "https://").replace("ftp//", "ftp://")); + } else { + stringBuilder.append(" " + array[index]); + } + } + parsed = member_msgs_array[0].replace(":", "") + ": " + stringBuilder.toString(); + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } else if(array[1].startsWith("NOTICE")) { + if(array.length > 4) { + for(int index = 3; index < array.length; index++) { + if(index == 3) { + stringBuilder.append(array[index].substring(1).replace("http//", "http://") + .replace("https//", "https://").replace("ftp//", "ftp://")); + } else { + stringBuilder.append(" " + array[index]); + } + } + parsed = member_msgs_array[0].replace(":", "") + " sent a notification: " + stringBuilder; + } + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } else if(array[1].startsWith("NICK")) { + parsed = member_msgs_array[0].replace(":", "") + " changed nickname to " + array[2].replace(":", ""); + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } else if(array[1].startsWith("353")) { + if(array.length > 5) { + for (int index = 5; index < array.length; index++) { + if (index == 5) { + stringBuilder.append(array[index].substring(1).replace("http//", "http://") + .replace("https//", "https://").replace("ftp//", "ftp://")); + } else { + stringBuilder.append(", " + array[index]); + } + } + parsed = "Members (" + (int)(array.length - 5) + "): " + stringBuilder; + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } + } else if(array[1].startsWith("TOPIC")) { + if(array.length > 3) { + for (int index = 3; index < array.length; index++) { + if (index == 3) { + stringBuilder.append(array[index].substring(1).replace("http//", "http://") + .replace("https//", "https://").replace("ftp//", "ftp://")); + } else { + stringBuilder.append(" " + array[index]); + } + } + parsed = "Topic: " + stringBuilder; + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } + } else if(array[1].startsWith("311")) { + if(array.length > 7) { + for (int index = 7; index < array.length; index++) { + if (index == 7) { + stringBuilder.append(array[index].substring(1).replace("http//", "http://") + .replace("https//", "https://").replace("ftp//", "ftp://")); + } else { + stringBuilder.append(" " + array[index].replace("http//", "http://") + .replace("https//", "https://").replace("ftp//", "ftp://")); + } + } + parsed = array[3] + " (" + array[4] + "@" + array[5] + ")\r\nReal name: " + stringBuilder + "\r\n------------------------------"; + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } + } else if(array[1].startsWith("319")) { + if(array.length > 4) { + for (int index = 4; index < array.length; index++) { + if (index == 4) { + stringBuilder.append(array[index].substring(1).replace("http//", "http://") + .replace("https//", "https://").replace("ftp//", "ftp://")); + } else { + stringBuilder.append(" " + array[index].replace("http//", "http://") + .replace("https//", "https://").replace("ftp//", "ftp://")); + } + } + parsed = "Mutual channels: " + stringBuilder; + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } + } else if(array[1].startsWith("317")) { + if(array.length > 4) { + try { + Date idle_time = new Date(TimeUnit.SECONDS.toMillis(Integer.parseInt(array[4]))); + Date logon_time = new Date(TimeUnit.SECONDS.toMillis(Integer.parseInt(array[5]))); + parsed = new SimpleDateFormat("HH:mm:ss").format(idle_time) + " idle, last logon time - " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(logon_time); + } catch(Exception e) { + e.printStackTrace(); + parsed = ""; + } + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]\r\nDate: " + System.currentTimeMillis()); + } + } else if(array[1].startsWith("MODE")) { + if(array.length > 3) { + for (int index = 3; index < array.length; index++) { + if (index == 3) { + stringBuilder.append(array[index].substring(1).replace("http//", "http://") + .replace("https//", "https://").replace("ftp//", "ftp://")); + } else { + stringBuilder.append(" " + array[index]); + } + } + parsed = "Enabled user modes for " + member_msgs_array[0].substring(1) + ": " + stringBuilder; + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } + } else { + try { + if(array.length > 3) { + for (int index = 3; index < array.length; index++) { + if (index == 3) { + stringBuilder.append(array[index].substring(1).replace("http//", "http://") + .replace("https//", "https://").replace("ftp//", "ftp://")); + } else { + stringBuilder.append(" " + array[index]); + } + } + parsed = "Code " + Integer.parseInt(array[1]) + ": " + stringBuilder.toString(); + } + } catch(NumberFormatException nfe) { + parsed = raw; + } + } + if(showTimestamp == true && parsed.length() > 0 && array[1].startsWith("317") == false && + array[1].startsWith("319") == false && array[1].startsWith("311") == false && array[1].startsWith("TOPIC") == false) { + Date time = new java.util.Date(System.currentTimeMillis()); + parsed = parsed + " (" + new SimpleDateFormat("HH:mm:ss").format(time) + ")"; + } + return parsed; + } + + + + public String getMessageBody(String raw) { + String[] array = raw.split(" "); + String[] member_msgs_array = array[0].split("!"); + StringBuilder stringBuilder = new StringBuilder(); + String parsed = new String(); + if(array[1].startsWith("PRIVMSG")) { + for(int index = 3; index < array.length; index++) { + if(index == 3) { + stringBuilder.append(array[index].substring(1).replace("http//", "http://") + .replace("https//", "https://").replace("ftp//", "ftp://")); + } else { + stringBuilder.append(" " + array[index]); + } + } + parsed = stringBuilder.toString(); + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } else { + parsed = ""; + } + return parsed; + } + + public String getMessageAuthor(String raw) { + String[] array = raw.split(" "); + String[] member_msgs_array = array[0].split("!"); + StringBuilder stringBuilder = new StringBuilder(); + String parsed = new String(); + if(array[1].startsWith("PRIVMSG")) { + parsed = member_msgs_array[0].substring(1); + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } else { + parsed = ""; + } + return parsed; + } + + public String getChannel(String raw) { + String[] array = raw.split(" "); + String[] member_msgs_array = array[0].split("!"); + StringBuilder stringBuilder = new StringBuilder(); + String parsed = new String(); + if(array[1].startsWith("JOIN")) { + parsed = array[2].substring(1); + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } else if(array[1].startsWith("PRIVMSG")) { + parsed = array[2]; + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } else if(array[1].startsWith("PART")) { + parsed = array[2]; + Log.i("Tinelix IRC Parser", "\r\nDone!\r\n\r\nOriginal string: [" + raw + "]\r\nCode: [" + array[1] + "]"); + } else { + parsed = ""; + } + return parsed; + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/MainActivity.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/MainActivity.java new file mode 100644 index 0000000..31fd414 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/MainActivity.java @@ -0,0 +1,233 @@ +package dev.tinelix.irc.android.legacy; + +import android.app.Activity; +import android.content.Context; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.os.Build; +import android.os.Bundle; + +import android.content.Intent; +import android.preference.PreferenceManager; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.view.View; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; + +import java.util.Locale; + +public class MainActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + if(global_prefs.getBoolean("connected", false) == true) { + finish(); + return; + } + setTitle(R.string.app_name); + setCustomTheme(global_prefs); + setContentView(R.layout.activity_main); + setColorStyle(global_prefs); + String[] mainMenu = getResources().getStringArray(R.array.main_menu_array); + ListView mainMenuList = (ListView) findViewById(R.id.mainmenu); + + ArrayAdapter mainMenuAdapter = new ArrayAdapter(this, + android.R.layout.simple_list_item_1, mainMenu); + + mainMenuList.setAdapter(mainMenuAdapter); + + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + ImageButton menu_button = (ImageButton) findViewById(R.id.menu_button); + menu_button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + openOptionsMenu(); + } + }); + } + + mainMenuList.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapterView, View view, int i, long l) { + if(i == 0) { + showConnectionManager(); + } else if(i == 1) { + showMainSettings(); + } else if(i == 2) { + showAboutApplication(); + } else if(i == 3) { + finish(); + System.exit(0); + } + } + }); + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + ImageButton menu_button = (ImageButton) findViewById(R.id.menu_button); + menu_button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + openOptionsMenu(); + } + }); + } + + } + + private void showMainSettings() { + Intent intent = new Intent(this, MainSettingsActivity.class); + startActivity(intent); + } + + private void showAboutApplication() { + Intent intent = new Intent(this, AboutApplicationActivity.class); + startActivity(intent); + } + + private void showConnectionManager() { + Intent intent = new Intent(this, ConnectionManagerActivity.class); + startActivity(intent); + } + + + @Override + public boolean onCreateOptionsMenu(Menu menu) + { + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.main_menu, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + int id = item.getItemId(); + + //noinspection SimplifiableIfStatement + if (id == R.id.about_application_item) { + showAboutApplication(); + } + + return super.onOptionsItemSelected(item); + } + + private void setColorStyle(SharedPreferences global_prefs) { + if (global_prefs.getString("theme", "Light").contains("Light")) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.white_75)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.white_75)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.white_75)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.white)); + ListView main_menu = (ListView) findViewById(R.id.mainmenu); + main_menu.setBackgroundColor(getResources().getColor(R.color.white)); + main_menu.setCacheColorHint(getResources().getColor(R.color.white)); + } else { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.title_v11_transparent)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + ListView main_menu = (ListView) findViewById(R.id.mainmenu); + main_menu.setBackgroundColor(getResources().getColor(R.color.black)); + main_menu.setCacheColorHint(getResources().getColor(R.color.black)); + } + } + } else { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.title_v11_transparent)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + ListView main_menu = (ListView) findViewById(R.id.mainmenu); + main_menu.setBackgroundColor(getResources().getColor(R.color.black)); + main_menu.setCacheColorHint(getResources().getColor(R.color.black)); + } else { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.white_75)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.white_75)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.white_75)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.white)); + ListView main_menu = (ListView) findViewById(R.id.mainmenu); + main_menu.setBackgroundColor(getResources().getColor(R.color.white)); + main_menu.setCacheColorHint(getResources().getColor(R.color.white)); + } + } + } + } + + private void setCustomTheme(SharedPreferences global_prefs) { + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } + if (global_prefs.getString("theme", "Light").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient_Light); + } else { + setTheme(R.style.IRCClient); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient); + } else { + setTheme(R.style.IRCClient_Light); + } + } + } + +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/MainSettingsActivity.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/MainSettingsActivity.java new file mode 100644 index 0000000..bfedb35 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/MainSettingsActivity.java @@ -0,0 +1,773 @@ +package dev.tinelix.irc.android.legacy; + +import android.Manifest; +import android.app.Activity; +import android.app.AlarmManager; +import android.app.AlertDialog; +import android.app.DialogFragment; +import android.app.PendingIntent; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.PackageManager; +import android.content.res.Configuration; +import android.graphics.Typeface; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Environment; +import android.preference.CheckBoxPreference; +import android.preference.Preference; +import android.preference.PreferenceActivity; +import android.preference.PreferenceManager; +import android.provider.Settings; +import android.text.Html; +import android.util.DisplayMetrics; +import android.util.Log; +import android.util.TypedValue; +import android.view.ContextThemeWrapper; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.MenuItem; +import android.view.View; +import android.widget.Button; +import android.widget.CheckBox; +import android.widget.EditText; +import android.widget.SeekBar; +import android.widget.TextView; +import android.widget.Toast; + +import org.w3c.dom.Text; + +import java.io.File; +import java.util.Locale; + +public class MainSettingsActivity extends PreferenceActivity { + + public String package_name; + public String current_parameter; + + @Override + protected void onCreate(Bundle savedInstanceState) { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + setCustomTheme(global_prefs); + setColorStyle(global_prefs); + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.main_settings); + setContentView(R.layout.custom_preferences_layout); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + getActionBar().setHomeButtonEnabled(true); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + getActionBar().setDisplayHomeAsUpEnabled(true); + } else { + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setText(R.string.settings_title); + } + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + final Preference ui_language = findPreference("interface_language"); + ui_language.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(Preference preference) { + setResult(Activity.RESULT_OK); + current_parameter = "setting_language"; + final String current_value; + final String[] value = {new String()}; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + DialogFragment setFontSizeDialogFragm = new SettingsItemsDialogFragm(); + setFontSizeDialogFragm.show(getFragmentManager(), "settings_items"); + } else { + current_value = getCurrentValue(current_parameter); + final String[] languages = getResources().getStringArray(R.array.ui_language); + final String[] requires_reboot_app = getResources().getStringArray(R.array.ui_language_app_restart_toast); + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + final AlertDialog.Builder dialogBuilder; + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(MainSettingsActivity.this, R.style.IRCClient_Light)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(MainSettingsActivity.this, R.style.IRCClient)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(MainSettingsActivity.this, R.style.IRCClient)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(MainSettingsActivity.this, R.style.IRCClient_Light)); + } + } + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder.setTitle(Html.fromHtml("" + getString(R.string.interface_language_item) + "")); + } else { + dialogBuilder.setTitle(Html.fromHtml("" + getString(R.string.interface_language_item) + "")); + } + } else { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder.setTitle(Html.fromHtml("" + getString(R.string.interface_language_item) + "")); + } else { + dialogBuilder.setTitle(Html.fromHtml("" + getString(R.string.interface_language_item) + "")); + } + } + if(current_value.contains("OS dependent")) { + dialogBuilder.setSingleChoiceItems(languages, 0, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + if(item == 0) { + value[0] = "OS dependent"; + } else if(item == 1) { + value[0] = "English"; + } else { + value[0] = "Russian"; + } + } + }); + } else if(current_value.contains("English")) { + dialogBuilder.setSingleChoiceItems(languages, 1, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + if(item == 0) { + value[0] = "OS dependent"; + } else if(item == 1) { + value[0] = "English"; + } else { + value[0] = "Russian"; + } + } + }); + } else { + dialogBuilder.setSingleChoiceItems(languages, 2, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + if(item == 0) { + value[0] = "OS dependent"; + } else if(item == 1) { + value[0] = "English"; + } else { + value[0] = "Russian"; + } + } + }); + } + dialogBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + onChangingValues(current_parameter, value[0]); + SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + if(global_prefs.getBoolean("connected", false) == false) { + Intent mainActivity = new Intent(getApplicationContext(), this.getClass()); + int pendingIntentId = 1; + PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), pendingIntentId, mainActivity, PendingIntent.FLAG_CANCEL_CURRENT); + AlarmManager mgr = (AlarmManager) getApplicationContext().getSystemService(Context.ALARM_SERVICE); + mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, pendingIntent); + System.exit(0); + } else { + if(current_value.contains("Russian")) { + Toast.makeText(getApplicationContext(), requires_reboot_app[1], Toast.LENGTH_LONG).show(); + } else { + Toast.makeText(getApplicationContext(), requires_reboot_app[0], Toast.LENGTH_LONG).show(); + } + } + } + }); + dialogBuilder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + } + }); + AlertDialog alertDialog = dialogBuilder.create(); + alertDialog.getWindow().setGravity(Gravity.BOTTOM); + + alertDialog.show(); + Button dialogButton; + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + customizeDialogStyle(dialogButton, global_prefs, alertDialog); + } + return true; + } + }); + String[] languages = getResources().getStringArray(R.array.ui_language); + if (global_prefs.getBoolean("language_requires_restart", false) == false) { + if (global_prefs.getString("language", "OS dependent").contains("English")) { + ui_language.setSummary(languages[1]); + } else if (global_prefs.getString("language", "OS dependent").contains("Russian")) { + ui_language.setSummary(languages[2]); + } else { + ui_language.setSummary(languages[0]); + } + } else { + ui_language.setSummary(R.string.need_to_restart); + ui_language.setEnabled(false); + } + final Preference app_theme = findPreference("interface_theme"); + final String[] value = {new String()}; + app_theme.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(Preference preference) { + setResult(Activity.RESULT_OK); + current_parameter = "setting_theme"; + final String current_value; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + DialogFragment setFontSizeDialogFragm = new SettingsItemsDialogFragm(); + setFontSizeDialogFragm.show(getFragmentManager(), "settings_items"); + } else { + current_value = getCurrentValue(current_parameter); + final String[] requires_reboot_app = getResources().getStringArray(R.array.ui_language_app_restart_toast); + final String[] themes = getResources().getStringArray(R.array.themes); + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + final AlertDialog.Builder dialogBuilder; + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(MainSettingsActivity.this, R.style.IRCClient_Light)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(MainSettingsActivity.this, R.style.IRCClient)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(MainSettingsActivity.this, R.style.IRCClient)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(MainSettingsActivity.this, R.style.IRCClient_Light)); + } + } + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder.setTitle(Html.fromHtml("" + getString(R.string.interface_theme_item) + "")); + } else { + dialogBuilder.setTitle(Html.fromHtml("" + getString(R.string.interface_theme_item) + "")); + } + } else { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder.setTitle(Html.fromHtml("" + getString(R.string.interface_theme_item) + "")); + } else { + dialogBuilder.setTitle(Html.fromHtml("" + getString(R.string.interface_theme_item) + "")); + } + } + if(current_value.contains("Light")) { + dialogBuilder.setSingleChoiceItems(themes, 1, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + if(item == 0) { + value[0] = "Dark"; + } else { + value[0] = "Light"; + } + } + }); + } else { + dialogBuilder.setSingleChoiceItems(themes, 0, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + if(item == 0) { + value[0] = "Dark"; + } else { + value[0] = "Light"; + } + } + }); + } + dialogBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + onChangingValues(current_parameter, value[0]); + if(global_prefs.getBoolean("connected", false) == false) { + Intent mainActivity = new Intent(getApplicationContext(), this.getClass()); + int pendingIntentId = 1; + PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), pendingIntentId, mainActivity, PendingIntent.FLAG_CANCEL_CURRENT); + AlarmManager mgr = (AlarmManager) getApplicationContext().getSystemService(Context.ALARM_SERVICE); + mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, pendingIntent); + System.exit(0); + } else { + if(current_value.contains("Russian")) { + Toast.makeText(getApplicationContext(), requires_reboot_app[0], Toast.LENGTH_LONG).show(); + } else { + Toast.makeText(getApplicationContext(), requires_reboot_app[1], Toast.LENGTH_LONG).show(); + } + } + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + if (global_prefs.getString("theme", "Dark").contains("Light")) { + app_theme.setSummary(themes[1]); + } else { + app_theme.setSummary(themes[0]); + } + } else { + app_theme.setSummary(R.string.need_to_restart); + app_theme.setEnabled(false); + } + } + }); + dialogBuilder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + } + }); + AlertDialog alertDialog = dialogBuilder.create(); + alertDialog.getWindow().setGravity(Gravity.BOTTOM); + + alertDialog.show(); + Button dialogButton; + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + customizeDialogStyle(dialogButton, global_prefs, alertDialog); + } + return true; + } + }); + String[] themes = getResources().getStringArray(R.array.themes); + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + if (global_prefs.getString("theme", "Dark").contains("Light")) { + app_theme.setSummary(themes[1]); + } else { + app_theme.setSummary(themes[0]); + } + } else { + app_theme.setSummary(R.string.need_to_restart); + app_theme.setEnabled(false); + } + + Preference setFontSizePref = findPreference("font_size"); + setFontSizePref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(Preference preference) { + setResult(Activity.RESULT_OK); + current_parameter = "setting_fontsize"; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + DialogFragment setFontSizeDialogFragm = new SetFontSizeDialogFragm(); + setFontSizeDialogFragm.show(getFragmentManager(), "set_font_size"); + } else { + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + final AlertDialog.Builder dialogBuilder; + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(MainSettingsActivity.this, R.style.IRCClient_Light)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(MainSettingsActivity.this, R.style.IRCClient)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(MainSettingsActivity.this, R.style.IRCClient)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(MainSettingsActivity.this, R.style.IRCClient_Light)); + } + } + LayoutInflater inflater = getLayoutInflater(); + final View dialogView = inflater.inflate(R.layout.set_font_size_activity, null); + DisplayMetrics metrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(metrics); + dialogView.setMinimumWidth(metrics.widthPixels); + final SeekBar font_size_seekbar = (SeekBar) dialogView.findViewById(R.id.font_size_seekbar); + final EditText preview_text = (EditText) dialogView.findViewById(R.id.preview_text); + final TextView value_label = (TextView) dialogView.findViewById(R.id.value_label); + dialogBuilder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + SharedPreferences.Editor editor = prefs.edit(); + editor.putInt("font_size", font_size_seekbar.getProgress() + 12); + editor.commit(); + } + }); + dialogBuilder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + return; + } + }); + preview_text.setKeyListener(null); + font_size_seekbar.setMax((60 - 12) / 1); + font_size_seekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { + @Override + public void onProgressChanged(SeekBar seekBar, int i, boolean b) { + preview_text.setTextSize(TypedValue.COMPLEX_UNIT_SP, i + 12); + value_label.setText(getString(R.string.value_in_px, i + 12)); + } + + @Override + public void onStartTrackingTouch(SeekBar seekBar) { + + } + + @Override + public void onStopTrackingTouch(SeekBar seekBar) { + + } + }); + if(prefs.getInt("font_size", 0) < 12) { + float text_size_in_sp = (int) preview_text.getTextSize() / getResources().getDisplayMetrics().scaledDensity; + font_size_seekbar.setProgress((int) text_size_in_sp - 12); + value_label.setText(getString(R.string.value_in_px, (int)text_size_in_sp)); + preview_text.setTextSize(TypedValue.COMPLEX_UNIT_SP, text_size_in_sp); + } else { + font_size_seekbar.setProgress(prefs.getInt("font_size", 0) - 12); + value_label.setText(getString(R.string.value_in_px, prefs.getInt("font_size", 0))); + preview_text.setTextSize(TypedValue.COMPLEX_UNIT_SP, prefs.getInt("font_size", 0)); + } + TextView dialog_title = (TextView) dialogView.findViewById(R.id.dialog_title); + dialog_title.setText(getString(R.string.changing_font_label)); + dialogBuilder.setView(dialogView); + AlertDialog alertDialog = dialogBuilder.create(); + alertDialog.getWindow().setGravity(Gravity.BOTTOM); + + alertDialog.show(); + Button dialogButton; + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + customizeDialogStyle(dialogButton, global_prefs, alertDialog); + } + return true; + } + }); + setFontSizePref.setSummary(getString(R.string.value_in_px, prefs.getInt("font_size", 18))); + + final CheckBoxPreference save_msg_history = (CheckBoxPreference) findPreference("save_msg_history"); + + save_msg_history.setChecked(global_prefs.getBoolean("save_msg_history", false)); + + File directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath()); + if (!directory.canWrite() && !directory.canRead()) { + save_msg_history.setChecked(false); + onChangingBooleanValues("setting_saving_msg_history", false); + save_msg_history.setEnabled(false); + save_msg_history.setSummary(R.string.device_memory_restricted); + } + + save_msg_history.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(Preference preference) { + if(save_msg_history.isChecked() == true) { + save_msg_history.setSummary(getResources().getString(R.string.saved_messages_history, "Tinelix/IRC Client/Messages Logs")); + } + + current_parameter = "setting_saving_msg_history"; + onChangingBooleanValues(current_parameter, save_msg_history.isChecked()); + return false; + } + }); + Preference debug_logs = findPreference("debug_logs"); + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + debug_logs.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(Preference preference) { + showDebugLogsActivity(); + return false; + } + }); + } + } + + @Override + protected void onResume() { + CheckBoxPreference save_msg_history = (CheckBoxPreference) findPreference("save_msg_history"); + SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(MainSettingsActivity.this); + File directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath()); + if (!directory.canWrite() && !directory.canRead()) { + save_msg_history.setChecked(false); + save_msg_history.setEnabled(false); + save_msg_history.setSummary(R.string.device_memory_restricted); + } else { + save_msg_history.setChecked(global_prefs.getBoolean("save_msg_history", false)); + save_msg_history.setSummary(getResources().getString(R.string.saved_messages_history, "Tinelix/IRC Client/Messages Logs")); + } + super.onResume(); + } + + private void showMissingPermssionDialog() { + AlertDialog dialog; + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(getResources().getString(R.string.allow_permisssion_in_storage_title)); + builder.setMessage(getResources().getString(R.string.allow_permisssion_in_storage)); + builder.setPositiveButton(getResources().getString(R.string.open_button), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); + Uri uri = Uri.fromParts("package", getPackageName(), null); + intent.setData(uri); + startActivity(intent); + } + }); + builder.setNegativeButton(getResources().getString(R.string.cancel_button), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + CheckBoxPreference save_msg_history = (CheckBoxPreference) findPreference("save_msg_history"); + save_msg_history.setChecked(false); + onChangingBooleanValues(current_parameter, save_msg_history.isChecked()); + return; + } + }); + dialog = builder.create(); + dialog.show(); + } + + private void showDebugLogsActivity() { + Intent intent = new Intent(this, DebugLogsActivity.class); + startActivity(intent); + } + + public String getCurrentParameter() { + return current_parameter; + } + + public String getCurrentValue(String current_parameter) { + String value; + if(current_parameter == "setting_language") { + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + value = prefs.getString("language", "OS dependent"); + } else if(current_parameter == "setting_theme") { + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + value = prefs.getString("theme", "Dark"); + } else { + value = ""; + } + return value; + } + + public void onChangingValues(String current_parameter, String value) { + if(current_parameter == "setting_language") { + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + SharedPreferences.Editor editor = prefs.edit(); + editor.putString("language", value); + editor.putBoolean("language_requires_restart", true); + editor.commit(); + Preference ui_language = findPreference("interface_language"); + final String[] languages = getResources().getStringArray(R.array.ui_language); + if(prefs.getBoolean("language_requires_restart", false) == false) { + if (prefs.getString("language", "OS dependent").contains("English")) { + ui_language.setSummary(languages[1]); + } else if (prefs.getString("language", "OS dependent").contains("Russian")) { + ui_language.setSummary(languages[2]); + } else { + ui_language.setSummary(languages[0]); + } + } else { + ui_language.setSummary(R.string.need_to_restart); + ui_language.setEnabled(false); + } + } else if(current_parameter == "setting_theme") { + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + SharedPreferences.Editor editor = prefs.edit(); + editor.putString("theme", value); + editor.putBoolean("theme_requires_restart", true); + editor.commit(); + Preference theme = findPreference("interface_theme"); + final String[] themes = getResources().getStringArray(R.array.themes); + if(prefs.getBoolean("theme_requires_restart", false) == false) { + if (prefs.getString("theme", "Dark").contains("Light")) { + theme.setSummary(themes[1]); + } else { + theme.setSummary(themes[0]); + } + } else { + theme.setSummary(R.string.need_to_restart); + theme.setEnabled(false); + } + } + } + + private void onChangingBooleanValues(String current_parameter, boolean value) { + if(current_parameter == "setting_saving_msg_history") { + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + SharedPreferences.Editor editor = prefs.edit(); + editor.putBoolean("save_msg_history", value); + editor.commit(); + } + } + + public void showDebugLogActivity() { + Intent intent = new Intent(this, ConnectionManagerActivity.class); + startActivity(intent); + } + + public void setColorStyle(SharedPreferences global_prefs) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + getListView().setBackgroundColor(getResources().getColor(R.color.white)); + getListView().setCacheColorHint(getResources().getColor(R.color.white)); + } else { + getListView().setBackgroundColor(getResources().getColor(R.color.black)); + getListView().setCacheColorHint(getResources().getColor(R.color.black)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + getListView().setBackgroundColor(getResources().getColor(R.color.black)); + getListView().setCacheColorHint(getResources().getColor(R.color.black)); + } else { + getListView().setBackgroundColor(getResources().getColor(R.color.white)); + getListView().setCacheColorHint(getResources().getColor(R.color.white)); + } + } + } + } + + private void setCustomTheme(SharedPreferences global_prefs) { + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } + if (global_prefs.getString("theme", "Light").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient_Light); + } else { + setTheme(R.style.IRCClient); + } + } else { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient); + } else { + setTheme(R.style.IRCClient_Light); + } + } + } + + private void customizeDialogStyle(Button dialogButton, SharedPreferences global_prefs, AlertDialog alertDialog) { + if(global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } else { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } else { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } + } + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + if(id == android.R.id.home) { + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) { + onBackPressed(); + } else { + finish(); + } + } + return super.onOptionsItemSelected(item); + } + +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/NotificationActivity.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/NotificationActivity.java new file mode 100644 index 0000000..582ad3a --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/NotificationActivity.java @@ -0,0 +1,52 @@ +package dev.tinelix.irc.android.legacy; + +import android.app.Activity; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.os.Bundle; +import android.preference.PreferenceManager; + +import java.util.Locale; + +public class NotificationActivity extends Activity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } + setContentView(R.layout.notification_activity); + } + +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/Profile.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/Profile.java new file mode 100644 index 0000000..89de209 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/Profile.java @@ -0,0 +1,18 @@ +package dev.tinelix.irc.android.legacy; + +public class Profile { + + String name; + String server; + int port; + boolean isConnected; + boolean isSelected; + + Profile(String _describe, String _server, int _port, boolean _isConnected, boolean _isSelected) { + name = _describe; + server = _server; + port = _port; + isConnected = _isConnected; + isSelected = _isSelected; + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/ProfileAdapter.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/ProfileAdapter.java new file mode 100644 index 0000000..d46f2af --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/ProfileAdapter.java @@ -0,0 +1,144 @@ +package dev.tinelix.irc.android.legacy; + +import android.content.Context; +import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.Button; +import android.widget.CheckBox; +import android.widget.EditText; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.ListView; +import android.widget.TextView; +import android.app.Activity; +import android.widget.Toast; + +import java.util.ArrayList; + +public class ProfileAdapter extends BaseAdapter { + Context ctx; + LayoutInflater inflater; + ArrayList objects; + + ProfileAdapter(Context context, ArrayList products) { + ctx = context; + objects = products; + inflater = (LayoutInflater) ctx + .getSystemService(Context.LAYOUT_INFLATER_SERVICE); + } + + @Override + public int getCount() { + return objects.size(); + } + + @Override + public Object getItem(int position) { + return objects.get(position); + } + + @Override + public long getItemId(int position) { + return position; + } + + Profile getProfile(int position) { + return ((Profile) getItem(position)); + } + + @Override + public View getView(final int position, View convertView, final ViewGroup parent) { + View view = convertView; + if (view == null) { + view = inflater.inflate(R.layout.profile_item, parent, false); + } + + Profile p = getProfile(position); + ((TextView) view.findViewById(R.id.profile_item_label)).setText(p.name); + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(view.getContext()); + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + ((TextView) view.findViewById(R.id.profile_item_label)).setTextColor(view.getResources().getColor(R.color.black)); + } else { + ((TextView) view.findViewById(R.id.profile_item_label)).setTextColor(view.getResources().getColor(R.color.white)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + ((TextView) view.findViewById(R.id.profile_item_label)).setTextColor(view.getResources().getColor(R.color.white)); + } else { + ((TextView) view.findViewById(R.id.profile_item_label)).setTextColor(view.getResources().getColor(R.color.black)); + } + } + SharedPreferences prefs = view.getContext().getSharedPreferences(p.name, 0); + if(prefs.getBoolean("connected", false) == true) { + view.findViewById(R.id.state_indicator).setVisibility(View.VISIBLE); + ImageButton edit_btn = (ImageButton) view.findViewById(R.id.edit_btn); + edit_btn.setVisibility(View.GONE); + ImageButton delete_btn = (ImageButton) view.findViewById(R.id.delete_btn); + delete_btn.setVisibility(View.GONE); + } else { + view.findViewById(R.id.state_indicator).setVisibility(View.GONE); + } + ((TextView) view.findViewById(R.id.profile_server_label)).setText(p.server + ":" + p.port); + ImageButton edit_btn = (ImageButton) view.findViewById(R.id.edit_btn); + edit_btn.setTag(position); + edit_btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + for (int pos = 0; pos < getCount(); pos++) { + if(pos == position) { + ((Profile) getItem(pos)).isSelected = true; + ((ConnectionManagerActivity) ctx).editProfile(pos); + } else { + ((Profile) getItem(pos)).isSelected = false; + } + } + } + }); + ImageButton delete_btn = (ImageButton) view.findViewById(R.id.delete_btn); + delete_btn.setTag(position); + delete_btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + for (int pos = 0; pos < getCount(); pos++) { + if(pos == position) { + ((Profile) getItem(pos)).isSelected = true; + ((ConnectionManagerActivity) ctx).deleteProfile(pos); + } else { + ((Profile) getItem(pos)).isSelected = false; + } + } + } + }); + ImageButton connect_btn = (ImageButton) view.findViewById(R.id.connect_btn); + connect_btn.setTag(position); + connect_btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + for (int pos = 0; pos < getCount(); pos++) { + if(pos == position) { + ((Profile) getItem(pos)).isSelected = true; + ((Profile) getItem(pos)).isConnected = true; + ((ConnectionManagerActivity) ctx).connectProfile(pos); + } else { + ((Profile) getItem(pos)).isSelected = false; + } + } + } + }); + return view; + } + + public class ViewHolder { + public TextView profile_name; + public TextView server; + } + + +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/ProfileSettingsActivity.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/ProfileSettingsActivity.java new file mode 100644 index 0000000..de1148d --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/ProfileSettingsActivity.java @@ -0,0 +1,1100 @@ +package dev.tinelix.irc.android.legacy; + +import android.app.Activity; +import android.app.AlertDialog; +import android.app.DialogFragment; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.graphics.Typeface; +import android.os.Build; +import android.os.Bundle; +import android.preference.Preference; +import android.preference.PreferenceActivity; +import android.preference.PreferenceManager; +import android.text.Editable; +import android.text.Html; +import android.text.TextWatcher; +import android.util.DisplayMetrics; +import android.util.Log; +import android.view.ContextThemeWrapper; +import android.view.Gravity; +import android.view.KeyEvent; +import android.view.LayoutInflater; +import android.view.MenuItem; +import android.view.View; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.CheckBox; +import android.widget.EditText; +import android.widget.Spinner; +import android.widget.TextView; +import android.widget.Toast; + +import org.w3c.dom.Text; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; + +public class ProfileSettingsActivity extends PreferenceActivity +{ + public String old_profile_name; + public String package_name; + public String current_parameter; + public String auth_method_string; + public String server_name; + public int server_port; + public String realname_string; + public String hostname_string; + public String quitmsg_string; + + @Override + protected void onCreate(Bundle savedInstanceState) + { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + setCustomTheme(global_prefs); + setColorStyle(global_prefs); + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.profile_settings); + setContentView(R.layout.custom_preferences_layout); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + getActionBar().setHomeButtonEnabled(true); + getActionBar().setTitle(getResources().getString(R.string.connection_manager_title)); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + getActionBar().setDisplayHomeAsUpEnabled(true); + } else { + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setText(R.string.connection_manager_title); + } + + if (savedInstanceState == null) { + Bundle extras = getIntent().getExtras(); + if(extras == null) { + old_profile_name = null; + package_name = null; + } else { + old_profile_name = extras.getString("profile_name"); + package_name = extras.getString("package_name"); + } + } else { + old_profile_name = (String) savedInstanceState.getSerializable("profile_name"); + package_name = (String) savedInstanceState.getSerializable("package_name"); + } + final Preference prof_name = (Preference) findPreference("prof_name"); + prof_name.setSummary(old_profile_name); + prof_name.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() + { + public boolean onPreferenceClick(Preference pref) + { + setResult(Activity.RESULT_OK); + current_parameter = "changing_profile_name"; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + DialogFragment enterTextDialogFragm = new EnterTextDialogFragm2(); + enterTextDialogFragm.show(getFragmentManager(), "enter_text_dlg"); + } else { + final AlertDialog.Builder dialogBuilder; + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient_Light)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient_Light)); + } + } + String old_profile_name = getCurrentValue(current_parameter); + LayoutInflater inflater = getLayoutInflater(); + final View dialogView = inflater.inflate(R.layout.enter_text_activity, null); + final EditText profile_name = (EditText) dialogView.findViewById(R.id.profile_name_text); + profile_name.setText(old_profile_name); + DisplayMetrics metrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(metrics); + dialogView.setMinimumWidth(metrics.widthPixels); + dialogBuilder.setView(dialogView); + dialogBuilder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + EditText profile_name = (EditText) dialogView.findViewById(R.id.profile_name_text); + onChangingValues(current_parameter, profile_name.getText().toString()); + } + }); + dialogBuilder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + + } + }); + TextView dialog_title = (TextView) dialogView.findViewById(R.id.dialog_title); + dialog_title.setText(getString(R.string.enter_the_pfn_title)); + final AlertDialog alertDialog = dialogBuilder.create(); + profile_name.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { + + } + + @Override + public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { + if(profile_name.getText().toString().contains("/")) { + profile_name.setError(getResources().getString(R.string.text_field_wrong_characters)); + alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false); + } else { + alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true); + } + } + + @Override + public void afterTextChanged(Editable editable) { + + } + }); + alertDialog.getWindow().setGravity(Gravity.BOTTOM); + alertDialog.show(); + Button dialogButton = null; + customizeDialogStyle(dialogButton, global_prefs, alertDialog); + } + return true; + } + }); + Preference auth_method = (Preference) findPreference("auth_method"); + auth_method.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() + { + public boolean onPreferenceClick(Preference pref) + { + setResult(Activity.RESULT_OK); + current_parameter = "changing_auth_method"; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + DialogFragment enterTextDialogFragm = new EnterTextDialogFragm2(); + enterTextDialogFragm.show(getFragmentManager(), "enter_text_dlg"); + } else { + final AlertDialog.Builder dialogBuilder; + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient_Light)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient_Light)); + } + } + String current_value = getCurrentValue(current_parameter); + String[] auth_methods = getResources().getStringArray(R.array.auth_method); + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder.setTitle(Html.fromHtml("" + getString(R.string.auth_method) + "")); + } else { + dialogBuilder.setTitle(Html.fromHtml("" + getString(R.string.auth_method) + "")); + } + } else { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder.setTitle(Html.fromHtml("" + getString(R.string.auth_method) + "")); + } else { + dialogBuilder.setTitle(Html.fromHtml("" + getString(R.string.auth_method) + "")); + } + } + if(current_value.contains("NickServ")) { + dialogBuilder.setSingleChoiceItems(auth_methods, 1, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + String value; + if(item == 0) { + value = "Disabled"; + } else { + value = "NickServ"; + } + onChangingValues(current_parameter, value); + } + }); + } else { + dialogBuilder.setSingleChoiceItems(auth_methods, 0, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + String value; + if(item == 0) { + value = "Disabled"; + } else { + value = "NickServ"; + } + onChangingValues(current_parameter, value); + } + }); + } + dialogBuilder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + } + }); + dialogBuilder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + + } + }); + AlertDialog alertDialog = dialogBuilder.create(); + alertDialog.getWindow().setGravity(Gravity.BOTTOM); + alertDialog.show(); + Button dialogButton = null; + customizeDialogStyle(dialogButton, global_prefs, alertDialog); + } + return true; + } + }); + Preference nicknames = (Preference) findPreference("nicknames"); + nicknames.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() + { + public boolean onPreferenceClick(Preference pref) + { + showNicknamesActivity(old_profile_name); + return true; + } + }); + Preference password = (Preference) findPreference("password"); + password.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() + { + public boolean onPreferenceClick(Preference pref) + { + setResult(Activity.RESULT_OK); + current_parameter = "setting_password"; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + DialogFragment enterPasswordDialogFragm = new EnterPasswordDialogFragm(); + enterPasswordDialogFragm.show(getFragmentManager(), "enter_password_dlg"); + } else { + final AlertDialog.Builder dialogBuilder; + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient_Light)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient_Light)); + } + } + LayoutInflater inflater = getLayoutInflater(); + final View dialogView = inflater.inflate(R.layout.enter_password_activity, null); + DisplayMetrics metrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(metrics); + dialogView.setMinimumWidth(metrics.widthPixels); + dialogBuilder.setView(dialogView); + dialogBuilder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + EditText profile_name = (EditText) dialogView.findViewById(R.id.password_text); + onChangingValues(current_parameter, profile_name.getText().toString()); + } + }); + + dialogBuilder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + + } + }); + TextView dialog_title = (TextView) dialogView.findViewById(R.id.dialog_title); + dialog_title.setText(getString(R.string.enter_the_password_title)); + AlertDialog alertDialog = dialogBuilder.create(); + alertDialog.getWindow().setGravity(Gravity.BOTTOM); + alertDialog.show(); + Button dialogButton = null; + customizeDialogStyle(dialogButton, global_prefs, alertDialog); + } + return true; + } + }); + Preference server_settings = (Preference) findPreference("server_settings"); + server_settings.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() + { + public boolean onPreferenceClick(Preference pref) + { + setResult(Activity.RESULT_OK); + current_parameter = "setting_server"; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + DialogFragment serverSettingsDialogFragm = new ServerSettingsDialogFragm(); + serverSettingsDialogFragm.show(getFragmentManager(), "server_settings_dlg"); + } else { + final AlertDialog.Builder dialogBuilder; + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient_Light)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient_Light)); + } + } + LayoutInflater inflater = getLayoutInflater(); + final View dialogView = inflater.inflate(R.layout.enter_server_activity, null); + DisplayMetrics metrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(metrics); + dialogView.setMinimumWidth(metrics.widthPixels); + dialogBuilder.setView(dialogView); + final Spinner encoding_spinner = (Spinner) dialogView.findViewById(R.id.encoding_spinner); + final EditText server_name = (EditText) dialogView.findViewById(R.id.server_text); + final EditText port_number = (EditText) dialogView.findViewById(R.id.port_numb); + final CheckBox hide_ip_cb = (CheckBox) dialogView.findViewById(R.id.hide_ip_checkbox); + final CheckBox force_ssl_cb = (CheckBox) dialogView.findViewById(R.id.force_ssl_checkbox); + dialogBuilder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + String[] encoding_array = getResources().getStringArray(R.array.encoding_array); + String encoding = new String(); + String force_ssl = new String(); + if(encoding_spinner.getSelectedItemPosition() == 0) { + encoding = "utf-8"; + } else if(encoding_spinner.getSelectedItemPosition() == 1) { + encoding = "cp866"; + } else if(encoding_spinner.getSelectedItemPosition() == 2) { + encoding = "windows-1251"; + } else if(encoding_spinner.getSelectedItemPosition() == 3) { + encoding = "koi8_r"; + } else if(encoding_spinner.getSelectedItemPosition() == 4) { + encoding = "koi8_u"; + }; + String hide_ip = new String(); + if(hide_ip_cb.isChecked() == true) { + hide_ip = "Enabled"; + } else { + hide_ip = "Disabled"; + } + if(force_ssl_cb.isChecked() == true) { + force_ssl = "Enabled"; + } else { + force_ssl = "Disabled"; + } + onSettingServer(server_name.getText().toString(), + port_number.getText().toString(), encoding, hide_ip, force_ssl); + } + }); + dialogBuilder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + + } + }); + + String[] encoding_array = getResources().getStringArray(R.array.encoding_array); + String server_parameter = new String(); + String current_value = new String(); + server_parameter = "changing_server"; + current_value = getCurrentValue(server_parameter); + final EditText server_text = (EditText) dialogView.findViewById(R.id.server_text); + server_text.setText(current_value); + server_parameter = "changing_port"; + current_value = getCurrentValue(server_parameter); + EditText port_numb = (EditText) dialogView.findViewById(R.id.port_numb); + port_numb.setText(current_value); + server_parameter = "changing_encoding"; + current_value = getCurrentValue(server_parameter); + if(current_value.contains("utf-8")) { + encoding_spinner.setSelection(0); + } else if(current_value.contains("cp866")) { + encoding_spinner.setSelection(1); + } else if(current_value.contains("windows-1251")) { + encoding_spinner.setSelection(2); + } else if(current_value.contains("koi8_r")) { + encoding_spinner.setSelection(3); + } else if(current_value.contains("koi8_u")) { + encoding_spinner.setSelection(4); + } + + server_parameter = "hide_ip"; + current_value = getCurrentValue(server_parameter); + if(current_value.contains("Disabled")) { + hide_ip_cb.setChecked(false); + } else { + hide_ip_cb.setChecked(true); + } + + server_parameter = "force_ssl"; + current_value = getCurrentValue(server_parameter); + if(current_value.contains("Disabled")) { + force_ssl_cb.setChecked(false); + } else { + force_ssl_cb.setChecked(true); + } + + customizeServerSettingsDialog(global_prefs, dialogView); + TextView dialog_title = (TextView) dialogView.findViewById(R.id.dialog_title); + dialog_title.setText(getString(R.string.server_settings)); + Spinner spinner = (Spinner) dialogView.findViewById(R.id.encoding_spinner); + + ArrayList spinnerArray = new ArrayList(); + spinnerArray.clear(); + for (int i = 0; i < 5; i++) { + spinnerArray.add(new CustomSpinnerItem(getResources().getStringArray(R.array.encoding_array)[i])); + } + CustomSpinnerAdapter customSpinnerAdapter = new CustomSpinnerAdapter(dialogView.getContext(), spinnerArray); + spinner.setAdapter(customSpinnerAdapter); + final AlertDialog alertDialog = dialogBuilder.create(); + server_text.addTextChangedListener(new TextWatcher() { + + public void afterTextChanged(Editable s) { } + + public void beforeTextChanged(CharSequence s, int start, int count, int after) {} + + public void onTextChanged(CharSequence s, int start, int before, int count) { + if(server_text.getText().toString().contains(":")) { + server_text.setError(getResources().getString(R.string.text_field_wrong_characters)); + ((AlertDialog) alertDialog).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false); + } else { + ((AlertDialog) alertDialog).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true); + } + } + }); + alertDialog.getWindow().setGravity(Gravity.BOTTOM); + alertDialog.show(); + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + server_name.setTextColor(getResources().getColor(R.color.black)); + port_number.setTextColor(getResources().getColor(R.color.black)); + } else { + server_name.setTextColor(getResources().getColor(R.color.white)); + port_number.setTextColor(getResources().getColor(R.color.white)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + server_name.setTextColor(getResources().getColor(R.color.white)); + port_number.setTextColor(getResources().getColor(R.color.white)); + } else { + server_name.setTextColor(getResources().getColor(R.color.black)); + port_number.setTextColor(getResources().getColor(R.color.black)); + } + } + if(getResources().getDisplayMetrics().density == 0.75) { + server_name.setPadding(6, 0, 6, 0); + port_number.setPadding(6, 0, 6, 0); + } else { + server_name.setPadding(12, 0, 12, 0); + port_number.setPadding(12, 0, 12, 0); + } + Button dialogButton = null; + customizeDialogStyle(dialogButton, global_prefs, alertDialog); + } + return true; + } + }); + Preference realname = (Preference) findPreference("realname"); + realname.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() + { + public boolean onPreferenceClick(Preference pref) + { + setResult(Activity.RESULT_OK); + current_parameter = "changing_realname"; + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + realname_string = prefs.getString("realname", ""); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + DialogFragment enterTextDialogFragm = new EnterTextDialogFragm2(); + enterTextDialogFragm.show(getFragmentManager(), "enter_text_dlg"); + } else { + final AlertDialog.Builder dialogBuilder; + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient_Light)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient_Light)); + } + } + LayoutInflater inflater = getLayoutInflater(); + final View dialogView = inflater.inflate(R.layout.enter_text_activity, null); + DisplayMetrics metrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(metrics); + dialogView.setMinimumWidth(metrics.widthPixels); + dialogBuilder.setView(dialogView); + dialogBuilder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + EditText profile_name = (EditText) dialogView.findViewById(R.id.profile_name_text); + onChangingValues(current_parameter, profile_name.getText().toString()); + } + }); + dialogBuilder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + + } + }); + TextView textAreaTitle = (TextView) dialogView.findViewById(R.id.profile_name_label); + TextView dialog_title = (TextView) dialogView.findViewById(R.id.dialog_title); + EditText dialog_value = (EditText) dialogView.findViewById(R.id.profile_name_text); + dialog_value.setText(realname_string); + dialog_title.setText(getString(R.string.enter_the_realname_title)); + AlertDialog alertDialog = dialogBuilder.create(); + alertDialog.getWindow().setGravity(Gravity.BOTTOM); + alertDialog.show(); + Button dialogButton = null; + customizeDialogStyle(dialogButton, global_prefs, alertDialog); + } + return true; + } + }); + Preference hostname = (Preference) findPreference("hostname"); + hostname.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() + { + public boolean onPreferenceClick(Preference pref) + { + setResult(Activity.RESULT_OK); + current_parameter = "changing_hostname"; + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + hostname_string = prefs.getString("hostname", ""); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + DialogFragment enterTextDialogFragm = new EnterTextDialogFragm2(); + enterTextDialogFragm.show(getFragmentManager(), "enter_text_dlg"); + } else { + final AlertDialog.Builder dialogBuilder; + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient_Light)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient_Light)); + } + } + LayoutInflater inflater = getLayoutInflater(); + final View dialogView = inflater.inflate(R.layout.enter_text_activity, null); + DisplayMetrics metrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(metrics); + dialogView.setMinimumWidth(metrics.widthPixels); + dialogBuilder.setView(dialogView); + dialogBuilder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + EditText profile_name = (EditText) dialogView.findViewById(R.id.profile_name_text); + onChangingValues(current_parameter, profile_name.getText().toString()); + } + }); + dialogBuilder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + + } + }); + TextView textAreaTitle = (TextView) dialogView.findViewById(R.id.profile_name_label); + textAreaTitle.setText(R.string.hostname); + TextView dialog_title = (TextView) dialogView.findViewById(R.id.dialog_title); + dialog_title.setText(getString(R.string.enter_the_hostname_title)); + EditText dialog_value = (EditText) dialogView.findViewById(R.id.profile_name_text); + dialog_value.setText(hostname_string); + AlertDialog alertDialog = dialogBuilder.create(); + alertDialog.getWindow().setGravity(Gravity.BOTTOM); + alertDialog.show(); + Button dialogButton = null; + customizeDialogStyle(dialogButton, global_prefs, alertDialog); + } + return true; + } + }); + Preference quit_msg = (Preference) findPreference("quit_message"); + quit_msg.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() + { + public boolean onPreferenceClick(Preference pref) + { + setResult(Activity.RESULT_OK); + current_parameter = "changing_quitmsg"; + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + quitmsg_string = prefs.getString("quit_message", ""); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + DialogFragment enterTextDialogFragm = new EnterTextDialogFragm2(); + enterTextDialogFragm.show(getFragmentManager(), "enter_text_dlg"); + } else { + final AlertDialog.Builder dialogBuilder; + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient_Light)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient)); + } else { + dialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(ProfileSettingsActivity.this, R.style.IRCClient_Light)); + } + } + LayoutInflater inflater = getLayoutInflater(); + final View dialogView = inflater.inflate(R.layout.enter_text_activity, null); + DisplayMetrics metrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(metrics); + dialogView.setMinimumWidth(metrics.widthPixels); + dialogBuilder.setView(dialogView); + dialogBuilder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + EditText profile_name = (EditText) dialogView.findViewById(R.id.profile_name_text); + onChangingValues(current_parameter, profile_name.getText().toString()); + } + }); + dialogBuilder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + + } + }); + TextView textAreaTitle = (TextView) dialogView.findViewById(R.id.profile_name_label); + textAreaTitle.setText(R.string.quit_message); + TextView dialog_title = (TextView) dialogView.findViewById(R.id.dialog_title); + dialog_title.setText(getString(R.string.enter_the_quiting_message)); + EditText dialog_value = (EditText) dialogView.findViewById(R.id.profile_name_text); + dialog_value.setText(quitmsg_string); + AlertDialog alertDialog = dialogBuilder.create(); + alertDialog.getWindow().setGravity(Gravity.BOTTOM); + alertDialog.show(); + Button dialogButton = null; + customizeDialogStyle(dialogButton, global_prefs, alertDialog); + } + return true; + } + }); + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + auth_method_string = prefs.getString("auth_method", ""); + if(auth_method_string.contains("NickServ")) { + auth_method.setSummary("NickServ"); + password.setEnabled(true); + } else { + String[] auth_methods = getResources().getStringArray(R.array.auth_method); + auth_method.setSummary(auth_methods[0]); + password.setEnabled(false); + }; + server_name = prefs.getString("server", ""); + server_port = prefs.getInt("port", 0); + if(server_name.length() > 0 && server_port > 0) { + server_settings.setSummary(server_name + ":" + Integer.toString(server_port)); + }; + realname_string = prefs.getString("realname", ""); + hostname_string = prefs.getString("hostname", ""); + quitmsg_string = prefs.getString("quit_message", ""); + realname.setSummary(realname_string); + hostname.setSummary(hostname_string); + quit_msg.setSummary(quitmsg_string); + } + + private void customizeServerSettingsDialog(SharedPreferences global_prefs, View dialogView) { + EditText server_name = (EditText) dialogView.findViewById(R.id.server_text); + EditText port_edit = (EditText) dialogView.findViewById(R.id.port_numb); + Spinner spinner = (Spinner) dialogView.findViewById(R.id.encoding_spinner); + + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + server_name.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_textarea_light)); + server_name.setTextColor(getResources().getColor(R.color.black)); + server_name.setTextAppearance(ProfileSettingsActivity.this, R.style.IRCClient_Light_TextArea); + } else { + server_name.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_textarea)); + server_name.setTextColor(getResources().getColor(R.color.white)); + server_name.setTextAppearance(ProfileSettingsActivity.this, R.style.IRCClient_TextArea); + } + } else { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + server_name.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_textarea)); + server_name.setTextColor(getResources().getColor(R.color.white)); + server_name.setTextAppearance(ProfileSettingsActivity.this, R.style.IRCClient_TextArea); + } else { + server_name.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_textarea_light)); + server_name.setTextColor(getResources().getColor(R.color.black)); + server_name.setTextAppearance(ProfileSettingsActivity.this, R.style.IRCClient_Light_TextArea); + } + } + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + port_edit.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_textarea_light)); + port_edit.setTextColor(getResources().getColor(R.color.black)); + port_edit.setTextAppearance(ProfileSettingsActivity.this, R.style.IRCClient_Light_TextArea); + } else { + port_edit.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_textarea)); + port_edit.setTextColor(getResources().getColor(R.color.white)); + port_edit.setTextAppearance(ProfileSettingsActivity.this, R.style.IRCClient_TextArea); + } + } else { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + port_edit.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_textarea)); + port_edit.setTextColor(getResources().getColor(R.color.white)); + port_edit.setTextAppearance(ProfileSettingsActivity.this, R.style.IRCClient_TextArea); + } else { + port_edit.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_textarea_light)); + port_edit.setTextColor(getResources().getColor(R.color.black)); + port_edit.setTextAppearance(ProfileSettingsActivity.this, R.style.IRCClient_Light_TextArea); + } + } + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + spinner.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_spinner_light)); + } else { + spinner.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_spinner)); + } + } else { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + spinner.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_spinner)); + } else { + spinner.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_spinner_light)); + } + } + } + + private void setCustomTheme(SharedPreferences global_prefs) { + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } + if (global_prefs.getString("theme", "Light").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient_Light); + } else { + setTheme(R.style.IRCClient); + } + } else { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient); + } else { + setTheme(R.style.IRCClient_Light); + } + } + } + + private void customizeDialogStyle(Button dialogButton, SharedPreferences global_prefs, AlertDialog alertDialog) { + if(global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } else { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } else { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } + } + } + + private void showNicknamesActivity(String profile_name) { + Intent intent = new Intent(this, CustomNicknamesActivity.class); + intent.putExtra("profile_name", profile_name); + startActivity(intent); + } + + public void onChangingValues(String parameter, String value) { + Preference prof_name = (Preference) findPreference("prof_name"); + Preference nicknames = (Preference) findPreference("nicknames"); + if (parameter == "changing_profile_name") { + Context context = getApplicationContext(); + String profile_path = "/data/data/" + package_name + "/shared_prefs/" + old_profile_name + ".xml"; + File file = new File(profile_path); + file.delete(); + SharedPreferences prefs = context.getSharedPreferences(value, 0); + SharedPreferences.Editor editor = prefs.edit(); + editor.putString("name", value); + editor.commit(); + old_profile_name = value; + prof_name.setSummary(old_profile_name); + } else if(parameter == "changing_auth_method") { + Preference auth_method = (Preference) findPreference("auth_method"); + Preference password = (Preference) findPreference("password"); + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + SharedPreferences.Editor editor = prefs.edit(); + String[] auth_methods = getResources().getStringArray(R.array.auth_method); + editor.putString("auth_method", value); + if(value == "Disabled") { + auth_method.setSummary(auth_methods[0]); + password.setEnabled(false); + } else { + auth_method.setSummary(value); + password.setEnabled(true); + } + editor.commit(); + } else if (parameter == "changing_nicknames") { + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + SharedPreferences.Editor editor = prefs.edit(); + editor.putString("nicknames", value); + editor.commit(); + nicknames.setSummary(value); + } else if (parameter == "setting_password") { + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + SharedPreferences.Editor editor = prefs.edit(); + editor.putString("password", value); + editor.commit(); + } else if (parameter == "changing_realname") { + Preference realname = (Preference) findPreference("realname"); + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + SharedPreferences.Editor editor = prefs.edit(); + editor.putString("realname", value); + editor.commit(); + realname.setSummary(value); + } else if (parameter == "changing_hostname") { + Preference hostname = (Preference) findPreference("hostname"); + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + SharedPreferences.Editor editor = prefs.edit(); + editor.putString("hostname", value); + editor.commit(); + hostname.setSummary(value); + } else if (parameter == "changing_quitmsg") { + Preference quit_msg = (Preference) findPreference("quit_message"); + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + SharedPreferences.Editor editor = prefs.edit(); + editor.putString("quit_message", value); + editor.commit(); + quit_msg.setSummary(value); + } + } + + public String getCurrentParameter() { + return current_parameter; + } + + public String getCurrentValue(String parameter) { + String value; + if(parameter == "changing_profile_name") { + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + value = old_profile_name; + } else if(parameter == "changing_auth_method") { + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + value = prefs.getString("auth_method", ""); + } else if(parameter == "changing_realname") { + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + value = prefs.getString("realname", ""); + } else if(parameter == "changing_hostname") { + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + value = prefs.getString("hostname", ""); + } else if(parameter == "changing_server") { + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + value = prefs.getString("server", ""); + } else if(parameter == "changing_port") { + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + value = "" + prefs.getInt("port", 0); + } else if(parameter == "changing_encoding") { + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + value = prefs.getString("encoding", ""); + } else if(parameter == "hide_ip") { + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + value = prefs.getString("hide_ip", ""); + } else if(parameter == "force_ssl") { + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + value = prefs.getString("force_ssl", ""); + } else if(parameter == "changing_quitmsg") { + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + value = prefs.getString("quit_message", ""); + } else { + value = ""; + }; + return value; + } + + public void onSettingServer(String server, String port, String encoding, String hide_ip, String force_ssl) { + Preference server_settings = (Preference) findPreference("server_settings"); + Context context = getApplicationContext(); + SharedPreferences prefs = context.getSharedPreferences(old_profile_name, 0); + SharedPreferences.Editor editor = prefs.edit(); + editor.putString("server", server); + editor.putInt("port", Integer.parseInt(port)); + if(server.length() > 0 && port.length() > 0) { + server_settings.setSummary(server + ":" + port); + } + editor.putString("encoding", encoding); + editor.putString("hide_ip", hide_ip); + editor.putString("force_ssl", force_ssl); + editor.commit(); + } + + public void setColorStyle(SharedPreferences global_prefs) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + getListView().setBackgroundColor(getResources().getColor(R.color.white)); + getListView().setCacheColorHint(getResources().getColor(R.color.white)); + } else { + getListView().setBackgroundColor(getResources().getColor(R.color.black)); + getListView().setCacheColorHint(getResources().getColor(R.color.black)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + getListView().setBackgroundColor(getResources().getColor(R.color.black)); + getListView().setCacheColorHint(getResources().getColor(R.color.black)); + } else { + getListView().setBackgroundColor(getResources().getColor(R.color.white)); + getListView().setCacheColorHint(getResources().getColor(R.color.white)); + } + } + } + } + + + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) { + if(id == android.R.id.home) { + onBackPressed(); + } + } + return super.onOptionsItemSelected(item); + } +} \ No newline at end of file diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/ServerSettingsDialogFragm.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/ServerSettingsDialogFragm.java new file mode 100644 index 0000000..654ea60 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/ServerSettingsDialogFragm.java @@ -0,0 +1,196 @@ +package dev.tinelix.irc.android.legacy; + +import android.annotation.SuppressLint; +import android.app.AlertDialog; +import android.app.Dialog; +import android.app.DialogFragment; +import android.content.Context; +import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.graphics.Color; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.text.Editable; +import android.text.Html; +import android.text.SpannableStringBuilder; +import android.text.TextWatcher; +import android.text.method.KeyListener; +import android.text.style.ForegroundColorSpan; +import android.util.Log; +import android.view.KeyEvent; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.ArrayAdapter; +import android.widget.CheckBox; +import android.widget.EditText; +import android.widget.Spinner; +import android.widget.TextView; + +import java.util.Locale; + +@SuppressLint("NewApi") +public class ServerSettingsDialogFragm extends DialogFragment { + + public String current_parameter; + + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + setLocale(global_prefs); + current_parameter = ((ProfileSettingsActivity) getActivity()).getCurrentParameter(); + String current_value; + String server_parameter; + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + if(current_parameter == "setting_server") { + LayoutInflater inflater = getActivity().getLayoutInflater(); + final View view = inflater.inflate(R.layout.enter_server_activity, null); + final Spinner encoding_spinner = (Spinner) view.findViewById(R.id.encoding_spinner); + Context context = view.getContext(); + ArrayAdapter adapter = + ArrayAdapter.createFromResource(context, R.array.encoding_array, + android.R.layout.simple_spinner_item); + adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + encoding_spinner.setAdapter(adapter); + builder.setView(view); + builder.setTitle(R.string.server_settings); + builder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + EditText server_name = (EditText) view.findViewById(R.id.server_text); + EditText port_number = (EditText) view.findViewById(R.id.port_numb); + CheckBox hide_ip_cb = (CheckBox) view.findViewById(R.id.hide_ip_checkbox); + CheckBox force_ssl_cb = (CheckBox) view.findViewById(R.id.force_ssl_checkbox); + String[] encoding_array = getResources().getStringArray(R.array.encoding_array); + String encoding = new String(); + String force_ssl = new String(); + if(encoding_spinner.getSelectedItemPosition() == 0) { + encoding = "utf-8"; + } else if(encoding_spinner.getSelectedItemPosition() == 1) { + encoding = "cp866"; + } else if(encoding_spinner.getSelectedItemPosition() == 2) { + encoding = "windows-1251"; + } else if(encoding_spinner.getSelectedItemPosition() == 3) { + encoding = "koi8_r"; + } else if(encoding_spinner.getSelectedItemPosition() == 4) { + encoding = "koi8_u"; + }; + String hide_ip = new String(); + if(hide_ip_cb.isChecked() == true) { + hide_ip = "Enabled"; + } else { + hide_ip = "Disabled"; + } + if(force_ssl_cb.isChecked() == true) { + force_ssl = "Enabled"; + } else { + force_ssl = "Disabled"; + } + ((ProfileSettingsActivity) getActivity()).onSettingServer(server_name.getText().toString(), + port_number.getText().toString(), encoding, hide_ip, force_ssl); + } + }); + builder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + return; + } + }); + String[] encoding_array = getResources().getStringArray(R.array.encoding_array); + server_parameter = "changing_server"; + current_value = ((ProfileSettingsActivity) getActivity()).getCurrentValue(server_parameter); + final EditText server_text = (EditText) view.findViewById(R.id.server_text); + server_text.setText(current_value); + server_text.addTextChangedListener(new TextWatcher() { + + public void afterTextChanged(Editable s) { } + + public void beforeTextChanged(CharSequence s, int start, int count, int after) {} + + public void onTextChanged(CharSequence s, int start, int before, int count) { + if(s.toString().contains(":")) { + server_text.setError(getResources().getString(R.string.text_field_wrong_characters)); + ((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false); + } else { + ((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true); + } + } + }); + server_parameter = "changing_port"; + current_value = ((ProfileSettingsActivity) getActivity()).getCurrentValue(server_parameter); + EditText port_numb = (EditText) view.findViewById(R.id.port_numb); + port_numb.setText(current_value); + ArrayAdapter encoding_adapter = + ArrayAdapter.createFromResource(view.getContext(), R.array.encoding_array, + android.R.layout.simple_spinner_item); + encoding_spinner.setAdapter(encoding_adapter); + server_parameter = "changing_encoding"; + current_value = ((ProfileSettingsActivity) getActivity()).getCurrentValue(server_parameter); + if(current_value.contains("utf-8")) { + encoding_spinner.setSelection(0); + } else if(current_value.contains("cp866")) { + encoding_spinner.setSelection(1); + } else if(current_value.contains("windows-1251")) { + encoding_spinner.setSelection(2); + } else if(current_value.contains("koi8_r")) { + encoding_spinner.setSelection(3); + } else if(current_value.contains("koi8_u")) { + encoding_spinner.setSelection(4); + } + server_parameter = "hide_ip"; + current_value = ((ProfileSettingsActivity) getActivity()).getCurrentValue(server_parameter); + CheckBox hide_ip_cb = (CheckBox) view.findViewById(R.id.hide_ip_checkbox); + if(current_value.contains("Disabled")) { + hide_ip_cb.setChecked(false); + } else { + hide_ip_cb.setChecked(true); + } + + server_parameter = "force_ssl"; + current_value = ((ProfileSettingsActivity) getActivity()).getCurrentValue(server_parameter); + CheckBox force_ssl_cb = (CheckBox) view.findViewById(R.id.force_ssl_checkbox); + if(current_value.contains("Disabled")) { + force_ssl_cb.setChecked(false); + } else { + force_ssl_cb.setChecked(true); + } + }; + return builder.create(); + } + + private void setLocale(SharedPreferences global_prefs) { + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/SetFontSizeDialogFragm.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/SetFontSizeDialogFragm.java new file mode 100644 index 0000000..3682b55 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/SetFontSizeDialogFragm.java @@ -0,0 +1,138 @@ +package dev.tinelix.irc.android.legacy; + +import android.annotation.SuppressLint; +import android.app.AlertDialog; +import android.app.Dialog; +import android.app.DialogFragment; +import android.content.Context; +import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.os.Build; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.util.Log; +import android.util.TypedValue; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.EditText; +import android.widget.SeekBar; +import android.widget.TextView; + +import java.util.Locale; + +@SuppressLint("NewApi") +public class SetFontSizeDialogFragm extends DialogFragment { + public String current_parameter; + + public Dialog onCreateDialog(Bundle savedInstanceState) { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + setLocale(global_prefs); + current_parameter = ((MainSettingsActivity) getActivity()).getCurrentParameter(); + String current_value; + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + if(current_parameter == "setting_fontsize") { + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + LayoutInflater inflater = getActivity().getLayoutInflater(); + final View view = inflater.inflate(R.layout.set_font_size_activity, null); + final SeekBar font_size_seekbar = (SeekBar) view.findViewById(R.id.font_size_seekbar); + final EditText preview_text = (EditText) view.findViewById(R.id.preview_text); + final TextView value_label = (TextView) view.findViewById(R.id.value_label); + if(global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + preview_text.setTextColor(getResources().getColor(R.color.black)); + } else { + preview_text.setTextColor(getResources().getColor(R.color.white)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + preview_text.setTextColor(getResources().getColor(R.color.white)); + } else { + preview_text.setTextColor(getResources().getColor(R.color.black)); + } + } + builder.setView(view); + builder.setTitle(R.string.changing_font_label); + builder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + SharedPreferences.Editor editor = prefs.edit(); + editor.putInt("font_size", font_size_seekbar.getProgress() + 12); + editor.commit(); + } + }); + builder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + return; + } + }); + preview_text.setKeyListener(null); + font_size_seekbar.setMax((60 - 12) / 1); + font_size_seekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { + @Override + public void onProgressChanged(SeekBar seekBar, int i, boolean b) { + preview_text.setTextSize(TypedValue.COMPLEX_UNIT_SP, i + 12); + value_label.setText(getString(R.string.value_in_px, i + 12)); + } + + @Override + public void onStartTrackingTouch(SeekBar seekBar) { + + } + + @Override + public void onStopTrackingTouch(SeekBar seekBar) { + + } + }); + if(prefs.getInt("font_size", 0) < 12) { + float text_size_in_sp = (int) preview_text.getTextSize() / getResources().getDisplayMetrics().scaledDensity; + font_size_seekbar.setProgress((int) text_size_in_sp - 12); + value_label.setText(getString(R.string.value_in_px, (int)text_size_in_sp)); + preview_text.setTextSize(TypedValue.COMPLEX_UNIT_SP, text_size_in_sp); + } else { + font_size_seekbar.setProgress(prefs.getInt("font_size", 0) - 12); + value_label.setText(getString(R.string.value_in_px, prefs.getInt("font_size", 0))); + preview_text.setTextSize(TypedValue.COMPLEX_UNIT_SP, prefs.getInt("font_size", 0)); + } + }; + return builder.create(); + } + + private void setLocale(SharedPreferences global_prefs) { + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/SettingsItemsDialogFragm.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/SettingsItemsDialogFragm.java new file mode 100644 index 0000000..6dfbe12 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/SettingsItemsDialogFragm.java @@ -0,0 +1,203 @@ +package dev.tinelix.irc.android.legacy; + +import android.annotation.SuppressLint; +import android.app.AlarmManager; +import android.app.AlertDialog; +import android.app.Dialog; +import android.app.DialogFragment; +import android.app.PendingIntent; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.os.Build; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.view.ContextThemeWrapper; +import android.widget.Toast; + +import java.util.Locale; + +@SuppressLint("NewApi") +public class SettingsItemsDialogFragm extends DialogFragment { + public String current_parameter; + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + current_parameter = ((MainSettingsActivity) getActivity()).getCurrentParameter(); + final String current_value; + final String[] value = new String[1]; + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + if(current_parameter == "setting_language") { + current_value = ((MainSettingsActivity) getActivity()).getCurrentValue(current_parameter); + final String[] languages = getResources().getStringArray(R.array.ui_language); + builder.setTitle(R.string.interface_language_item); + if(current_value.contains("OS dependent")) { + builder.setSingleChoiceItems(languages, 0, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + if(item == 0) { + value[0] = "OS dependent"; + } else if(item == 1) { + value[0] = "English"; + } else { + value[0] = "Russian"; + } + } + }); + } else if(current_value.contains("English")) { + builder.setSingleChoiceItems(languages, 1, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + if(item == 0) { + value[0] = "OS dependent"; + } else if(item == 1) { + value[0] = "English"; + } else { + value[0] = "Russian"; + } + } + }); + } else { + builder.setSingleChoiceItems(languages, 2, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + if(item == 0) { + value[0] = "OS dependent"; + } else if(item == 1) { + value[0] = "English"; + } else { + value[0] = "Russian"; + } + } + }); + } + builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + ((MainSettingsActivity) getActivity()).onChangingValues(current_parameter, value[0]); + SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + final String[] requires_reboot_app = getResources().getStringArray(R.array.ui_language_app_restart_toast); + if(global_prefs.getBoolean("connected", false) == false) { + Intent mainActivity = new Intent(getActivity(), this.getClass()); + int pendingIntentId = 1; + PendingIntent pendingIntent; + pendingIntent = PendingIntent.getActivity(getActivity(), pendingIntentId, mainActivity, PendingIntent.FLAG_CANCEL_CURRENT); + AlarmManager mgr = (AlarmManager) getActivity().getSystemService(Context.ALARM_SERVICE); + mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, pendingIntent); + System.exit(0); + } else { + if(current_value.contains("Russian")) { + Toast.makeText(getActivity(), requires_reboot_app[1], Toast.LENGTH_LONG).show(); + } else { + Toast.makeText(getActivity(), requires_reboot_app[0], Toast.LENGTH_LONG).show(); + } + } + } + }); + builder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + } + }); + } else if(current_parameter == "setting_theme") { + current_value = ((MainSettingsActivity) getActivity()).getCurrentValue(current_parameter); + String[] themes = getResources().getStringArray(R.array.themes); + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + builder.setTitle(getString(R.string.interface_theme_item)); + if(current_value.contains("Dark")) { + builder.setSingleChoiceItems(themes, 0, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + if(item == 0) { + value[0] = "Dark"; + } else { + value[0] = "Light"; + } + } + }); + } else { + builder.setSingleChoiceItems(themes, 1, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + if(item == 0) { + value[0] = "Dark"; + } else { + value[0] = "Light"; + } + } + }); + } + builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + ((MainSettingsActivity) getActivity()).onChangingValues(current_parameter, value[0]); + SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + final String[] requires_reboot_app = getResources().getStringArray(R.array.ui_language_app_restart_toast); + if(global_prefs.getBoolean("connected", false) == false) { + Intent mainActivity = new Intent(getActivity(), this.getClass()); + int pendingIntentId = 1; + PendingIntent pendingIntent; + pendingIntent = PendingIntent.getActivity(getActivity(), pendingIntentId, mainActivity, PendingIntent.FLAG_CANCEL_CURRENT); + AlarmManager mgr = (AlarmManager) getActivity().getSystemService(Context.ALARM_SERVICE); + mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, pendingIntent); + System.exit(0); + } else { + if(current_value.contains("Russian")) { + Toast.makeText(getActivity(), requires_reboot_app[0], Toast.LENGTH_LONG).show(); + } else { + Toast.makeText(getActivity(), requires_reboot_app[1], Toast.LENGTH_LONG).show(); + } + } + } + }); + builder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + } + }); + } + return builder.create(); + } + + private void setLocale(SharedPreferences global_prefs) { + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } + } +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/StatisticsFragm.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/StatisticsFragm.java new file mode 100644 index 0000000..5a15e5f --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/StatisticsFragm.java @@ -0,0 +1,207 @@ +package dev.tinelix.irc.android.legacy; + +import android.annotation.SuppressLint; +import android.app.AlertDialog; +import android.app.Dialog; +import android.app.DialogFragment; +import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.content.res.Configuration; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.preference.PreferenceManager; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.EditText; +import android.widget.TextView; + +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.util.Locale; +import java.util.Timer; +import java.util.TimerTask; + +@SuppressLint("NewApi") +public class StatisticsFragm extends DialogFragment { + public int sended_bytes; + public int received_bytes; + public int total_bytes; + public Timer statsTimer; + public TextView sended_bytes_label; + public TextView received_bytes_label; + public TextView total_bytes_label; + public View view; + + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + setLocale(global_prefs); + sended_bytes = ((ThreadActivity) getActivity()).getSendedBytes(); + received_bytes = ((ThreadActivity) getActivity()).getReceivedBytes(); + total_bytes = sended_bytes + received_bytes; + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + builder.setTitle(R.string.statistics_item); + LayoutInflater inflater = getActivity().getLayoutInflater(); + view = inflater.inflate(R.layout.statistics_activity, null); + builder.setView(view); + sended_bytes_label = (TextView) view.findViewById(R.id.sended_label2); + received_bytes_label = (TextView) view.findViewById(R.id.received_label2); + total_bytes_label = (TextView) view.findViewById(R.id.total_label2); + TextView session_label = (TextView) view.findViewById(R.id.session_label); + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + session_label.setTextColor(getResources().getColor(R.color.black)); + } else { + session_label.setTextColor(getResources().getColor(R.color.white)); + } + } else { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + session_label.setTextColor(getResources().getColor(R.color.white)); + } else { + session_label.setTextColor(getResources().getColor(R.color.black)); + } + } + DecimalFormat dF = new DecimalFormat("#.##"); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { + dF.setRoundingMode(RoundingMode.DOWN); + } + if (sended_bytes > 1073741824) { + String sended_bytes_rounded = dF.format((float)(sended_bytes / 1073741824)); + sended_bytes_label.setText(getString(R.string.gbytes_stats, sended_bytes_rounded)); + } else if(sended_bytes > 1048576) { + String sended_bytes_rounded = dF.format((float)(sended_bytes / 1048576)); + sended_bytes_label.setText(getString(R.string.mbytes_stats, sended_bytes_rounded)); + } else if(sended_bytes > 1024) { + String sended_bytes_rounded = dF.format((float)(sended_bytes / 1024)); + sended_bytes_label.setText(getString(R.string.kbytes_stats, sended_bytes_rounded)); + } else { + sended_bytes_label.setText(getString(R.string.bytes_stats, Integer.toString(sended_bytes))); + } + if (received_bytes > 1073741824) { + String received_bytes_rounded = dF.format((float)(received_bytes / 1073741824)); + received_bytes_label.setText(getString(R.string.gbytes_stats, received_bytes_rounded)); + } else if(received_bytes > 1048576) { + String received_bytes_rounded = dF.format((float)(received_bytes / 1048576)); + received_bytes_label.setText(getString(R.string.mbytes_stats, received_bytes_rounded)); + } else if(received_bytes > 1024) { + String received_bytes_rounded = dF.format((float)(received_bytes / 1024)); + received_bytes_label.setText(getString(R.string.kbytes_stats, received_bytes_rounded)); + } else { + received_bytes_label.setText(getString(R.string.bytes_stats, Integer.toString(received_bytes))); + } + if (total_bytes > 1073741824) { + String total_bytes_rounded = dF.format((float)(total_bytes / 1073741824)); + total_bytes_label.setText(getString(R.string.gbytes_stats, total_bytes_rounded)); + } else if(total_bytes > 1048576) { + String total_bytes_rounded = dF.format((float)(total_bytes / 1048576)); + total_bytes_label.setText(getString(R.string.mbytes_stats, total_bytes_rounded)); + } else if(total_bytes > 1024) { + String total_bytes_rounded = dF.format((float)(total_bytes / 1024)); + total_bytes_label.setText(getString(R.string.kbytes_stats, total_bytes_rounded)); + } else { + total_bytes_label.setText(getString(R.string.bytes_stats, Integer.toString(total_bytes))); + } + final Handler updateHandler = new Handler(); + statsTimer = new Timer(); + statsTimer.schedule(new TimerTask() { + @Override + public void run() { + sended_bytes = ((ThreadActivity) getActivity()).getSendedBytes(); + received_bytes = ((ThreadActivity) getActivity()).getReceivedBytes(); + total_bytes = sended_bytes + received_bytes; + updateHandler.post(new Runnable() { + @Override + public void run() { + DecimalFormat dF = new DecimalFormat("#.##"); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { + dF.setRoundingMode(RoundingMode.DOWN); + } + if (sended_bytes > 1073741824) { + String sended_bytes_rounded = dF.format((float)(sended_bytes / 1073741824)); + sended_bytes_label.setText(getString(R.string.gbytes_stats, sended_bytes_rounded)); + } else if(sended_bytes > 1048576) { + String sended_bytes_rounded = dF.format((float)(sended_bytes / 1048576)); + sended_bytes_label.setText(getString(R.string.mbytes_stats, sended_bytes_rounded)); + } else if(sended_bytes > 1024) { + String sended_bytes_rounded = dF.format((float)(sended_bytes / 1024)); + sended_bytes_label.setText(getString(R.string.kbytes_stats, sended_bytes_rounded)); + } else { + sended_bytes_label.setText(getString(R.string.bytes_stats, Integer.toString(sended_bytes))); + } + if (received_bytes > 1073741824) { + String received_bytes_rounded = dF.format((float)(received_bytes / 1073741824)); + received_bytes_label.setText(getString(R.string.gbytes_stats, received_bytes_rounded)); + } else if(received_bytes > 1048576) { + String received_bytes_rounded = dF.format((float)(received_bytes / 1048576)); + received_bytes_label.setText(getString(R.string.mbytes_stats, received_bytes_rounded)); + } else if(received_bytes > 1024) { + String received_bytes_rounded = dF.format((float)(received_bytes / 1024)); + received_bytes_label.setText(getString(R.string.kbytes_stats, received_bytes_rounded)); + } else { + received_bytes_label.setText(getString(R.string.bytes_stats, Integer.toString(received_bytes))); + } + if (total_bytes > 1073741824) { + String total_bytes_rounded = dF.format((float)(total_bytes / 1073741824)); + total_bytes_label.setText(getString(R.string.gbytes_stats, total_bytes_rounded)); + } else if(total_bytes > 1048576) { + String total_bytes_rounded = dF.format((float)(total_bytes / 1048576)); + total_bytes_label.setText(getString(R.string.mbytes_stats, total_bytes_rounded)); + } else if(total_bytes > 1024) { + String total_bytes_rounded = dF.format((float)(total_bytes / 1024)); + total_bytes_label.setText(getString(R.string.kbytes_stats, total_bytes_rounded)); + } else { + total_bytes_label.setText(getString(R.string.bytes_stats, Integer.toString(total_bytes))); + } + } + }); + } + }, 1000, 1000); + builder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + statsTimer.cancel(); + statsTimer = null; + return; + } + }); + return builder.create(); + } + + private void setLocale(SharedPreferences global_prefs) { + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getActivity().getResources().updateConfiguration(config, + getActivity().getResources().getDisplayMetrics()); + } + } + } + +} diff --git a/android/app/src/main/java/dev/tinelix/irc/android/legacy/ThreadActivity.java b/android/app/src/main/java/dev/tinelix/irc/android/legacy/ThreadActivity.java new file mode 100644 index 0000000..375b607 --- /dev/null +++ b/android/app/src/main/java/dev/tinelix/irc/android/legacy/ThreadActivity.java @@ -0,0 +1,1856 @@ +package dev.tinelix.irc.android.legacy; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.app.ActivityManager; +import android.app.AlertDialog; +import android.app.DialogFragment; +import android.app.Notification; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.pm.PackageManager; +import android.content.res.Configuration; +import android.graphics.Typeface; +import android.os.Build; +import android.os.Bundle; +import android.os.Environment; +import android.os.Handler;import android.preference.PreferenceManager; +import android.text.Editable; +import android.text.Html; +import android.text.InputType; +import android.text.method.KeyListener; +import android.util.DisplayMetrics; +import android.util.Log; +import android.util.TypedValue; +import android.view.ContextMenu; +import android.view.ContextThemeWrapper; +import android.view.Gravity; +import android.view.KeyEvent; +import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuItem; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.view.WindowManager; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.EditText; +import android.widget.FrameLayout; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.RemoteViews; +import android.widget.Spinner; +import android.widget.TabHost; +import android.widget.TextView; +import android.widget.Toast; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.math.RoundingMode; +import java.net.ConnectException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.SocketAddress; +import java.net.SocketTimeoutException; +import java.net.UnknownHostException; +import java.nio.channels.IllegalBlockingModeException; +import java.security.KeyStore; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Timer; +import java.util.TimerTask; +import java.util.zip.Inflater; + +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.X509TrustManager; + +import static java.lang.System.out; +import static java.lang.Thread.sleep; + +public class ThreadActivity extends Activity { + + public Socket socket; + public SSLSocket sslSocket; + public boolean isConnected; + public InputStream input; + public OutputStream output; + Handler updateConversationHandler; + public String profile_name; + public String server; + public String nicknames; + public String hostname; + public String realname; + public StringBuilder msg; + public int received_bytes; + public int sended_bytes; + public List channelsArray = new ArrayList(); + public List outputMsgArray = new ArrayList(); + public byte[] socket_data_bytes; + public int port; + private EditText socks_msg_text; + public EditText output_msg_text; + public byte[] socket_data = new byte[1<<12]; + public String socket_data_string; + public String raw_socket_data_string; + private Timer timer; + private UpdateUITask updateUITask; + public String state; + public String encoding; + public String channel; + public String current_channel; + public String password; + public String auth_method; + public String hide_ip; + public String quit_msg; + public String force_ssl; + public int sended_bytes_count; + public int received_bytes_count; + public String messageAuthor; + public String messageBody; + public boolean isMentioned; + public String sendingMsgText; + public AlertDialog connectionDialog; + public Date dt; + public boolean autoscroll_needed; + public Menu thread_menu; + public TabHost tabHost; + public List channels_sb = new LinkedList(); + + @SuppressLint("ClickableViewAccessibility") + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + setCustomTheme(global_prefs); + setContentView(R.layout.thread_activity); + setColorStyle(global_prefs); + dt = new Date(System.currentTimeMillis()); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + getActionBar().setHomeButtonEnabled(true); + } + channel = new String(); + current_channel = new String(); + for (int ch_index = 0; ch_index < 128; ch_index++) { + channels_sb.add(ch_index, new StringBuilder()); + } + autoscroll_needed = true; + socks_msg_text = (EditText) findViewById(R.id.sock_msg_text); + socks_msg_text.setKeyListener(null); + socks_msg_text.setLongClickable(true); + socks_msg_text.setTypeface(Typeface.MONOSPACE); + socks_msg_text.setOnTouchListener(new View.OnTouchListener() { + @Override + public boolean onTouch(View view, MotionEvent motionEvent) { + switch (motionEvent.getAction()) { + case MotionEvent.ACTION_SCROLL: + autoscroll_needed = false; + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + MenuItem go_down = thread_menu.findItem(R.id.go_down_item); + go_down.setVisible(true); + } else { + Button go_down_btn = (Button) findViewById(R.id.go_down_button); + go_down_btn.setVisibility(View.VISIBLE); + } + } + return false; + } + }); + socks_msg_text.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View view) { + autoscroll_needed = false; + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + MenuItem go_down = thread_menu.findItem(R.id.go_down_item); + go_down.setVisible(true); + } else { + Button go_down_btn = (Button) findViewById(R.id.go_down_button); + go_down_btn.setVisibility(View.VISIBLE); + } + Toast.makeText(getApplicationContext(), getResources().getString(R.string.autoscroll_is_disabled), Toast.LENGTH_LONG).show(); + return false; + } + }); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + socks_msg_text.setTextIsSelectable(true); + } + if(global_prefs.getInt("font_size", 0) >= 12) { + socks_msg_text.setTextSize(TypedValue.COMPLEX_UNIT_SP, global_prefs.getInt("font_size", 0)); + } + EditText channel_socks_msg = (EditText) findViewById(R.id.channels_msg_text); + channel_socks_msg.setKeyListener(null); + channel_socks_msg.setLongClickable(true); + channel_socks_msg.setTypeface(Typeface.MONOSPACE); + channel_socks_msg.setOnTouchListener(new View.OnTouchListener() { + @Override + public boolean onTouch(View view, MotionEvent motionEvent) { + switch (motionEvent.getAction()) { + case MotionEvent.ACTION_SCROLL: + autoscroll_needed = false; + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + MenuItem go_down = thread_menu.findItem(R.id.go_down_item); + go_down.setVisible(true); + } else { + Button go_down_btn = (Button) findViewById(R.id.go_down_button); + go_down_btn.setVisibility(View.VISIBLE); + } + } + return false; + } + }); + channel_socks_msg.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View view) { + autoscroll_needed = false; + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + MenuItem go_down = thread_menu.findItem(R.id.go_down_item); + go_down.setVisible(true); + Toast.makeText(getApplicationContext(), getResources().getString(R.string.autoscroll_is_disabled), Toast.LENGTH_LONG).show(); + } else { + Button go_down_btn = (Button) findViewById(R.id.go_down_button); + go_down_btn.setVisibility(View.VISIBLE); + } + return false; + } + }); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + channel_socks_msg.setTextIsSelectable(true); + } + if(global_prefs.getInt("font_size", 0) >= 12) { + channel_socks_msg.setTextSize(TypedValue.COMPLEX_UNIT_SP, global_prefs.getInt("font_size", 0)); + } + output_msg_text = (EditText) findViewById(R.id.output_msg_text); + Spinner channels_spinner = (Spinner) findViewById(R.id.channels_spinner); + + if (savedInstanceState == null) { + Bundle extras = getIntent().getExtras(); + if(extras == null) { + profile_name = null; + } else { + profile_name = extras.getString("profile_name"); + } + } else { + profile_name = (String) savedInstanceState.getSerializable("profile_name"); + }; + SharedPreferences prefs = getApplicationContext().getSharedPreferences(profile_name, 0); + if (timer != null) { + timer.cancel(); + } + if(profile_name == null) { + socket = null; + finish(); + return; + } + + updateUITask = new UpdateUITask(); + sendingMsgText = new String(); + + final Context context = getApplicationContext(); + server = prefs.getString("server", ""); + port = prefs.getInt("port", 0); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + getActionBar().setSubtitle(server + ":" + port); + } else { + Log.i("Client", "\r\nProfile Info:\r\n\r\nPROFILE NAME: [" + profile_name + "]\r\nSERVER: [" + server + "]\r\nPORT: " + port); + } + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + TextView app_summary = (TextView) findViewById(R.id.app_summary_text); + app_summary.setText(server + ":" + port); + final Button go_down_btn = (Button) findViewById(R.id.go_down_button); + go_down_btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + autoscroll_needed = true; + if(tabHost.getCurrentTab() == 0) { + socks_msg_text.setSelection(socks_msg_text.getText().length()); + } else if(tabHost.getCurrentTab() == 1) { + EditText channel_socks_msg = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_msg_text); + channel_socks_msg.setSelection(channel_socks_msg.getText().length()); + } + go_down_btn.setVisibility(View.GONE); + } + }); + } + nicknames = prefs.getString("nicknames", ""); + auth_method = prefs.getString("auth_method", ""); + password = prefs.getString("password", ""); + hostname = prefs.getString("hostname", ""); + realname = prefs.getString("realname", ""); + encoding = prefs.getString("encoding", ""); + hide_ip = prefs.getString("hide_ip", ""); + quit_msg = prefs.getString("quit_message", ""); + force_ssl = prefs.getString("force_ssl", "Disabled"); + if(hostname.length() <= 2) { + hostname = nicknames.split(", ")[0]; + } + if(realname.length() <= 2) { + realname = "Member"; + } + + tabHost = (TabHost) findViewById(R.id.thread_tabs_host); + tabHost.setup(); + TabHost.TabSpec tabSpec = tabHost.newTabSpec("thread"); + tabSpec.setContent(R.id.thread_tab); + tabSpec.setIndicator(getResources().getString(R.string.thread_category)); + tabHost.addTab(tabSpec); + tabHost.setCurrentTab(0); + tabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() { + @Override + public void onTabChanged(String s) { + tabHost.setCurrentTab(tabHost.getCurrentTab()); + } + }); + + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + View view = tabHost.getTabWidget().getChildAt(0); + view.setBackgroundResource(R.drawable.tabwidget); + if (view != null) { + tabHost.getTabWidget().getChildAt(0).getLayoutParams().height = (int) (30 * getResources().getDisplayMetrics().density); + View tabImage = view.findViewById(android.R.id.icon); + if (tabImage != null) { + tabImage.setVisibility(View.GONE); + Log.d("Client", "TabIcon View"); + } else { + Log.e("Client", "TabImage View is null"); + } + TextView tabTitle = (TextView) view.findViewById(android.R.id.title); + if (tabTitle != null) { + Log.d("Client", "TabTitle View"); + tabTitle.setGravity(Gravity.CENTER); + ViewGroup parent = (ViewGroup) tabTitle.getParent(); + parent.removeView(tabTitle); + parent.addView(tabTitle); + ViewGroup.LayoutParams params = tabTitle.getLayoutParams(); + params.height = ViewGroup.LayoutParams.MATCH_PARENT; + } else { + } + } else { + } + } + + tabSpec = tabHost.newTabSpec("thread"); + if(force_ssl.equals("Enabled")) { + new Thread(new sslIrcThread()).start(); + } else { + new Thread(new ircThread()).start(); + } + ImageButton send_btn = (ImageButton) findViewById(R.id.send_button); + send_btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (output_msg_text.getText().toString().length() > 0) { + EditText output_msg_text = (EditText) findViewById(R.id.output_msg_text); + Thread send_msg_thread = new Thread(new SendSocketMsg()); + new Thread(new SendSocketMsg()).start(); + socks_msg_text.setText(socks_msg_text.getText() + "You: " + output_msg_text.getText() + "\r\n"); + socks_msg_text.setSelection(socks_msg_text.getText().length()); + } else { + Toast emptyMessageAttempting = Toast.makeText(context, getString(R.string.empty_message_sending_attempt), Toast.LENGTH_SHORT); + emptyMessageAttempting.show(); + } + } + }); + + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + ImageButton menu_button = (ImageButton) findViewById(R.id.menu_button); + menu_button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + openOptionsMenu(); + } + }); + } + AlertDialog.Builder builder; + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + builder = new AlertDialog.Builder(this); + } else { + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + builder = new AlertDialog.Builder(new ContextThemeWrapper(ThreadActivity.this, R.style.IRCClient_Light)); + } else { + builder = new AlertDialog.Builder(new ContextThemeWrapper(ThreadActivity.this, R.style.IRCClient)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + builder = new AlertDialog.Builder(new ContextThemeWrapper(ThreadActivity.this, R.style.IRCClient)); + } else { + builder = new AlertDialog.Builder(new ContextThemeWrapper(ThreadActivity.this, R.style.IRCClient_Light)); + } + } + } + LayoutInflater inflater = getLayoutInflater(); + final View dialogView = inflater.inflate(R.layout.progress_activity, null); + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + DisplayMetrics metrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(metrics); + dialogView.setMinimumWidth(metrics.widthPixels); + } + TextView progressText = (TextView) dialogView.findViewById(R.id.progress_text); + progressText.setText(getString(R.string.connection_progress, server + ":" + port)); + builder.setView(dialogView); + connectionDialog = builder.create(); + connectionDialog.setCancelable(false); + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + connectionDialog.getWindow().setGravity(Gravity.BOTTOM); + } + connectionDialog.show(); + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + Button dialogButton; + dialogButton = connectionDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + if(dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = connectionDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if(dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = connectionDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if(dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } + } + + private void setColorStyle(SharedPreferences global_prefs) { + if (global_prefs.getString("theme", "Light").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + EditText socks_msg_text = (EditText) findViewById(R.id.sock_msg_text); + socks_msg_text.setTextColor(getResources().getColor(R.color.black)); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + LinearLayout app_title_bar = (LinearLayout) findViewById(R.id.app_title_bar); + app_title_bar.setBackgroundColor(getResources().getColor(R.color.white_75)); + TextView app_title = (TextView) findViewById(R.id.app_title_label); + app_title.setBackgroundColor(getResources().getColor(R.color.white_75)); + ImageView app_icon = (ImageView) findViewById(R.id.app_icon_view); + app_icon.setBackgroundColor(getResources().getColor(R.color.white_75)); + LinearLayout activity_ll = (LinearLayout) findViewById(R.id.activity_ll); + activity_ll.setBackgroundColor(getResources().getColor(R.color.white)); + socks_msg_text.setBackgroundColor(getResources().getColor(R.color.white_75)); + EditText sended_msg_area = (EditText) findViewById(R.id.output_msg_text); + sended_msg_area.setTextColor(getResources().getColor(R.color.black)); + Spinner channels_spinner = (Spinner) findViewById(R.id.channels_spinner); + channels_spinner.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_spinner_light)); + } + } + } + } + + @Override + protected void onResume() { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + if(global_prefs.getInt("font_size", 0) >= 12) { + socks_msg_text.setTextSize(TypedValue.COMPLEX_UNIT_SP, global_prefs.getInt("font_size", 0)); + } + super.onResume(); + } + + @Override + public void onBackPressed() { + AlertDialog alertDialog; + AlertDialog.Builder builder; + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + builder = new AlertDialog.Builder(this); + builder.setTitle(getResources().getString(R.string.quit_session_title)); + builder.setMessage(getResources().getString(R.string.quit_session_msg)); + } else { + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + builder = new AlertDialog.Builder(new ContextThemeWrapper(ThreadActivity.this, R.style.IRCClient_Light)); + builder.setTitle(Html.fromHtml("" + getResources().getString(R.string.quit_session_title) + "")); + builder.setMessage(Html.fromHtml("" + getResources().getString(R.string.quit_session_msg) + "")); + } else { + builder = new AlertDialog.Builder(new ContextThemeWrapper(ThreadActivity.this, R.style.IRCClient)); + builder.setTitle(Html.fromHtml("" + getResources().getString(R.string.quit_session_title) + "")); + builder.setMessage(Html.fromHtml("" + getResources().getString(R.string.quit_session_msg) + "")); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + builder = new AlertDialog.Builder(new ContextThemeWrapper(ThreadActivity.this, R.style.IRCClient)); + builder.setTitle(Html.fromHtml("" + getResources().getString(R.string.quit_session_title) + "")); + builder.setMessage(Html.fromHtml("" + getResources().getString(R.string.quit_session_msg) + "")); + } else { + builder = new AlertDialog.Builder(new ContextThemeWrapper(ThreadActivity.this, R.style.IRCClient_Light)); + builder.setTitle(Html.fromHtml("" + getResources().getString(R.string.quit_session_title) + "")); + builder.setMessage(Html.fromHtml("" + getResources().getString(R.string.quit_session_msg) + "")); + } + } + } + builder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + sendQuitMessage(); + } + }); + builder.setNegativeButton(R.string.cancel_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + return; + } + }); + alertDialog = builder.create(); + alertDialog.show(); + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + Button dialogButton = null; + customizeDialogStyle(dialogButton, global_prefs, alertDialog); + } + } + + private void sendQuitMessage() { + if(tabHost.getCurrentTab() == 0) { + output_msg_text.setText("/quit"); + } else { + EditText channel_output_msg = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_output_msg_text); + channel_output_msg.setText("/quit"); + } + sendingMsgText = "/quit"; + state = "sending_message"; + new Thread(new SendSocketMsg()).start(); + } + + @Override + public void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.thread_menu, menu); + thread_menu = menu; + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + int id = item.getItemId(); + + //noinspection SimplifiableIfStatement + if (id == R.id.statistics_item) { + showStatisticsDialog(); + return true; + } else if (id == R.id.about_application_item) { + showAboutApplication(); + } else if (id == R.id.connection_manager_item) { + showConnectionManager(); + } else if (id == R.id.settings_item) { + showMainSettings(); + } else if(id == R.id.disconnect_item) { + onBackPressed(); + } else if(id == R.id.go_down_item) { + if(tabHost.getCurrentTab() == 0) { + socks_msg_text.setSelection(socks_msg_text.getText().length()); + } else if(tabHost.getCurrentTab() == 1) { + EditText channel_socks_msg = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_msg_text); + channel_socks_msg.setSelection(channel_socks_msg.getText().length()); + } + autoscroll_needed = true; + MenuItem go_down = thread_menu.findItem(R.id.go_down_item); + go_down.setVisible(false); + } + + return super.onOptionsItemSelected(item); + } + + private void showConnectionManager() { + Intent intent = new Intent(ThreadActivity.this, ConnectionManagerActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(intent); + } + + private void showAboutApplication() { + Intent intent = new Intent(ThreadActivity.this, AboutApplicationActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(intent); + } + + private void showStatisticsDialog() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + DialogFragment statsDialogFragm = new StatisticsFragm(); + statsDialogFragm.show(getFragmentManager(), "stats_dialog"); + } else { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + AlertDialog.Builder builder; + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + builder = new AlertDialog.Builder(new ContextThemeWrapper(ThreadActivity.this, R.style.IRCClient_Light)); + } else { + builder = new AlertDialog.Builder(new ContextThemeWrapper(ThreadActivity.this, R.style.IRCClient)); + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + builder = new AlertDialog.Builder(new ContextThemeWrapper(ThreadActivity.this, R.style.IRCClient)); + } else { + builder = new AlertDialog.Builder(new ContextThemeWrapper(ThreadActivity.this, R.style.IRCClient_Light)); + } + } + LayoutInflater inflater = getLayoutInflater(); + final View dialogView = inflater.inflate(R.layout.statistics_activity, null); + TextView session_label = (TextView) dialogView.findViewById(R.id.session_label); + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + session_label.setTextColor(getResources().getColor(R.color.black)); + } else { + session_label.setTextColor(getResources().getColor(R.color.white)); + } + } else { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + session_label.setTextColor(getResources().getColor(R.color.white)); + } else { + session_label.setTextColor(getResources().getColor(R.color.black)); + } + } + DisplayMetrics metrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(metrics); + dialogView.setMinimumWidth(metrics.widthPixels); + builder.setView(dialogView); + builder.setPositiveButton(R.string.ok_button, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + + } + }); + sended_bytes = getSendedBytes(); + received_bytes = getReceivedBytes(); + int total_bytes = sended_bytes + received_bytes; + TextView sended_bytes_label = (TextView) dialogView.findViewById(R.id.sended_label2); + TextView received_bytes_label = (TextView) dialogView.findViewById(R.id.received_label2); + TextView total_bytes_label = (TextView) dialogView.findViewById(R.id.total_label2); + TextView dialog_title = (TextView) dialogView.findViewById(R.id.dialog_title); + dialog_title.setText(getString(R.string.statistics_item)); + DecimalFormat dF = new DecimalFormat("#.00"); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { + dF.setRoundingMode(RoundingMode.DOWN); + } + if (sended_bytes > 1073741824) { + String sended_bytes_rounded = dF.format((sended_bytes / 1073741824)); + sended_bytes_label.setText(getString(R.string.gbytes_stats, sended_bytes_rounded)); + } else if(sended_bytes > 1048576) { + String sended_bytes_rounded = dF.format((sended_bytes / 1048576)); + sended_bytes_label.setText(getString(R.string.mbytes_stats, sended_bytes_rounded)); + } else if(sended_bytes > 1024) { + String sended_bytes_rounded = dF.format((sended_bytes / 1024)); + sended_bytes_label.setText(getString(R.string.kbytes_stats, sended_bytes_rounded)); + } else { + sended_bytes_label.setText(getString(R.string.bytes_stats, Integer.toString(sended_bytes))); + } + if (received_bytes > 1073741824) { + String received_bytes_rounded = dF.format((received_bytes / 1073741824)); + received_bytes_label.setText(getString(R.string.gbytes_stats, received_bytes_rounded)); + } else if(received_bytes > 1048576) { + String received_bytes_rounded = dF.format((received_bytes / 1048576)); + received_bytes_label.setText(getString(R.string.mbytes_stats, received_bytes_rounded)); + } else if(received_bytes > 1024) { + String received_bytes_rounded = dF.format((received_bytes / 1024)); + received_bytes_label.setText(getString(R.string.kbytes_stats, received_bytes_rounded)); + } else { + received_bytes_label.setText(getString(R.string.bytes_stats, Integer.toString(received_bytes))); + } + if (total_bytes > 1073741824) { + String total_bytes_rounded = dF.format((total_bytes / 1073741824)); + total_bytes_label.setText(getString(R.string.gbytes_stats, total_bytes_rounded)); + } else if(total_bytes > 1048576) { + String total_bytes_rounded = dF.format((total_bytes / 1048576)); + total_bytes_label.setText(getString(R.string.mbytes_stats, total_bytes_rounded)); + } else if(total_bytes > 1024) { + String total_bytes_rounded = dF.format((total_bytes / 1024)); + total_bytes_label.setText(getString(R.string.kbytes_stats, total_bytes_rounded)); + } else { + total_bytes_label.setText(getString(R.string.bytes_stats, Integer.toString(total_bytes))); + } + AlertDialog statisticsDlg = builder.create(); + statisticsDlg.getWindow().setGravity(Gravity.BOTTOM); + statisticsDlg.show(); + + Button dialogButton = null; + customizeDialogStyle(dialogButton, global_prefs, statisticsDlg); + } + } + + private void setCustomTheme(SharedPreferences global_prefs) { + if(global_prefs.getString("language", "OS dependent").contains("Russian")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } else if (global_prefs.getString("language", "OS dependent").contains("English")) { + if(global_prefs.getBoolean("language_requires_restart", false) == false) { + Locale locale = new Locale("en_US"); + Locale.setDefault(locale); + Configuration config = new Configuration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } else { + Locale locale = new Locale("ru"); + Locale.setDefault(locale); + Configuration config = getResources().getConfiguration(); + config.locale = locale; + getResources().updateConfiguration(config, + getApplicationContext().getResources().getDisplayMetrics()); + } + } + if (global_prefs.getString("theme", "Light").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient_Light); + } else { + setTheme(R.style.IRCClient); + } + } else { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + setTheme(R.style.IRCClient); + } else { + setTheme(R.style.IRCClient_Light); + } + } + } + + private void customizeDialogStyle(Button dialogButton, SharedPreferences global_prefs, AlertDialog alertDialog) { + if(global_prefs.getString("theme", "Dark").contains("Light")) { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } else { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } + } else { + if(global_prefs.getBoolean("theme_requires_restart", false) == false) { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.title_v11_full_transparent)); + dialogButton.setTextColor(getResources().getColor(R.color.white)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } else { + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL); + + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.black)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + dialogButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (dialogButton != null) { + dialogButton.setBackgroundColor(getResources().getColor(R.color.white)); + dialogButton.setTextColor(getResources().getColor(R.color.orange)); + dialogButton.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); + } + } + } + } + + private void showMainSettings() { + Intent intent = new Intent(ThreadActivity.this, MainSettingsActivity.class); + startActivity(intent); + } + + @Override + protected void onDestroy() { + if(profile_name != null) { + SharedPreferences prefs = getApplicationContext().getSharedPreferences(profile_name, 0); + SharedPreferences.Editor editor = prefs.edit(); + editor.putBoolean("connected", false); + editor.commit(); + SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + editor = global_prefs.edit(); + editor.putBoolean("connected", false); + editor.commit(); + } + super.onDestroy(); + } + + public int getSendedBytes() { + return sended_bytes_count; + } + + public int getReceivedBytes() { + return received_bytes_count; + } + + class ircThread implements Runnable { + @Override + public void run() { + try { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + socket = new Socket(); + state = "connecting"; + Log.d("Client", "Getting IP address from " + server + ":" + port + "..."); + InetAddress serverAddr = InetAddress.getByName(server); + SocketAddress socketAddress = new InetSocketAddress(serverAddr, port); + Log.d("Client", "Connecting to " + server + ":" + port + "..."); + socket.connect(socketAddress, 30000); + socket.setKeepAlive(true); + while(state == "connecting") { + if (socket.isConnected()) { + updateUITask.run(); + sleep(50); + } + } + input = socket.getInputStream(); + output = socket.getOutputStream(); + output.write(("USER " + nicknames.split(", ")[0] + " " + + hostname + " " + nicknames.split(", ")[0] + " :" + + realname + "\r\n").getBytes(encoding)); + output.flush(); + sended_bytes_count += ("USER " + nicknames.split(", ")[0] + " " + + hostname + " " + nicknames.split(", ")[0] + " :" + + realname + "\r\n").getBytes(encoding).length; + output.write(("NICK " + nicknames.split(", ")[0] + "\r\n").getBytes(encoding)); + output.flush(); + sended_bytes_count += ("NICK " + nicknames.split(", ")[0] + "\r\n").getBytes(encoding).length; + if(password.length() > 0 && auth_method.startsWith("NickServ")) { + output.write(("NICKSERV identify " + password + "\r\n").getBytes(encoding)); + output.flush(); + sended_bytes_count += ("NICKSERV identify " + password + "\r\n").getBytes(encoding).length; + } + if(hide_ip.startsWith("Enabled")) { + output.write(("MODE " + nicknames.split(", ")[0] + " +x\r\n").getBytes(encoding)); + output.flush(); + sended_bytes_count += ("MODE " + nicknames.split(", ")[0] + " +x\r\n").getBytes(encoding).length; + } + BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream(), encoding)); + String response; + messageAuthor = new String(); + messageBody = new String(); + messageBody = ""; + String nick = nicknames.split(", ")[0]; + IRCParser parser = new IRCParser(); + msg = new StringBuilder(); + while(socket.isConnected() == true) { + if(in.ready() == true) { + sleep(10); + response = in.readLine(); + raw_socket_data_string = response; + received_bytes_count += response.length(); + if (response.startsWith("PING")) { + output.write(("PONG " + response.split(" ")[1]).getBytes(encoding)); + output.flush(); + sended_bytes_count += ("PONG " + response.split(" ")[1]).getBytes(encoding).length; + } + if(response != null) { + String parsedString; + if(global_prefs.getBoolean("show_msg_timestamps", true) == true) { + parsedString = parser.parseString(response, true); + } else { + parsedString = parser.parseString(response, false); + } + messageBody = parser.getMessageBody(response); + messageAuthor = parser.getMessageAuthor(response); + current_channel = parser.getChannel(response); + if(parsedString.length() > 0) { + msg.append(parsedString).append("\n"); + socket_data_string = msg.toString(); + msg.setLength(0); + if(messageBody.contains(nicknames.split(", ")[0])) { + state = "getting_data_with_mention"; + } else { + state = "getting_data"; + } + updateUITask.run(); + }; + } + }; + } + socket.close(); + socket = null; + state = "connection_lost"; + updateUITask.run(); + } catch (UnknownHostException uhEx) { + Log.e("Socket", "UnknownHostException"); + try { + socket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + socket = null; + state = "no_connection"; + updateUITask.run(); + } catch(SocketTimeoutException timeoutEx) { + Log.e("Socket", "SocketTimeoutException"); + try { + socket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + socket = null; + state = "timeout"; + updateUITask.run(); + } catch (IllegalBlockingModeException ibmEx) { + Log.e("Socket", "IllegalBlockingModeException"); + try { + socket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + socket = null; + state = "no_connection"; + updateUITask.run(); + } catch (IllegalArgumentException iaEx) { + Log.e("Socket", "IllegalArgumentException"); + try { + socket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + socket = null; + state = "no_connection"; + updateUITask.run(); + } catch (ConnectException Ex) { + Log.e("Socket", "ConnectException"); + try { + socket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + socket = null; + state = "no_connection"; + updateUITask.run(); + } catch (IOException ioEx) { + ioEx.printStackTrace(); + } catch (Exception ex) { + try { + if(socket != null) { + socket.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + socket = null; + state = "disconnected"; + updateUITask.run(); + } + } + } + + class sslIrcThread implements Runnable { + @Override + public void run() { + try { + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + final TrustManager[] trustAllCerts = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + + final SSLContext sslContext = SSLContext.getInstance("SSL"); + sslContext.init(null, trustAllCerts, new java.security.SecureRandom()); + SSLSocketFactory ssf = (SSLSocketFactory) sslContext.getSocketFactory(); + Log.d("Client", "Getting IP address from " + server + ":" + port + "..."); + InetAddress serverAddr = InetAddress.getByName(server); + + state = "connecting"; + Log.d("Client", "Connecting to " + server + ":" + port + "... (Secured)"); + SocketAddress socketAddress = new InetSocketAddress(serverAddr, port); + sslSocket = (SSLSocket) ssf.createSocket(serverAddr, port); + + while(state == "connecting") { + if (sslSocket.isConnected()) { + updateUITask.run(); + sleep(50); + } + } + input = sslSocket.getInputStream(); + output = sslSocket.getOutputStream(); + output.write(("USER " + nicknames.split(", ")[0] + " " + + hostname + " " + nicknames.split(", ")[0] + " :" + + realname + "\r\n").getBytes(encoding)); + output.flush(); + sended_bytes_count += ("USER " + nicknames.split(", ")[0] + " " + + hostname + " " + nicknames.split(", ")[0] + " :" + + realname + "\r\n").getBytes(encoding).length; + output.write(("NICK " + nicknames.split(", ")[0] + "\r\n").getBytes(encoding)); + output.flush(); + sended_bytes_count += ("NICK " + nicknames.split(", ")[0] + "\r\n").getBytes(encoding).length; + if(password.length() > 0 && auth_method.startsWith("NickServ")) { + output.write(("NICKSERV identify " + password + "\r\n").getBytes(encoding)); + output.flush(); + sended_bytes_count += ("NICKSERV identify " + password + "\r\n").getBytes(encoding).length; + } + if(hide_ip.startsWith("Enabled")) { + output.write(("MODE " + nicknames.split(", ")[0] + " +x\r\n").getBytes(encoding)); + output.flush(); + sended_bytes_count += ("MODE " + nicknames.split(", ")[0] + " +x\r\n").getBytes(encoding).length; + } + BufferedReader in = new BufferedReader(new InputStreamReader(sslSocket.getInputStream(), encoding)); + String response; + messageAuthor = new String(); + messageBody = new String(); + messageBody = ""; + String nick = nicknames.split(", ")[0]; + IRCParser parser = new IRCParser(); + msg = new StringBuilder(); + while(sslSocket.isConnected() == true) { + sleep(10); + response = in.readLine(); + raw_socket_data_string = response; + received_bytes_count += response.length(); + if (response.startsWith("PING")) { + output.write(("PONG " + response.split(" ")[1]).getBytes(encoding)); + output.flush(); + sended_bytes_count += ("PONG " + response.split(" ")[1]).getBytes(encoding).length; + } + if(response != null) { + String parsedString; + if(global_prefs.getBoolean("show_msg_timestamps", true) == true) { + parsedString = parser.parseString(response, true); + } else { + parsedString = parser.parseString(response, false); + } + messageBody = parser.getMessageBody(response); + messageAuthor = parser.getMessageAuthor(response); + current_channel = parser.getChannel(response); + if(parsedString.length() > 0) { + msg.append(parsedString).append("\n"); + socket_data_string = msg.toString(); + msg.setLength(0); + if(messageBody.contains(nicknames.split(", ")[0])) { + state = "getting_data_with_mention"; + } else { + state = "getting_data"; + } + updateUITask.run(); + }; + } + } + sslSocket.close(); + sslSocket = null; + state = "connection_lost"; + updateUITask.run(); + } catch (UnknownHostException uhEx) { + Log.e("Socket", "UnknownHostException"); + try { + sslSocket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + sslSocket = null; + state = "no_connection"; + updateUITask.run(); + } catch(SocketTimeoutException timeoutEx) { + Log.e("Socket", "SocketTimeoutException"); + try { + sslSocket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + sslSocket = null; + state = "timeout"; + updateUITask.run(); + } catch (IllegalBlockingModeException ibmEx) { + Log.e("Socket", "IllegalBlockingModeException"); + try { + sslSocket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + sslSocket = null; + state = "no_connection"; + updateUITask.run(); + } catch (IllegalArgumentException iaEx) { + Log.e("Socket", "IllegalArgumentException"); + try { + sslSocket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + sslSocket = null; + state = "no_connection"; + updateUITask.run(); + } catch (ConnectException Ex) { + Log.e("Socket", "ConnectException"); + try { + socket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + sslSocket = null; + state = "no_connection"; + updateUITask.run(); + } catch (IOException ioEx) { + ioEx.printStackTrace(); + } catch (Exception ex) { + try { + if(socket != null) { + socket.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + sslSocket = null; + state = "disconnected"; + updateUITask.run(); + } + } + } + + class SendSocketMsg implements Runnable { + @Override + public void run() { + if (socket != null || sslSocket != null) { + state = "sending_message"; + while(state == "sending_message") { + updateUITask.run(); + try { + sleep(50); + state = "finishing_sending_message"; + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + if(sendingMsgText.length() > 0) { + try { + if(sendingMsgText.startsWith("QUIT")) { + Timer shutdownTimer = new Timer(); + shutdownTimer.schedule(new TimerTask() { + @Override + public void run() { + try { + if(force_ssl.equals("Enabled")) { + if (sslSocket != null) { + sslSocket.close(); + sslSocket = null; + } + } else { + if (socket != null) { + socket.close(); + socket = null; + } + } + } catch (IOException e) { + e.printStackTrace(); + } + finish(); + } + }, 1000); + } + if(force_ssl.equals("Enabled")) { + if (sslSocket.isConnected() == true && state == "finishing_sending_message") { + PrintWriter out; + out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(output, encoding))); + Log.i("Client", "Sending message...\r\n\r\nMESSAGE: [" + sendingMsgText.replace("\r", "\\r").replace("\n", "\\n") + "]"); + out.println(new String((sendingMsgText).getBytes(encoding), encoding)); + Log.i("Client", "Clearing output stream..."); + out.flush(); + Log.i("Client", "\r\nSended message!"); + state = "sended_message"; + updateUITask.run(); + } + } else { + if (socket.isConnected() == true && state == "finishing_sending_message") { + PrintWriter out; + out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(output, encoding))); + Log.i("Client", "Sending message...\r\n\r\nMESSAGE: [" + sendingMsgText.replace("\r", "\\r").replace("\n", "\\n") + "]"); + out.println(new String((sendingMsgText).getBytes(encoding), encoding)); + Log.i("Client", "Clearing output stream..."); + out.flush(); + Log.i("Client", "\r\nSended message!"); + state = "sended_message"; + updateUITask.run(); + } + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } else { + Log.e("Socket", "Socket not created"); + } + } + } + + class UpdateUITask extends TimerTask { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + if(current_channel.length() > 0 && channelsArray.size() > 0 && tabHost.getTabWidget().getTabCount() > 1) { + socks_msg_text = (EditText) findViewById(R.id.sock_msg_text); + for(int ch_index = 0; ch_index < channelsArray.size(); ch_index++) { + if(channelsArray.get(ch_index).equals(current_channel)) { + View tab = tabHost.getTabWidget().getChildTabViewAt(0); + if(tab == null) { + Log.e("Client", "TabView is null"); + } + socks_msg_text = (EditText) tab.findViewById(R.id.sock_msg_text); + if(socks_msg_text == null) { + socks_msg_text = (EditText) findViewById(R.id.sock_msg_text); + } + } + } + } else { + socks_msg_text = (EditText) findViewById(R.id.sock_msg_text); + } + final SharedPreferences global_prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + if(state == "getting_data") { + if(socket_data_string.length() > 0) { + if(global_prefs.getBoolean("save_msg_history", false) == true) { + File directory; + directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "Tinelix"); + if (!directory.exists()) { + directory.mkdirs(); + } + + directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Tinelix", "IRC Client"); + if (!directory.exists()) { + directory.mkdirs(); + } + directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Tinelix/IRC Client", "Messages Logs"); + if (!directory.exists()) { + directory.mkdirs(); + } + + try { + Log.d("App", "Attempting creating log file..."); + File file = new File(directory, "LOG_" + new SimpleDateFormat("yyyyMMdd_HHmmss").format(dt) + ".log"); + if (!file.exists()) { + file.createNewFile(); + } + Log.d("App", "Log file created!"); + FileWriter writer = new FileWriter(file); + writer.append(socks_msg_text.getText() + socket_data_string); + writer.flush(); + writer.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + int cursor_pos = socks_msg_text.getSelectionStart(); + int current_ch_index = -1; + for (int ch_index = 0; ch_index < channelsArray.size(); ch_index++) { + if(current_channel.length() > 0 && current_channel.equals(channelsArray.get(ch_index))) { + current_ch_index = ch_index; + } + } + if(current_ch_index > -1 && channels_sb.size() > current_ch_index && channelsArray.size() > current_ch_index) { + channels_sb.get(current_ch_index).append(socket_data_string); + } + if(tabHost.getTabWidget().getTabCount() == 1) { + socks_msg_text.setText(socks_msg_text.getText() + socket_data_string); + } else if(tabHost.getTabWidget().getTabCount() > 1) { + try { + if(current_ch_index > -1) { + Spinner channel_spinner = (Spinner) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_spinner); + if (channel_spinner.getSelectedItemPosition() == current_ch_index) { + EditText channel_socks_msg = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_msg_text); + channel_socks_msg.setText(channels_sb.get(current_ch_index)); + } + } else { + socks_msg_text.setText(socks_msg_text.getText() + socket_data_string); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + if(autoscroll_needed == true) { + if(tabHost.getCurrentTab() == 0) { + socks_msg_text.setSelection(socks_msg_text.getText().length()); + } else if(tabHost.getCurrentTab() == 1) { + if(current_ch_index > -1) { + EditText channel_socks_msg = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_msg_text); + channel_socks_msg.setSelection(channel_socks_msg.getText().length()); + } else { + socks_msg_text.setSelection(socks_msg_text.getText().length()); + } + + } + } else { + if (tabHost.getCurrentTab() == 0) { + cursor_pos = socks_msg_text.getSelectionStart(); + socks_msg_text.setSelection(socks_msg_text.getSelectionStart()); + } else if (tabHost.getCurrentTab() == 1) { + EditText channel_socks_msg = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_msg_text); + cursor_pos = channel_socks_msg.getSelectionStart(); + channel_socks_msg.setSelection(cursor_pos); + } + } + Log.d("Client", "Position 2: " + socks_msg_text.getSelectionStart()); + socket_data_string = ""; + } + } else if(state == "getting_data_with_mention") { + int cursor_pos = socks_msg_text.getSelectionStart(); + int current_ch_index = -1; + if(socket_data_string.length() > 0) { + for (int ch_index = 0; ch_index < channelsArray.size(); ch_index++) { + if(current_channel.length() > 0 && current_channel.equals(channelsArray.get(ch_index))) { + current_ch_index = ch_index; + } + } + if(current_ch_index > -1 && channels_sb.size() > current_ch_index && channelsArray.size() > current_ch_index) { + channels_sb.get(current_ch_index).append(socket_data_string); + } + if(tabHost.getTabWidget().getTabCount() == 1) { + socks_msg_text.setText(socks_msg_text.getText() + socket_data_string); + } else if(tabHost.getTabWidget().getTabCount() > 1) { + try { + if(current_ch_index > -1) { + Spinner channel_spinner = (Spinner) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_spinner); + if (channel_spinner.getSelectedItemPosition() == current_ch_index) { + EditText channel_socks_msg = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_msg_text); + channel_socks_msg.setText(channels_sb.get(current_ch_index)); + } + } else { + socks_msg_text.setText(socks_msg_text.getText() + socket_data_string); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + socket_data_string = ""; + Context context = getApplicationContext(); + if(messageBody.length() > 0 && nicknames.split(", ")[0].length() > 0) { + if(global_prefs.getBoolean("save_msg_history", false) == true) { + File directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "Tinelix"); + if (!directory.exists()) { + directory.mkdirs(); + } + + directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Tinelix", "IRC Client"); + if (!directory.exists()) { + directory.mkdirs(); + } + directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Tinelix/IRC Client", "App Logs"); + if (!directory.exists()) { + directory.mkdirs(); + } + + try { + Log.d("App", "Attempting creating log file..."); + File file = new File(directory, "LOG_" + new SimpleDateFormat("yyyyMMdd_HHmmss").format(dt) + ".log"); + if (!file.exists()) { + file.createNewFile(); + } + Log.d("App", "Log file created!"); + FileWriter writer = new FileWriter(file); + writer.append(socks_msg_text.getText() + socket_data_string); + writer.flush(); + writer.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + Notification.Builder notificationBuilder = null; + notificationBuilder = new Notification.Builder(context); + notificationBuilder + .setSmallIcon(R.drawable.ic_notification_icon) + .setWhen(System.currentTimeMillis()) + .setContentTitle(getString(R.string.mention_notification_title, messageAuthor)) + .setContentText(messageBody); + notificationManager.notify(1, notificationBuilder.build()); + } else { + Notification notification = new Notification(R.drawable.ic_notification_icon, getString(R.string.mention_notification_title, messageAuthor), System.currentTimeMillis()); + NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.notification_activity); + contentView.setTextViewText(R.id.notification_title, getString(R.string.mention_notification_title, messageAuthor)); + contentView.setTextViewText(R.id.notification_text, messageBody); + DisplayMetrics metrics = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(metrics); + notification.contentView = contentView; + ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE); + List tasks = am.getRunningTasks(1); + ActivityManager.RunningTaskInfo task = tasks.get(0); // Should be my task + Intent notificationIntent = new Intent(context, ThreadActivity.class); + notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + notificationIntent.setAction(Intent.ACTION_MAIN); + notificationIntent.addCategory(Intent.CATEGORY_LAUNCHER); + notification.flags |= Notification.FLAG_AUTO_CANCEL; + PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), 0, notificationIntent, 0); + notification.contentIntent = contentIntent; + notificationManager.notify(R.layout.notification_activity, notification); + } + } + } + } else if(state == "disconnected") { + Toast.makeText(getApplicationContext(), R.string.connection_lost_msg, Toast.LENGTH_SHORT).show(); + socks_msg_text.setSelection(socks_msg_text.getText().length()); + connectionDialog.cancel(); + finish(); + } else if(state == "connection_lost") { + Toast.makeText(getApplicationContext(), R.string.connection_lost_msg, Toast.LENGTH_SHORT).show(); + socks_msg_text.setSelection(socks_msg_text.getText().length()); + connectionDialog.cancel(); + finish(); + } else if(state == "timeout") { + Toast.makeText(getApplicationContext(), R.string.connection_timeout_msg, Toast.LENGTH_SHORT).show(); + socks_msg_text.setSelection(socks_msg_text.getText().length()); + connectionDialog.cancel(); + finish(); + } else if(state == "no_connection") { + Toast.makeText(getApplicationContext(), R.string.no_connection_msg, Toast.LENGTH_SHORT).show(); + socks_msg_text.setSelection(socks_msg_text.getText().length()); + connectionDialog.cancel(); + finish(); + } else if(state == "sending_message") { + if (socket != null || sslSocket != null) { + EditText output_msg_text; + if(tabHost.getCurrentTab() == 1) { + output_msg_text = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_output_msg_text); + } else { + output_msg_text = (EditText) findViewById(R.id.output_msg_text); + } + outputMsgArray = new LinkedList(Arrays.asList(output_msg_text.getText().toString().split(" "))); + Log.i("Client", "\r\nSending message...\r\n\r\nMESSAGE: [" + output_msg_text.getText().toString() + "]"); + if (outputMsgArray.get(0).startsWith("/join") && outputMsgArray.size() > 1 && outputMsgArray.get(1).startsWith("#")) { + try { + channelsArray.add(outputMsgArray.get(1)); + sendingMsgText = ("JOIN " + outputMsgArray.get(1) + "\r\n"); + sended_bytes_count += ("JOIN " + outputMsgArray.get(1) + "\r\n").getBytes(encoding).length; + if(tabHost.getTabWidget().getTabCount() < 2) { + TabHost.TabSpec tabSpec = tabHost.newTabSpec("channels"); + tabSpec.setContent(R.id.channels_tab); + tabSpec.setIndicator(getResources().getString(R.string.channels_tab_item)); + tabHost.addTab(tabSpec); + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + View view = tabHost.getTabWidget().getChildAt(1); + view.setBackgroundResource(R.drawable.tabwidget); + if (view != null) { + Log.d("Client", "TabWidget View"); + tabHost.getTabWidget().getChildAt(1).getLayoutParams().height = (int) (30 * getResources().getDisplayMetrics().density); + View tabImage = view.findViewById(android.R.id.icon); + if (tabImage != null) { + tabImage.setVisibility(View.GONE); + Log.d("Client", "TabIcon View"); + } else { + Log.e("Client", "TabImage View is null"); + } + TextView tabTitle = (TextView) view.findViewById(android.R.id.title); + if (tabTitle != null) { + Log.d("Client", "TabTitle View"); + tabTitle.setGravity(Gravity.CENTER); + ViewGroup parent = (ViewGroup) tabTitle.getParent(); + parent.removeView(tabTitle); + parent.addView(tabTitle); + ViewGroup.LayoutParams params = tabTitle.getLayoutParams(); + params.height = ViewGroup.LayoutParams.MATCH_PARENT; + } else { + Log.e("Client", "TabTitle View is null"); + } + } else { + Log.e("Client", "TabWidget View is null"); + } + } + } + tabHost.setCurrentTab(1); + final Spinner channels_spinner = (Spinner) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_spinner); + final EditText channels_socks_text = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_msg_text); + final EditText channels_output_text = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_output_msg_text); + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + channels_spinner.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_spinner_light)); + } else { + channels_spinner.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_spinner)); + } + } else if (global_prefs.getString("theme", "Dark").contains("Dark")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + channels_spinner.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_spinner)); + } else { + channels_spinner.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_spinner_light)); + } + } + channels_spinner.setPadding(2, 0, 2, 0); + ArrayList spinnerArray = new ArrayList(); + spinnerArray.clear(); + for (int i = 0; i < channelsArray.size(); i++) { + spinnerArray.add(new CustomSpinnerItem(channelsArray.get(i))); + } + CustomSpinnerAdapter customSpinnerAdapter = new CustomSpinnerAdapter(getApplicationContext(), spinnerArray); + channels_spinner.setAdapter(customSpinnerAdapter); + } else { + ArrayList spinnerArray = new ArrayList(); + spinnerArray.clear(); + for (int i = 0; i < channelsArray.size(); i++) { + spinnerArray.add(new CustomSpinnerItem(channelsArray.get(i))); + } + CustomSpinnerAdapter customSpinnerAdapter = new CustomSpinnerAdapter(getApplicationContext(), spinnerArray); + channels_spinner.setAdapter(customSpinnerAdapter); + } + ImageButton channels_send_btn = (ImageButton) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_send_button); + channels_send_btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (channels_output_text.getText().toString().length() > 0) { + sendingMsgText = channels_output_text.getText().toString(); + Thread send_msg_thread = new Thread(new SendSocketMsg()); + new Thread(new SendSocketMsg()).start(); + channels_socks_text.setText(channels_socks_text.getText() + "You: " + channels_output_text.getText() + "\r\n"); + channels_socks_text.setSelection(channels_socks_text.getText().length()); + channels_sb.get(channels_spinner.getSelectedItemPosition()).append("You: " + channels_output_text.getText() + "\r\n"); + } else { + Toast emptyMessageAttempting = Toast.makeText(getApplicationContext(), getString(R.string.empty_message_sending_attempt), Toast.LENGTH_SHORT); + emptyMessageAttempting.show(); + } + } + }); + channels_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView adapterView, View view, int i, long l) { + try { + channels_socks_text.setText(channels_sb.get(i).toString()); + } catch(IndexOutOfBoundsException ioofe) { + ioofe.printStackTrace(); + } + } + + @Override + public void onNothingSelected(AdapterView adapterView) { + + } + }); + } catch (IOException e) { + e.printStackTrace(); + } + } else if (outputMsgArray.get(0).startsWith("/join") && outputMsgArray.size() > 1 && !outputMsgArray.get(1).startsWith("#")) { + try { + channelsArray.add(outputMsgArray.get(1)); + sendingMsgText = ("JOIN " + outputMsgArray.get(1) + "\r\n"); + sended_bytes_count += ("JOIN " + outputMsgArray.get(1) + "\r\n").getBytes(encoding).length; + if(tabHost.getTabWidget().getTabCount() < 2) { + TabHost.TabSpec tabSpec = tabHost.newTabSpec("channels"); + tabSpec.setContent(R.id.channels_tab); + tabSpec.setIndicator(getResources().getString(R.string.channels_tab_item)); + tabHost.addTab(tabSpec); + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + View view = tabHost.getTabWidget().getChildAt(1); + view.setBackgroundResource(R.drawable.tabwidget); + if (view != null) { + tabHost.getTabWidget().getChildAt(1).getLayoutParams().height = (int) (30 * getResources().getDisplayMetrics().density); + View tabImage = view.findViewById(android.R.id.icon); + if (tabImage != null) { + tabImage.setVisibility(View.GONE); + Log.d("Client", "TabIcon View"); + } else { + Log.e("Client", "TabImage View is null"); + } + TextView tabTitle = (TextView) view.findViewById(android.R.id.title); + if (tabTitle != null) { + Log.d("Client", "TabTitle View"); + tabTitle.setGravity(Gravity.CENTER); + ViewGroup parent = (ViewGroup) tabTitle.getParent(); + parent.removeView(tabTitle); + parent.addView(tabTitle); + ViewGroup.LayoutParams params = tabTitle.getLayoutParams(); + params.height = ViewGroup.LayoutParams.MATCH_PARENT; + } else { + Log.e("Client", "TabTitle View is null"); + } + } else { + Log.e("Client", "TabWidget View is null"); + } + } + } + tabHost.setCurrentTab(1); + final Spinner channels_spinner = (Spinner) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_spinner); + final EditText channels_socks_text = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_msg_text); + final EditText channels_output_text = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_output_msg_text); + if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + if (global_prefs.getString("theme", "Dark").contains("Light")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + channels_spinner.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_spinner_light)); + } else { + channels_spinner.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_spinner)); + } + } else if (global_prefs.getString("theme", "Dark").contains("Dark")) { + if (global_prefs.getBoolean("theme_requires_restart", false) == false) { + channels_spinner.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_spinner)); + } else { + channels_spinner.setBackgroundDrawable(getResources().getDrawable(R.drawable.dialog_spinner_light)); + } + } + channels_spinner.setPadding(2, 0, 2, 0); + ArrayList spinnerArray = new ArrayList(); + spinnerArray.clear(); + for (int i = 0; i < channelsArray.size(); i++) { + spinnerArray.add(new CustomSpinnerItem(channelsArray.get(i))); + } + CustomSpinnerAdapter customSpinnerAdapter = new CustomSpinnerAdapter(getApplicationContext(), spinnerArray); + channels_spinner.setAdapter(customSpinnerAdapter); + } else { + ArrayList spinnerArray = new ArrayList(); + spinnerArray.clear(); + for (int i = 0; i < channelsArray.size(); i++) { + spinnerArray.add(new CustomSpinnerItem(channelsArray.get(i))); + } + CustomSpinnerAdapter customSpinnerAdapter = new CustomSpinnerAdapter(getApplicationContext(), spinnerArray); + channels_spinner.setAdapter(customSpinnerAdapter); + } + ImageButton channels_send_btn = (ImageButton) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_send_button); + channels_send_btn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (channels_output_text.getText().toString().length() > 0) { + sendingMsgText = channels_output_text.getText().toString(); + Thread send_msg_thread = new Thread(new SendSocketMsg()); + new Thread(new SendSocketMsg()).start(); + channels_socks_text.setText(channels_socks_text.getText() + "You: " + channels_output_text.getText() + "\r\n"); + channels_socks_text.setSelection(channels_socks_text.getText().length()); + channels_sb.get(channels_spinner.getSelectedItemPosition()).append("You: " + channels_output_text.getText() + "\r\n"); + } else { + Toast emptyMessageAttempting = Toast.makeText(getApplicationContext(), getString(R.string.empty_message_sending_attempt), Toast.LENGTH_SHORT); + emptyMessageAttempting.show(); + } + } + }); + channels_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView adapterView, View view, int i, long l) { + try { + channels_socks_text.setText(channels_sb.get(i).toString()); + } catch(IndexOutOfBoundsException ioofe) { + ioofe.printStackTrace(); + } + } + + @Override + public void onNothingSelected(AdapterView adapterView) { + + } + }); + } catch (IOException e) { + e.printStackTrace(); + } + } else if (outputMsgArray.get(0).startsWith("/mode") && outputMsgArray.size() > 1) { + try { + StringBuilder message_sb = new StringBuilder(); + for (int i = 1; i < outputMsgArray.size(); i++) { + if (i < outputMsgArray.size() - 1 && outputMsgArray.get(i).length() > 0) { + message_sb.append(outputMsgArray.get(i)).append(" "); + } else if (outputMsgArray.get(i).length() > 0) { + message_sb.append(outputMsgArray.get(i)); + } + } + sendingMsgText = ("MODE " + message_sb.toString() + "\r\n"); + sended_bytes_count += ("MODE " + message_sb.toString() + "\r\n").getBytes(encoding).length; + } catch (IOException e) { + e.printStackTrace(); + } + } else if (outputMsgArray.get(0).startsWith("/nick") && outputMsgArray.size() > 1) { + try { + sendingMsgText = ("NICK " + outputMsgArray.get(1) + "\r\n"); + sended_bytes_count += ("NICK " + outputMsgArray.get(1) + "\r\n").getBytes(encoding).length; + } catch (IOException e) { + e.printStackTrace(); + } + } else if (outputMsgArray.get(0).startsWith("/quit")) { + try { + sendingMsgText = ("QUIT :" + quit_msg + "\r\n"); + sended_bytes_count += ("QUIT :" + quit_msg + "\r\n").getBytes(encoding).length; + } catch (IOException e) { + e.printStackTrace(); + } + } else if (outputMsgArray.get(0).startsWith("/")) { + try { + StringBuilder message_sb = new StringBuilder(); + for (int i = 0; i < outputMsgArray.size(); i++) { + if (i < outputMsgArray.size() - 1 && outputMsgArray.get(i).length() > 0) { + message_sb.append(outputMsgArray.get(i)).append(" "); + } else if (outputMsgArray.get(i).length() > 0) { + message_sb.append(outputMsgArray.get(i)); + } + } + sendingMsgText = (message_sb.toString().substring(1) + "\r\n"); + sended_bytes_count += (message_sb.toString().substring(1) + "\r\n").getBytes(encoding).length; + } catch (Exception e) { + e.printStackTrace(); + } + } else if (!outputMsgArray.get(0).startsWith("/")) { + try { + if (channelsArray.size() > 0) { + if(tabHost.getCurrentTab() == 1) { + Spinner channels_spinner = (Spinner) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_spinner); + EditText channels_socks_msg = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_msg_text); + EditText channels_output_msg = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_output_msg_text); + sendingMsgText = ("PRIVMSG " + channelsArray.get(channels_spinner.getSelectedItemPosition()) + " :" + channels_output_msg.getText().toString() + "\r\n"); + sended_bytes_count += ("PRIVMSG " + channelsArray.get(channels_spinner.getSelectedItemPosition()) + " :" + channels_output_msg.getText().toString() + "\r\n").getBytes(encoding).length; + } else { + + } + } + } catch (IOException e) { + e.printStackTrace(); + } + } + if(tabHost.getCurrentTab() == 1) { + output_msg_text.setText(""); + EditText ch_output_msg_text = (EditText) tabHost.getTabContentView().getChildAt(1).findViewById(R.id.channels_output_msg_text); + ch_output_msg_text.setText(""); + } else { + output_msg_text.setText(""); + } + if(global_prefs.getBoolean("save_msg_history", false) == true) { + File directory; + directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "Tinelix"); + if (!directory.exists()) { + directory.mkdirs(); + } + + directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Tinelix", "IRC Client"); + if (!directory.exists()) { + directory.mkdirs(); + } + directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Tinelix/IRC Client", "Messages Logs"); + if (!directory.exists()) { + directory.mkdirs(); + } + + try { + Log.d("App", "Attempting creating log file..."); + File file = new File(directory, "LOG_" + new SimpleDateFormat("yyyyMMdd_HHmmss").format(dt) + ".log"); + if (!file.exists()) { + file.createNewFile(); + } + Log.d("App", "Log file created!"); + FileWriter writer = new FileWriter(file); + writer.append(socks_msg_text.getText() + socket_data_string); + writer.flush(); + writer.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } else { + Log.e("Socket", "Socket not created"); + } + } else if(state == "connecting") { + connectionDialog.cancel(); + state = "connected"; + } + } + }); + } + } +} diff --git a/android/app/src/main/res/drawable-anydpi/button_bottom_border.png b/android/app/src/main/res/drawable-anydpi/button_bottom_border.png new file mode 100644 index 0000000000000000000000000000000000000000..ec3e42ebeb2a4343585056fea5cb7ff25dc011ee GIT binary patch literal 2270 zcmd^AX>1f_7@no2lyVg?QU&ZdH3E^@Irf;{k%gAs+5@&MWi2gYV0Px4?%3U#VP@KH zYq1rDf)WTA1PuhxXi|$9jY_bALgZ2q(ML(LB^C6`^pi-k`LE`%nbM+ruM9c2aM$P1_}fv1km!Lx#)Dt z?RL#Tkm;MYZ0s!kGVoAq=j6hpyDKt(yrNE97>INoUSIOuYiMP=ck_oO-YuaC^4{h@ zvNy<6m;SJF*tDX<1vf@Er5$a1#rx{$;jdr5x#O~X%4y5Hq3#`P7Ov^9Y_B`NY46pO z7bl6^hP9M!d#|p&7RjEr;z-WrzRZ?xf5&zEvD?jb?)#-_dCNN{gU8oqecO4iErUuw zwQJ`K+2dN;%D#7GFUW7(dV6vpOB+B+zrNL!y{zS;?#W&6J~UceW|=?r`I?p`o5xI!zP@!kDE z-dU8HKhra*svx%8+Wc(J({Ef09akS2+s8Eqg$_pDXBoAx@be|Be|>n?*kTRUsNdX3dGI9A5(r zGz6+8*@N|UbYiF^c(BC|Kj~M!AS@L(YG6@gS&(n6;oSl@XEr)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#qcgI)C~RK_HS2bWnrMFQnW=;;AaOYOrBRCC`IGwqkcO%C-z%c-6{ zJ`3VNXACG}*ytVK{$-m(qkN=Xf5GDL^KE5^RXS`DeQmc+gMd%fQ3bJX6;-x-IE#nW zi#$UJKx&kUoTuze2u@5fr-3hy zHU2(Io-(@~_T9!u=Lpi^8D^;#2vY0D>{}`M?5h`B8$r5?WDQXZA`+E@@SfiMH%1k= z1`lYqV61xt|1(&tH=RL`R>(06ac=X*d~l?LJ>-1Pay$jB-p$w>qDwl=tgB0P68uEl zUb3bGiZZ&QMhbm;1tzS+?4;|gY5Mb*iC74P)t)7qT3GQ1%DE zIj_5KgpnN0}yppPdoD5P~6^Sf0 zCD8uI;ETt4x`qCK!z6cq(1`)|cY-C}EilA|fCIF!cvl?Uz}LkcXMuCUh6d1Zmrt4i M107RzwYGE2zYr|yT>t<8 literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-hdpi/ic_menu_delete.png b/android/app/src/main/res/drawable-hdpi/ic_menu_delete.png new file mode 100644 index 0000000000000000000000000000000000000000..24d8f6a4be54237073aa7f4862ac5afc55a7edca GIT binary patch literal 1413 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}trX+877l!}s{b%+Ad7K3vk;OpT z1B~5HX4`=T%L*LRfizez!?|}o;S3Bcy`CBRbl%lU8h&YQ!% zOS9*b?ewKlUB_=09oLxJyz*+Lo!UNrk*6~r6}G*rj7sm5&nWwC@#fRL2RGHv%gI;I zj97AZmsjBV5AU{pk=n03`}rd22BxR#Z1;>@mwQ;pg%9(`s$ zvNk45o+0&T4Ex#DsmB(*ed&_3R>EYF$TNkFcF#p4OM6`1FWo-dx;*d95rHJ@UppO( zRBY75zyDO9sWFA0@15ECC--^Q*14-FFIp1v*Ti+-h556t|GoL-)h4|YIeBU;A}7T$ z2!zbLHodQJUyzN?WTA;CH?9b=T&{lUyjFKHbNq2_>FZNUjP{pj{JUYze*gSxaaK`( zh8?A)x#w9IFX-5*5X^1v|KYV8!{w73TbX_~3$E+z>e{ls+M(fK!nNmYqN4h*zQ0&! zb9CNhnMxB@r&6U{`FFgbx5N7tUa1Dws7FgH2i%BV{4KRekE>|{LttQF$j1sBzTAuJ z7r8kzbuRY*n$zs1e#&@K&bMFBxgKABy7J)PgZ~!z_18vNn(JTh zc&cjmb{P|fGQRhcCfD;{u6^42G$Zc4QtE4dpt1#et2f8nX}ZO6)eN(>vW zUE5myQCYX^QmkaxY{ngVswb@))N2>&Gq46_zqXxX%5-Il${Ta0jkly-Z*@8RV(rke z4Or6Pb#`)EW(t!?aL!t7hK8lfR8lU?^!Hszs;3@F-h3~Osi(=;Cf22~t*ZUC^n(>kt!67MjFPz} zr@MIV!;KZL&$h(z8(nt}YgZQd@I0mNL4jV7W69euA(6YqU6?+%?+M#!X#MwgyyV5S zZ2_#8Tp#=M&+X9)%<4KOk!+x(q?IKUY(D*oh`h=DxIIORR;KZ%PlcrkZQsbj<8zFC z#*|ABPE>p;NYG%dj4bk9`%8P>rdc67GM^ngzk7#T>04oj1sWRufLXwmXw!Tg4o4dFOWDtn@#1W{>}$Zk|-n zz`kBC#5QQ<|d}62BjvZR2H60 RwE-$(@O1TaS?83{1OQadY$X5y literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-hdpi/ic_menu_edit.png b/android/app/src/main/res/drawable-hdpi/ic_menu_edit.png new file mode 100644 index 0000000000000000000000000000000000000000..9bdba1b704c2452d8180634abab7126b9ba99a73 GIT binary patch literal 1931 zcmV;62Xy#}P)6i3s!^+oR%u1l zJoT;WLt80r(>9H1sR&I0fl*u*<0T*rge{wc4YAGOnelkVW-{ZM`M!JlU_(5$4PM}- z=ke3b?|1GwGw0s>0S`FnK2Zn&gCBf~(-M{!! zWYPgPm5i@bGORXD3y;8Oz8Lv}$b@lTw7^VJu9lh~8Gn3p?(4=93ZqTD6*&=9FQ=X~ zMh7Xziz^XnteUPqoml@y)}Kr{!pL?mrELa}qbY6FqWVNa5HDOH5i`IWU6p$udR5ki zAc;T%%ISldx;Th1}TC`f&?NB#mKZAG^oLzk%{up zUqCt=(xRJ7%PT#XBKrb$qdlfllZSOkAV?rCksB4?Opp*?w_cW^10ZN*;3v(yE&BC^DwxA|nqa0QrGlVy_G z>`GLRu12godc~BleqC&}*i-im9{h5RvrwxrpOVi6a=mM)g|-c9AL<|G;pW^+B$LW6 z*U+jy)^|Z4tt6?0Y&7ATI;y8ZTO@9>yB?4%K4V%-M|t@1zlH;`ho%JgTxK}4*s43 znGEc5`fCbS)O(6qhXNv<6#W^+w&d8@CxM9T8ELs`clc`jyUx1!XTGYv1Hp09r))fT z6)0q4m&0GPY(>4dl=aCEO8^O8PX<4zC5I^IHR;+3?dg zeF8xM&n;hn$W_oI5~E1W#-FwVVr1Fi&N0L=phgtTcvusV@h0sE zsHZbqmnFt%cKl4o76WajT-Mo~qGp)hac`K`1syW}fFB2y)7i}hiRLL|VWvp>E=gb% zsNeYKvTwWBT5rZLcL$s=npB~al!Skae$=P5WwqodTJC}WpAu~pOek9Kc#&S9pQ<}E z;6B>%lUP)h?-WXhj6c(>L8UFbIVawFPkgd~j>GFk?#n5%h$A7M)pq7U`pc)AhCcv- z!O$V&uk^z{r7gQDCw_Vk_~a515LubN=C@X>kVz)yCl!O|WW2j)pS&g2%Ni8CjUR-R zGnpsS;^*dsPhJ66n^5#Edpe7WA16WlQfV!yC>-&H7mYXR{mau}|lL|4Kkt*_(#ET8knyns~?%kQgYVt=@fI7oy@LXR{h>pBFx9 z*bU~VrN1CUmkAI6B$i2&Tf{%Y$D_Dr{n$3()57z_e$LT@JaM6QLXOS)3g z-4^YKN*XQh{yW)&A+yQyujr1kQ9nAZoqoTa0U}_&ExlVjisw*?y}vd$@?2>|OKBsl;8 literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-hdpi/ic_menu_send.png b/android/app/src/main/res/drawable-hdpi/ic_menu_send.png new file mode 100644 index 0000000000000000000000000000000000000000..d94e6928256857f4046cacd6476381a9d059e911 GIT binary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$w}QS$Hzl2B?U^ M)78&qol`;+098Uk+5i9m literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-hdpi/ic_notification_icon.png b/android/app/src/main/res/drawable-hdpi/ic_notification_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..4967c45d212220c8868c040d340850ab05b87457 GIT binary patch literal 519 zcmV+i0{H!jP)}Cj*whZljaQM;DO$6p0>IBz9f-|OVkTvtP^a20x+2WQnJ(yTAN>^ z%S|Q;vH^)W35jA^sT4ZX0n5mQOsTX?sK|mZC71r9OsJ|rs45d;3WQiBg|2~S!w~gr z5>74G8*~`A3qHIGJ%CBjL+u*XXQT`KjvWSNTIU(`f^nKJk^(oi{$Gm>+N&shR3V4m7;!3a38gqXaTdwCJcIrQr; z2jd$B&3>V6)ggCZt3`-M>q8sNplR024*AceP`|QS=UDtQamMIJNJWxw$b{}`fgmZk z^xuX3pve3@DAwaqS|-DHTGH#whNn8+Q~Xqa1e>le8{!g$@&n|uc`AJ3c|`yK002ov JPDHLkV1fcU=F3!SeyzLO7w^}T3M&Hj9T~yNLmZAvI#kD#4>48DI1Id4o zQo#e$U4kSiev!OB@6P)kv%}ur9Xr`Q!3TbDGxL5t>@G8Nx!i+V6m@{^ouO;+1#EzF z0^U1guE%w`en@eKs$d2bKt2@MrjTEB#(Amx44l+EQe#6`WXvQoq9VtTit9@s?ia`n zP#uCoXfc7Pfgu+6k$!>PMHRneFHeU>@rL**alb(BqN*HPNGOUi#NvM1*j-R{t|9z> z2R=LSBQ8eFD=$EoHk%UD zx*?h8qO7mhoErKA<}E(T{3|jaEI$p_bGxQ3@@%N)#IDHvDHsGtGJa~u*`kyTv7S%{ zhJJ!Ri#3`5Cgao%Md>e?mAFg{-GDb>T?oubTNnU za`@~T22*5?mt)CQ4#BA8v}LH-X}@jPkeo5FL+0q<^K2=i22+yw)(!a(`MeML5P2|E z2`wZPH8)hz#_ob@i_A&Q--!>#BjyzDqj#u=hN>jj%l|FzBmDxoi?;Z^_J;yIi_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$qP(_@$>ZL7rA%cS@poL`H(PS literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-ldpi/checkbox_checked_disabled.png b/android/app/src/main/res/drawable-ldpi/checkbox_checked_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..00dff69a923a89049696d83694aa2e375903d371 GIT binary patch literal 2283 zcmcIlYg80v7#>6vxftaI@)FZ%3d!uw%r3j^$g0aiTw-w*L_`Z`XTD`Oc4wBIfn8B! zy5*Y$!VmjU%1)h%Pwj_=41{pONu@+`CC+|l)!^VgyUdyF;vGL3bXhxq-KH=7dE!M-4v@TM~S{afNYZM98|XU$=GX#V)`z`IqKbSMMSbjg-H`})QBd~yr%HTW2$NG3_ zxR!4#F|-dNmFThlf)<#}s8MhORHGnpmLMpUBsB_Bqt`YNqzDj4I_=CYKJ!X?67p+u!JRXHdr4Zc3aIa1$b5Ilx5xBUBml!Y3ixUPI zQh~_2?JmhK@TknlScEc3k3p&ZIXGPbT3+<~1RYa)8JCh&5OPifK$Gd-P^UA17NxXu z7{#ymj>KZ#A{S832BJ{rWj z33tgO@Hmi-i#ECeBMI(2L2wLI$~?e=Qlx@Ho%Y7I^3rVv`1Ao`&u*a#dWG4}@+IJ70f%TtrQsNg z(BcfGf<0+bYjKN~A#gRNR&xMo2u7PYz&6uuhp!If_$RBZii3xk~P4$PTl} zu#2#Ci~R3LE-3Y{9Coy?>1c+PdtHyQa*+Xt`ET3r;NJb|?5FkE03^Lf@%v$-V3jvXW7f!9TTWX$BH#Wr)>rTQqhl3*Dd^DI!kNpu zda<8JZOE)yxc+G2;=0i(+iO#@;={k+RP^n&WplqS-1kJ&mnUL!tERo`F}E)X|1G)t zjBRCY&1q|HRaemObJtWRL>OPMEhxG8Q+f2^=*Szlrk%F-{5aGwb+19r0ZH mVbt};H@1w9_-cMjPmy!N#!b!Fn>*!iX=YkZ>i(34%l`s%(J&?e literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-ldpi/checkbox_disabled.png b/android/app/src/main/res/drawable-ldpi/checkbox_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..7b14ad95e82cbf19c93ce49a5274a4b7cc36a44a GIT binary patch literal 2114 zcmcIleM}Q)7(YM}QCK%Ozm?-OeoU{uyMED=s@PU2u~@JQ=r+0Dy@ivucitUPma%(a3Pb#He$`fN?q}D$b1<7dOrRSr(mjW9~zp>^&&eEb91Ym)!Mz?|#qk z`8^-+(+%#t?3Cp3$q0g^ICJa;@K>YWNr~{8*3-)%NSv9s+1y#2;00(w_5ySUX|ZI? zM35QVc5Z3UJ>!0LUHb&b*?r5Bez+x0&v*N~Pj7Utcpoilv2FjvY1`?2CD>Z~K(jeG z>5Uuj#81yYo%PG`H3?^%-?Ob9IrM{@zct;oOuQVo-+Qg8A-|!gsHO7jZLL3cULWJz z6(7#qb)d4P0?|xg{rT9Nk)-f7SKD2~xren>+QHm}DJ5+aK>GUREA3aC6UiYL_wHGx zc`4kS_pMR0cz*MT4=1>jrCucW!u>UxmEr5MHEpA%W2Ce)ZqcMS%frjJr+!l$@pOI+ zim%?CmNj+Du#Yxh)}KsUw;^{__gDF2&PNhT$TYus(#d7V4xhST``G&OwH^@Mlbtkw zwslN#R%oBLcIntTJ8pZw5XYrPm>Lh)W)@GxjX2>rzP$d|(V3~WNXNOwfA=hzcOGVP zxR_HcBglwR>K%tP?jDOEL%-xbMM{xt5zPt#Eu-dF8w!XJjUbuxLL$SK0|oVhQa)(K zB5my$%5zq%(C8vuq79VsIW-bkQj_OlYsy&*hs~RdW`<};5C95;h64VeOoyykA1@8p z>T4Z__Cb_#E7o7oB9|Mr2@*g}S^{SYf8h%#v{iboAeBN}i$&$2C>$bixjLvYAv`Eg8DOvj znU#1^;e{ZoGBRGFLa|~{YJUs?F-9Adqj`cE(}fsOM`{T*rU9VK^U}1$?5P%kt^mkFg~S3!B?u~02Apwh%vP+B{C$yftPc1=0K#M_jEuPw%LGM`%Y^5| z5&ImAMx<>LU=%^}2!em0Qtkm3lp?hhI-`&eazd3nQ&ki-0Cq+JRt#2+!U+RTSUe;} z8%#8%pGBByg6N03U?Xsh!VC^9aJ;X2Fi@9^b_QjI39`Uxw_;F~mghOz#~4_%o+5Dz z!FX{KVX)v{pMk&)49jqo(W18yhCW@;-Y&2eYWh_B{=Ve|7IMTgM6oKc?Y@b%zTYw&!z(x)?3bmo%?ey9U47t*byC@BS?)C zJN`tzf2-bB(uLkpR-CV2X0ONVKfM%b_^bC)2XXXxpnBnmaAp^I^tF4bhwJXt^~O)E zYm)D_wBAlF@##8-Z{1Kg?nvD0`dM{d4*#7vzA-UkO<&vg(^RK>son1N&DnCwNQ_TR zO22g~(peauy!C#=%#_T|^jlpIhCM>GSH7#xP3ZbVBMxzQ=jSvYJhW=%Wb|?Ty+jX& zIr1O*dZzh4OW7@#?j15Wd^_jfcq_O_y#0HV(7|LKTjMJ1R{x@$jy!wof|7Ut0eO$q A>;M1& literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-ldpi/checkbox_unchecked.png b/android/app/src/main/res/drawable-ldpi/checkbox_unchecked.png new file mode 100644 index 0000000000000000000000000000000000000000..d2525cec6bcaa85fa5570c55ee5fb160ee3ca33c GIT binary patch literal 2083 zcmcIle^3-<7+xe0Q2~FH6e8BD;MA$!J!8Tmx7_PxBD$@-0iNr3ml9M z=T9;XN6j)PGbgjiwEjuQAw#D`jdV&=Mr+V)CY!Nfj2vfV%D#oW%W2g3r=8ioZ+D;X zd7t-r-+gaGX>q~$#3vFF1R3uxbd|y16#Yzyhu4gOy9|QFSOurEG>?;f04*z+ht4ML zcH0~TnZ0HE=FXxoN+-8=rsbd5vnb)(Re9FJQvZeHo7^wFf>!KzZav_3Zud_-H`^Sznu6@=ehQH@{zCK z+5KWla;UxdvL&S?xBZR5w9-W7E>iT>t(7UuLzh%X#wPo*amwH^9m#0jP&Dbnw+pA7>W{4^GyK-{Ba1%$=;*DMzZ?^K27tJ` zAR#x?F{LsuxW~})eCph7H+(1M$CLV*W-r%al@G^^J)D1N$-3Vk%T8)Rj&+s%IZ&Q+ z3OYGPF051$Wb7pUj6rt3m5Ly7rv-0?R^eGdvr@po=>8gl0U4qZBs(W4Gi)8uP#>rf zLSpfPAL;1^Xo=)i_} zX}H!O8!>bUqSZOD;eu9pN>Qhz05r=$;4DEC+L_l$jC<0Ku5GI?Nk7xNs3pJ{E|k%1*n;G0GQ^>}EvsA`PJ0=LV7K~V-l;Aoy>%x06_ zhFf_i3+F6mE6%XMhnp;f1+bKlvYE&sU2wlkV(WGL^!>wq%SkNch&n{`49{>D){2uh z&W2MKGl%;a-h!JbAHf0AWG79Q2wRCFz)y$q-^;42;vgfzTUa|_Nu2aqIULx`7TjjG zTXBvzWm$O6Mw)mALphe_B_+VXJ`n;;4KT`L4Tk=s#wqzF#UpXhbCcf9kR4`GD5$V> zP2umO9IObh`~o`EbTq^2z3#wRy~u#W!jFafxHmGL!?caH0FpkW_`@(&;Hlml_SDx4Q>TlaTNvny;Yjdj7#&b6ZT<*lJPrKKA z-jhOcKPINjeS_1kPwgE%eDch|)H>XA9;sT@ZTK~P)d?bWd)oD?%#wjLq_wu9{Mx1W zLuc;9E(=ZA*RrhqTGQUp+z`o6D4QJDwWFdpbY%OD@dv8r??f(Mwk7Y{yJEU6zT{DA dAk%+wQtG~+gwwY^fPYg6;?6I29h_Ia`fq-?#xei^ literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-mdpi/ic_menu_btn_add.png b/android/app/src/main/res/drawable-mdpi/ic_menu_btn_add.png new file mode 100644 index 0000000000000000000000000000000000000000..361c7c460ef8cd5225a54f6ccb636cad9b4e3aea GIT binary patch literal 1339 zcmV-B1;qM^P)kdg00002VoOIv0RM-N z%)bBt010qNS#tmY07w7;07w8v$!k6U000Sga6xAP001BW001BWhx(kI000C-Nkl_>9LGPubI-lIciVMtyL-^9Zs>Az<+6s4G&5yrIu$7;B*G#JLqv;`SdgK< zFhZjj(t1(RA|w>itT1D!3rwu#wx*5E)o4%ds_d!VyL-<$zh2zC+JlC@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En58O;r z^WJ`4n|d{8Q*PzkZ%OsX9zK|VEqvzk=jTpYE3dqN=8SM8&zk2B4$A6#_kCUXH^-52 zgJR{eibeM4Eux=DOUQZr)U=XZ?eySZoWO+>o~!dU>#JJ%I3k{;tbe`vzAfmzM6IF{nBWKlCJ&F zE?ktIxTQ?$2XV~#p*tI&-tTwYa}u}6|y;rG16O_LfA88O~?yz0ZFZ6_wP z83)d}xAf29$BcJa?%H>U$z(7opDurpQWd>qnY}>kr9EE%eSf+iV|vl95t%+^Ef<5s zPw&e2OXr`iRek(5p*ZA}#NSn)+TEC6v{wXtUmI*<^o@ac$&UHIZS+s8?ABTvUjN1a z%EtWJ7p_mS7vXx4-w|UwZ9xX30i#CUz7;;khN-u6cl$lv-sV{E@&CmM$uEu-Uo0kg zI4odekgK(n-KN&$ne;Q_)|9`d=69s{6gVa>&Q}x^VfZz1;?C_g@(gU789Am-dTvp8 z@n)xj%d&Y4lQ@qseW~7d(@Z3%(v?LlD&MDkZ~apD?GslnpUA_)bhu#uwTIeUmp|eE zb$eyEdC7LcEsMHzKD1eTG#sN z?~T)mFkmp;e)O;U24=4XVt%(W0@OK@#P>{KO39fkbN$EsAL0=$t?y>Xzh42&%Bm%< z5hW>!C8<`)MX5lF!N|bSP}jgv*T^Eo$jHjX+{)Bg*TBNcz+j1A(Mc2yx%nxXX_dG& zTopc53e+G8vLQG>t)x7$D3!r6B|j-u!8128JvAsbF{QHbWU38N5re0zpUXO@geCwC C{t{dO literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-mdpi/ic_menu_moreoverflow_normal_holo_dark.png b/android/app/src/main/res/drawable-mdpi/ic_menu_moreoverflow_normal_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..ba704b67e3a25f1fb1b16a261c5a1b25fabd0c0d GIT binary patch literal 122 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzM^6{Wkch)?uQ+l6B^Vrgk4UOiAAEE)4(M`_JqL@;D1TB8!2v z2N=7Z%(epwmK8Xr18D^?ZvQoBE>PP7PZ!4!kK=Ez`1%VwO0a+Uzj^cRJa0{oAf2U4 z)dV_4rp}s?k>tanwL-l^s<(z&zm8>bxbP1)wW@>PTh1#eT;Pf^`1r^%V`)I#mXhsn z&pl?$DPvsd;(zS9$;os7%_mo;vHytg`xGeMcqD$picc$_KDBw$_(o{@lE}?jMuAH` zBqbK`T&tG*&UR~g^Azqixtp9~7=zfJO)Yi%oA6ut{m~ayZ;~hUF1sopB-1g4QO)4X zv31f}-KEzr%f@#5w%@Rrb=JEyKIQnt-{*LKiJp|1y8Y|C6K*+bDxd$Y(Tr7DDRkgW z>7C3~TOB4TL_g8}TlAy)dCq2&KatM6zPsc&%n2$oF50>^)JsTV6Niyf{;R!bXK$RD zc6!Y@u_b=fnEvrj2s^N%_xQPB&KvVm8!dI%?}Q&pd!Dl+<=3V*R`>2)2F3<4i|g-I zg`5Pt0$K#R8ko3F*1fH|(Q($zEA6gV+&hn{$9q;?*!xaHXF~jh+^KAT8;_q3cs6DE z&gb)u^fxfwy0s*WS)yU%jLIYkN}0%i18><4zYZ zx=BBH&Z|&yt5-;vIl)6?&4h*f9xq(V@0lypt@tnq8eK8B znKI8S>#>LELp9;H$6_}anHKNT6<}0Qj0lLUJ$m@1i_>g}RUA{j49Z(%85$dR^(otB zZuGMJs>;7SO=unGlI@3<+8*KqIwxT|`=|DAQGEL6RAYpHgxxTI!|-Sh%c0|Ym5&`> z|2g=bX9|}<%3JBOJ4eDkeSDtHo4#KqW72d+B{n{e_j2@n5~-s_X|$w5lbp5hW>!C8<`)MX5lF!N|bSP}jgv*T^Eo$jHjX+{)Bg*TBNc zz+j1A(Mc2yx%nxXX_dG&Topc53e+G8vLQG>t)x7$D3!r6B|j-u!8128JvAsbF{QHb SWU38N5re0zpUXO@geCwEYl2_^ literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-mdpi/ic_notification_icon.png b/android/app/src/main/res/drawable-mdpi/ic_notification_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c5afcbae0d6db932f2c6eb4533b32bf4b8521878 GIT binary patch literal 368 zcmV-$0gwKPP)pY z#Ck}$6rTkk@D0lEgYs8F`I~_FA`s68VpbsD0mN&ee4>L0p9MFe{Jl_q1`vlLsiW9} zdC)NKg!*6^wJqQTVr^(R=K}F>YFnTU4Rd5bRSVVwu|5!QN6PV3wEz^!SD{Jt1i2Rc z0OFHSehCm?!IFwV5v>lyTcDXN5t@8K_%_UUxGcB}#NtR;1DgKDp>i-V7l_-S>;xqB zpiH-dP!Q3yETX9e&!CD)#ZRz_QM1DNkEOzyLCq@jKU$SJ4QrJ-WB~yF^`>J;WBXPB O0000{|NOdMS?fb1)TuyR4+gItcy=@0;;a?N6(JxCH0o9*JQmx zMs#4$*-(!HzK&tgmh}=P7U*1pK}sz60E_OBsU;QcgBQ?LeMto^Fh@qxkXpQeiod4z zTeK{-8E^y6q>rhG2#S7a^QwOrtb`Tzg` literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-nodpi/checkbox_checked.png b/android/app/src/main/res/drawable-nodpi/checkbox_checked.png new file mode 100644 index 0000000000000000000000000000000000000000..d414117ad65879d144b402df2fc8adc5ee9f256e GIT binary patch literal 2567 zcmcImdsGv57M}2i@Q7sN_W=OFFEu4Gi~a?jmzM|qOj~%K;#A-+?`jw64rw>~Mr6U9QjZdN@o*tjW|5T&zxA_b!-sQnCN{sfq*Y*Nm;U z7p&dJ(1M}2T_Tb%%Aa~~cD>xZRk6+2z3Tq6qxU6CZZaCwgGVdZR8HibEbHIb`ncy# zkmjI^J^f%~*~wCX6|w13@cnTw`=GMpiSWvljURR*%{6>OM+m<39iKkOXU!h4+l{(o z8(9JN=JdNFRz`et%~VLHkLi0L?fT?qR+0SSQyF7_WstSYQSOrBvd&m?`kcKg?hV*PDE=ar1_CbHwYX(zqO zlza*Rn1RlV0USCK3;^!ebgDdao^rJmB@A4|=`Yt}AZauJ#Ku`j1TDeMpc>cej579k zhl363Fc~{nq=b~D0x#C3SWS4gHC=^TOHc{Mj{6lDYmw3f2HcE*7K7eMNi8z=G_RCi zJ0J7d;55WsB4f`KG*6icDhLw}Mspz!3PF4jhNHP~v``!!9R>0sKFovoJXpfv3#2e4 zg~Z_OhfRkwVH#;x;;(0e(RVU-vDr*YdA#!Sa&EbROPI9uUWvrX!RK>m1c$0Hnh^`f zNQKWaB;pim(vfBzVFaCwh?*!h%hk9lmqQJP zc{F8CDx;&!>itP#N>xGPyeym|N=+!9RE8VP;d8+-bbc>cYSK?kdVlf-UP^pG684$WpbOuC=^GKtX4gR1; zLFfsSlE7%s1irMp#jc=M=>2=_A(@7E3+3PYk>MSyjv1cFae!{(1 z(>X(1UX0VEFDd>Ej3PAVa>RtowY1a!v$=RbC!RveUM~IB3jcqUK5Hvlj2N{zJvn)7 zXEHqJh?yx0@4xFc{q9HOXbw)#IOlSHy3#lE^BFhN)FyiR7Q#1B0C1^KO_ZzhwqLH1 zr>NvhuGl{P;?~0cj~AY9iVUQ(+fE7nws`I9OdnacV%sQdf!uqkg;~99C%cJTcq*H9 zv`vxHmn3LNidwgz@guKm19p!?{x`Yx3Y8W zm07!9er-bdMu<8?5c$@GqUi+WP&)D<0k4vr*m|9Jb28$7r;R;LDuBJK&NO;{`{oCK?Dp;**n8M}(EsA|sCEbHR%lbk zZq5hnr-7l-%CP%nQy{mtCJ z7A6X)zPrq~<91C&B$%%52v0p8;Q~NsfB;$FWYVNIocu6o%Y#RM4)g$62~WP#9vjI@ zb{iVs`n2{@mz>v=+fdU0#kvPNkQMIBhFTc$F2~bO3~t-$;ue4FADWVWNA=(H>|8q& zzixlON4KL2ujulzhymf!DXz;;di^^ V)V71e51juqQj^jXTN5^H`42OLr)&TK literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-nodpi/checkbox_checked_disabled.png b/android/app/src/main/res/drawable-nodpi/checkbox_checked_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..46c50e90a0d7f48f9c90436e270bacad35aca959 GIT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U{%M5I&%fdsC|rp+dd>l1?s%OM2}l>>o4sZr5J z+N_}o&U2Bon>ltai&z88l`eng{n$+Io>>_U;8fEoFx=VeN(grrnIxc@$A({W@0oN? z(^~Z;NBSGZpN6q?w#AB>$*3I8>ECTG!LNyDvAo}r{!E4cKT4mm71v`_4#`bU0pv_Z z;2bg2MG^dOy{7hlHjZZD+>CQB=cX%nGdG_}ila7j)3^4M%)J2M@oA)nQclCS$kH&eyvxX|}Hv`68_7=(Rm)8n+sCDZk+DUgj43!-rleZcym8 z+JVo*BGIiy)}p`5&wIYxZ)hvubZS{(9pZTUbp4y;>5@Q47`X6_`#_GPXB$6F5gBRa zg?FGO{dRBdh#DPP5pgzr$nP(o4wektyLW!{o^H(&*U}B$(aGwbT%YLV%N0AyMsJ3B z=_4GONOekG0zZQYy)I<(M}+pI_^j}5*vIy9j;I5^)k)6ey6`nAE^eSO_} zadv0%X1i`pG<0~xc5sl%&zD=TZ?tDj8c#GgH{a~*duY2&9nU&@rPjA^n-eFkT3wOA zUz!x`t*^W{`sm5}X4BaC_+OcC6YK=~VUJIXSti7{^OXOXm^2Uy3DFng$ls-lVFP?;OgD)uYUCs z4_Fl#80O=C>-O#I{>3(1b$U4J?@`JFCex3_uWoE=D%w+{wWS7q*nR5btqm#lH-O2H zdz&>)J&%VOzm~i8Uq5)TKk;2vQ_m|$ms2F*NPD9xc|ghW`a8b3IRA9rfljewg}rg8 zWMk}+vc{pK9Xm!^TtDH3?5_=tiHRxUCDcheEmrV&$Mbf4AY>%(`Fm-vyuEu}XYhE} c$@|5?KF!0M*SGgvbpG*(i%wKGZp?i3zY9sZ-~a#s literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-nodpi/checkbox_disabled.png b/android/app/src/main/res/drawable-nodpi/checkbox_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..6f88c9c11490700a67f5f066b7a55e910480e365 GIT binary patch literal 2131 zcmcIleM}Q)7{7`lA~Kv#K&G6BPMx;*(Jxx5T3dt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&c*X!Pw@ zdzwSZf$pDs?Uz3r;_ONOL$NO}{a{pX$Xt-sSyexAB}80MPZ~;XD)`lYxpTM0I$2ws zdg;?Nhc-Tep1kJWIuuI2cr&r=pgUuG@H-b2l@x-av7jQZ1d3upFa6m2@al~5y;C~l zI(Ij1bYB~HYx(RqEk{#^bcM`TCTU$+kP^$9i$ibJD&}{N{IVdfBadESuUuAqq3gQM V+;#w6RUrRo*)nsj&GSm$`Ws^{-_QU6 literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-nodpi/checkbox_unchecked.png b/android/app/src/main/res/drawable-nodpi/checkbox_unchecked.png new file mode 100644 index 0000000000000000000000000000000000000000..33326696197f594c14de6d41287530651100ef24 GIT binary patch literal 2114 zcmcIle{9rb818Ps#@JxMbjT#Dg)oTp+TL|{*TTWZ-Pn(C+c6HffyjF8cU#?ETiR~B z4ag?K5J3n-0ul)jBFQ#cG(ibjaKphsAw)q!KqAT?AgC-jFbXPu-EJo_fcwYGwf)-f zd7t-rfAsA}Z*hJ~(!?YLK~f3}+@U39s;xq=)3XledjbQ;Al zj_C+8ZQG8mokiW=v<;mZc_;TTPQ3n|lC{7ax_EqZ;j*_-f19iMP@!u_V4T$6@E~=I zH0hPAYfM@B$8+zFTpfS1;0OxY9uvl<%tQ`dJ`Kjc{=XUJr5f!nFovFCzp3*fS2A(`m*zU%Lr=N*?oIo zOC8hLQhX&lwIruy=fezdlKKcK`r`iT)D?}FHD~5#rYl)p5jTI*@~XzA&7;3A>-C*! z1!d>&OwFCLHR0VY=d4FFH*72#fAOmY>8E?+%c;zeebUjzAAfM{e#2kRv6uRQv^PI7 zXNEJqEH|>>+^}fE%d;DdX*C!D5&4#MP0HAP@9>=d6KlC6lF70Hrj5p%|I=rg(64`K{2?+%2Fgt z+R^9_gYHxz$d5x7<->0AVtw8?`E zZlLk1sOX|Bp#~!tkgIhk2Bi+f5LRNek`~Pq%oq{j6oN97Mofc1kLTIYa5#q6^t>AA zC93y{#G0>80YoX#z$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}mOO5=A)uRlNmAmqy}M(em~^A<$y z6c8GJbt+Mds@YOe5gRG#5f0iU4wI5?&e!~6$yS0CwQ?0H*Lb)ty(0KJhT@t|Y7W8W zKbGFrCsj#LPFe4HW?Y?>l!M~sW%HSqyRVX$8ga@6H1mOjpVFcL(f?(E(W%J3*YD|I zSnru;h=@Q~*n6s&_?M z4wvEg!oppeqdLkT7URvoq?M@nqKRn6$H(;?^&sNQO%u~N#VizDC~+p$FRMu%@9bOi zA)L#SEi~9Sgv%pQ5icFdh-pXqUIY|8hw)wbO@{aC=g*&;()r0fWl23e_JHa=jM@Qp z!uZrrYm7~$t{g^EEGMX<;GfSXNj788%sCIZK5}=d#&^24=Ur;BqOsMaqVNtDjApmn zBrZWGAKK^z5MEqxkKwI)b>#gry_{{x7}I(z(|gjW{aF6INvo+=lb>t7T`$X^5qu&M5dxAH{{;E@tGAUA+IX)bynS~PE%#4qPbOi(2 zP5z`&`0Wp|NcQ6^I=rYQ07K|Dt6H>~W|bjfkoA1Pl*t$#m{{y?!piHB<}pg?N278V zzy6$5LJAf|*#BAMx#X2Y<7GjZrO2^|$3KPm;$oH5W18Gkl+jb1)PsF*#1TXRqvlrN z6p}k=XIXs$e>9PL79Kb^kqd)N!gI@jznU^1eKn?n~r zbReA#>r{XtbG%(jb(NgM66>z@R?$2~dzx29&gVrcv4%kFz%c z!x9tMv3CRy&|#2@$lE0`rEt{#Ukd)mKW`ubUA%9>8*lONnaO~hl(J;KxM|4$0lqpr Ay8r+H literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-nodpi/spinner_arrow_dialog.png b/android/app/src/main/res/drawable-nodpi/spinner_arrow_dialog.png new file mode 100644 index 0000000000000000000000000000000000000000..1cecc4f9c78e9b99fbb37b8083ca93f4c03a706c GIT binary patch literal 2287 zcmcIlZEO@p7~Z3NluEGz+Cpu*Y>gCUZ$IvzH7@B7TmdS6XtcGk2k1VOSrRqi_YMvW(PEd1Bn+b<)C$sxL2zH&hh0JN@hE?P`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d3`=hI&AW z7_=GMo0<)%DA)|s%r3$u+ksEasaC+`>U=j}UCJ|pVZw{(_z(*T0zl)?P{1El*^tf9 z!OOz7-i;g34v1E2GjtZT$W?&aB?X`sBZ2V*L7^mRF_ISAYO$oE6hVQcB=lhS51F3WEqttqN*f2n(vo zT?|=3b)LVT1`I zNH;~X1kIY5v4oW+h)$>r8bRPR?jbPcCM~QvjWt{U1(pQSTlFMRmy2}N z?03TRQjxr(9}aYGv-{_!?s}*KMw=t5u*6m2eKZ-Ag6 z#cs0vWbt&;R{8)WeT+#uVXEZSDmevYl)#E~#qmfJ;*S!qautu4P6`Cg5P-uxW@uZl znPxDK0Tv8!Bp_g!2@e+u{eO`jPAl)@f+YZ+u(;vrgLyKycUy=5?!Tw0L-)bp`nlTa zF#KWjb&Nf52E#&jbispNZ$_>Z_z}63KoI6hfmhCv%v;Cdb#>dBmEkU$fB7VtYtM)~ zaJ6mF%kR*ib0GRt`ihnPixzFld3(*=`M-Kb3>N*r&04a| z7hiK{%8aBtiKmK?o-E=hlTw12fO{+-SZyAV&7K z|FyG0yV$d#Y~Hvp<{a6PsV>{LW=}oxQ7Aj%*60M^!Pav7nOP|<{i{Qc-Yb0fS{sv3 z_I2ThQwJa^-|tSGk?1kiBz{)rOR0Apd*SECU0g!r`Nky2SNjIVl7YhC@zS*Yb7*{T zc6{mach3*H{rSLQXQSu;vEcaj3z=iDZ6taKbulZW?%G;nP*bXuXTyKd?`)?dKdT{g H_S}B}i1RD% literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-nodpi/spinner_arrow_dialog_light.png b/android/app/src/main/res/drawable-nodpi/spinner_arrow_dialog_light.png new file mode 100644 index 0000000000000000000000000000000000000000..b25e21b927cfdfe8588450c63c0292276ac4974c GIT binary patch literal 2295 zcmcIldu$X%9Nwc^N_luxW2+UrZb6E$ce{JfT{)rL)%GgamU2K_Fm!Kswzu?d_t@R` zt_9OZC=VeZAXp6q(V!`h#>599Ra)dB5keHf0-6;3$3H+S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j Rf9UtBx1hw+KCSxoe*hV&1|R?c literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-nodpi/spinner_arrow_dialog_pressed.png b/android/app/src/main/res/drawable-nodpi/spinner_arrow_dialog_pressed.png new file mode 100644 index 0000000000000000000000000000000000000000..82c35bc5c77a1aedaefd4d2c5654447206e7b661 GIT binary patch literal 2386 zcmcIl3rrM87+#81ponOV_#!MzBigceyL-=FJr(Z|j(UiCRj~Cjw>t-0?{3fC1rDmc zOI56oXnds_V|+B)qSd5{))J#&tJJ8aYDKh~(wZiw^??>mTeXi_4o+*;7?WPIx3e?< zeDi((|IN&j;-dWCNrRIx4D0PIa7;#TTze9FqJO2P<~D}KSwy?NI9HH75TBes4j)dl ztaSv24PUixWkcbY#r+pI49PpXb!x)pAA;GFihV7Impk8FikIxNuiovnuk-W^>(cxevhxq;-b$Pof3$9aePQy8%i3;lYGa2s$9?E&-BdfNwxeWM<+rQ$Tsd(e z&Aa}ENYVQ3mAfji)aHg_(>Uh4ERl4-A2s?2-KXuiH@-D5V|LxP=3j;QqLm_UC;zebKK2Mx}(Y#-@pXc1#&_ z3}rGgSWv29m@Z3u;zHZURAN}qL!!GxEpbiYc*(B=T7GpQe-K4u*r+j~AmHaf75Bh0 zF<>Lw4>SXNB)JUDWmye_VMr7~D%AlMgvfxB z)s5hQ3NMR6Rg?m_h6p@Tg=!-Z)u;x4Fa{e?y7GiFrVoLjp4L&CrtUzO>*=9>e=J&2 z^D5CQU3?!4thlR#P(K+eQiaUJyh<2Qv$_`(_}JWFh3xB8D)4&fgMJjIAYycEsbIOJ zN=mu(1Rb&An3^DGmmyFk*)2)F?n)JRqu>m!WANeA#DE}GDI+vST@#=KsL)2Bsxc&G zASv3-FdSv%4D4%^g`=ows0$fE04jJSm~qo)&ct#i=3l{*AbP8xCDi5OoB>4z0UkOX zHUg2-iK4(EYYM;$EF?>z>I1WpC#?pGCp{()%X%or0F8!DUTD5U;w!ZDY4fAL6(k;E z#4^NrtVUoEctFxtgPCMZMh2nrR?=&*ns{ghUN0kbqfL}Wv~_^*VN{KkfDjqhYP8a< zKzadU#R!NM>tO(CF<5xPMAHCzEd(y`oL7?l0Qp4pgEFWO2FeKh0UNvIlVq19pqwKO z5Bie})M3(X`1G^D(|k@A3;^#6r=S6caU5GaG_gw+$zFXq|Y{@6PFcmF+49Ud=6ubrz= zhv^?RU+36EXD}*cXBRrywPx%}K_9V82?kJ}WOU^uFKNDvuB+dij$C)iqU-1ALVIp% z)2+5OYt7=!bxqCV3pNl$0&yfh6nAjJ_qgR$Rw!;6p0Ik@_SvgcXXXIWcWrat_`L~- z=JzZ3F=c|G;5eKJZa+~;Ou$HE+`QOumCUD?jOBFCO_v)}s% DkHa&2 literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-xhdpi/ic_menu_btn_add.png b/android/app/src/main/res/drawable-xhdpi/ic_menu_btn_add.png new file mode 100644 index 0000000000000000000000000000000000000000..7d498a96e21a343346f11c4c1e7191dc0886eb81 GIT binary patch literal 3061 zcmZ{mX*kpi8^-@*8_8HAW;kS5*~VJNHo_ofX{=+NF@(t4Sh5U~HA}?EM49u-E^T8e z`%Wlp8iqM)gy>`^yw3Udet19J_wRb1>$$Jz>z!(CX$s*I;Q{~vVs2)9A=OpSr#`RvPrx?atvBjf?GQ7!vBxj-GbTFB8x!#i&;k#o$v4&}SOQnU6MEis{(IyB~ zy+W(SmO$#79&=|{Z=HPC5>)qKs)xS+)FD9L{V_Dsyt12%OW6CkL2 zu{Th%wpkl_2b9vrEwk!_=uyW2*JT-r4t1AtD03;ZiM%54^=g^t@_@LZy zn3|bn{u?fPj2zpj##VW?0%(S0`a#?GTwnp^48Qw}vaQwNZPLD&+8J^A zch+9+Sz8+Oz4W-8T9rgK3-St7xtz)-ZMl7JW2byj*bXhBn^uk|CSXN4J=z>d_@&!C`|i|XoWZXV!bKe4^|W(ErbQ!KqbLD!sa@a? zvj#H>LclNARI7As=QUEn4hOxYjXYfxhuvlY8!{bKU=BaOm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Km~C*G zrqo!>I=@@z5Hjvm0?jHZr7f0BVm+^uZd924G>!aBvfN0)<&3FNgmYTh%?6FlM0-LLUfctY@#VWwh&pE4PB|9)XDG&Cf2kXYCT zK=D2|G8;i@Y|@fu2576fN(Me81Zd&_FY&ZLOb7IfIVy63_V{VuGR?Q>>%fCEaNvB%|%aXUP#M(I)55>Iq^M;HQuY-sxO2l@^dZ@hcfr8zhW!G_GE z9W%_5>61Kh4Q$CLU?4Ty{n9sQ%M_L}A8RA^pLH*YE}xV?D@O6JT2?D3Inq{hN3jkXBIGzN8%<5`f=zd7Tn?Wo5RwwG*m2)vt+u`F2zdZ`UO8O2E0^z_P zuPYpm;RyHS!|sY)z@RIY{5J2}1Mv#^+_m+ROJyzTz}Y?b|4yr@`s}GxZ5&&;%RK(qQRiRXP5xh z1o%|34%bRnNrzG?Th>xq=`SftJ>TjkOIQ?1NX6s^*z;;!K6Bc-xS~tzc!=VwCzxkD zHC;;qaLH3TNtXa+5cPvsBT5!_Y)J)p`{}j}B{P;yMT6&Ek^9KBq62O(?X1teu#Jd4 zv5d*_y_Ti?<}J-4c8W%@`x_1p>lqA`16zN%ZE1iu8IcKP|tgBHvCtZ?%>P)jC*Xy4 zbaM{+{{bxa+Lg-y`=1RaXlG2Iov#x>%@J+y1lRGhb8#|uvU3db>2*@PYy#-qGt{V1 Hw+;UFVdQ&MBb@0L8N*<^TWy literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-xhdpi/ic_menu_send.png b/android/app/src/main/res/drawable-xhdpi/ic_menu_send.png new file mode 100644 index 0000000000000000000000000000000000000000..6e5ec78103f8d68e143c41ecab75945d0102701a GIT binary patch literal 1775 zcmZ`)XFS^r7yjGh%1dihTWWi&R_w+IAqZ`(N{xobNQ|fut40M?qA0IhwYO`QY8$Op zIK?WNzEK;2ICB+Ft(u8zhf420YW#MnR7x4M#>zJf)JqqB31(Fu z3907D!WA7HX@g-Jonb0HVmH-NjpmHh;8F>|EmjM0@{KI-NEuL04t4Sv*D!)bs?4i~ zejy5J{ueL=!#8{m^qyYqqZGvsJ`Riuozc>&@Dv+?j1?dW=aL#$L#(Bz*o%U2OC((5 zfyb=Vb(v?z;0kbkbD-u`7_)RULsbU2V%0Aza;t|Q~9Ectp9To#aMQ_)aL^9*+mo?f_8-%!vRx#f--@4eGbehwH)4=|_qDm2#Xd-dAB>eT7OOsTz zV^n@x@+AOz(YQgsEM@^h<=_w$6qE`Bge>JgtXJNJ-0{UnR@F6F#beCh79u!B#9JYB zm+r#YCwk<2(m7%rJP|hNNWtN_7}YI%_h`mv6j)?4K(lWny3}O6htWjc@{O(qK&&ax z_gZql+36&nf%!NfyDlxvJk=ZRJ-c8*+M3Oi(%10eEGSvjMy$zhuQY=3&SPXh28n{? z0R$5;pOf08=jPCXjH7WE{3DTvI^22_(4`gyF+Usr$ zY361_{Y0#dVwu6Kstk|4n6RctPf+RfKW|==u48xsf%jj9wG8|77eJejyO~zujqOur z7M+CQNPKUVg<=+;>~`w+&rSI{#**4edWW4|;wP0qFkI@55<}-`mtLf7J5YZWk|kyr zY1Kj$OJI7NE`39jL}~SVL;2$Pd&W{3Gz%qr?x|sUJs(M-x!kRko}eJz(U!da2jjvL zu2N1%ApmdJS-0Dxv_bnHvze{R7v7rq$lVpefMg@!R8bJTdRL}PCPw(yREtYe^l61K zXI)q_HL>kSZtvw4ZKv%Fai8w}5q|EPDx^vAP^%xWrVrogp{d=qGTY_T`=@EvKhN&+ z)XHMntGZ&7JnuO6FHj1%bPf0Q3db7y5V33lw82_h>R?@UZGC4j#85}iP)A1{Y+wim z3oA6Y|BvAg!8ZUG{r?T|@e(|2!}*^RZV+(cQC>tW0P`hyV`Xjbc==(SuwK5=p;W9f Py9ltcw1YRBW0L*`nddO% literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-xhdpi/ic_notification_icon.png b/android/app/src/main/res/drawable-xhdpi/ic_notification_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..fd58378688994a956753f806404f7d78abbdbfa1 GIT binary patch literal 687 zcmV;g0#N;lP)GjTDHkD5m8g}Epdtzi zJ{s{95ljLW1_BZFd}RC%{tkw9Z+F&nH?ufD_;9el*}3`b?auz@CMHIQ4jnIoF%}DQ zKtI?9*UY^LMmT;=-_6I6%g5wo@a13;{A2D%&?e8vummckB+w`idqmBqP8S7GPSyZvuxPV8J-Go3d#apcj%^ z^x2$u7>&TZP1}5G*DTR*JeUTLLjR9;b35`yVDq&Cd!Pff2>Ap$#_5$6pmR&XiQyOK zWkQ|Mr;$!D7VR@|Dde+E^36iNhi)m6I?APjN#VS468PixL+nIg-XuRL)LAXOKkx(8 zfL1SNp*Il_+U$cFi~h8LTenagC;+D_3w$z}%gZU31SaSlH3e)IO7-Bk@&dFRZ2;}U zeE!*Rj?w}j!GcX`uIw|wuXZ-50$Y9*m;s|89hA_NdFLkqK8>D%ZjeZC+Z}N4Cjmy~ z!U#wMP2k9H0%3_R@PR%r{3gKY_NfKQpb;$7I$#cDfJ|`gmcUOchrbH>6roI>l@Q>6 zN*#bo%9nw2Ay-9WQzq;f7C`Q=$RgB2Jl1JuiYK9Pe6i@i5VVQ!6Q=@epxA<1Y8McW ztwj*vSMnRZCw>XXS1tOlru9Q8+Gjxjt)d0qlfW(2E?#lupzW26z$Vo)DzYIXFzoRL zhivdM4Xe1tBohxbCaEnZuQ&N*uDtvvpJAJIfa;N(|1j{s?0K7YkU80A)uH2^#S;;{ V=}&KlREq!r002ovPDHLkV1malGJOC5 literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-xhdpi/ic_stat_name.png b/android/app/src/main/res/drawable-xhdpi/ic_stat_name.png new file mode 100644 index 0000000000000000000000000000000000000000..ffe95a3bafbf810bf5bfff7c6f944e45aeee66e2 GIT binary patch literal 831 zcmV-F1Hk-=P)vh+@dU1(}VK5{05Hrm(QG zB4s1VpM=-*&VBFo-pBdA?%eslJNK*m)UTQQp7)&dJ~QXud(NFTt5QiMEhetNGElU* z{(1)9gNtAo3^kae;BX+WbLpHqcTik^$iR1S1q^~N(9V6PD~!1W%nQWZZO#F334F7f z5^<09n(3%o)4jUNa_GU;j8c=CXzCdoT4CIj%VF17PfU!F41S@|w_bxIuKlIO zl#P~A(m@Sr{&wy)R;M&Kj%^T3?wf@&Ux2#RKCj-{!p~XH+ zhBv+xXkf&*S^Jo4AGO$oU4P>IkfcNgCM;GN-~_Mf7&t3YuIIY7=?%Nf`jpl{J?YbC z@`jZbH1G=ayFR5h@D*$WvwfbIl-R&q@DbbrD}A1ql-R%pa1Q(g_rOvKoGqlp22O)z z;I>3dNk0s%7TW{4KBYA<0@^??xC(wq^krc_^(n6b7uT)0K01GcQ{wji(h3HwZ7X;z z(Q+CGy%xW3`OP&TQ{PUr0X?{^m+0xFI%DxZyVj3Z@mNf^8z;Acc%oX;fomFwh4>zc z96H<>kHRUjVXxHxhBY~U_f3_44K)}l2f;`-UZ7qEkK zW=dL%)s%>H*nsLeSO+>dw&>3Q}EcvKMj%~bz*sb%BE_17~{N^$+IZ=li)=`W;Qno3EXnj8QC002ov JPDHLkV1nW|lDz-` literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-xxhdpi/ic_notification_icon.png b/android/app/src/main/res/drawable-xxhdpi/ic_notification_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1d5a932f4c72f16e5587f19a22d81c2031ca25e3 GIT binary patch literal 1074 zcmV-21kL-2P)@t&KR!(Ffeq$EPl zE>H`agf}A|LFSO69)aC5M>m2BDd&&yZm0+n%t_`}peiQ=-0|>}<5rMhZnEmgP!W_5 z8in`6jUd4s^Hl^@@LdhMAem!@il7G8{6QBab8Ju%)aIe4ye|dG9NSa``6b*6`WIS| z7NiAfK|v5y35pzW)NpN)B9%6|?FF0NmX|0&#SY8JQoe!SGPZ%&F$85fEN>OK$x(eE z1kC`)ql^iEfrSps8v=4TQb@RLWxDOGRX)y1U`AK6>}@7*rxm}o|j72f=oaQ;&8z;L{l^W^KJyndk*B&UCu8;%cW{geW(gkDgrRx#G^YC&3% z7G&3orI4B6Oqc}8MS;>7Of@v~X<%ct@&YNy;l0R?;z=zi`ZobbVwD$IL56U^`krQC;VHVUg)c6VRfvsRH zr#04rTj0AE)E&P$0k#Q@;xwv!s%m&F^nzrxu|KpLjNrWVKJZjnd{Gcl*2oFFnp<@WN#o^{V^DztYs|b<CYqRI zMD@b~KkRx|jhF7O@x#7(l}OCKd4nY5e_m)24nH*TK=jRjUNDK0Gj{oG-QEd* sZ1^=kG4-6>mpNo4>CmA=hYtV8Uw71l+f+N5wEzGB07*qoM6N<$f*1zz$N&HU literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-xxhdpi/ic_stat_name.png b/android/app/src/main/res/drawable-xxhdpi/ic_stat_name.png new file mode 100644 index 0000000000000000000000000000000000000000..04ba4a3c00d216d15d2bbeb34c04072cd20dccef GIT binary patch literal 1300 zcmV+v1?&2WP)x=vMBojcvPy1IJ7f|iz+ zLj_toXf6>o=8EPLQDd%XE)g~6islkgW3Ff}5jFPV8|p>sdTJ}Rnc6f*x&)yQdc2VJ z?RI~{|tv6R-KtPK1ojRR*#K%;L){Cey;U$D{mS~;11k()2urc^p>}se) z>qOM(e2s8fHRhL7fEfg2*jRi_HntM#kEqeHYj&M_n*e4QkYQu;v6WD7M2*faYMFYQ z07eVQZrnDu66%ep(XoG{jk@;~V6=ejUSwk{q27oZoz3cN3K$_E!^S3K?V!Gh8l6q* zYYG@WAe&5O5_!tx&y z?|;-b>M$>RH7PT0()z=I2@1$~oI1|S+JI0F$k^&-Z9r%PY6I#4qX%Tmqi1E;u>RLPVoh?aQSp+m4Y|e9P(pDQ#!XMN|X{!w=VSPngSq1bx!s2<)!)P7IETG@1 zCy+dA4FZ`2WWSuJ5T3JsrtYH_X}v0tNkE?>Tw32Dg!ChIH-^|Pf=mMXgjzxEM0d_( zlfyfyHK+*+nFO?tT12g+ZlvD#pB_Y><3?4s)dJJKHWV}l~ zK&?qUSqHR~Iul`zRD@(p9k)`)xW{&`?)5UGSpi{oU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<7*7&~dq1 z-ey+<($8Iff7xiCU+cmDYN`byGzU}jF*PMz=TkLD^DoIyv`S)V8(){G v(sakCB*^&FR^p5X27|$1Fc=I5qdwwaLY6Z$+mp8c00000NkvXXu0mjf760ge literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-xxxhdpi/ic_stat_name.png b/android/app/src/main/res/drawable-xxxhdpi/ic_stat_name.png new file mode 100644 index 0000000000000000000000000000000000000000..482376aa269f173c1e86ee9156c425ae0ca149e0 GIT binary patch literal 2226 zcmaJ@dpy(YAD=Oot<5x-*bsA2iqMGVvYMipsT@?8pM=pkQ7*ZR+=nliIZDh;r%TR>N{RG2@K-z0T|R`{Vb=_xpXlKF{-cKJVxGyr1{`n@J=bhJrP~ z0002$#-y zPQ>_#+nh=e{!?S8tpZ=h@7z10Kz>S_vO}K;;exay6 zYCZq5M06skLxCJLmdK29i7IM8YdzBVrV-{>b~vcRNXglQihln#mlpAX%zseQ0xt6W$kB;7%cvhHCt3h!SrJ_qaQKlX_ECU=g zH=e2JM_5{yk<4aGjc2ry@iq$N@a(-8U*k9+7O8gn4zi*_5-9+l=|0_m-13k=fm_WHffWwG$8q zT9w`1O!#td-dV9|c!>$yA2P_}t~CpoYk+h{b*6y3dt$z`4Hd z>^U!<(Cjr@=_cv-fR)7TiNy7g6}eYJ%@ghGEzpGFjE&vqhq9nFO_tT&gZ?(59z8m9 zvfYR(UH}p`1YP7xKTCWP$+#i_kJkg@z|G-sp>10_Cr~jCat4W2`c*JCvI@}|xmHVp zLH2MxK`+=kGbd~Jluo`+Tg;O_!`UsjREcD9Hz3}X%lz#);Hx(;#+YI#(7Qyjs<(S* zpSp>_#<8Xbn8%VMQ0SZ-UgumnNptj$s$EX(vYSRvu373FJqz3&SYFK~0H3bvU%aqGB?^iR>*rr)< z0kE;>B1S$Ad?9}d9~q|zy$ul5dqaWRI%@zw&4kKRY(r2`x`3Q9H@5s){t8^%!kacn zjGs>J{t;gtSZEQ=o49zC_fX`&C+BmDDLvm_AZ$7Dy^#>+s_OTGI_K|C(U^2}TjJyN z856W}lH!1!-^pq*Ch0rSr@`_j4)gBZN~K)6er&6qnYY%^pFwo+ckH^C2ijjRfOvJz zi5CQa6}D4W3}MG)zQf1MHk5`~x55^WrAS9K)laMN!ahu}9h)&kFc&t|4_9|YMOpe{ z#2RBv+y~$;RYr1HHN8rx@?&#b_TKLvY)`2djk!KK z@dejY?v?xltG&MwoZ!~_s>p$rV4OxfJB#rS8#EO5Z2R!+=6_Q_J5(z7a0`wN^4xD; zMR1LwCcww|i)iDuOY+UtHg6)HCyAZbX+MbYNX`@RFM+m2ssD=YE6lnb##>(q*?QHc z88tv(=-4EDpS9yI@z;f6!BPzK*3x2CFJPAk$Idq&X?BDs*earF< z5<2gs5`r{TMGkCWG<6Y4^P>{-1C_C?2Sx{5`c<`Rz5?f(H3m37*}k3I zj%+cRjCL0r@QO{DkTzhQ=12c^bml4ihSC&f0^unT%&_)~;sGTxh-Dw`vKUCg^18jJ zwUH~DPH%NL_|3ir+_e}|GUP^aUM=@OQ9WGD~LyLnAN_P{dt^It;X}m9dh2+jZ?a|iq9L* zUOJr~ZXj$aKV)jzs}#|nvEgyBVN4rRQ|<9fY_C%>*5Mi#gsLx^~ z{pFl!|E;;vmSX+0$a8o2jQ$$$C(GglZOOO*jf3tE7enb5?^1|j_bBJl5+%a(Fnsh( z9QPwaAn^gjXhpl2X#gMgT$b(Dy#r;Un?}6k#?;N|1Et7`KjhXEEyPCSx{wVQRG%yO zY?bm`@I#lV!i0>uq0o7~+VX+axh+K!zic(WuxY`D3$*{|=aAF`jQZFZZPX2ywX6K> RJjuTZz{!DtuRTCY{u`(}90vdZ literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable/checkbox.xml b/android/app/src/main/res/drawable/checkbox.xml new file mode 100644 index 0000000..bdce318 --- /dev/null +++ b/android/app/src/main/res/drawable/checkbox.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/dialog_spinner.xml b/android/app/src/main/res/drawable/dialog_spinner.xml new file mode 100644 index 0000000..9e46a9b --- /dev/null +++ b/android/app/src/main/res/drawable/dialog_spinner.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/dialog_spinner_light.xml b/android/app/src/main/res/drawable/dialog_spinner_light.xml new file mode 100644 index 0000000..01a9b3b --- /dev/null +++ b/android/app/src/main/res/drawable/dialog_spinner_light.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/dialog_textarea.xml b/android/app/src/main/res/drawable/dialog_textarea.xml new file mode 100644 index 0000000..0cb075c --- /dev/null +++ b/android/app/src/main/res/drawable/dialog_textarea.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/dialog_textarea_light.xml b/android/app/src/main/res/drawable/dialog_textarea_light.xml new file mode 100644 index 0000000..a7faf8a --- /dev/null +++ b/android/app/src/main/res/drawable/dialog_textarea_light.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/successfully_state_shape.xml b/android/app/src/main/res/drawable/successfully_state_shape.xml new file mode 100644 index 0000000..8ca0924 --- /dev/null +++ b/android/app/src/main/res/drawable/successfully_state_shape.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/tabwidget.xml b/android/app/src/main/res/drawable/tabwidget.xml new file mode 100644 index 0000000..df9df9b --- /dev/null +++ b/android/app/src/main/res/drawable/tabwidget.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/tabwidget_default.xml b/android/app/src/main/res/drawable/tabwidget_default.xml new file mode 100644 index 0000000..989948b --- /dev/null +++ b/android/app/src/main/res/drawable/tabwidget_default.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/tabwidget_selected.xml b/android/app/src/main/res/drawable/tabwidget_selected.xml new file mode 100644 index 0000000..5753c6c --- /dev/null +++ b/android/app/src/main/res/drawable/tabwidget_selected.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable/textarea.xml b/android/app/src/main/res/drawable/textarea.xml new file mode 100644 index 0000000..12e2e38 --- /dev/null +++ b/android/app/src/main/res/drawable/textarea.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/layout-ldpi/checkbox_prefw.xml b/android/app/src/main/res/layout-ldpi/checkbox_prefw.xml new file mode 100644 index 0000000..fb96fb9 --- /dev/null +++ b/android/app/src/main/res/layout-ldpi/checkbox_prefw.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/layout-v11/about_application_activity.xml b/android/app/src/main/res/layout-v11/about_application_activity.xml new file mode 100644 index 0000000..84cdecd --- /dev/null +++ b/android/app/src/main/res/layout-v11/about_application_activity.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + +