├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── themes.xml
│ │ │ │ └── strings.xml
│ │ │ ├── values-land
│ │ │ │ └── dimens.xml
│ │ │ ├── values-w1240dp
│ │ │ │ └── dimens.xml
│ │ │ ├── values-w600dp
│ │ │ │ └── dimens.xml
│ │ │ ├── drawable
│ │ │ │ ├── start.png
│ │ │ │ ├── ic_call.png
│ │ │ │ ├── ic_clock.png
│ │ │ │ ├── ic_emoji.png
│ │ │ │ ├── ic_info.png
│ │ │ │ ├── ic_mic.png
│ │ │ │ ├── ic_star.png
│ │ │ │ ├── ic_users.png
│ │ │ │ ├── lc_mail.png
│ │ │ │ ├── ic_callend.png
│ │ │ │ ├── ic_history.png
│ │ │ │ ├── ic_message.png
│ │ │ │ ├── ic_micoff.png
│ │ │ │ ├── ic_recents.png
│ │ │ │ ├── ic_search.png
│ │ │ │ ├── main_logo.png
│ │ │ │ ├── ic_back_arrow.png
│ │ │ │ ├── ic_bluetooth.png
│ │ │ │ ├── ic_call_made.png
│ │ │ │ ├── ic_call_white.png
│ │ │ │ ├── ic_contacts.png
│ │ │ │ ├── ic_favorites.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_white_call.png
│ │ │ │ ├── search_icon.png
│ │ │ │ ├── bottom_nav_menu.png
│ │ │ │ ├── ic_attach_file.png
│ │ │ │ ├── ic_attach_image.png
│ │ │ │ ├── ic_call_outline.png
│ │ │ │ ├── ic_info_outline.png
│ │ │ │ ├── ic_mail_outline.png
│ │ │ │ ├── ic_mic_outline.png
│ │ │ │ ├── ic_share_white.png
│ │ │ │ ├── ic_star_outline.png
│ │ │ │ ├── ic_volume_high.png
│ │ │ │ ├── phone_bule_all.png
│ │ │ │ ├── phone_bule_all1.png
│ │ │ │ ├── ic_bluetooth_audio.png
│ │ │ │ ├── ic_callend_outline.png
│ │ │ │ ├── ic_callend_white.png
│ │ │ │ ├── ic_clock_outline.png
│ │ │ │ ├── ic_contact_default.png
│ │ │ │ ├── ic_fluent_record.png
│ │ │ │ ├── ic_keyboard_white.png
│ │ │ │ ├── ic_message_outline.png
│ │ │ │ ├── ic_micoff_outline.png
│ │ │ │ ├── ic_users_outline.png
│ │ │ │ ├── phone_blue_outline.png
│ │ │ │ ├── ic_contact_default1.png
│ │ │ │ ├── ic_voice_recognition.png
│ │ │ │ ├── phone_blue_outline1.png
│ │ │ │ ├── ic_call_outline_white.png
│ │ │ │ ├── ic_callend_outline_white.png
│ │ │ │ ├── none_background.xml
│ │ │ │ ├── ic_none_background.xml
│ │ │ │ ├── ic_avatar_background.xml
│ │ │ │ ├── ic_search_bar_background.xml
│ │ │ │ ├── search_bar_background.xml
│ │ │ │ ├── green_button_background.xml
│ │ │ │ ├── rounded_background.xml
│ │ │ │ ├── favorite_active_background.xml
│ │ │ │ ├── search_contact_button.xml
│ │ │ │ ├── normal_background.xml
│ │ │ │ ├── avatar_background.xml
│ │ │ │ ├── rounded_border.xml
│ │ │ │ ├── share_background.xml
│ │ │ │ ├── circle_border.xml
│ │ │ │ ├── search_active_button.xml
│ │ │ │ ├── ic_launcher_foreground.xml
│ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.webp
│ │ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.webp
│ │ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.webp
│ │ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.webp
│ │ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.webp
│ │ │ │ └── ic_launcher_round.webp
│ │ │ ├── layout
│ │ │ │ ├── employee_list.xml
│ │ │ │ ├── contacts_container.xml
│ │ │ │ ├── incoming_call_detail.xml
│ │ │ │ ├── recents_container.xml
│ │ │ │ ├── call_history_item.xml
│ │ │ │ ├── favorite_add.xml
│ │ │ │ ├── search_contacts_item.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── bottom_navigation.xml
│ │ │ │ ├── dialog_set_default.xml
│ │ │ │ ├── call_history.xml
│ │ │ │ ├── contact_item.xml
│ │ │ │ ├── sms_send.xml
│ │ │ │ ├── favorite_list_item.xml
│ │ │ │ ├── profile_detail.xml
│ │ │ │ └── search_contacts_container.xml
│ │ │ ├── navigation
│ │ │ │ └── nav_graph.xml
│ │ │ ├── menu
│ │ │ │ ├── sms_popup_menu.xml
│ │ │ │ ├── history_popup_menu.xml
│ │ │ │ ├── menu_main.xml
│ │ │ │ └── bottom_nav_menu.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── values-night
│ │ │ │ └── themes.xml
│ │ │ ├── values-v23
│ │ │ │ └── themes.xml
│ │ │ ├── xml
│ │ │ │ ├── accessibility_service_config.xml
│ │ │ │ ├── backup_rules.xml
│ │ │ │ └── data_extraction_rules.xml
│ │ │ ├── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── layout-v21
│ │ │ │ └── bottom_navigation.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── pms_client
│ │ │ │ ├── SearchContactsItem.java
│ │ │ │ ├── Contact.java
│ │ │ │ ├── RecentsListContainer.java
│ │ │ │ ├── ContactsListContainer.java
│ │ │ │ ├── ContactDetail.java
│ │ │ │ ├── ProfileDetail.java
│ │ │ │ ├── FavoriteListItem.java
│ │ │ │ ├── IncomingCallHelper.java
│ │ │ │ ├── SearchContactAdapter.java
│ │ │ │ ├── CallHistory.java
│ │ │ │ ├── OverlayService.java
│ │ │ │ ├── SearchContactsContainer.java
│ │ │ │ ├── FavoriteAdd.java
│ │ │ │ ├── SMSStateManager.java
│ │ │ │ ├── OverlayDialog.java
│ │ │ │ ├── CallStateManager.java
│ │ │ │ ├── WebSocketManager.java
│ │ │ │ ├── FavoriteAdapter.java
│ │ │ │ ├── FavoriteListContainer.java
│ │ │ │ ├── FavoriteListHelper.java
│ │ │ │ ├── ContactAdapter.java
│ │ │ │ └── SMSSend.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── pms_client
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── pms_client
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
└── build.gradle
├── README.md
├── .idea
├── .gitignore
├── dictionaries
│ └── AOC.xml
├── vcs.xml
├── compiler.xml
├── appInsightsSettings.xml
├── migrations.xml
├── deploymentTargetSelector.xml
├── misc.xml
├── material_theme_project_new.xml
├── deviceManager.xml
├── inspectionProfiles
│ └── Project_Default.xml
└── gradle.xml
├── gradle
├── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
└── libs.versions.toml
├── .gitignore
├── settings.gradle
├── gradle.properties
├── gradlew.bat
└── gradlew
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # LogiPhone
2 | Android App for company employees
3 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 |
--------------------------------------------------------------------------------
/app/src/main/res/values-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 48dp
3 |
--------------------------------------------------------------------------------
/.idea/dictionaries/AOC.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w1240dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 200dp
3 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w600dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 48dp
3 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/drawable/start.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/start.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_call.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_call.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_clock.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_emoji.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_emoji.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_info.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_mic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_mic.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_star.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_users.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_users.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/lc_mail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/lc_mail.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_callend.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_callend.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_history.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_history.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_message.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_micoff.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_micoff.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_recents.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_recents.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/main_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/main_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_back_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_back_arrow.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bluetooth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_bluetooth.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_call_made.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_call_made.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_call_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_call_white.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_contacts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_contacts.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_favorites.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_favorites.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_white_call.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_white_call.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/search_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/search_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bottom_nav_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/bottom_nav_menu.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_attach_file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_attach_file.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_attach_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_attach_image.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_call_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_call_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_info_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_info_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_mail_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_mail_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_mic_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_mic_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_share_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_share_white.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_star_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_star_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_volume_high.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_volume_high.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/phone_bule_all.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/phone_bule_all.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/phone_bule_all1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/phone_bule_all1.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bluetooth_audio.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_bluetooth_audio.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_callend_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_callend_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_callend_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_callend_white.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_clock_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_clock_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_contact_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_contact_default.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_fluent_record.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_fluent_record.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_keyboard_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_keyboard_white.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_message_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_message_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_micoff_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_micoff_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_users_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_users_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/phone_blue_outline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/phone_blue_outline.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_contact_default1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_contact_default1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_voice_recognition.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_voice_recognition.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/phone_blue_outline1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/phone_blue_outline1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_call_outline_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_call_outline_white.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_callend_outline_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/drawable/ic_callend_outline_white.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vector41/old-logi-app/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/drawable/none_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_none_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_avatar_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/appInsightsSettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_search_bar_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/search_bar_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/green_button_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rounded_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/favorite_active_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/search_contact_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/employee_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/normal_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Aug 18 07:14:26 VLAT 2024
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/avatar_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rounded_border.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/share_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/navigation/nav_graph.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/.idea/migrations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/sms_popup_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/deploymentTargetSelector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/circle_border.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/history_popup_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/src/main/res/values-v23/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
--------------------------------------------------------------------------------
/.idea/material_theme_project_new.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/example/pms_client/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/xml/accessibility_service_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/backup_rules.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
--------------------------------------------------------------------------------
/.idea/deviceManager.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | google {
4 | content {
5 | includeGroupByRegex("com\\.android.*")
6 | includeGroupByRegex("com\\.google.*")
7 | includeGroupByRegex("androidx.*")
8 | }
9 | }
10 | mavenCentral()
11 | gradlePluginPortal()
12 | }
13 | }
14 | dependencyResolutionManagement {
15 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
16 | repositories {
17 | google()
18 | mavenCentral()
19 | }
20 | }
21 |
22 | rootProject.name = "PMS_Client"
23 | include ':app'
24 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/bottom_nav_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/data_extraction_rules.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FF000000
4 | #FFFFFFFF
5 | #007BFF
6 | #28A745
7 | #17A2B8
8 | #FFC107
9 | #DC3545
10 | #6C757D
11 | #DADADA
12 | #EAEAF3
13 | #EFEDF6
14 | #DDE2F9
15 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/SearchContactsItem.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | public class SearchContactsItem {
4 |
5 | private String name = "";
6 | private int contactId = 0;
7 | private int color = 0;
8 |
9 | public SearchContactsItem(String name, int contactId, int color) {
10 |
11 | this.name = name;
12 | this.contactId = contactId;
13 | this.color = color;
14 | }
15 |
16 | public String getName() {
17 | return name;
18 | }
19 |
20 | public String getNickName() {
21 | return name.substring(0, 1);
22 | }
23 |
24 | public int getContactId() {
25 | return contactId;
26 | }
27 |
28 | public int getIconColor() {
29 | return color;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/Contact.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | public class Contact {
4 | private String name;
5 | private String officePhone;
6 | private String mobilePhone;
7 | private int iconResourceId;
8 |
9 | public Contact(String name, String officePhone, String mobilePhone, int iconResourceId) {
10 | this.name = name;
11 | this.officePhone = officePhone;
12 | this.mobilePhone = mobilePhone;
13 | this.iconResourceId = iconResourceId;
14 | }
15 |
16 | public String getName() {
17 | return name;
18 | }
19 |
20 | public String getOfficePhone() {
21 | return officePhone;
22 | }
23 | public String getMobilePhone() {
24 | return mobilePhone;
25 | }
26 | public int getIconResourceId() {
27 | return iconResourceId;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/RecentsListContainer.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.os.Bundle;
4 |
5 | import androidx.annotation.Nullable;
6 | import androidx.appcompat.app.AppCompatActivity;
7 |
8 | import com.google.android.material.bottomnavigation.BottomNavigationView;
9 |
10 | public class RecentsListContainer extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(@Nullable Bundle savedInstanceState) {
14 |
15 | super.onCreate(savedInstanceState);
16 | setContentView(R.layout.recents_container);
17 |
18 | BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_navigation_recent);
19 | bottomNavigationView.findViewById(R.id.nav_history).setEnabled(true);
20 | }
21 |
22 | @Override
23 | protected void onDestroy() {
24 | super.onDestroy();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/ContactsListContainer.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.os.Bundle;
4 |
5 | import androidx.annotation.Nullable;
6 | import androidx.appcompat.app.AppCompatActivity;
7 |
8 | import com.google.android.material.bottomnavigation.BottomNavigationView;
9 |
10 | public class ContactsListContainer extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(@Nullable Bundle savedInstanceState) {
14 |
15 | super.onCreate(savedInstanceState);
16 | setContentView(R.layout.contacts_container);
17 |
18 | BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_navigation_contact);
19 | bottomNavigationView.findViewById(R.id.nav_contacts).setEnabled(true);
20 | }
21 |
22 | @Override
23 | protected void onDestroy() {
24 | super.onDestroy();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/example/pms_client/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.example.pms_client", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/ContactDetail.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.FrameLayout;
9 | import android.widget.TextView;
10 | import android.widget.ListView;
11 |
12 | import androidx.annotation.LayoutRes;
13 | import androidx.annotation.NonNull;
14 | import androidx.annotation.Nullable;
15 | import androidx.appcompat.app.AppCompatActivity;
16 |
17 | public class ContactDetail extends AppCompatActivity {
18 |
19 | @Override
20 | protected void onCreate(@Nullable Bundle savedInstanceState) {
21 |
22 | super.onCreate(savedInstanceState);
23 | setContentView(R.layout.contact_detail);
24 | }
25 |
26 | @Override
27 | protected void onDestroy() {
28 | super.onDestroy();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/ProfileDetail.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.FrameLayout;
9 | import android.widget.TextView;
10 | import android.widget.ListView;
11 |
12 | import androidx.annotation.LayoutRes;
13 | import androidx.annotation.NonNull;
14 | import androidx.annotation.Nullable;
15 | import androidx.appcompat.app.AppCompatActivity;
16 |
17 | public class ProfileDetail extends AppCompatActivity {
18 |
19 | @Override
20 | protected void onCreate(@Nullable Bundle savedInstanceState) {
21 |
22 | super.onCreate(savedInstanceState);
23 | setContentView(R.layout.profile_detail);
24 | }
25 |
26 | @Override
27 | protected void onDestroy() {
28 | super.onDestroy();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/contacts_container.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/search_active_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | -
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. For more details, visit
12 | # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Enables namespacing of each library's R class so that its R class includes only the
19 | # resources declared in the library itself and none from the library's dependencies,
20 | # thereby reducing the size of the R class for that library
21 | android.nonTransitiveRClass=true
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/FavoriteListItem.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | public class FavoriteListItem {
4 |
5 | private int id = 0;
6 | private String lookupKey = "";
7 | private String name = "";
8 | private String phone = "";
9 | private String phoneTitle = "";
10 | private int color = 0;
11 | private boolean shared = false;
12 |
13 | public FavoriteListItem(int id, String lookupKey, String name, String phone, String phoneTitle, int color, boolean shared) {
14 |
15 | this.id = id;
16 | this.lookupKey = lookupKey;
17 | this.name = name;
18 | this.phone = phone;
19 | this.phoneTitle = phoneTitle;
20 | this.color = color;
21 | this.shared = shared;
22 | }
23 |
24 | public int getId() {
25 | return id;
26 | }
27 |
28 | public String getLookupKey() {
29 | return lookupKey;
30 | }
31 |
32 | public String getName() {
33 | return name;
34 | }
35 |
36 | public String getNickName() {
37 | return name.substring(0, 1);
38 | }
39 |
40 | public String getPhone() {
41 | return phone;
42 | }
43 |
44 | public String getPhoneTitle() {
45 | return phoneTitle;
46 | }
47 |
48 | public int getIconColor() {
49 | return color;
50 | }
51 |
52 | public boolean getShared() {
53 | return shared;
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/IncomingCallHelper.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.util.Log;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.widget.TextView;
10 |
11 | import org.json.JSONException;
12 | import org.json.JSONObject;
13 |
14 | public class IncomingCallHelper {
15 |
16 | private Context context;
17 | private View view;
18 |
19 | public IncomingCallHelper(Context context, View view) {
20 | this.context = context;
21 | this.view = view;
22 | }
23 |
24 | public void displayIncomingDetail(JSONObject obj) {
25 |
26 | JSONObject paramObj = obj;
27 | try {
28 | TextView companyText = (TextView) view.findViewById(R.id.incoming_company);
29 | TextView nameText = (TextView) view.findViewById(R.id.incoming_name);
30 | TextView numberText = (TextView) view.findViewById(R.id.incoming_number);
31 |
32 | String companyName = paramObj.getString("company_name");
33 | String name = paramObj.getString("person_name");
34 | String number = "";
35 |
36 |
37 | companyText.setText(companyName);
38 | nameText.setText(name);
39 | numberText.setText(number);
40 | } catch (JSONException e) {
41 | throw new RuntimeException(e);
42 | }
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | alias(libs.plugins.androidApplication)
3 | }
4 |
5 | android {
6 | namespace 'com.example.pms_client'
7 | compileSdk 34
8 |
9 | defaultConfig {
10 | applicationId "com.example.pms_client"
11 | minSdk 21
12 | targetSdk 34
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | debuggable false
24 | }
25 | }
26 | compileOptions {
27 | sourceCompatibility JavaVersion.VERSION_1_8
28 | targetCompatibility JavaVersion.VERSION_1_8
29 | }
30 | buildFeatures {
31 | viewBinding true
32 | }
33 | }
34 |
35 | dependencies {
36 |
37 | implementation libs.appcompat
38 | implementation libs.material
39 | implementation libs.constraintlayout
40 | implementation libs.navigation.fragment
41 | implementation libs.navigation.ui
42 | implementation libs.socket.io.client
43 | implementation libs.java.android.websocket.client
44 | implementation libs.okhttp.v491
45 | implementation libs.okhttp
46 | implementation libs.pusher.java.client
47 | testImplementation libs.junit
48 | androidTestImplementation libs.ext.junit
49 | androidTestImplementation libs.espresso.core
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/incoming_call_detail.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
22 |
23 |
30 |
31 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/gradle/libs.versions.toml:
--------------------------------------------------------------------------------
1 | [versions]
2 | agp = "8.3.1"
3 | javaAndroidWebsocketClient = "1.2.2"
4 | junit = "4.13.2"
5 | junitVersion = "1.1.5"
6 | espressoCore = "3.5.1"
7 | appcompat = "1.6.1"
8 | material = "1.10.0"
9 | constraintlayout = "2.1.4"
10 | navigationFragment = "2.6.0"
11 | navigationUi = "2.6.0"
12 | okhttp = "4.12.0"
13 | okhttpVersion = "4.9.1"
14 | pusherJavaClient = "2.4.2"
15 | socketIoClient = "2.1.1"
16 |
17 | [libraries]
18 | java-android-websocket-client = { module = "tech.gusavila92:java-android-websocket-client", version.ref = "javaAndroidWebsocketClient" }
19 | junit = { group = "junit", name = "junit", version.ref = "junit" }
20 | ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
21 | espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
22 | appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
23 | material = { group = "com.google.android.material", name = "material", version.ref = "material" }
24 | constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
25 | navigation-fragment = { group = "androidx.navigation", name = "navigation-fragment", version.ref = "navigationFragment" }
26 | navigation-ui = { group = "androidx.navigation", name = "navigation-ui", version.ref = "navigationUi" }
27 | okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
28 | okhttp-v491 = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttpVersion" }
29 | pusher-java-client = { module = "com.pusher:pusher-java-client", version.ref = "pusherJavaClient" }
30 | socket-io-client = { module = "io.socket:socket.io-client", version = "2.1.1" }
31 |
32 | [plugins]
33 | androidApplication = { id = "com.android.application", version.ref = "agp" }
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/recents_container.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
23 |
24 |
30 |
31 |
32 |
38 |
39 |
40 |
41 |
49 |
50 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | LogiPhone
3 | Settings
4 | Next
5 | Previous
6 |
7 | 電話アプリをデフォルトとして設定してください
8 | 電話アプリで通話の発着信を行うには、これをデフォルトの通話アプリに設定する必要があります。
9 | デフォルトとして設定してください
10 | 電話 をデフォルトの電話アプリとして設定しますか?
11 | 電話
12 | 通話履歴へのアクセス権、SMSの送信権限が必要です
13 | 現在のデフォルト
14 | デフォルトに設定
15 | キャンセル
16 | 電話 現在のデフォルトが選択されました
17 | 電話が選択されました
18 |
19 | お気に入り
20 | 履歴
21 | 連絡先
22 |
23 | 電話帳
24 | 共有電話帳
25 | スマホのみ
26 | 対象
27 | 検索方法
28 | 五十音
29 | 県別
30 | 業種別
31 |
32 | 全て
33 | メッセージ
34 | 履歴を開く
35 | 詳細を開
36 | 追加
37 | 検索
38 | 検索設定
39 | 会社
40 | 個人
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/SearchContactAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.graphics.drawable.Drawable;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.BaseAdapter;
10 | import android.widget.LinearLayout;
11 | import android.widget.TextView;
12 | import android.widget.Toast;
13 | import androidx.core.content.ContextCompat;
14 |
15 | public class SearchContactAdapter extends BaseAdapter {
16 |
17 |
18 | private final Context context;
19 | private final int layoutId;
20 | private final SearchContactsItem[] contactsList;
21 |
22 | public SearchContactAdapter(Context context, int layoutId, SearchContactsItem[] contactsList) {
23 |
24 | this.context = context;
25 | this.layoutId = layoutId;
26 | this.contactsList = contactsList;
27 | }
28 |
29 | @Override
30 | public int getCount() {
31 | return contactsList.length;
32 | }
33 |
34 | @Override
35 | public Object getItem(int i) {
36 | return contactsList[i];
37 | }
38 |
39 | @Override
40 | public long getItemId(int i) {
41 | return i;
42 | }
43 |
44 | @SuppressLint("ViewHolder")
45 | @Override
46 | public View getView(int i, View view, ViewGroup viewGroup) {
47 |
48 | View lineItem;
49 | LayoutInflater layout = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
50 | lineItem = layout.inflate(layoutId, null);
51 |
52 | TextView nickName = (TextView)lineItem.findViewById(R.id.contact_avatar_nickname);
53 | TextView name = (TextView)lineItem.findViewById(R.id.search_contact_name);
54 | LinearLayout avatar = (LinearLayout)lineItem.findViewById(R.id.contact_avatar_container);
55 |
56 | SearchContactsItem searchContactsItem = contactsList[i];
57 | nickName.setText(searchContactsItem.getNickName());
58 | name.setText(searchContactsItem.getName());
59 |
60 | Drawable drawableAvatar = ContextCompat.getDrawable(this.context, searchContactsItem.getIconColor());
61 | avatar.setBackground(drawableAvatar);
62 |
63 | return lineItem;
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/CallHistory.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.os.Bundle;
4 | import android.view.MenuItem;
5 | import android.view.View;
6 | import android.widget.ImageView;
7 | import android.widget.Toast;
8 | import androidx.appcompat.app.AppCompatActivity;
9 | import androidx.appcompat.widget.PopupMenu;
10 |
11 | public class CallHistory extends AppCompatActivity {
12 | protected void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | setContentView(R.layout.call_history);
15 | ImageView backButton = findViewById(R.id.call_history_send_back);
16 | backButton.setOnClickListener(v -> finish());
17 | ImageView bottomNavMenu = findViewById(R.id.bottom_nav_menu);
18 |
19 | bottomNavMenu.setOnClickListener(new View.OnClickListener() {
20 | @Override
21 | public void onClick(View view) {
22 | showPopupMenu(view);
23 | }
24 | });
25 | }
26 |
27 | private void showPopupMenu(View view) {
28 | PopupMenu popup = new PopupMenu(this, view);
29 | popup.getMenuInflater().inflate(R.menu.history_popup_menu, popup.getMenu());
30 |
31 | popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
32 | @Override
33 | public boolean onMenuItemClick(MenuItem item) {
34 | int itemId = item.getItemId();
35 |
36 | if (itemId == R.id.copy_number) {
37 | Toast.makeText(CallHistory.this, "電話番号をコピー", Toast.LENGTH_SHORT).show();
38 | // Handle copy number action
39 | return true;
40 | } else if (itemId == R.id.block) {
41 | Toast.makeText(CallHistory.this, "ブロック", Toast.LENGTH_SHORT).show();
42 | // Handle block action
43 | return true;
44 | } else if (itemId == R.id.delete_history) {
45 | Toast.makeText(CallHistory.this, "履歴を削除", Toast.LENGTH_SHORT).show();
46 | // Handle delete history action
47 | return true;
48 | } else {
49 | return false;
50 | }
51 | }
52 | });
53 | popup.show();
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/OverlayService.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.app.Activity;
5 | import android.app.ActivityManager;
6 | import android.app.Application;
7 | import android.app.Notification;
8 | import android.app.NotificationChannel;
9 | import android.app.NotificationManager;
10 | import android.app.Service;
11 | import android.content.ComponentName;
12 | import android.content.Context;
13 | import android.content.Intent;
14 | import android.graphics.PixelFormat;
15 | import android.os.Build;
16 | import android.os.Bundle;
17 | import android.os.IBinder;
18 | import android.view.Gravity;
19 | import android.view.LayoutInflater;
20 | import android.view.View;
21 | import android.view.WindowManager;
22 | import android.widget.Button;
23 | import android.widget.ImageView;
24 | import android.widget.Toast;
25 |
26 | import androidx.annotation.NonNull;
27 | import androidx.annotation.Nullable;
28 | import androidx.core.app.NotificationCompat;
29 |
30 | public class OverlayService extends Service {
31 |
32 | private final String CHANNEL_ID = "CHANNEL_ID";
33 |
34 | @Nullable
35 | @Override
36 | public IBinder onBind(Intent intent) {
37 | return null;
38 | }
39 |
40 | @SuppressLint("ForegroundServiceType")
41 | @Override
42 | public int onStartCommand(Intent intent, int flags, int startId) {
43 |
44 | super.onCreate();
45 | if (Build.VERSION.SDK_INT >= 26) {
46 |
47 | NotificationChannel channel = new NotificationChannel(CHANNEL_ID, "overlay channel", NotificationManager.IMPORTANCE_DEFAULT);
48 | ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE))
49 | .createNotificationChannel(channel);
50 |
51 | Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID)
52 | .setContentTitle("Overlay")
53 | .setContentText("overlay starting notification")
54 | .setSmallIcon(R.drawable.ic_launcher_foreground)
55 | .build();
56 |
57 | startForeground(1, notification);
58 | }
59 | return START_STICKY;
60 | }
61 |
62 | @Override
63 | public void onDestroy() {
64 | super.onDestroy();
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/SearchContactsContainer.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.content.Intent;
4 | import android.net.Uri;
5 | import android.os.Build;
6 | import android.os.Bundle;
7 | import android.os.PersistableBundle;
8 | import android.view.MenuItem;
9 | import android.view.View;
10 | import android.widget.TextView;
11 | import android.widget.ListView;
12 | import android.widget.Toast;
13 |
14 | import androidx.annotation.NonNull;
15 | import androidx.annotation.Nullable;
16 | import androidx.appcompat.app.AppCompatActivity;
17 |
18 | public class SearchContactsContainer extends AppCompatActivity {
19 |
20 | ListView contactsContainer;
21 |
22 | @Override
23 | protected void onCreate(Bundle savedInstanceState)
24 | {
25 |
26 | super.onCreate(savedInstanceState);
27 | setContentView(R.layout.search_contacts_container);
28 |
29 | contactsContainer = (ListView) findViewById(R.id.container_contacts_list);
30 | contactsContainer.setDivider(null);
31 |
32 | SearchContactsItem[] searchContactsItems = new SearchContactsItem[] {
33 | new SearchContactsItem("田崎 幸治", 1, R.drawable.avatar_background),
34 | new SearchContactsItem("谷口 日野自動車", 2, R.drawable.green_button_background),
35 | new SearchContactsItem("谷口 日野自動車", 3, R.drawable.avatar_background),
36 | new SearchContactsItem("田崎 幸治", 4, R.drawable.green_button_background),
37 | new SearchContactsItem("谷口 日野自動車", 5, R.drawable.avatar_background),
38 | new SearchContactsItem("田崎 幸治", 6, R.drawable.avatar_background),
39 | new SearchContactsItem("谷口 日野自動車", 7, R.drawable.green_button_background),
40 | new SearchContactsItem("谷口 日野自動車", 8, R.drawable.avatar_background),
41 | new SearchContactsItem("田崎 幸治", 9, R.drawable.green_button_background),
42 | new SearchContactsItem("谷口 日野自動車", 10, R.drawable.avatar_background),
43 | new SearchContactsItem("田崎 幸治", 11, R.drawable.green_button_background),
44 | new SearchContactsItem("谷口 日野自動車", 12, R.drawable.avatar_background),
45 | };
46 |
47 | SearchContactAdapter adapter = new SearchContactAdapter(this, R.layout.search_contacts_item, searchContactsItems);
48 | contactsContainer.setAdapter(adapter);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/call_history_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
18 |
19 |
25 |
26 |
33 |
34 |
42 |
43 |
50 |
51 |
52 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/FavoriteAdd.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.view.View;
6 | import android.widget.TextView;
7 | import android.widget.ImageView;
8 | import androidx.appcompat.app.AppCompatActivity;
9 | import androidx.recyclerview.widget.LinearLayoutManager;
10 | import androidx.recyclerview.widget.RecyclerView;
11 |
12 | import java.util.ArrayList;
13 | import java.util.List;
14 |
15 | public class FavoriteAdd extends AppCompatActivity {
16 | boolean isFavoriteView = false;
17 | @Override
18 | protected void onCreate(Bundle savedInstanceState) {
19 | super.onCreate(savedInstanceState);
20 | setContentView(R.layout.favorite_add);
21 |
22 | // Setup RecyclerView
23 | RecyclerView recyclerView = findViewById(R.id.recycler_view_for_all_contact);
24 | recyclerView.setLayoutManager(new LinearLayoutManager(this));
25 |
26 | // Set up adapter with dummy data
27 | ContactAdapter adapter = new ContactAdapter(getDummyContacts(), isFavoriteView);
28 | recyclerView.setAdapter(adapter);
29 |
30 | // Set up the back button
31 | ImageView backButton = findViewById(R.id.favorite_back);
32 | //
33 | backButton.setOnClickListener(v -> finish());
34 | }
35 |
36 | // Dummy contacts data
37 | private List getDummyContacts() {
38 | List contacts = new ArrayList<>();
39 | contacts.add(new Contact("田崎 幸治", "0761-55-3487", "090-4275-0206", R.drawable.ic_contact_default)); // Use your own drawable
40 | contacts.add(new Contact("谷口 日野自動車", "", "090-4275-0206", R.drawable.ic_contact_default));
41 | contacts.add(new Contact("田治", "0761-55-3487", "090-4275-0206", R.drawable.ic_contact_default)); // Use your own drawable
42 | contacts.add(new Contact("野自", "0761-55-3483", "090-4275-0213", R.drawable.ic_contact_default));
43 | contacts.add(new Contact("動治", "0761-55-3487", "090-4275-0276", R.drawable.ic_contact_default)); // Use your own drawable
44 | contacts.add(new Contact("野幸", "0761-55-3483", "090-4275-0253", R.drawable.ic_contact_default));
45 | contacts.add(new Contact("動自", "0761-55-3417", "090-4275-0226", R.drawable.ic_contact_default)); // Use your own drawable
46 | contacts.add(new Contact("自幸", "0761-55-3423", "090-4275-0243", R.drawable.ic_contact_default));
47 | return contacts;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/favorite_add.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
14 |
15 |
16 |
24 |
25 |
26 |
35 |
36 |
37 |
46 |
54 |
55 |
56 |
57 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/search_contacts_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
20 |
21 |
25 |
26 |
32 |
33 |
40 |
41 |
42 |
43 |
50 |
51 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/SMSStateManager.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.content.BroadcastReceiver;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.content.pm.PackageManager;
7 | import android.os.Bundle;
8 | import android.telephony.SmsMessage;
9 | import android.telephony.SubscriptionInfo;
10 | import android.telephony.SubscriptionManager;
11 | import android.telephony.TelephonyManager;
12 | import android.util.Log;
13 |
14 | import androidx.core.app.ActivityCompat;
15 |
16 | import org.json.JSONException;
17 | import org.json.JSONObject;
18 |
19 | import java.util.List;
20 |
21 | public class SMSStateManager extends BroadcastReceiver {
22 |
23 | @Override
24 | public void onReceive(Context context, Intent intent) {
25 |
26 | Bundle bundle = intent.getExtras();
27 | SmsMessage[] msgs = null;
28 | String number = "";
29 | String content = "";
30 | String target = getSimNumber(context) == null ? "0" : getSimNumber(context);
31 | WebSocketManager webSocketManager = new WebSocketManager(context, null);
32 | if (bundle != null)
33 | {
34 | Object[] pdus = (Object[]) bundle.get("pdus");
35 | msgs = new SmsMessage[pdus.length];
36 | for (int i = 0; i < msgs.length; i++)
37 | {
38 | msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);
39 | number = msgs[i].getOriginatingAddress();
40 | content = msgs[i].getMessageBody();
41 | }
42 | }
43 | JSONObject obj = new JSONObject();
44 | try {
45 | JSONObject paramObj = new JSONObject();
46 | paramObj.put("sender", number);
47 | paramObj.put("receiver", target);
48 | paramObj.put("content", content);
49 |
50 | obj.put("event", "SAVE_SMS_LOG");
51 | obj.put("data", paramObj);
52 | } catch (JSONException e) {
53 | throw new RuntimeException(e);
54 | }
55 | webSocketManager.getGlobalWebSocket().send(obj.toString());
56 | }
57 |
58 | private String getSimNumber(Context context) {
59 |
60 | if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP_MR1) {
61 | SubscriptionManager manager = (SubscriptionManager) context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
62 | if (ActivityCompat.checkSelfPermission(context, android.Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
63 | List subscriptionInfos = manager.getActiveSubscriptionInfoList();
64 |
65 | if (subscriptionInfos != null && !subscriptionInfos.isEmpty()) {
66 | SubscriptionInfo simInfo = subscriptionInfos.get(0);
67 | return simInfo.getNumber();
68 | }
69 | }
70 | }
71 | return null;
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/OverlayDialog.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.app.AlertDialog;
4 | import android.app.Dialog;
5 | import android.content.Context;
6 | import android.content.DialogInterface;
7 | import android.graphics.Color;
8 | import android.graphics.drawable.ColorDrawable;
9 | import android.os.Bundle;
10 | import android.view.Gravity;
11 | import android.view.KeyEvent;
12 | import android.view.View;
13 | import android.view.ViewGroup;
14 | import android.view.Window;
15 | import android.view.WindowManager;
16 |
17 | import androidx.annotation.NonNull;
18 | import androidx.annotation.Nullable;
19 | import androidx.fragment.app.DialogFragment;
20 |
21 | public class OverlayDialog extends DialogFragment {
22 |
23 | // public OverlayDialog(Context context) {
24 | //
25 | // super(context);
26 | // init();
27 | // }
28 | //
29 | // @Override
30 | // public void setContentView(@NonNull View view) {
31 | // super.setContentView(view);
32 | // }
33 | //
34 | // @Override
35 | // public void setContentView(int layoutResID) {
36 | // super.setContentView(layoutResID);
37 | // }
38 | //
39 | // @Override
40 | // public void setContentView(@NonNull View view, @Nullable ViewGroup.LayoutParams params) {
41 | // super.setContentView(view, params);
42 | // }
43 | //
44 | // @Override
45 | // public void addContentView(@NonNull View view, @Nullable ViewGroup.LayoutParams params) {
46 | // super.addContentView(view, params);
47 | // }
48 | //
49 | // @Override
50 | // public void show() {
51 | // super.show();
52 | // }
53 | //
54 | // @Override
55 | // public void setOnDismissListener(@Nullable OnDismissListener listener) {
56 | //
57 | // super.show();
58 | // }
59 | //
60 | // private void init() {
61 | //
62 | // requestWindowFeature(Window.FEATURE_NO_TITLE);
63 | // Window window = getWindow();
64 | // if (window != null) {
65 | //
66 | // window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
67 | // window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
68 | // WindowManager.LayoutParams params = window.getAttributes();
69 | // params.gravity = Gravity.BOTTOM | Gravity.CENTER;
70 | // }
71 | // }
72 |
73 |
74 | @NonNull
75 | @Override
76 | public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
77 |
78 | // return super.onCreateDialog(savedInstanceState);
79 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
80 | builder.setTitle("None Dissdlkf").setMessage("sdfsdfdsfds");
81 |
82 | AlertDialog dialog = builder.create();
83 | dialog.setCanceledOnTouchOutside(false);
84 | dialog.setOnKeyListener(new DialogInterface.OnKeyListener() {
85 |
86 | @Override
87 | public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
88 | if(keyCode == KeyEvent.KEYCODE_BACK) {
89 | return true;
90 | }
91 | return false;
92 | }
93 | });
94 |
95 | return dialog;
96 | }
97 |
98 | @Override
99 | public void onCancel(@NonNull DialogInterface dialog) {
100 | super.onCancel(dialog);
101 | }
102 |
103 | public void closeDialog() {
104 | dismiss();
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
29 |
30 |
31 |
43 |
44 |
45 |
46 |
47 |
60 |
61 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/app/src/main/res/layout-v21/bottom_navigation.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
31 |
32 |
37 |
38 |
39 |
47 |
48 |
49 |
50 |
54 |
55 |
60 |
61 |
71 |
72 |
77 |
78 |
79 |
86 |
87 |
88 |
89 |
93 |
94 |
99 |
100 |
110 |
111 |
116 |
117 |
118 |
125 |
126 |
127 |
128 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/bottom_navigation.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
19 |
20 |
32 |
33 |
38 |
39 |
40 |
48 |
49 |
50 |
51 |
55 |
56 |
61 |
62 |
72 |
73 |
78 |
79 |
80 |
87 |
88 |
89 |
90 |
94 |
95 |
100 |
101 |
111 |
112 |
117 |
118 |
119 |
126 |
127 |
128 |
129 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/CallStateManager.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.BroadcastReceiver;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.content.pm.PackageManager;
8 | import android.provider.ContactsContract;
9 | import android.telephony.SubscriptionInfo;
10 | import android.telephony.SubscriptionManager;
11 | import android.telephony.TelephonyManager;
12 | import android.util.Log;
13 |
14 | import androidx.core.app.ActivityCompat;
15 |
16 | import org.json.JSONException;
17 | import org.json.JSONObject;
18 |
19 | import java.util.List;
20 |
21 | public class CallStateManager extends BroadcastReceiver {
22 |
23 | private static String lastState = TelephonyManager.EXTRA_STATE_IDLE;
24 | private static boolean isIncoming = false;
25 | private static String savedNumber = null;
26 | PhoneAppAccessibilityService service = new PhoneAppAccessibilityService();
27 |
28 | @SuppressLint("UnsafeProtectedBroadcastReceiver")
29 | @Override
30 | public void onReceive(Context context, Intent intent) {
31 |
32 | WebSocketManager webSocketManager = new WebSocketManager(context, null);
33 | String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
34 | String number = intent.getStringExtra(TelephonyManager.EXTRA_INCOMING_NUMBER);
35 | String target = getSimNumber(context) == null ? "0" : getSimNumber(context);
36 |
37 | Log.d("Incoming", "Number" + state + number + target);
38 |
39 | if (state != null && number != null) {
40 |
41 | if (state.equals("RINGING")) {
42 |
43 | isIncoming = true;
44 | savedNumber = number;
45 | JSONObject obj = new JSONObject();
46 | try {
47 | obj.put("event", "GET_USER_DETAIL");
48 | obj.put("data", savedNumber);
49 | } catch (JSONException e) {
50 | throw new RuntimeException(e);
51 | }
52 | webSocketManager.getGlobalWebSocket().send(obj.toString());
53 | } else if (state.equals("OFFHOOK")) {
54 |
55 | if (lastState.equals(TelephonyManager.EXTRA_STATE_RINGING)) {
56 | JSONObject obj = new JSONObject();
57 | try {
58 | JSONObject paramObj = new JSONObject();
59 | paramObj.put("sender", number);
60 | paramObj.put("receiver", target);
61 |
62 | obj.put("event", "START_CALL_LOG");
63 | obj.put("data", paramObj);
64 | } catch (JSONException e) {
65 | throw new RuntimeException(e);
66 | }
67 | webSocketManager.getGlobalWebSocket().send(obj.toString());
68 | webSocketManager.getGlobalWebSocket().close(1000, null);
69 | service.hideOverlayIncomingDetail();
70 | } else {
71 | Log.e("Outgoing Accepted : ", number);
72 | }
73 | } else if (state.equals("IDLE")) {
74 |
75 | if (isIncoming) {
76 | JSONObject obj = new JSONObject();
77 | try {
78 | JSONObject paramObj = new JSONObject();
79 | paramObj.put("sender", number);
80 | paramObj.put("receiver", target);
81 |
82 | obj.put("event", "SAVE_CALL_LOG");
83 | obj.put("data", paramObj);
84 | } catch (JSONException e) {
85 | throw new RuntimeException(e);
86 | }
87 | webSocketManager.getGlobalWebSocket().send(obj.toString());
88 | webSocketManager.getGlobalWebSocket().close(1000, null);
89 | service.hideOverlayIncomingDetail();
90 | isIncoming = false;
91 | } else {
92 | Log.e("Call Rejected : ", number);
93 | }
94 | }
95 | lastState = state;
96 | }
97 | }
98 |
99 | private String getSimNumber(Context context) {
100 |
101 | if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP_MR1) {
102 | SubscriptionManager manager = (SubscriptionManager) context.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
103 | if (ActivityCompat.checkSelfPermission(context, android.Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
104 | List subscriptionInfos = manager.getActiveSubscriptionInfoList();
105 |
106 | if (subscriptionInfos != null && !subscriptionInfos.isEmpty()) {
107 | SubscriptionInfo simInfo = subscriptionInfos.get(0);
108 | return simInfo.getNumber();
109 | }
110 | }
111 | }
112 | return null;
113 | }
114 |
115 | }
116 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/WebSocketManager.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.os.Handler;
6 | import android.os.Looper;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.widget.ListView;
10 |
11 | import androidx.annotation.NonNull;
12 | import androidx.annotation.Nullable;
13 |
14 | import org.json.JSONArray;
15 | import org.json.JSONException;
16 | import org.json.JSONObject;
17 |
18 | import java.util.ArrayList;
19 | import java.util.List;
20 | import java.util.concurrent.ExecutionException;
21 |
22 | import okhttp3.OkHttpClient;
23 | import okhttp3.Request;
24 | import okhttp3.Response;
25 | import okhttp3.WebSocket;
26 | import okhttp3.WebSocketListener;
27 | import okio.ByteString;
28 |
29 | public class WebSocketManager {
30 |
31 | public Context globalContext;
32 | public ListView globalListView;
33 | public OkHttpClient client = new OkHttpClient();
34 | public Request request = new Request.Builder().url("ws://163.43.30.119:6001/app/3aea7acffe7a50de88de?protocol=7&client=js&version=4.3.1&flash=false").build();
35 | public WebSocket globalWebSocket = null;
36 |
37 | public WebSocket getGlobalWebSocket() {
38 |
39 | if (globalWebSocket == null) {
40 | globalWebSocket = client.newWebSocket(request, new WebSocketListener() {
41 | @Override
42 | public void onClosed(@NonNull WebSocket webSocket, int code, @NonNull String reason) {
43 | super.onClosed(webSocket, code, reason);
44 | }
45 |
46 | @Override
47 | public void onMessage(@NonNull WebSocket webSocket, @NonNull String text) {
48 | try {
49 | JSONObject obj = new JSONObject(text);
50 | String event = obj.getString("event");
51 | if (event.equals("VERIFIED_PHONE_LIST")) {
52 | List numbers = new ArrayList();
53 | JSONArray arr = obj.getJSONArray("data");
54 |
55 | for (int i = 0; i < arr.length(); i++) {
56 | numbers.add(arr.getString(i));
57 | }
58 |
59 | FavoriteListHelper helper = new FavoriteListHelper(globalContext, globalListView);
60 | helper.setupFavoriteList(numbers);
61 | webSocket.close(1000, null);
62 | } else if (event.equals("GOT_USER_DETAIL")) {
63 | JSONObject resultObj = obj.getJSONObject("data");
64 | LayoutInflater inflater = (LayoutInflater) globalContext.getSystemService(globalContext.LAYOUT_INFLATER_SERVICE);
65 | View incomingView = inflater.inflate(R.layout.incoming_call_detail, null);
66 | PhoneAppAccessibilityService service = PhoneAppAccessibilityService.getInstance();
67 |
68 | new Handler(Looper.getMainLooper()).postDelayed(() -> {
69 | try {
70 | IncomingCallHelper helper = new IncomingCallHelper(globalContext, incomingView);
71 | helper.displayIncomingDetail(resultObj);
72 |
73 | service.showOverlayIncomingDetail();
74 | } catch (Exception e) {
75 | e.printStackTrace();
76 | }
77 | }, 500);
78 | webSocket.close(1000, null);
79 | }
80 | } catch (JSONException e) {
81 | throw new RuntimeException(e);
82 | }
83 | }
84 |
85 | @Override
86 | public void onFailure(@NonNull WebSocket webSocket, @NonNull Throwable t, @Nullable Response response) {
87 | super.onFailure(webSocket, t, response);
88 | }
89 |
90 | @Override
91 | public void onClosing(@NonNull WebSocket webSocket, int code, @NonNull String reason) {
92 | super.onClosing(webSocket, code, reason);
93 | }
94 |
95 | @Override
96 | public void onMessage(@NonNull WebSocket webSocket, @NonNull ByteString bytes) {
97 | super.onMessage(webSocket, bytes);
98 | }
99 |
100 | @Override
101 | public void onOpen(@NonNull WebSocket webSocket, @NonNull Response response) {
102 | super.onOpen(webSocket, response);
103 | }
104 | });
105 | }
106 | return globalWebSocket;
107 | }
108 |
109 | public WebSocketManager(Context context, ListView listView) {
110 |
111 | this.globalContext = context;
112 | this.globalListView = listView;
113 | }
114 |
115 | }
116 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
54 |
55 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
82 |
83 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/FavoriteAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.graphics.drawable.Drawable;
7 | import android.net.Uri;
8 | import android.provider.ContactsContract;
9 | import android.view.LayoutInflater;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import android.widget.BaseAdapter;
13 | import android.widget.ImageView;
14 | import android.widget.LinearLayout;
15 | import android.widget.TextView;
16 | import android.widget.Toast;
17 | import androidx.core.content.ContextCompat;
18 |
19 | public class FavoriteAdapter extends BaseAdapter {
20 |
21 | private final Context context;
22 | private final int layoutId;
23 | private final FavoriteListItem[] favoriteList;
24 |
25 | public FavoriteAdapter(Context context, int layoutId, FavoriteListItem[] favoriteList) {
26 |
27 | this.context = context;
28 | this.layoutId = layoutId;
29 | this.favoriteList = favoriteList;
30 | }
31 |
32 | @Override
33 | public int getCount() {
34 | return favoriteList.length;
35 | }
36 |
37 | @Override
38 | public Object getItem(int i) {
39 | return favoriteList[i];
40 | }
41 |
42 | @Override
43 | public long getItemId(int i) {
44 | return i;
45 | }
46 |
47 | @SuppressLint({"SetTextI18n", "ViewHolder"})
48 | @Override
49 | public View getView(int i, View view, ViewGroup viewGroup) {
50 |
51 | View lineItem;
52 | LayoutInflater layout = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
53 | lineItem = layout.inflate(layoutId, null);
54 |
55 | TextView nickName = (TextView) lineItem.findViewById(R.id.favorite_avatar_nickname);
56 | TextView name = (TextView) lineItem.findViewById(R.id.favorite_item_name);
57 | TextView phone = (TextView) lineItem.findViewById(R.id.favorite_item_phone);
58 | LinearLayout avatar = (LinearLayout) lineItem.findViewById(R.id.favorite_avatar_container);
59 | LinearLayout shared = (LinearLayout) lineItem.findViewById(R.id.favorite_shared);
60 |
61 | FavoriteListItem favoriteItem = favoriteList[i];
62 | nickName.setText(favoriteItem.getNickName());
63 | name.setText(favoriteItem.getName());
64 | phone.setText(favoriteItem.getPhoneTitle() + " " + favoriteItem.getPhone());
65 | shared.setVisibility(favoriteItem.getShared() ? View.VISIBLE : View.GONE);
66 |
67 | Drawable drawableAvatar = ContextCompat.getDrawable(this.context, favoriteItem.getIconColor());
68 | avatar.setBackground(drawableAvatar);
69 |
70 | Drawable drawableNone = ContextCompat.getDrawable(this.context, R.drawable.none_background);
71 | Drawable drawableSelected = ContextCompat.getDrawable(this.context, R.drawable.favorite_active_background);
72 |
73 | lineItem.findViewById(R.id.favorite_item_info).setOnClickListener(v -> {
74 |
75 | if(lineItem.findViewById(R.id.favorite_contact_details).getVisibility() == View.GONE) {
76 |
77 | lineItem.findViewById(R.id.favorite_contact_details).setVisibility(View.VISIBLE);
78 | lineItem.findViewById(R.id.favorite_list_item).setBackground(drawableSelected);
79 | } else {
80 |
81 | lineItem.findViewById(R.id.favorite_contact_details).setVisibility(View.GONE);
82 | lineItem.findViewById(R.id.favorite_list_item).setBackground(drawableNone);
83 | }
84 | });
85 |
86 | lineItem.findViewById(R.id.favorite_sms).setOnClickListener(v -> {
87 |
88 | Intent intent = new Intent(Intent.ACTION_VIEW);
89 | intent.setData(Uri.parse("sms:+" + favoriteItem.getPhone()));
90 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
91 |
92 | context.startActivity(intent);
93 | });
94 |
95 | lineItem.findViewById(R.id.favorite_log).setOnClickListener(v -> {
96 |
97 | Intent intent = new Intent(Intent.ACTION_VIEW);
98 | Uri uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(favoriteItem.getPhone()));
99 | intent.setData(uri);
100 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
101 |
102 | context.startActivity(intent);
103 | });
104 |
105 | lineItem.findViewById(R.id.favorite_profile).setOnClickListener(v -> {
106 |
107 | Intent intent = new Intent(Intent.ACTION_VIEW);
108 | Uri contactUri = ContactsContract.Contacts.getLookupUri(favoriteItem.getId(), favoriteItem.getLookupKey());
109 | intent.setData(contactUri);
110 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
111 |
112 | context.startActivity(intent);
113 | });
114 |
115 | lineItem.findViewById(R.id.favorite_ic_call).setOnClickListener(v -> {
116 |
117 | // Intent intent = new Intent(Intent.ACTION_CALL);
118 | Intent intent = new Intent(Intent.ACTION_DIAL);
119 | intent.setData(Uri.parse("tel:" + favoriteItem.getPhone()));
120 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
121 |
122 | context.startActivity(intent);
123 | });
124 |
125 | return lineItem;
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_set_default.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
15 |
16 |
17 |
27 |
28 |
29 |
35 |
36 |
37 |
43 |
44 |
50 |
51 |
52 |
58 |
59 |
66 |
67 |
74 |
75 |
76 |
77 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
94 |
100 |
101 |
102 |
108 |
109 |
116 |
117 |
124 |
125 |
126 |
127 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/FavoriteListContainer.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Intent;
5 | import android.content.pm.PackageManager;
6 | import android.database.Cursor;
7 | import android.os.Bundle;
8 | import android.provider.ContactsContract;
9 | import android.util.Log;
10 | import android.widget.ListView;
11 |
12 | import androidx.annotation.NonNull;
13 | import androidx.annotation.Nullable;
14 | import androidx.appcompat.app.AppCompatActivity;
15 | import androidx.core.app.ActivityCompat;
16 | import androidx.core.content.ContextCompat;
17 |
18 | import org.json.JSONException;
19 | import org.json.JSONObject;
20 |
21 | import java.util.ArrayList;
22 | import java.util.List;
23 |
24 | public class FavoriteListContainer extends AppCompatActivity {
25 |
26 | private FavoriteListHelper listHelper;
27 | private static final int PERMISSIONS_REQUEST_READ_CONTACTS = 100;
28 |
29 | @SuppressLint("Range")
30 | @Override
31 | protected void onCreate(Bundle savedInstanceState) {
32 |
33 | super.onCreate(savedInstanceState);
34 | setContentView(R.layout.favorite_container);
35 |
36 | if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
37 | ActivityCompat.requestPermissions(
38 | this,
39 | new String[]{android.Manifest.permission.READ_CONTACTS},
40 | PERMISSIONS_REQUEST_READ_CONTACTS
41 | );
42 | }
43 | getContacts();
44 |
45 | JSONObject paramObj = new JSONObject();
46 | List numbers = new ArrayList();
47 | try {
48 | Cursor cursor = getContentResolver().query(
49 | ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
50 | null,
51 | null,
52 | null,
53 | ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " ASC"
54 | );
55 | if(cursor != null && cursor.getCount() > 0) {
56 | while (cursor.moveToNext()) {
57 | numbers.add(cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)));
58 | }
59 | }
60 | paramObj.put("event", "VERIFY_PHONE_LIST");
61 | paramObj.put("data", numbers);
62 | } catch (JSONException e) {
63 | throw new RuntimeException(e);
64 | }
65 |
66 | ListView listView = findViewById(R.id.container_favorite_list);
67 | WebSocketManager socketManager = new WebSocketManager(this, listView);
68 | socketManager.getGlobalWebSocket().send(paramObj.toString());
69 | }
70 |
71 | @Override
72 | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
73 |
74 | super.onRequestPermissionsResult(requestCode, permissions, grantResults);
75 | if (requestCode == PERMISSIONS_REQUEST_READ_CONTACTS) {
76 | if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
77 | getContacts();
78 | }
79 | }
80 | }
81 |
82 | @Override
83 | protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
84 | super.onActivityResult(requestCode, resultCode, data);
85 | }
86 |
87 | @Override
88 | protected void onDestroy() {
89 | super.onDestroy();
90 | }
91 | //
92 | // public void navigateRecents(View view) {
93 | //
94 | // Intent intent = new Intent(Intent.ACTION_VIEW);
95 | // intent.setData(CallLog.Calls.CONTENT_URI);
96 | // startActivity(intent);
97 | // }
98 | //
99 | // public void navigateContacts(View view) {
100 | //
101 | // Intent intent = new Intent(Intent.ACTION_VIEW);
102 | // intent.setData(ContactsContract.Contacts.CONTENT_URI);
103 | // startActivity(intent);
104 | // }
105 |
106 |
107 | @SuppressLint("Range")
108 | private void getContacts() {
109 |
110 | Cursor cursor = getContentResolver().query(
111 | ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
112 | null,
113 | null,
114 | null,
115 | ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " ASC"
116 | );
117 |
118 | if(cursor != null && cursor.getCount() > 0) {
119 | while (cursor.moveToNext()) {
120 |
121 | String id = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));
122 | String lookupKey = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.LOOKUP_KEY));
123 | String displayName = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
124 | String phoneticName = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.PHONETIC_NAME));
125 | String number = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
126 | String starred = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.STARRED));
127 | String icon = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.PHOTO_URI));
128 | Log.d("Contact Detail", id + ", " + lookupKey + ", " + displayName + ", " + phoneticName + ", " + number + ", " + starred + ", " + icon);
129 | }
130 | }
131 | }
132 |
133 | }
134 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/FavoriteListHelper.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.app.ProgressDialog;
5 | import android.content.Context;
6 | import android.database.Cursor;
7 | import android.os.Handler;
8 | import android.os.Looper;
9 | import android.provider.ContactsContract;
10 | import android.widget.ListView;
11 |
12 | import java.util.ArrayList;
13 | import java.util.List;
14 |
15 | public class FavoriteListHelper {
16 |
17 | Context context = null;
18 | ListView favoriteContainer = null;
19 | FavoriteListItem[] favoriteItems ;
20 | List baseNumberList = new ArrayList<>();
21 | ProgressDialog loadingDialog;
22 | Thread loadingThread;
23 |
24 | @SuppressLint("Range")
25 | public FavoriteListHelper(Context context, ListView listView) {
26 |
27 | this.context = context;
28 | this.favoriteContainer = listView;
29 | // loadingThread = new Thread(new Runnable() {
30 | // @Override
31 | // public void run() {
32 | // loadingDialog = new ProgressDialog(context);
33 | // loadingDialog.setMessage("サーバーに接続中です。しばらくお待ちください。");
34 | // loadingDialog.show();
35 | // }
36 | // });
37 | // loadingThread.start();
38 | }
39 |
40 | @SuppressLint("Range")
41 | public void setupFavoriteList(List numbers) {
42 |
43 | this.baseNumberList = numbers;
44 |
45 | Cursor cursor = context.getContentResolver().query(
46 | ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
47 | null,
48 | "starred = ?",
49 | new String[]{"1"},
50 | ContactsContract.CommonDataKinds.Phone.LAST_TIME_USED + " DESC"
51 | );
52 | int count = 0;
53 | if(cursor != null && cursor.getCount() > 0) {
54 | favoriteItems = new FavoriteListItem[cursor.getCount()];
55 | while (cursor.moveToNext()) {
56 | int id = cursor.getInt(cursor.getColumnIndex(ContactsContract.Contacts._ID));
57 | String lookupKey = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.LOOKUP_KEY));
58 | String name = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
59 | int type = cursor.getInt(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE));
60 | String number = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
61 | boolean shared = baseNumberList.contains(number);
62 |
63 | favoriteItems[count] = new FavoriteListItem(id, lookupKey, name, number, getPhoneNumberType(type), R.drawable.green_button_background, shared);
64 | count ++;
65 | }
66 | }
67 | try {
68 | new Handler(Looper.getMainLooper()).post(new Runnable() {
69 | @Override
70 | public void run() {
71 | FavoriteAdapter adapter = new FavoriteAdapter(context, R.layout.favorite_list_item, favoriteItems);
72 | favoriteContainer.setAdapter(adapter);
73 | }
74 | });
75 | } catch (Exception e) {
76 | e.printStackTrace();
77 | }
78 | // loadingThread.destroy();
79 | }
80 |
81 | private String getPhoneNumberType(int type) {
82 |
83 | switch (type) {
84 | case ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE:
85 | return "携帯";
86 | case ContactsContract.CommonDataKinds.Phone.TYPE_HOME:
87 | return "自宅";
88 | case ContactsContract.CommonDataKinds.Phone.TYPE_WORK:
89 | return "勤務先";
90 | case ContactsContract.CommonDataKinds.Phone.TYPE_FAX_WORK:
91 | return "FAX(勤務先)";
92 | case ContactsContract.CommonDataKinds.Phone.TYPE_FAX_HOME:
93 | return "FAX(自宅)";
94 | case ContactsContract.CommonDataKinds.Phone.TYPE_PAGER:
95 | return "ポケベル";
96 | case ContactsContract.CommonDataKinds.Phone.TYPE_OTHER:
97 | return "その他";
98 | case ContactsContract.CommonDataKinds.Phone.TYPE_CALLBACK:
99 | return "コールバック";
100 | case ContactsContract.CommonDataKinds.Phone.TYPE_CAR:
101 | return "クルマ";
102 | case ContactsContract.CommonDataKinds.Phone.TYPE_COMPANY_MAIN:
103 | return "会社代表番号";
104 | case ContactsContract.CommonDataKinds.Phone.TYPE_ISDN:
105 | return "ISDN";
106 | case ContactsContract.CommonDataKinds.Phone.TYPE_MAIN:
107 | return "メイン";
108 | case ContactsContract.CommonDataKinds.Phone.TYPE_OTHER_FAX:
109 | return "FAX (その他)";
110 | case ContactsContract.CommonDataKinds.Phone.TYPE_RADIO:
111 | return "無線";
112 | case ContactsContract.CommonDataKinds.Phone.TYPE_TELEX:
113 | return "テレックス";
114 | case ContactsContract.CommonDataKinds.Phone.TYPE_TTY_TDD:
115 | return "TTY TDDD";
116 | case ContactsContract.CommonDataKinds.Phone.TYPE_WORK_MOBILE:
117 | return "携帯(勤務先)";
118 | case ContactsContract.CommonDataKinds.Phone.TYPE_WORK_PAGER:
119 | return "ポケベル (勤務先)";
120 | case ContactsContract.CommonDataKinds.Phone.TYPE_ASSISTANT:
121 | return "アシスタント";
122 | case ContactsContract.CommonDataKinds.Phone.TYPE_MMS:
123 | return "MMS";
124 | default:
125 | return "カスタム";
126 | }
127 | }
128 |
129 | }
130 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/ContactAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.Manifest;
4 | import android.app.Activity;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.content.pm.PackageManager;
8 | import android.net.Uri;
9 | import android.provider.ContactsContract;
10 | import android.view.LayoutInflater;
11 | import android.view.View;
12 | import android.view.ViewGroup;
13 | import android.widget.ImageView;
14 | import android.widget.LinearLayout;
15 | import android.widget.TextView;
16 | import android.widget.Toast;
17 |
18 | import androidx.annotation.NonNull;
19 | import androidx.core.app.ActivityCompat;
20 | import androidx.core.content.ContextCompat;
21 | import androidx.recyclerview.widget.RecyclerView;
22 |
23 | import java.util.List;
24 |
25 | public class ContactAdapter extends RecyclerView.Adapter {
26 | private static final int REQUEST_CALL_PERMISSION = 1;
27 | private List contactList;
28 | private boolean isFavoriteView = true; // Add a boolean flag to determine which layout to use
29 |
30 | private Context context;
31 |
32 | public ContactAdapter(List contactList, boolean isFavoriteView) {
33 | this.contactList = contactList;
34 | this.isFavoriteView = isFavoriteView;
35 | }
36 |
37 | @NonNull
38 | @Override
39 | public ContactViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
40 |
41 | View view = LayoutInflater.from(parent.getContext())
42 | .inflate(R.layout.contact_item, parent, false);
43 | return new ContactViewHolder(view);
44 | }
45 |
46 | @Override
47 | public void onBindViewHolder(@NonNull ContactViewHolder holder, int position) {
48 | Contact contact = contactList.get(position);
49 | holder.nameTextView.setText(contact.getName());
50 |
51 | // Set mobile and office phone text views
52 | holder.mobileTextView.setText(contact.getMobilePhone().isEmpty() ? "" : "勤務先 " + contact.getMobilePhone());
53 | holder.officeTextView.setText(contact.getOfficePhone().isEmpty() ? "" : "携帯 " + contact.getOfficePhone());
54 |
55 | holder.iconImageView.setImageResource(contact.getIconResourceId());
56 |
57 | // Handle contact_main_info click to show/hide details
58 | holder.contactMainInfo.setOnClickListener(v -> {
59 | if (holder.contactDetails.getVisibility() == View.GONE) {
60 | holder.contactDetails.setVisibility(View.VISIBLE);
61 | } else {
62 | holder.contactDetails.setVisibility(View.GONE);
63 | }
64 | });
65 |
66 | // Set click listener for SMS send action
67 | holder.sms_send.setOnClickListener(v -> {
68 | Intent intent = new Intent(v.getContext(), SMSSend.class);
69 | intent.putExtra("contact_name", contact.getName());
70 | intent.putExtra("mobile_phone", contact.getMobilePhone());
71 | v.getContext().startActivity(intent);
72 | });
73 |
74 | // Set click listener for call history action
75 | holder.callHistory.setOnClickListener(v -> {
76 | Intent intent = new Intent(v.getContext(), CallHistory.class);
77 | intent.putExtra("contact_name", contact.getName());
78 | intent.putExtra("mobile_phone", contact.getMobilePhone());
79 | v.getContext().startActivity(intent);
80 | });
81 |
82 | // Handle phone icon visibility (only if using Favorite.xml)
83 | if (!isFavoriteView && holder.phoneIcon != null) {
84 | holder.phoneIcon.setVisibility(View.GONE);
85 | }
86 |
87 | holder.phoneIcon.setOnClickListener(v -> {
88 | if (ContextCompat.checkSelfPermission(v.getContext(), Manifest.permission.CALL_PHONE)
89 | != PackageManager.PERMISSION_GRANTED) {
90 | // Request permission through the Activity
91 | if (v.getContext() instanceof Activity) {
92 | ActivityCompat.requestPermissions((Activity) v.getContext(),
93 | new String[]{Manifest.permission.CALL_PHONE}, REQUEST_CALL_PERMISSION);
94 | }
95 | } else {
96 | Intent callIntent = new Intent(Intent.ACTION_CALL);
97 | callIntent.setData(Uri.parse("tel:" + contact.getMobilePhone()));
98 | v.getContext().startActivity(callIntent);
99 | }
100 | });
101 | }
102 |
103 | @Override
104 | public int getItemCount() {
105 | return contactList.size();
106 | }
107 |
108 | static class ContactViewHolder extends RecyclerView.ViewHolder {
109 | TextView nameTextView;
110 | TextView mobileTextView;
111 | TextView officeTextView;
112 | ImageView iconImageView;
113 | LinearLayout contactInfo;
114 | LinearLayout contactMainInfo;
115 | LinearLayout contactDetails;
116 | LinearLayout sms_send;
117 | LinearLayout callHistory;
118 | ImageView phoneIcon; // Reference to the phone icon (for Favorite.xml)
119 |
120 | ContactViewHolder(View itemView) {
121 | super(itemView);
122 |
123 | nameTextView = itemView.findViewById(R.id.contact_name);
124 | mobileTextView = itemView.findViewById(R.id.mobile_phone);
125 | officeTextView = itemView.findViewById(R.id.office_phone);
126 | iconImageView = itemView.findViewById(R.id.contact_icon);
127 | contactInfo = itemView.findViewById(R.id.contact_info);
128 | contactMainInfo = itemView.findViewById(R.id.contact_main_info);
129 | contactDetails = itemView.findViewById(R.id.contact_details);
130 | sms_send = itemView.findViewById(R.id.sms_send);
131 | phoneIcon = itemView.findViewById(R.id.favorite_ic_call); // Initialize phone icon
132 | callHistory = itemView.findViewById(R.id.call_history);
133 | }
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/call_history.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
14 |
15 |
16 |
25 |
26 |
27 |
35 |
36 |
37 |
43 |
44 |
45 |
53 |
54 |
55 |
63 |
64 |
65 |
66 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
86 |
87 |
93 |
94 |
104 |
105 |
106 |
114 |
115 |
116 |
117 |
125 |
126 |
127 |
128 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/contact_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
17 |
18 |
24 |
25 |
32 |
33 |
40 |
41 |
47 |
48 |
54 |
55 |
62 |
63 |
64 |
65 |
76 |
77 |
78 |
86 |
87 |
92 |
93 |
100 |
101 |
102 |
103 |
111 |
112 |
117 |
118 |
125 |
126 |
127 |
128 |
135 |
136 |
141 |
142 |
149 |
150 |
151 |
152 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/sms_send.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
14 |
15 |
16 |
23 |
24 |
25 |
26 |
33 |
34 |
35 |
36 |
45 |
46 |
47 |
48 |
55 |
56 |
63 |
64 |
65 |
66 |
73 |
74 |
75 |
76 |
83 |
84 |
85 |
94 |
103 |
104 |
105 |
106 |
114 |
115 |
116 |
123 |
124 |
125 |
132 |
133 |
134 |
138 |
139 |
140 |
153 |
154 |
155 |
164 |
165 |
166 |
174 |
175 |
176 |
177 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/pms_client/SMSSend.java:
--------------------------------------------------------------------------------
1 | package com.example.pms_client;
2 |
3 | import android.content.Intent;
4 | import android.Manifest;
5 | import android.content.pm.PackageManager;
6 | import android.net.Uri;
7 | import android.os.Bundle;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 | import android.widget.Toast;
11 | import androidx.activity.result.ActivityResultLauncher;
12 | import androidx.activity.result.contract.ActivityResultContracts;
13 | import androidx.appcompat.app.AppCompatActivity;
14 | import android.database.Cursor;
15 | import android.provider.OpenableColumns;
16 | import android.util.Log;
17 | import android.widget.PopupMenu;
18 | import android.view.View;
19 | import android.view.MenuInflater;
20 | import android.view.MenuItem;
21 |
22 | import androidx.annotation.NonNull;
23 | import androidx.core.app.ActivityCompat;
24 | import androidx.core.content.ContextCompat;
25 |
26 | public class SMSSend extends AppCompatActivity {
27 |
28 | TextView textView;
29 | private static final int REQUEST_CALL_PERMISSION = 1;
30 |
31 | private static String mobile_number = "";
32 | private ActivityResultLauncher filePickerLauncher;
33 |
34 | protected void onCreate(Bundle savedInstanceState) {
35 | super.onCreate(savedInstanceState);
36 | setContentView(R.layout.sms_send);
37 |
38 | // Initialize ActivityResultLauncher
39 | filePickerLauncher = registerForActivityResult(
40 | new ActivityResultContracts.StartActivityForResult(),
41 | result -> {
42 | if (result.getResultCode() == RESULT_OK && result.getData() != null) {
43 | Uri uri = result.getData().getData();
44 | if (uri != null) {
45 | displaySelectedFile(uri);
46 | }
47 | }
48 | }
49 | );
50 |
51 | // Retrieve the contact details passed from the ContactAdapter
52 | String contactName = getIntent().getStringExtra("contact_name");
53 | mobile_number = getIntent().getStringExtra("mobile_phone");
54 |
55 | // Set the contact details to views if needed
56 | // For example, set the contact name on a TextView in sms_send.xml
57 | TextView titleTextView = findViewById(R.id.selected_username);
58 | titleTextView.setText(contactName);
59 |
60 | //bottom_nav_menu
61 | ImageView bottomNavMenu = findViewById(R.id.bottom_nav_menu);
62 | bottomNavMenu.setOnClickListener( v-> showPopupMenu(v));
63 |
64 | // Call
65 | ImageView callButton = findViewById(R.id.selected_user_call);
66 | callButton.setOnClickListener(v -> {
67 | if (ContextCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
68 | // Request permission if not granted
69 | ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CALL_PHONE}, REQUEST_CALL_PERMISSION);
70 | } else {
71 | // Permission already granted, make the call
72 | makePhoneCall(mobile_number);
73 | }
74 | });
75 |
76 | // Set up the back button
77 | ImageView backButton = findViewById(R.id.sms_send_back);
78 | backButton.setOnClickListener(v -> finish());
79 |
80 | // Upload function
81 | ImageView attachFile = findViewById(R.id.attach_file);
82 | ImageView attachImage = findViewById(R.id.attach_image);
83 |
84 | attachFile.setOnClickListener(v -> openFileChooser("file/*"));
85 | attachImage.setOnClickListener(v -> openFileChooser("image/*"));
86 |
87 | }
88 |
89 | private void showPopupMenu(View view) {
90 | PopupMenu popupMenu = new PopupMenu(this, view);
91 | MenuInflater inflater = popupMenu.getMenuInflater();
92 | inflater.inflate(R.menu.sms_popup_menu, popupMenu.getMenu());
93 | popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
94 | @Override
95 | public boolean onMenuItemClick(MenuItem item) {
96 | // Handle menu item clicks here
97 | int itemId = item.getItemId();
98 | if (itemId == R.id.menu_search) {
99 | Toast.makeText(SMSSend.this, "Search clicked", Toast.LENGTH_SHORT).show();
100 | return true;
101 | } else if (itemId == R.id.menu_show_input) {
102 | Toast.makeText(SMSSend.this, "Show input clicked", Toast.LENGTH_SHORT).show();
103 | return true;
104 | } else {
105 | return false;
106 | }
107 | }
108 | });
109 | popupMenu.show();
110 | }
111 |
112 |
113 | private void makePhoneCall(String mobile_number) {
114 | Log.d("MakePhoneCall", "makePhoneCall method called with phoneNumber: " + mobile_number);
115 | Intent callIntent = new Intent(Intent.ACTION_DIAL);
116 | callIntent.setData(Uri.parse("tel:" + mobile_number));
117 | startActivity(callIntent);
118 | }
119 |
120 | @Override
121 | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
122 | super.onRequestPermissionsResult(requestCode, permissions, grantResults);
123 | if (requestCode == REQUEST_CALL_PERMISSION) {
124 | if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
125 | // Permission granted, make the call
126 | makePhoneCall(mobile_number);
127 | } else {
128 | // Permission denied
129 | Toast.makeText(this, "Permission DENIED", Toast.LENGTH_SHORT).show();
130 | }
131 | }
132 | }
133 |
134 | private void openFileChooser(String mimeType) {
135 | Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
136 | intent.addCategory(Intent.CATEGORY_OPENABLE);
137 | intent.setType(mimeType);
138 | filePickerLauncher.launch(intent);
139 | }
140 |
141 | private void displaySelectedFile(Uri uri) {
142 | // For example, if you are loading an image, use an ImageView:
143 | ImageView imageView = findViewById(R.id.attach_image);
144 | imageView.setImageURI(uri);
145 |
146 | // For other files, you might want to show the file name or path:
147 | String fileName = getFileNameFromUri(uri);
148 | if (textView != null) {
149 | textView.setText(fileName);
150 | }
151 | }
152 |
153 | public String getFileNameFromUri(Uri uri) {
154 | String displayName = null;
155 |
156 | if (uri != null) {
157 | Cursor cursor = getContentResolver().query(uri, null, null, null, null);
158 | if (cursor != null) {
159 | try {
160 | if (cursor.moveToFirst()) {
161 | int nameIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
162 | if (nameIndex != -1) {
163 | displayName = cursor.getString(nameIndex);
164 | }
165 | }
166 | } finally {
167 | cursor.close();
168 | }
169 | }
170 | }
171 |
172 | return displayName;
173 | }
174 | }
175 |
176 |
177 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/favorite_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
20 |
21 |
24 |
25 |
32 |
33 |
40 |
41 |
50 |
51 |
55 |
56 |
57 |
58 |
59 |
60 |
67 |
68 |
74 |
75 |
81 |
82 |
83 |
84 |
93 |
94 |
95 |
96 |
107 |
108 |
117 |
118 |
124 |
125 |
132 |
133 |
134 |
143 |
144 |
150 |
151 |
158 |
159 |
160 |
169 |
170 |
176 |
177 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/profile_detail.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
22 |
23 |
29 |
30 |
31 |
32 |
39 |
40 |
45 |
46 |
50 |
51 |
55 |
56 |
61 |
62 |
67 |
68 |
72 |
73 |
74 |
75 |
79 |
80 |
81 |
82 |
86 |
87 |
92 |
93 |
98 |
99 |
103 |
104 |
105 |
106 |
110 |
111 |
112 |
113 |
117 |
118 |
123 |
124 |
129 |
130 |
134 |
135 |
136 |
137 |
141 |
142 |
143 |
144 |
148 |
149 |
154 |
155 |
160 |
161 |
165 |
166 |
167 |
168 |
172 |
173 |
174 |
175 |
179 |
180 |
181 |
182 |
188 |
189 |
195 |
196 |
199 |
200 |
201 |
202 |
203 |
204 |
209 |
210 |
216 |
217 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/search_contacts_container.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
21 |
22 |
28 |
29 |
37 |
38 |
39 |
40 |
47 |
48 |
57 |
58 |
67 |
68 |
77 |
78 |
87 |
88 |
97 |
98 |
99 |
100 |
109 |
110 |
119 |
120 |
129 |
130 |
139 |
140 |
149 |
150 |
151 |
152 |
161 |
162 |
171 |
172 |
181 |
182 |
191 |
192 |
201 |
202 |
203 |
204 |
205 |
206 |
217 |
218 |
--------------------------------------------------------------------------------